From 98d346dd0e1cdbde75fba01efd36a07e7cf24391 Mon Sep 17 00:00:00 2001 From: Michael de Hoog Date: Fri, 20 Dec 2024 08:31:06 -1000 Subject: [PATCH] Switch inbox calculation to the recommendation from op-stack spec (#38) --- bindings/deploy_chain.go | 28 ++++++++++++++-------------- contracts/src/DeployChain.sol | 15 ++++----------- testnet/genesis.go | 2 +- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/bindings/deploy_chain.go b/bindings/deploy_chain.go index 69f0d89..79c7355 100644 --- a/bindings/deploy_chain.go +++ b/bindings/deploy_chain.go @@ -65,8 +65,8 @@ type DeployChainGenesisConfiguration struct { // DeployChainMetaData contains all meta data concerning the DeployChain contract. var DeployChainMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_proxyAdmin\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_protocolVersions\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSAGE_PASSER_STORAGE_HASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateBatchInbox\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"deploy\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"genesisConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.GenesisConfiguration\",\"components\":[{\"name\":\"l1Number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"l2Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2StateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2Time\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"gasConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.GasConfiguration\",\"components\":[{\"name\":\"basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"blobbasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasToken\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"addressConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.AddressConfiguration\",\"components\":[{\"name\":\"batcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"proofsEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deployAddresses\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.DeployAddresses\",\"components\":[{\"name\":\"l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deployProxy\",\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1CrossDomainMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1ERC721Bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1StandardBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2OutputOracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismMintableERC20Factory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismPortal\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolVersions\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAddress\",\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAdmin\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Deploy\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"configHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"batchInbox\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"addresses\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structDeployChain.DeployAddresses\",\"components\":[{\"name\":\"l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false}]", - Bin: "0x6101c06040523480156200001257600080fd5b5060405162001f9138038062001f9183398101604081905262000035916200009c565b6001600160a01b03998a1660805297891660a05295881660c05293871660e05291861661010052851661012052841661014052831661016052821661018052166101a0526200016b565b80516001600160a01b03811681146200009757600080fd5b919050565b6000806000806000806000806000806101408b8d031215620000bd57600080fd5b620000c88b6200007f565b9950620000d860208c016200007f565b9850620000e860408c016200007f565b9750620000f860608c016200007f565b96506200010860808c016200007f565b95506200011860a08c016200007f565b94506200012860c08c016200007f565b93506200013860e08c016200007f565b9250620001496101008c016200007f565b91506200015a6101208c016200007f565b90509295989b9194979a5092959850565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051611d1e6200027360003960006102570152600081816101a90152818161111f01528181611430015281816114f901526115b3015260008181610230015281816107390152610c040152600081816102ba015281816108080152610cd3015260008181610293015281816108d70152610da2015260008181610336015281816108920152610d5d01526000818161010a0152818161084d0152610d180152600081816101820152818161077e0152610c4901526000818161015b015281816107c30152610c8e0152600081816102090152818161043801526106140152611d1e6000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80634d9f155911610097578063a711986911610066578063a7119869146102b5578063aabcb26e146102dc578063beab4f7e14610311578063c4e8ddfa1461033157600080fd5b80634d9f15591461022b5780636624856a1461025257806394e49a1b146102795780639b7d7f0a1461028e57600080fd5b806336e0909b116100d357806336e0909b146101cb578063380cb000146101de57806338db8411146101f15780633e47158c1461020457600080fd5b8063078f29cf146101055780630a49cb031461015657806333d7e2bd1461017d57806335e80ab3146101a4575b600080fd5b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c6101d9366004611708565b610358565b61012c6101ec36600461174a565b6103e0565b61012c6101ff36600461174a565b61060c565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61028c610287366004611896565b610639565b005b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6103037f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1281565b60405190815260200161014d565b61032461031f366004611708565b6106c3565b60405161014d91906119c7565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6000805b82156103965761036d600a84611a67565b61037882600a611aaa565b6103829190611ae7565b905061038f600a84611aff565b925061035c565b60005b81156103c3576103aa600a83611a67565b60049190911b176103bc600a83611aff565b9150610399565b73ff00000000000000000000000000000000000000179392505050565b6040517f600661011c565b730000000000000000000000000000000000000000000000008152606083811b60088301527f9055730000000000000000000000000000000000000000000000000000000000601c8301527f0000000000000000000000000000000000000000000000000000000000000000811b601f8301527f905561012280603f5f395ff35f365f600860dd565b805490918054803314331560338301527f171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b1460538301527f609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa5760738301527f5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d6020141660938301527f805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e60b38301527f5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b5050602060d38301527f60045f375f518091559160d957903333602060445f375f51956064955050604060f38301527f96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc6101138301527f3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b66101338301527fe8ee1178d6a717850b5d61039156ff000000000000000000000000000000000061015383015230901b610162820152610176810182905261016180822061019683015260559101206000905b90505b92915050565b6000610603837f00000000000000000000000000000000000000000000000000000000000000008461091b565b600061064486610b8e565b90506000610659878787876000015186610dc7565b9050600061066688610358565b9050610676868683858789611021565b815160208301516040518a927f49ea8b4c640f12c7d41cb7b7931d984f226f95ce1d55e1e449ee3d61b877c1ad926106b19286908990611b13565b60405180910390a25050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008260405160200161071191815260200190565b6040516020818303038152906040528051906020012090506040518060e0016040528061075e7f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1681526020016107a37f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1681526020016107e87f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff16815260200161082d7f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108727f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108b77f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108fc7f0000000000000000000000000000000000000000000000000000000000000000846103e0565b73ffffffffffffffffffffffffffffffffffffffff1690529392505050565b6040517f600661011c565b730000000000000000000000000000000000000000000000008152606084811b60088301527f9055730000000000000000000000000000000000000000000000000000000000601c83015283901b601f8201527f905561012280603f5f395ff35f365f600860dd565b805490918054803314331560338201527f171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b1460538201527f609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa5760738201527f5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d6020141660938201527f805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e60b38201527f5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b5050602060d38201527f60045f375f518091559160d957903333602060445f375f51956064955050604060f38201527f96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc6101138201527f3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b66101338201527fe8ee1178d6a717850b5d61039156000000000000000000000000000000000000610153820152600090826101618284f591505073ffffffffffffffffffffffffffffffffffffffff8116610b87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f50726f78793a2063726561746532206661696c6564000000000000000000000060448201526064015b60405180910390fd5b9392505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152600082604051602001610bdc91815260200190565b6040516020818303038152906040528051906020012090506040518060e00160405280610c297f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff168152602001610c6e7f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cb37f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cf87f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff168152602001610d3d7f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff168152602001610d827f00000000000000000000000000000000000000000000000000000000000000008461060c565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108fc7f00000000000000000000000000000000000000000000000000000000000000008461060c565b6040805180820190915260008082526020820152845167ffffffffffffffff164080610e75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4465706c6f79436861696e3a2067656e6573697320626c6f636b68617368206e60448201527f6f7420617661696c61626c6500000000000000000000000000000000000000006064820152608401610b7e565b6000856000015163ffffffff166020876020015163ffffffff16901b60f86001901b171760001b905060008089848a602001518b606001518a878d604001518c604001518d60200151604051602001610f7a9a9998979695949392919060c09a8b1b7fffffffffffffffff0000000000000000000000000000000000000000000000009081168252600882019a909a526028810198909852604888019690965293881b87166068870152606092831b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090811660708801526084870192909252871b90951660a485015290811b841660ac8401521b9091169181019190915260d40190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012060808401835260008085528c840151858401527f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1293850193909352908b01516060840152925090611000906116ac565b60408051808201909152928352602083015250925050505b95945050505050565b81516020808401518551918601516040517fb820514800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201526024810193909352604483015283151560648301529091169063b820514890608401600060405180830381600087803b1580156110ae57600080fd5b505af11580156110c2573d6000803e3d6000fd5b505050506040828101518351602085015192517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292811660248401527f000000000000000000000000000000000000000000000000000000000000000081166044840152169063c0c53b8b90606401600060405180830381600087803b15801561116a57600080fd5b505af115801561117e573d6000803e3d6000fd5b5050505060006112b08388606001516040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e00160405280846060015173ffffffffffffffffffffffffffffffffffffffff1681526020018460a0015173ffffffffffffffffffffffffffffffffffffffff168152602001846080015173ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001846040015173ffffffffffffffffffffffffffffffffffffffff1681526020018460c0015173ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b9050826020015173ffffffffffffffffffffffffffffffffffffffff1663dc7e20a588600001518960200151896000015173ffffffffffffffffffffffffffffffffffffffff1660001b8b604001518b604001516113876040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526301312d008152600a6020820152600891810191909152633b9aca006060820152620f424060808201526fffffffffffffffffffffffffffffffff60a082015290565b8c8e602001518a6040518a63ffffffff1660e01b81526004016113b299989796959493929190611bae565b600060405180830381600087803b1580156113cc57600080fd5b505af11580156113e0573d6000803e3d6000fd5b505050506060830151604080850151602086015191517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152918216602482015291811660448301529091169063c0c53b8b90606401600060405180830381600087803b15801561148d57600080fd5b505af11580156114a1573d6000803e3d6000fd5b505050506080830151606084015160208501516040517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201527f000000000000000000000000000000000000000000000000000000000000000083166024820152908216604482015291169063c0c53b8b90606401600060405180830381600087803b15801561154d57600080fd5b505af1158015611561573d6000803e3d6000fd5b50505060a084015160608501516040517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201527f0000000000000000000000000000000000000000000000000000000000000000821660248201529116915063485cc95590604401600060405180830381600087803b15801561160057600080fd5b505af1158015611614573d6000803e3d6000fd5b50505060c084015160808501516040517fc4d66de800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529116915063c4d66de890602401600060405180830381600087803b15801561168b57600080fd5b505af115801561169f573d6000803e3d6000fd5b5050505050505050505050565b600081600001518260200151836040015184606001516040516020016116eb949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b60006020828403121561171a57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461174557600080fd5b919050565b6000806040838503121561175d57600080fd5b61176683611721565b946020939093013593505050565b6040516080810167ffffffffffffffff811182821017156117be577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b803567ffffffffffffffff8116811461174557600080fd5b803563ffffffff8116811461174557600080fd5b60006060828403121561180257600080fd5b6040516060810181811067ffffffffffffffff8211171561184c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290508061185b83611721565b815261186960208401611721565b602082015261187a60408401611721565b60408201525092915050565b8035801515811461174557600080fd5b60008060008060008587036101a08112156118b057600080fd5b8635955060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820112156118e457600080fd5b6118ec611774565b6118f8602089016117c4565b8152604088013560208201526060880135604082015261191a608089016117c4565b6060820152945060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608201121561195157600080fd5b5061195a611774565b61196660a088016117dc565b815261197460c088016117dc565b602082015261198560e088016117c4565b60408201526119976101008801611721565b606082015292506119ac8761012088016117f0565b91506119bb6101808701611886565b90509295509295909350565b60e08101610606828473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611a7657611a76611a38565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611ae257611ae2611a7b565b500290565b60008219821115611afa57611afa611a7b565b500190565b600082611b0e57611b0e611a38565b500490565b8481526020810184905273ffffffffffffffffffffffffffffffffffffffff831660408201526101408101611018606083018473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b60006102808201905063ffffffff808c168352808b16602084015289604084015267ffffffffffffffff8916606084015273ffffffffffffffffffffffffffffffffffffffff881660808401528087511660a084015260ff60208801511660c084015260ff60408801511660e08401528060608801511661010084015280608088015116610120840152506fffffffffffffffffffffffffffffffff60a087015116610140830152611c7961016083018673ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8416610180830152825173ffffffffffffffffffffffffffffffffffffffff9081166101a0840152602084015181166101c0840152604084015181166101e0840152606084015181166102008401526080840151811661022084015260a0840151811661024084015260c0840151166102608301529a995050505050505050505056fea164736f6c634300080f000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_proxyAdmin\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_superchainConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_protocolVersions\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MESSAGE_PASSER_STORAGE_HASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateBatchInbox\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"deploy\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"genesisConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.GenesisConfiguration\",\"components\":[{\"name\":\"l1Number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"l2Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2StateRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l2Time\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"gasConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.GasConfiguration\",\"components\":[{\"name\":\"basefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"blobbasefeeScalar\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"gasLimit\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"gasToken\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"addressConfig\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.AddressConfiguration\",\"components\":[{\"name\":\"batcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"proposer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"unsafeBlockSigner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"name\":\"proofsEnabled\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deployAddresses\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structDeployChain.DeployAddresses\",\"components\":[{\"name\":\"l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deployProxy\",\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"l1CrossDomainMessenger\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1ERC721Bridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l1StandardBridge\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"l2OutputOracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismMintableERC20Factory\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"optimismPortal\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"protocolVersions\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAddress\",\"inputs\":[{\"name\":\"proxy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"salt\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxyAdmin\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"superchainConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"systemConfig\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Deploy\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"},{\"name\":\"configHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"outputRoot\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"batchInbox\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"addresses\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structDeployChain.DeployAddresses\",\"components\":[{\"name\":\"l2OutputOracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"systemConfig\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismPortal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1CrossDomainMessenger\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1StandardBridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"l1ERC721Bridge\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"optimismMintableERC20Factory\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"anonymous\":false}]", + Bin: "0x6101c06040523480156200001257600080fd5b5060405162001e9738038062001e9783398101604081905262000035916200009c565b6001600160a01b03998a1660805297891660a05295881660c05293871660e05291861661010052851661012052841661014052831661016052821661018052166101a0526200016b565b80516001600160a01b03811681146200009757600080fd5b919050565b6000806000806000806000806000806101408b8d031215620000bd57600080fd5b620000c88b6200007f565b9950620000d860208c016200007f565b9850620000e860408c016200007f565b9750620000f860608c016200007f565b96506200010860808c016200007f565b95506200011860a08c016200007f565b94506200012860c08c016200007f565b93506200013860e08c016200007f565b9250620001496101008c016200007f565b91506200015a6101208c016200007f565b90509295989b9194979a5092959850565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051611c246200027360003960006102440152600081816101a9015281816110dc015281816113ed015281816114b6015261157001526000818161021d015281816106b30152610bc10152600081816102a7015281816107820152610c90015260008181610280015281816108510152610d5f0152600081816103230152818161080c0152610d1a01526000818161010a015281816107c70152610cd5015260008181610182015281816106f80152610c0601526000818161015b0152818161073d0152610c4b0152600081816101f6015281816103b0015261058c0152611c246000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636624856a11610097578063aabcb26e11610066578063aabcb26e146102c9578063beab4f7e146102fe578063c4e8ddfa1461031e578063d655a76f1461034557600080fd5b80636624856a1461023f57806394e49a1b146102665780639b7d7f0a1461027b578063a7119869146102a257600080fd5b8063380cb000116100d3578063380cb000146101cb57806338db8411146101de5780633e47158c146101f15780634d9f15591461021857600080fd5b8063078f29cf146101055780630a49cb031461015657806333d7e2bd1461017d57806335e80ab3146101a4575b600080fd5b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c6101d93660046116ee565b610358565b61012c6101ec3660046116ee565b610584565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61027961027436600461183a565b6105b1565b005b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6102f07f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1281565b60405190815260200161014d565b61031161030c36600461196b565b61063d565b60405161014d9190611984565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c6103533660046119f5565b610895565b6040517f600661011c565b730000000000000000000000000000000000000000000000008152606083811b60088301527f9055730000000000000000000000000000000000000000000000000000000000601c8301527f0000000000000000000000000000000000000000000000000000000000000000811b601f8301527f905561012280603f5f395ff35f365f600860dd565b805490918054803314331560338301527f171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b1460538301527f609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa5760738301527f5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d6020141660938301527f805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e60b38301527f5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b5050602060d38301527f60045f375f518091559160d957903333602060445f375f51956064955050604060f38301527f96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc6101138301527f3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b66101338301527fe8ee1178d6a717850b5d61039156ff000000000000000000000000000000000061015383015230901b610162820152610176810182905261016180822061019683015260559101206000905b90505b92915050565b600061057b837f0000000000000000000000000000000000000000000000000000000000000000846108d8565b60006105bc86610b4b565b905060006105d1878787876000015186610d84565b905060006105e0600089610895565b90506105f0868683858789610fde565b815160208301516040518a927f49ea8b4c640f12c7d41cb7b7931d984f226f95ce1d55e1e449ee3d61b877c1ad9261062b9286908990611a19565b60405180910390a25050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008260405160200161068b91815260200190565b6040516020818303038152906040528051906020012090506040518060e001604052806106d87f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff16815260200161071d7f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016107627f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016107a77f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016107ec7f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108317f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108767f000000000000000000000000000000000000000000000000000000000000000084610358565b73ffffffffffffffffffffffffffffffffffffffff1690529392505050565b60006068826040516020016108ac91815260200190565b6040516020818303038152906040528051906020012060001c901c60988460ff16901b17905092915050565b6040517f600661011c565b730000000000000000000000000000000000000000000000008152606084811b60088301527f9055730000000000000000000000000000000000000000000000000000000000601c83015283901b601f8201527f905561012280603f5f395ff35f365f600860dd565b805490918054803314331560338201527f171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b1460538201527f609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa5760738201527f5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d6020141660938201527f805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e60b38201527f5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b5050602060d38201527f60045f375f518091559160d957903333602060445f375f51956064955050604060f38201527f96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc6101138201527f3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b66101338201527fe8ee1178d6a717850b5d61039156000000000000000000000000000000000000610153820152600090826101618284f591505073ffffffffffffffffffffffffffffffffffffffff8116610b44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f50726f78793a2063726561746532206661696c6564000000000000000000000060448201526064015b60405180910390fd5b9392505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152600082604051602001610b9991815260200190565b6040516020818303038152906040528051906020012090506040518060e00160405280610be67f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff168152602001610c2b7f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff168152602001610c707f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cb57f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cfa7f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff168152602001610d3f7f000000000000000000000000000000000000000000000000000000000000000084610584565b73ffffffffffffffffffffffffffffffffffffffff1681526020016108767f000000000000000000000000000000000000000000000000000000000000000084610584565b6040805180820190915260008082526020820152845167ffffffffffffffff164080610e32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4465706c6f79436861696e3a2067656e6573697320626c6f636b68617368206e60448201527f6f7420617661696c61626c6500000000000000000000000000000000000000006064820152608401610b3b565b6000856000015163ffffffff166020876020015163ffffffff16901b60f86001901b171760001b905060008089848a602001518b606001518a878d604001518c604001518d60200151604051602001610f379a9998979695949392919060c09a8b1b7fffffffffffffffff0000000000000000000000000000000000000000000000009081168252600882019a909a526028810198909852604888019690965293881b87166068870152606092831b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090811660708801526084870192909252871b90951660a485015290811b841660ac8401521b9091169181019190915260d40190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012060808401835260008085528c840151858401527f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1293850193909352908b01516060840152925090610fbd90611669565b60408051808201909152928352602083015250925050505b95945050505050565b81516020808401518551918601516040517fb820514800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201526024810193909352604483015283151560648301529091169063b820514890608401600060405180830381600087803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b505050506040828101518351602085015192517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015292811660248401527f000000000000000000000000000000000000000000000000000000000000000081166044840152169063c0c53b8b90606401600060405180830381600087803b15801561112757600080fd5b505af115801561113b573d6000803e3d6000fd5b50505050600061126d8388606001516040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e00160405280846060015173ffffffffffffffffffffffffffffffffffffffff1681526020018460a0015173ffffffffffffffffffffffffffffffffffffffff168152602001846080015173ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001846040015173ffffffffffffffffffffffffffffffffffffffff1681526020018460c0015173ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b9050826020015173ffffffffffffffffffffffffffffffffffffffff1663dc7e20a588600001518960200151896000015173ffffffffffffffffffffffffffffffffffffffff1660001b8b604001518b604001516113446040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526301312d008152600a6020820152600891810191909152633b9aca006060820152620f424060808201526fffffffffffffffffffffffffffffffff60a082015290565b8c8e602001518a6040518a63ffffffff1660e01b815260040161136f99989796959493929190611ab4565b600060405180830381600087803b15801561138957600080fd5b505af115801561139d573d6000803e3d6000fd5b505050506060830151604080850151602086015191517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152918216602482015291811660448301529091169063c0c53b8b90606401600060405180830381600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b505050506080830151606084015160208501516040517fc0c53b8b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201527f000000000000000000000000000000000000000000000000000000000000000083166024820152908216604482015291169063c0c53b8b90606401600060405180830381600087803b15801561150a57600080fd5b505af115801561151e573d6000803e3d6000fd5b50505060a084015160608501516040517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201527f0000000000000000000000000000000000000000000000000000000000000000821660248201529116915063485cc95590604401600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505060c084015160808501516040517fc4d66de800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529116915063c4d66de890602401600060405180830381600087803b15801561164857600080fd5b505af115801561165c573d6000803e3d6000fd5b5050505050505050505050565b600081600001518260200151836040015184606001516040516020016116a8949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146116e957600080fd5b919050565b6000806040838503121561170157600080fd5b61170a836116c5565b946020939093013593505050565b6040516080810167ffffffffffffffff81118282101715611762577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405290565b803567ffffffffffffffff811681146116e957600080fd5b803563ffffffff811681146116e957600080fd5b6000606082840312156117a657600080fd5b6040516060810181811067ffffffffffffffff821117156117f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040529050806117ff836116c5565b815261180d602084016116c5565b602082015261181e604084016116c5565b60408201525092915050565b803580151581146116e957600080fd5b60008060008060008587036101a081121561185457600080fd5b8635955060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08201121561188857600080fd5b611890611718565b61189c60208901611768565b815260408801356020820152606088013560408201526118be60808901611768565b6060820152945060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60820112156118f557600080fd5b506118fe611718565b61190a60a08801611780565b815261191860c08801611780565b602082015261192960e08801611768565b604082015261193b61010088016116c5565b60608201529250611950876101208801611794565b915061195f610180870161182a565b90509295509295909350565b60006020828403121561197d57600080fd5b5035919050565b60e0810161057e828473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b60008060408385031215611a0857600080fd5b823560ff8116811461170a57600080fd5b8481526020810184905273ffffffffffffffffffffffffffffffffffffffff831660408201526101408101610fd5606083018473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b60006102808201905063ffffffff808c168352808b16602084015289604084015267ffffffffffffffff8916606084015273ffffffffffffffffffffffffffffffffffffffff881660808401528087511660a084015260ff60208801511660c084015260ff60408801511660e08401528060608801511661010084015280608088015116610120840152506fffffffffffffffffffffffffffffffff60a087015116610140830152611b7f61016083018673ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8416610180830152825173ffffffffffffffffffffffffffffffffffffffff9081166101a0840152602084015181166101c0840152604084015181166101e0840152606084015181166102008401526080840151811661022084015260a0840151811661024084015260c0840151166102608301529a995050505050505050505056fea164736f6c634300080f000a", } // DeployChainABI is the input ABI used to generate the binding from. @@ -267,12 +267,12 @@ func (_DeployChain *DeployChainCallerSession) MESSAGEPASSERSTORAGEHASH() ([32]by return _DeployChain.Contract.MESSAGEPASSERSTORAGEHASH(&_DeployChain.CallOpts) } -// CalculateBatchInbox is a free data retrieval call binding the contract method 0x36e0909b. +// CalculateBatchInbox is a free data retrieval call binding the contract method 0xd655a76f. // -// Solidity: function calculateBatchInbox(uint256 chainID) pure returns(address) -func (_DeployChain *DeployChainCaller) CalculateBatchInbox(opts *bind.CallOpts, chainID *big.Int) (common.Address, error) { +// Solidity: function calculateBatchInbox(uint8 version, uint256 chainID) pure returns(address) +func (_DeployChain *DeployChainCaller) CalculateBatchInbox(opts *bind.CallOpts, version uint8, chainID *big.Int) (common.Address, error) { var out []interface{} - err := _DeployChain.contract.Call(opts, &out, "calculateBatchInbox", chainID) + err := _DeployChain.contract.Call(opts, &out, "calculateBatchInbox", version, chainID) if err != nil { return *new(common.Address), err @@ -284,18 +284,18 @@ func (_DeployChain *DeployChainCaller) CalculateBatchInbox(opts *bind.CallOpts, } -// CalculateBatchInbox is a free data retrieval call binding the contract method 0x36e0909b. +// CalculateBatchInbox is a free data retrieval call binding the contract method 0xd655a76f. // -// Solidity: function calculateBatchInbox(uint256 chainID) pure returns(address) -func (_DeployChain *DeployChainSession) CalculateBatchInbox(chainID *big.Int) (common.Address, error) { - return _DeployChain.Contract.CalculateBatchInbox(&_DeployChain.CallOpts, chainID) +// Solidity: function calculateBatchInbox(uint8 version, uint256 chainID) pure returns(address) +func (_DeployChain *DeployChainSession) CalculateBatchInbox(version uint8, chainID *big.Int) (common.Address, error) { + return _DeployChain.Contract.CalculateBatchInbox(&_DeployChain.CallOpts, version, chainID) } -// CalculateBatchInbox is a free data retrieval call binding the contract method 0x36e0909b. +// CalculateBatchInbox is a free data retrieval call binding the contract method 0xd655a76f. // -// Solidity: function calculateBatchInbox(uint256 chainID) pure returns(address) -func (_DeployChain *DeployChainCallerSession) CalculateBatchInbox(chainID *big.Int) (common.Address, error) { - return _DeployChain.Contract.CalculateBatchInbox(&_DeployChain.CallOpts, chainID) +// Solidity: function calculateBatchInbox(uint8 version, uint256 chainID) pure returns(address) +func (_DeployChain *DeployChainCallerSession) CalculateBatchInbox(version uint8, chainID *big.Int) (common.Address, error) { + return _DeployChain.Contract.CalculateBatchInbox(&_DeployChain.CallOpts, version, chainID) } // DeployAddresses is a free data retrieval call binding the contract method 0xbeab4f7e. diff --git a/contracts/src/DeployChain.sol b/contracts/src/DeployChain.sol index 275aeea..872f863 100644 --- a/contracts/src/DeployChain.sol +++ b/contracts/src/DeployChain.sol @@ -127,7 +127,7 @@ contract DeployChain { Hashes memory hashes = calculateHashes(chainID, genesisConfig, gasConfig, addressConfig.batcher, addresses); - address batchInbox = calculateBatchInbox(chainID); + address batchInbox = calculateBatchInbox(0, chainID); initializeProxies(gasConfig, addressConfig, batchInbox, hashes, addresses, proofsEnabled); @@ -140,16 +140,9 @@ contract DeployChain { }); } - function calculateBatchInbox(uint256 chainID) public pure returns (address) { - uint256 reverse = 0; - for (; chainID > 0; chainID /= 10) { - reverse = (reverse * 10) + (chainID % 10); - } - uint256 base16 = 0; - for (; reverse > 0; reverse /= 10) { - base16 = (base16 << 4) | (reverse % 10); - } - return address(uint160(base16 | (0xff << 152))); + function calculateBatchInbox(uint8 version, uint256 chainID) public pure returns (address) { + // see https://specs.optimism.io/protocol/configurability.html#consensus-parameters + return address(uint160(uint256(version) << 152 | uint256(keccak256(abi.encodePacked(chainID))) >> 104)); } function setupProxies(uint256 chainID) internal returns (DeployAddresses memory) { diff --git a/testnet/genesis.go b/testnet/genesis.go index cddf039..0eb2591 100644 --- a/testnet/genesis.go +++ b/testnet/genesis.go @@ -191,7 +191,7 @@ func Main(cliCtx *cli.Context) error { return fmt.Errorf("failed to get ProtocolVersions contract address: %w", err) } - batchInboxAddress, err := deployChain.CalculateBatchInbox(&bind.CallOpts{}, l2ChainID) + batchInboxAddress, err := deployChain.CalculateBatchInbox(&bind.CallOpts{}, 0, l2ChainID) if err != nil { return fmt.Errorf("failed to calculate BatchInbox address: %w", err) }