Skip to content

Commit

Permalink
Migrate L1 deploys (base#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaraghu authored Jun 21, 2023
1 parent 251103f commit 579536c
Show file tree
Hide file tree
Showing 48 changed files with 8,199 additions and 13 deletions.
1 change: 1 addition & 0 deletions goerli-devnet/2023-05-18-deploy/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OP_COMMIT=3c3e1a88b234a68bcd59be0c123d9f3cc152a91e
14 changes: 14 additions & 0 deletions goerli-devnet/2023-05-18-deploy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include ../../Makefile
include ../.env
include .env

##
# Deploy command
##
.PHONY: deploy
deploy:
go run cmd/foundry_deploy_config_gen/main.go
forge script --rpc-url $(L1_RPC_URL) DeployBedrock --broadcast
jq --sort-keys . unsorted.json > deployed/addresses.json
cp deployed/addresses.json ../addresses.json
rm unsorted.json inputs/foundry-config.json
115 changes: 115 additions & 0 deletions goerli-devnet/2023-05-18-deploy/cmd/foundry_deploy_config_gen/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
package main

import (
"encoding/json"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"

"io/ioutil"
)

type DeployConfigParams struct {
BatchSenderAddress common.Address `json:"batchSenderAddress"`
Controller common.Address `json:"controller"`
FinalSystemOwner common.Address `json:"finalSystemOwner"`
FinalizationPeriodSeconds uint64 `json:"finalizationPeriodSeconds"`
GasPriceOracleOverhead uint64 `json:"gasPriceOracleOverhead"`
GasPriceOracleScalar uint64 `json:"gasPriceOracleScalar"`
L2BlockTime uint64 `json:"l2BlockTime"`
L2GenesisBlockGasLimit hexutil.Uint64 `json:"l2GenesisBlockGasLimit"`
L2OutputOracleChallenger common.Address `json:"l2OutputOracleChallenger"`
L2OutputOracleProposer common.Address `json:"l2OutputOracleProposer"`
L2OutputOracleStartingBlockNumber uint64 `json:"l2OutputOracleStartingBlockNumber"`
L2OutputOracleSubmissionInterval uint64 `json:"l2OutputOracleSubmissionInterval"`
L2OutputOracleStartingTimestamp uint64 `json:"l2OutputOracleStartingTimestamp"`
P2PSequencerAddress common.Address `json:"p2pSequencerAddress"`
ProxyAdminOwner common.Address `json:"proxyAdminOwner"`
}

type MiscConfigParams struct {
DeployerAddress common.Address `json:"deployerAddress"`
}

type FoundryConfigParams struct {
BatchSenderAddress common.Address `json:"batchSenderAddress"`
Controller common.Address `json:"controller"`
DeployerAddress common.Address `json:"deployerAddress"`
FinalSystemOwner common.Address `json:"finalSystemOwner"`
FinalizationPeriodSeconds uint64 `json:"finalizationPeriodSeconds"`
GasPriceOracleOverhead uint64 `json:"gasPriceOracleOverhead"`
GasPriceOracleScalar uint64 `json:"gasPriceOracleScalar"`
L2BlockTime uint64 `json:"l2BlockTime"`
L2GenesisBlockGasLimit uint64 `json:"l2GenesisBlockGasLimit"`
L2OutputOracleChallenger common.Address `json:"l2OutputOracleChallenger"`
L2OutputOracleProposer common.Address `json:"l2OutputOracleProposer"`
L2OutputOracleStartingBlockNumber uint64 `json:"l2OutputOracleStartingBlockNumber"`
L2OutputOracleStartingTimestamp uint64 `json:"l2OutputOracleStartingTimestamp"`
L2OutputOracleSubmissionInterval uint64 `json:"l2OutputOracleSubmissionInterval"`
P2PSequencerAddress common.Address `json:"p2pSequencerAddress"`
ProxyAdminOwnerL2 common.Address `json:"proxyAdminOwner"`
}

type FoundryConfig struct {
DeployConfig FoundryConfigParams `json:"deployConfig"`
}

func main() {
deployConfigJsonBytes, err := ioutil.ReadFile("inputs/deploy-config.json")
if err != nil {
panic(err)
}

var deployConfigParams DeployConfigParams
err = json.Unmarshal(deployConfigJsonBytes, &deployConfigParams)
if err != nil {
panic(err)
}

miscConfigJsonByes, err := ioutil.ReadFile("inputs/misc-config.json")
if err != nil {
panic(err)
}
var miscConfigParams MiscConfigParams
err = json.Unmarshal(miscConfigJsonByes, &miscConfigParams)
if err != nil {
panic(err)
}

var foundryConfigParams FoundryConfigParams

// Params copied from deploy-config.json
foundryConfigParams.BatchSenderAddress = deployConfigParams.BatchSenderAddress
foundryConfigParams.Controller = deployConfigParams.Controller
foundryConfigParams.FinalSystemOwner = deployConfigParams.FinalSystemOwner
foundryConfigParams.FinalizationPeriodSeconds = deployConfigParams.FinalizationPeriodSeconds
foundryConfigParams.GasPriceOracleOverhead = deployConfigParams.GasPriceOracleOverhead
foundryConfigParams.GasPriceOracleScalar = deployConfigParams.GasPriceOracleScalar
foundryConfigParams.L2BlockTime = deployConfigParams.L2BlockTime
foundryConfigParams.L2GenesisBlockGasLimit = uint64(deployConfigParams.L2GenesisBlockGasLimit)
foundryConfigParams.L2OutputOracleChallenger = deployConfigParams.L2OutputOracleChallenger
foundryConfigParams.L2OutputOracleProposer = deployConfigParams.L2OutputOracleProposer
foundryConfigParams.L2OutputOracleStartingBlockNumber = deployConfigParams.L2OutputOracleStartingBlockNumber
foundryConfigParams.L2OutputOracleStartingTimestamp = deployConfigParams.L2OutputOracleStartingTimestamp
foundryConfigParams.L2OutputOracleSubmissionInterval = deployConfigParams.L2OutputOracleSubmissionInterval
foundryConfigParams.P2PSequencerAddress = deployConfigParams.P2PSequencerAddress
foundryConfigParams.ProxyAdminOwnerL2 = deployConfigParams.ProxyAdminOwner

// Params copied from misc-config.json
foundryConfigParams.DeployerAddress = miscConfigParams.DeployerAddress

config := &FoundryConfig{
DeployConfig: foundryConfigParams,
}

file, err := json.MarshalIndent(config, "", " ")
if err != nil {
panic(err)
}

outputFileName := "inputs/foundry-config.json"
err = ioutil.WriteFile(outputFileName, file, 0600)
if err != nil {
panic(err)
}
}
25 changes: 25 additions & 0 deletions goerli-devnet/2023-05-18-deploy/deployed/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"AddressManager": "0x098492Ef1F4Bf26F305F25826CA0F4e4Be6d45f4",
"BlockNumber": 9011568,
"BlockTimestamp": 1684262892,
"L1ContractsOwner": "0xA221e753e82626F96b83b3665F4fA92114a2a6f3",
"L1CrossDomainMessengerImpl": "0x5DF3FfCb458dDc3f636262a20200De7238Ae7943",
"L1CrossDomainMessengerProxy": "0x548531f9E60e75726F6f6ec1E5F0A181B9d2c1C0",
"L1ERC721BridgeImpl": "0xAE4A890BD60abf3072831E9913D782ec5e4fBB93",
"L1ERC721BridgeProxy": "0x8e5B1fF0C5afB207Ac447B31e149996E053D9C22",
"L1StandardBridgeImpl": "0x67f03cF862AA9b32a262460224d7783853A3B4AC",
"L1StandardBridgeProxy": "0x21E0Cc91D566cfF3edC500F8012D6105f889d2b0",
"L2ContractsOwner": "0x7768171512911988ACfCE3Fd295A4Cf8AA8E8dBA",
"L2OutputOracleImpl": "0x21f2EE45b1298698Fe8A6987b5Fb2F9E326aCDFa",
"L2OutputOracleProxy": "0x805fbEDB43E814b2216ce6926A0A19bdeDb0C8Cd",
"OptimismMintableERC20FactoryImpl": "0x0Aa15633CCCD725dc28Fb5e9Afa91f20083C453B",
"OptimismMintableERC20FactoryProxy": "0x92210e86f7e71606394FD57Be284Ef46Eced62Da",
"OptimismPortalImpl": "0xcb102c85c611a784806B054329A73b11E38BeCA1",
"OptimismPortalProxy": "0x61A7dc680a0f3F67aDc357453d3f51bDc70fAE1B",
"PortalSenderImpl": "0xB17134f9b847818c96Ba49a0BB0985c9a3DB9D49",
"ProxyAdmin": "0x4d56E97228bBF10DcB2ED7E8F455c57AbE247404",
"SystemConfigImpl": "0x4795afe8799937c0735e49DadAcA2B99d8a513DC",
"SystemConfigProxy": "0x4f775d578e3Ab8ce81f5Ec065050938DbD5Fb8c2",
"SystemDictatorImpl": "0xD5a8b65b505886fA2A3fE3F45A3Af7f3963C4273",
"SystemDictatorProxy": "0xb684894834b0843E755CAdd18fA74785Eb42Dd6B"
}
Loading

0 comments on commit 579536c

Please sign in to comment.