diff --git a/bindings/deploy_chain.go b/bindings/deploy_chain.go index 69f0d89..afe442b 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\":\"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\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"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\":\"chainID\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}],\"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: "0x6101c06040523480156200001257600080fd5b506040516200252d3803806200252d83398101604081905262000035916200009c565b6001600160a01b03998a1660805297891660a05295881660c05293871660e05291861661010052851661012052841661014052831661016052821661018052166101a0526200016b565b80516001600160a01b03811681146200009757600080fd5b919050565b6000806000806000806000806000806101408b8d031215620000bd57600080fd5b620000c88b6200007f565b9950620000d860208c016200007f565b9850620000e860408c016200007f565b9750620000f860608c016200007f565b96506200010860808c016200007f565b95506200011860a08c016200007f565b94506200012860c08c016200007f565b93506200013860e08c016200007f565b9250620001496101008c016200007f565b91506200015a6101208c016200007f565b90509295989b9194979a5092959850565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051612289620002a460003960006102440152600081816101bc015281816110fb015281816114960152818161152b01526115b701526000818161021d0152818161052401528181610bbe01526110270152600081816102a7015281816105f301528181610c8d01526114d2015260008181610280015281816106c201528181610d5c01526116b50152600081816103230152818161067d01528181610d17015261159101526000818161010a0152818161063801528181610cd2015261155f0152600081816101950152818161056901528181610c0301526112ff01526000818161015b015281816105ae01528181610c4801526111260152600081816101f6015281816118020152611a8801526122896000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636624856a11610097578063aabcb26e11610066578063aabcb26e146102c9578063beab4f7e146102fe578063c4e8ddfa1461031e578063dda8804c1461034557600080fd5b80636624856a1461023f57806394e49a1b146102665780639b7d7f0a1461027b578063a7119869146102a257600080fd5b806335e80ab3116100d357806335e80ab3146101b757806336e0909b146101de5780633e47158c146101f15780634d9f15591461021857600080fd5b8063078f29cf146101055780630a49cb0314610156578063113bfd4a1461017d57806333d7e2bd14610190575b600080fd5b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c61018b366004611b1a565b610358565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c6101ec366004611b4a565b6103c8565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b610279610274366004611c72565b610450565b005b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6102f07f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1281565b60405190815260200161014d565b61031161030c366004611b4a565b6104da565b60405161014d9190611da5565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b61012c610353366004611b1a565b610704565b600080838360405160200161039c92919091825260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602082015260340190565b6040516020818303038152906040528051906020012090506103be3082610937565b9150505b92915050565b6000805b8215610406576103dd600a84611e45565b6103e882600a611e88565b6103f29190611ec5565b90506103ff600a84611edd565b92506103cc565b60005b81156104335761041a600a83611e45565b60049190911b1761042c600a83611edd565b9150610409565b73ff00000000000000000000000000000000000000179392505050565b600061045b86610b74565b90506000610470878787876000015186610d80565b9050600061047d886103c8565b905061048d868683858789610fda565b815160208301516040518a927f49ea8b4c640f12c7d41cb7b7931d984f226f95ce1d55e1e449ee3d61b877c1ad926104c89286908990611ef1565b60405180910390a25050505050505050565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e00160405280610548847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff16815260200161058d847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff1681526020016105d2847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff168152602001610617847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff16815260200161065c847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff1681526020016106a1847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff1681526020016106e6847f0000000000000000000000000000000000000000000000000000000000000000610704565b73ffffffffffffffffffffffffffffffffffffffff16905292915050565b600080838360405160200161074892919091825260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602082015260340190565b6040516020818303038152906040528051906020012090506103be30826040517f600661010e565b730000000000000000000000000000000000000000000000008152606092831b60088201527f90915561012a8060295f395ff35f365f600860e5565b80549091805480331433601c8201527f15171560545760045f5f375f5160e01c8063f851a4401460a75780635c60da1b603c8201527f1460a45780638f2839701460b45780633659cfe61460b157634f1ef2861460af605c8201527f575b63204e1c7a60e01b5f5282801560e2576004525f5f60245f845afa3d5f5f607c8201527f3e3d60201416805f510290158402015f875f89895f375f935af43d5f893d6020609c8201527f5260205f523e5f3d89019160a257fd5bf35b50505b505f5260205ff35b5f5b9360bc8201527f915b5050602060045f375f518091559160de57903333602060445f375f51956060dc8201527f64955050604096506054565b5f5ff35b5ffd5b7f360894a13ba1a3210667c82860fc8201527f492db98dca3e2076cc3735a920a3ca505d382bbc7fb53127684a568b3173ae1361011c8201527fb9f8a6016e243e63b6e8ee1178d6a717850b5d61039156ff000000000000000061013c8201523090921b610154830152610168820152610153808220610188830152605591012090565b6040517f600661010e565b730000000000000000000000000000000000000000000000008152606083901b60088201527f90915561012a8060295f395ff35f365f600860e5565b80549091805480331433601c8201527f15171560545760045f5f375f5160e01c8063f851a4401460a75780635c60da1b603c8201527f1460a45780638f2839701460b45780633659cfe61460b157634f1ef2861460af605c8201527f575b63204e1c7a60e01b5f5282801560e2576004525f5f60245f845afa3d5f5f607c8201527f3e3d60201416805f510290158402015f875f89895f375f935af43d5f893d6020609c8201527f5260205f523e5f3d89019160a257fd5bf35b50505b505f5260205ff35b5f5b9360bc8201527f915b5050602060045f375f518091559160de57903333602060445f375f51956060dc8201527f64955050604096506054565b5f5ff35b5ffd5b7f360894a13ba1a3210667c82860fc8201527f492db98dca3e2076cc3735a920a3ca505d382bbc7fb53127684a568b3173ae1361011c8201527fb9f8a6016e243e63b6e8ee1178d6a717850b5d6103915600000000000000000061013c820152600090826101538284f591505073ffffffffffffffffffffffffffffffffffffffff81166103c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f50726f78793a2063726561746532206661696c6564000000000000000000000060448201526064015b60405180910390fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e00160405280610be2847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff168152602001610c27847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff168152602001610c6c847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cb1847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff168152602001610cf6847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff168152602001610d3b847f0000000000000000000000000000000000000000000000000000000000000000610358565b73ffffffffffffffffffffffffffffffffffffffff1681526020016106e6847f0000000000000000000000000000000000000000000000000000000000000000610358565b6040805180820190915260008082526020820152845167ffffffffffffffff164080610e2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4465706c6f79436861696e3a2067656e6573697320626c6f636b68617368206e60448201527f6f7420617661696c61626c6500000000000000000000000000000000000000006064820152608401610b6b565b6000856000015163ffffffff166020876020015163ffffffff16901b60f86001901b171760001b905060008089848a602001518b606001518a878d604001518c604001518d60200151604051602001610f339a9998979695949392919060c09a8b1b7fffffffffffffffff0000000000000000000000000000000000000000000000009081168252600882019a909a526028810198909852604888019690965293881b87166068870152606092831b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090811660708801526084870192909252871b90951660a485015290811b841660ac8401521b9091169181019190915260d40190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012060808401835260008085528c840151858401527f8ed4baae3a927be3dea54996b4d5899f8c01e7594bf50b17dc1e741388ce3d1293850193909352908b01516060840152925090610fb99061175c565b60408051808201909152928352602083015250925050505b95945050505050565b815160208084015185519186015160405173ffffffffffffffffffffffffffffffffffffffff90921660248301526044820192909252606481019190915282151560848201526110c591907f00000000000000000000000000000000000000000000000000000000000000009060a401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb8205148000000000000000000000000000000000000000000000000000000001790526117b8565b60408083015183516020850151925173ffffffffffffffffffffffffffffffffffffffff918216602482015292811660448401527f00000000000000000000000000000000000000000000000000000000000000001660648301526111c5917f0000000000000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc0c53b8b000000000000000000000000000000000000000000000000000000001790526117b8565b60006112f38388606001516040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040518060e00160405280846060015173ffffffffffffffffffffffffffffffffffffffff1681526020018460a0015173ffffffffffffffffffffffffffffffffffffffff168152602001846080015173ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001846040015173ffffffffffffffffffffffffffffffffffffffff1681526020018460c0015173ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b905061146d83602001517f000000000000000000000000000000000000000000000000000000000000000089600001518a602001518a6000015173ffffffffffffffffffffffffffffffffffffffff1660001b8c604001518c604001516113d36040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152506040805160c0810182526301312d008152600a6020820152600891810191909152633b9aca006060820152620f424060808201526fffffffffffffffffffffffffffffffff60a082015290565b8d8f602001518b6040516024016113f299989796959493929190611f8c565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fdc7e20a5000000000000000000000000000000000000000000000000000000001790526117b8565b60608301516040808501516020860151915173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660248301529182166044820152911660648201526114fa91907f00000000000000000000000000000000000000000000000000000000000000009060840161114a565b60808301516060840151602085015160405173ffffffffffffffffffffffffffffffffffffffff92831660248201527f0000000000000000000000000000000000000000000000000000000000000000831660448201529116606482015261158791907f00000000000000000000000000000000000000000000000000000000000000009060840161114a565b6116848360a001517f000000000000000000000000000000000000000000000000000000000000000085606001517f000000000000000000000000000000000000000000000000000000000000000060405160240161160992919073ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f485cc955000000000000000000000000000000000000000000000000000000001790526117b8565b60c0830151608084015160405173ffffffffffffffffffffffffffffffffffffffff909116602482015261175391907f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de8000000000000000000000000000000000000000000000000000000001790526117b8565b50505050505050565b6000816000015182602001518360400151846060015160405160200161179b949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6040517f204e1c7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015284916000917f0000000000000000000000000000000000000000000000000000000000000000169063204e1c7a90602401602060405180830381865afa158015611849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186d91906120ef565b905073ffffffffffffffffffffffffffffffffffffffff8116611912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4465706c6f79436861696e3a20696e76616c696420696d706c656d656e74617460448201527f696f6e00000000000000000000000000000000000000000000000000000000006064820152608401610b6b565b6040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690634f1ef286906119669084908790600401612143565b6000604051808303816000875af1158015611985573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119cb91908101906121b1565b506040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152831690633659cfe690602401600060405180830381600087803b158015611a3557600080fd5b505af1158015611a49573d6000803e3d6000fd5b50506040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015285169250638f2839709150602401600060405180830381600087803b158015611ad657600080fd5b505af1158015611aea573d6000803e3d6000fd5b505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611b1757600080fd5b50565b60008060408385031215611b2d57600080fd5b823591506020830135611b3f81611af5565b809150509250929050565b600060208284031215611b5c57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611bb557611bb5611b63565b60405290565b803567ffffffffffffffff81168114611bd357600080fd5b919050565b803563ffffffff81168114611bd357600080fd5b600060608284031215611bfe57600080fd5b6040516060810181811067ffffffffffffffff82111715611c2157611c21611b63565b6040529050808235611c3281611af5565b81526020830135611c4281611af5565b60208201526040830135611c5581611af5565b6040919091015292915050565b80358015158114611bd357600080fd5b60008060008060008587036101a0811215611c8c57600080fd5b8635955060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082011215611cc057600080fd5b611cc8611b92565b611cd460208901611bbb565b81526040880135602082015260608801356040820152611cf660808901611bbb565b6060820152945060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6082011215611d2d57600080fd5b50611d36611b92565b611d4260a08801611bd8565b8152611d5060c08801611bd8565b6020820152611d6160e08801611bbb565b6040820152610100870135611d7581611af5565b60608201529250611d8a876101208801611bec565b9150611d996101808701611c62565b90509295509295909350565b60e081016103c2828473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611e5457611e54611e16565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611ec057611ec0611e59565b500290565b60008219821115611ed857611ed8611e59565b500190565b600082611eec57611eec611e16565b500490565b8481526020810184905273ffffffffffffffffffffffffffffffffffffffff831660408201526101408101610fd1606083018473ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401528060408301511660408401528060608301511660608401528060808301511660808401528060a08301511660a08401528060c08301511660c0840152505050565b60006102808201905063ffffffff808c168352808b16602084015289604084015267ffffffffffffffff8916606084015273ffffffffffffffffffffffffffffffffffffffff881660808401528087511660a084015260ff60208801511660c084015260ff60408801511660e08401528060608801511661010084015280608088015116610120840152506fffffffffffffffffffffffffffffffff60a08701511661014083015261205761016083018673ffffffffffffffffffffffffffffffffffffffff169052565b73ffffffffffffffffffffffffffffffffffffffff8416610180830152825173ffffffffffffffffffffffffffffffffffffffff9081166101a0840152602084015181166101c0840152604084015181166101e0840152606084015181166102008401526080840151811661022084015260a0840151811661024084015260c0840151166102608301529a9950505050505050505050565b60006020828403121561210157600080fd5b815161210c81611af5565b9392505050565b60005b8381101561212e578181015183820152602001612116565b8381111561213d576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000825180604084015261217e816060850160208701612113565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b6000602082840312156121c357600080fd5b815167ffffffffffffffff808211156121db57600080fd5b818401915084601f8301126121ef57600080fd5b81518181111561220157612201611b63565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561224757612247611b63565b8160405282815287602084870101111561226057600080fd5b612271836020830160208801612113565b97965050505050505056fea164736f6c634300080f000a", } // DeployChainABI is the input ABI used to generate the binding from. @@ -546,12 +546,12 @@ func (_DeployChain *DeployChainCallerSession) ProtocolVersions() (common.Address return _DeployChain.Contract.ProtocolVersions(&_DeployChain.CallOpts) } -// ProxyAddress is a free data retrieval call binding the contract method 0x380cb000. +// ProxyAddress is a free data retrieval call binding the contract method 0xdda8804c. // -// Solidity: function proxyAddress(address proxy, bytes32 salt) view returns(address) -func (_DeployChain *DeployChainCaller) ProxyAddress(opts *bind.CallOpts, proxy common.Address, salt [32]byte) (common.Address, error) { +// Solidity: function proxyAddress(uint256 chainID, address implementation) view returns(address) +func (_DeployChain *DeployChainCaller) ProxyAddress(opts *bind.CallOpts, chainID *big.Int, implementation common.Address) (common.Address, error) { var out []interface{} - err := _DeployChain.contract.Call(opts, &out, "proxyAddress", proxy, salt) + err := _DeployChain.contract.Call(opts, &out, "proxyAddress", chainID, implementation) if err != nil { return *new(common.Address), err @@ -563,18 +563,18 @@ func (_DeployChain *DeployChainCaller) ProxyAddress(opts *bind.CallOpts, proxy c } -// ProxyAddress is a free data retrieval call binding the contract method 0x380cb000. +// ProxyAddress is a free data retrieval call binding the contract method 0xdda8804c. // -// Solidity: function proxyAddress(address proxy, bytes32 salt) view returns(address) -func (_DeployChain *DeployChainSession) ProxyAddress(proxy common.Address, salt [32]byte) (common.Address, error) { - return _DeployChain.Contract.ProxyAddress(&_DeployChain.CallOpts, proxy, salt) +// Solidity: function proxyAddress(uint256 chainID, address implementation) view returns(address) +func (_DeployChain *DeployChainSession) ProxyAddress(chainID *big.Int, implementation common.Address) (common.Address, error) { + return _DeployChain.Contract.ProxyAddress(&_DeployChain.CallOpts, chainID, implementation) } -// ProxyAddress is a free data retrieval call binding the contract method 0x380cb000. +// ProxyAddress is a free data retrieval call binding the contract method 0xdda8804c. // -// Solidity: function proxyAddress(address proxy, bytes32 salt) view returns(address) -func (_DeployChain *DeployChainCallerSession) ProxyAddress(proxy common.Address, salt [32]byte) (common.Address, error) { - return _DeployChain.Contract.ProxyAddress(&_DeployChain.CallOpts, proxy, salt) +// Solidity: function proxyAddress(uint256 chainID, address implementation) view returns(address) +func (_DeployChain *DeployChainCallerSession) ProxyAddress(chainID *big.Int, implementation common.Address) (common.Address, error) { + return _DeployChain.Contract.ProxyAddress(&_DeployChain.CallOpts, chainID, implementation) } // ProxyAdmin is a free data retrieval call binding the contract method 0x3e47158c. @@ -691,25 +691,25 @@ func (_DeployChain *DeployChainTransactorSession) Deploy(chainID *big.Int, genes return _DeployChain.Contract.Deploy(&_DeployChain.TransactOpts, chainID, genesisConfig, gasConfig, addressConfig, proofsEnabled) } -// DeployProxy is a paid mutator transaction binding the contract method 0x38db8411. +// DeployProxy is a paid mutator transaction binding the contract method 0x113bfd4a. // -// Solidity: function deployProxy(address proxy, bytes32 salt) returns(address) -func (_DeployChain *DeployChainTransactor) DeployProxy(opts *bind.TransactOpts, proxy common.Address, salt [32]byte) (*types.Transaction, error) { - return _DeployChain.contract.Transact(opts, "deployProxy", proxy, salt) +// Solidity: function deployProxy(uint256 chainID, address implementation) returns(address) +func (_DeployChain *DeployChainTransactor) DeployProxy(opts *bind.TransactOpts, chainID *big.Int, implementation common.Address) (*types.Transaction, error) { + return _DeployChain.contract.Transact(opts, "deployProxy", chainID, implementation) } -// DeployProxy is a paid mutator transaction binding the contract method 0x38db8411. +// DeployProxy is a paid mutator transaction binding the contract method 0x113bfd4a. // -// Solidity: function deployProxy(address proxy, bytes32 salt) returns(address) -func (_DeployChain *DeployChainSession) DeployProxy(proxy common.Address, salt [32]byte) (*types.Transaction, error) { - return _DeployChain.Contract.DeployProxy(&_DeployChain.TransactOpts, proxy, salt) +// Solidity: function deployProxy(uint256 chainID, address implementation) returns(address) +func (_DeployChain *DeployChainSession) DeployProxy(chainID *big.Int, implementation common.Address) (*types.Transaction, error) { + return _DeployChain.Contract.DeployProxy(&_DeployChain.TransactOpts, chainID, implementation) } -// DeployProxy is a paid mutator transaction binding the contract method 0x38db8411. +// DeployProxy is a paid mutator transaction binding the contract method 0x113bfd4a. // -// Solidity: function deployProxy(address proxy, bytes32 salt) returns(address) -func (_DeployChain *DeployChainTransactorSession) DeployProxy(proxy common.Address, salt [32]byte) (*types.Transaction, error) { - return _DeployChain.Contract.DeployProxy(&_DeployChain.TransactOpts, proxy, salt) +// Solidity: function deployProxy(uint256 chainID, address implementation) returns(address) +func (_DeployChain *DeployChainTransactorSession) DeployProxy(chainID *big.Int, implementation common.Address) (*types.Transaction, error) { + return _DeployChain.Contract.DeployProxy(&_DeployChain.TransactOpts, chainID, implementation) } // DeployChainDeployIterator is returned from FilterDeploy and is used to iterate over the raw logs and unpacked data for Deploy events raised by the DeployChain contract. diff --git a/contracts/deployments/84532-deploy.json b/contracts/deployments/84532-deploy.json index 9fefd3a..6f51556 100644 --- a/contracts/deployments/84532-deploy.json +++ b/contracts/deployments/84532-deploy.json @@ -3,7 +3,7 @@ "AnchorStateRegistryProxy": "0x0000000000000000000000000000000000000001", "CertManager": "0xD42fd50A9A8eE3F127A11AEACD4ADAA67Da7FE3B", "DelayedWETHProxy": "0x0000000000000000000000000000000000000001", - "DeployChain": "0x8B4dB9468126EA0AA6EC8f1FAEb32173de3A27c7", + "DeployChain": "0x36B138a8cD20b417BFD89Cc0003a55D62B4cFAB5", "DisputeGameFactoryProxy": "0x0000000000000000000000000000000000000001", "L1CrossDomainMessenger": "0x50237F4364Dfa91EB16d1DD20ae97b40e430c1fA", "L1CrossDomainMessengerProxy": "0x05c8428901475fae5341d24DB61529450827E5c6", diff --git a/contracts/src/DeployChain.sol b/contracts/src/DeployChain.sol index 275aeea..fd05abd 100644 --- a/contracts/src/DeployChain.sol +++ b/contracts/src/DeployChain.sol @@ -5,6 +5,7 @@ import {ResolvingProxyFactory} from "./ResolvingProxyFactory.sol"; import {Portal} from "./Portal.sol"; import {OutputOracle} from "./OutputOracle.sol"; import {SystemConfigOwnable} from "./SystemConfigOwnable.sol"; +import {ResolvingProxy} from "./ResolvingProxy.sol"; import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; import {ISystemConfig} from "@eth-optimism-bedrock/src/L1/interfaces/ISystemConfig.sol"; import {OptimismPortal} from "@eth-optimism-bedrock/src/L1/OptimismPortal.sol"; @@ -21,6 +22,10 @@ import {Hashing} from "@eth-optimism-bedrock/src/libraries/Hashing.sol"; import {Types} from "@eth-optimism-bedrock/src/libraries/Types.sol"; import {Constants} from "@eth-optimism-bedrock/src/libraries/Constants.sol"; +interface IProxyAdmin { + function getProxyImplementation(address) external view returns (address); +} + contract DeployChain { struct DeployAddresses { address l2OutputOracle; @@ -100,20 +105,20 @@ contract DeployChain { } function deployAddresses(uint256 chainID) external view returns (DeployAddresses memory) { - bytes32 salt = keccak256(abi.encodePacked(chainID)); return DeployAddresses({ - l2OutputOracle: proxyAddress(l2OutputOracle, salt), - systemConfig: proxyAddress(systemConfig, salt), - optimismPortal: proxyAddress(optimismPortal, salt), - l1CrossDomainMessenger: proxyAddress(l1CrossDomainMessenger, salt), - l1StandardBridge: proxyAddress(l1StandardBridge, salt), - l1ERC721Bridge: proxyAddress(l1ERC721Bridge, salt), - optimismMintableERC20Factory: proxyAddress(optimismMintableERC20Factory, salt) + l2OutputOracle: proxyAddress(chainID, l2OutputOracle), + systemConfig: proxyAddress(chainID, systemConfig), + optimismPortal: proxyAddress(chainID, optimismPortal), + l1CrossDomainMessenger: proxyAddress(chainID, l1CrossDomainMessenger), + l1StandardBridge: proxyAddress(chainID, l1StandardBridge), + l1ERC721Bridge: proxyAddress(chainID, l1ERC721Bridge), + optimismMintableERC20Factory: proxyAddress(chainID, optimismMintableERC20Factory) }); } - function proxyAddress(address proxy, bytes32 salt) public view returns (address) { - return ResolvingProxyFactory.proxyAddress(proxy, proxyAdmin, salt); + function proxyAddress(uint256 chainID, address implementation) public view returns (address) { + bytes32 salt = keccak256(abi.encodePacked(chainID, implementation)); + return ResolvingProxyFactory.proxyAddress(address(this), salt); } function deploy( @@ -153,20 +158,20 @@ contract DeployChain { } function setupProxies(uint256 chainID) internal returns (DeployAddresses memory) { - bytes32 salt = keccak256(abi.encodePacked(chainID)); return DeployAddresses({ - l2OutputOracle: deployProxy(l2OutputOracle, salt), - systemConfig: deployProxy(systemConfig, salt), - optimismPortal: deployProxy(optimismPortal, salt), - l1CrossDomainMessenger: deployProxy(l1CrossDomainMessenger, salt), - l1StandardBridge: deployProxy(l1StandardBridge, salt), - l1ERC721Bridge: deployProxy(l1ERC721Bridge, salt), - optimismMintableERC20Factory: deployProxy(optimismMintableERC20Factory, salt) + l2OutputOracle: deployProxy(chainID, l2OutputOracle), + systemConfig: deployProxy(chainID, systemConfig), + optimismPortal: deployProxy(chainID, optimismPortal), + l1CrossDomainMessenger: deployProxy(chainID, l1CrossDomainMessenger), + l1StandardBridge: deployProxy(chainID, l1StandardBridge), + l1ERC721Bridge: deployProxy(chainID, l1ERC721Bridge), + optimismMintableERC20Factory: deployProxy(chainID, optimismMintableERC20Factory) }); } - function deployProxy(address proxy, bytes32 salt) public returns (address) { - return ResolvingProxyFactory.setupProxy(proxy, proxyAdmin, salt); + function deployProxy(uint256 chainID, address implementation) public returns (address) { + bytes32 salt = keccak256(abi.encodePacked(chainID, implementation)); + return ResolvingProxyFactory.setupProxy(address(this), salt); } function calculateHashes( @@ -217,47 +222,66 @@ contract DeployChain { DeployAddresses memory addresses, bool proofsEnabled ) internal { - OutputOracle(addresses.l2OutputOracle).initialize( - SystemConfigOwnable(addresses.systemConfig), hashes.configHash, hashes.genesisOutputRoot, proofsEnabled - ); - - Portal(payable(addresses.optimismPortal)).initialize( + _upgradeInitializeAndTransferProxyOwnership(addresses.l2OutputOracle, l2OutputOracle, abi.encodeCall(OutputOracle.initialize, ( + SystemConfigOwnable(addresses.systemConfig), + hashes.configHash, + hashes.genesisOutputRoot, + proofsEnabled + ))); + + _upgradeInitializeAndTransferProxyOwnership(addresses.optimismPortal, optimismPortal, abi.encodeCall(Portal.initialize, ( OutputOracle(addresses.l2OutputOracle), ISystemConfig(addresses.systemConfig), ISuperchainConfig(superchainConfig) - ); + ))); SystemConfig.Addresses memory systemAddresses = _createSystemAddresses(addresses, gasConfig.gasToken); - SystemConfigOwnable(addresses.systemConfig).initialize({ - _basefeeScalar: gasConfig.basefeeScalar, - _blobbasefeeScalar: gasConfig.blobbasefeeScalar, - _batcherHash: bytes32(uint256(uint160(addressConfig.batcher))), - _gasLimit: gasConfig.gasLimit, - _unsafeBlockSigner: addressConfig.unsafeBlockSigner, - _config: Constants.DEFAULT_RESOURCE_CONFIG(), - _batchInbox: batchInbox, - _proposer: addressConfig.proposer, - _addresses: systemAddresses - }); - - L1CrossDomainMessenger(addresses.l1CrossDomainMessenger).initialize( + _upgradeInitializeAndTransferProxyOwnership(addresses.systemConfig, systemConfig, abi.encodeCall(SystemConfigOwnable.initialize, ( + gasConfig.basefeeScalar, + gasConfig.blobbasefeeScalar, + bytes32(uint256(uint160(addressConfig.batcher))), + gasConfig.gasLimit, + addressConfig.unsafeBlockSigner, + Constants.DEFAULT_RESOURCE_CONFIG(), + batchInbox, + addressConfig.proposer, + systemAddresses + ))); + + _upgradeInitializeAndTransferProxyOwnership(addresses.l1CrossDomainMessenger, l1CrossDomainMessenger, abi.encodeCall(L1CrossDomainMessenger.initialize, ( ISuperchainConfig(superchainConfig), IOptimismPortal(payable(addresses.optimismPortal)), ISystemConfig(addresses.systemConfig) - ); + ))); - L1StandardBridge(payable(addresses.l1StandardBridge)).initialize( + _upgradeInitializeAndTransferProxyOwnership(addresses.l1StandardBridge, l1StandardBridge, abi.encodeCall(L1StandardBridge.initialize, ( ICrossDomainMessenger(addresses.l1CrossDomainMessenger), ISuperchainConfig(superchainConfig), ISystemConfig(addresses.systemConfig) - ); + ))); - L1ERC721Bridge(addresses.l1ERC721Bridge).initialize( - ICrossDomainMessenger(addresses.l1CrossDomainMessenger), ISuperchainConfig(superchainConfig) - ); + _upgradeInitializeAndTransferProxyOwnership(addresses.l1ERC721Bridge, l1ERC721Bridge, abi.encodeCall(L1ERC721Bridge.initialize, ( + ICrossDomainMessenger(addresses.l1CrossDomainMessenger), + ISuperchainConfig(superchainConfig) + ))); + + _upgradeInitializeAndTransferProxyOwnership(addresses.optimismMintableERC20Factory, optimismMintableERC20Factory, abi.encodeCall(OptimismMintableERC20Factory.initialize, ( + addresses.l1StandardBridge + ))); + } - OptimismMintableERC20Factory(addresses.optimismMintableERC20Factory).initialize(addresses.l1StandardBridge); + function _upgradeInitializeAndTransferProxyOwnership( + address _proxy, + address _implementation, + bytes memory _data + ) private { + ResolvingProxy proxy = ResolvingProxy(payable(_proxy)); + address actual = IProxyAdmin(proxyAdmin).getProxyImplementation(_implementation); + require(actual != address(0), "DeployChain: invalid implementation"); + proxy.upgradeToAndCall(actual, _data); + proxy.upgradeTo(_implementation); + proxy.changeAdmin(proxyAdmin); } function _createSystemAddresses(DeployAddresses memory addresses, address gasToken) diff --git a/contracts/src/ResolvingProxy.sol b/contracts/src/ResolvingProxy.sol index 6a15aba..4aecd93 100644 --- a/contracts/src/ResolvingProxy.sol +++ b/contracts/src/ResolvingProxy.sol @@ -43,8 +43,7 @@ contract ResolvingProxy { /// implementation is not possible. /// @param _admin Address of the initial contract admin. Admin has the ability to access the /// transparent proxy interface. - constructor(address _implementation, address _admin) { - _setImplementation(_implementation); + constructor(address _admin) { _setAdmin(_admin); } @@ -145,6 +144,7 @@ contract ResolvingProxy { function _resolveImplementation() internal view returns (address) { address proxy = _getImplementation(); + require(proxy != address(0)); bytes memory data = abi.encodeCall(IResolver.getProxyImplementation, (proxy)); (bool success, bytes memory returndata) = _getAdmin().staticcall(data); if (success && returndata.length == 0x20) { diff --git a/contracts/src/ResolvingProxyFactory.sol b/contracts/src/ResolvingProxyFactory.sol index 6b17fc3..40757c6 100644 --- a/contracts/src/ResolvingProxyFactory.sol +++ b/contracts/src/ResolvingProxyFactory.sol @@ -9,65 +9,61 @@ import {ResolvingProxy} from "./ResolvingProxy.sol"; /// implementation that is more gas efficient to deploy and operate than the solidity /// ResolvingProxy implementation. library ResolvingProxyFactory { - function setupProxy(address proxy, address admin, bytes32 salt) internal returns (address instance) { + function setupProxy(address admin, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) - mstore(ptr, shl(0xC0, 0x600661011c565b73)) - mstore(add(ptr, 0x8), shl(0x60, proxy)) - mstore(add(ptr, 0x1c), shl(0xE8, 0x905573)) - mstore(add(ptr, 0x1f), shl(0x60, admin)) - mstore(add(ptr, 0x33), 0x905561012280603f5f395ff35f365f600860dd565b8054909180548033143315) - mstore(add(ptr, 0x53), 0x171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b14) - mstore(add(ptr, 0x73), 0x609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa57) - mstore(add(ptr, 0x93), 0x5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d60201416) - mstore(add(ptr, 0xb3), 0x805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e) - mstore(add(ptr, 0xd3), 0x5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b50506020) - mstore(add(ptr, 0xf3), 0x60045f375f518091559160d957903333602060445f375f519560649550506040) - mstore(add(ptr, 0x113), 0x96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc) - mstore(add(ptr, 0x133), 0x3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b6) - mstore(add(ptr, 0x153), shl(0x90, 0xe8ee1178d6a717850b5d61039156)) - instance := create2(0, ptr, 0x161, salt) + mstore(ptr, shl(0xC0, 0x600661010e565b73)) + mstore(add(ptr, 0x8), shl(0x60, admin)) + mstore(add(ptr, 0x1c), 0x90915561012a8060295f395ff35f365f600860e5565b80549091805480331433) + mstore(add(ptr, 0x3c), 0x15171560545760045f5f375f5160e01c8063f851a4401460a75780635c60da1b) + mstore(add(ptr, 0x5c), 0x1460a45780638f2839701460b45780633659cfe61460b157634f1ef2861460af) + mstore(add(ptr, 0x7c), 0x575b63204e1c7a60e01b5f5282801560e2576004525f5f60245f845afa3d5f5f) + mstore(add(ptr, 0x9c), 0x3e3d60201416805f510290158402015f875f89895f375f935af43d5f893d6020) + mstore(add(ptr, 0xbc), 0x5260205f523e5f3d89019160a257fd5bf35b50505b505f5260205ff35b5f5b93) + mstore(add(ptr, 0xdc), 0x915b5050602060045f375f518091559160de57903333602060445f375f519560) + mstore(add(ptr, 0xfc), 0x64955050604096506054565b5f5ff35b5ffd5b7f360894a13ba1a3210667c828) + mstore(add(ptr, 0x11c), 0x492db98dca3e2076cc3735a920a3ca505d382bbc7fb53127684a568b3173ae13) + mstore(add(ptr, 0x13c), shl(0x48, 0xb9f8a6016e243e63b6e8ee1178d6a717850b5d61039156)) + instance := create2(0, ptr, 0x153, salt) } require(instance != address(0), "Proxy: create2 failed"); } - function proxyAddress(address proxy, address admin, bytes32 salt) internal view returns (address predicted) { + function proxyAddress(address admin, bytes32 salt) internal view returns (address predicted) { address deployer = address(this); /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) - mstore(ptr, shl(0xC0, 0x600661011c565b73)) - mstore(add(ptr, 0x8), shl(0x60, proxy)) - mstore(add(ptr, 0x1c), shl(0xE8, 0x905573)) - mstore(add(ptr, 0x1f), shl(0x60, admin)) - mstore(add(ptr, 0x33), 0x905561012280603f5f395ff35f365f600860dd565b8054909180548033143315) - mstore(add(ptr, 0x53), 0x171560545760045f5f375f5160e01c8063f851a4401460a25780635c60da1b14) - mstore(add(ptr, 0x73), 0x609f5780638f2839701460af5780633659cfe61460ac57634f1ef2861460aa57) - mstore(add(ptr, 0x93), 0x5b63204e1c7a60e01b5f52826004525f5f60245f845afa3d5f5f3e3d60201416) - mstore(add(ptr, 0xb3), 0x805f510290158402015f875f89895f375f935af43d5f893d60205260205f523e) - mstore(add(ptr, 0xd3), 0x5f3d890191609d57fd5bf35b50505b505f5260205ff35b5f5b93915b50506020) - mstore(add(ptr, 0xf3), 0x60045f375f518091559160d957903333602060445f375f519560649550506040) - mstore(add(ptr, 0x113), 0x96506054565b5f5ff35b7f360894a13ba1a3210667c828492db98dca3e2076cc) - mstore(add(ptr, 0x133), 0x3735a920a3ca505d382bbc7fb53127684a568b3173ae13b9f8a6016e243e63b6) - mstore(add(ptr, 0x153), shl(0x88, 0xe8ee1178d6a717850b5d61039156ff)) - mstore(add(ptr, 0x162), shl(0x60, deployer)) - mstore(add(ptr, 0x176), salt) - mstore(add(ptr, 0x196), keccak256(ptr, 0x161)) - predicted := keccak256(add(ptr, 0x161), 0x55) + mstore(ptr, shl(0xC0, 0x600661010e565b73)) + mstore(add(ptr, 0x8), shl(0x60, admin)) + mstore(add(ptr, 0x1c), 0x90915561012a8060295f395ff35f365f600860e5565b80549091805480331433) + mstore(add(ptr, 0x3c), 0x15171560545760045f5f375f5160e01c8063f851a4401460a75780635c60da1b) + mstore(add(ptr, 0x5c), 0x1460a45780638f2839701460b45780633659cfe61460b157634f1ef2861460af) + mstore(add(ptr, 0x7c), 0x575b63204e1c7a60e01b5f5282801560e2576004525f5f60245f845afa3d5f5f) + mstore(add(ptr, 0x9c), 0x3e3d60201416805f510290158402015f875f89895f375f935af43d5f893d6020) + mstore(add(ptr, 0xbc), 0x5260205f523e5f3d89019160a257fd5bf35b50505b505f5260205ff35b5f5b93) + mstore(add(ptr, 0xdc), 0x915b5050602060045f375f518091559160de57903333602060445f375f519560) + mstore(add(ptr, 0xfc), 0x64955050604096506054565b5f5ff35b5ffd5b7f360894a13ba1a3210667c828) + mstore(add(ptr, 0x11c), 0x492db98dca3e2076cc3735a920a3ca505d382bbc7fb53127684a568b3173ae13) + mstore(add(ptr, 0x13c), shl(0x40, 0xb9f8a6016e243e63b6e8ee1178d6a717850b5d61039156ff)) + mstore(add(ptr, 0x154), shl(0x60, deployer)) + mstore(add(ptr, 0x168), salt) + mstore(add(ptr, 0x188), keccak256(ptr, 0x153)) + predicted := keccak256(add(ptr, 0x153), 0x55) } } - function setupExpensiveProxy(address proxy, address admin, bytes32 salt) internal returns (address instance) { - return address(new ResolvingProxy{salt: salt}(proxy, admin)); + function setupExpensiveProxy(address admin, bytes32 salt) internal returns (address instance) { + return address(new ResolvingProxy{salt: salt}(admin)); } - function expensiveProxyAddress(address proxy, address admin, bytes32 salt) + function expensiveProxyAddress(address admin, bytes32 salt) internal view returns (address predicted) { - bytes memory bytecode = abi.encodePacked(type(ResolvingProxy).creationCode, abi.encode(proxy, admin)); + bytes memory bytecode = abi.encodePacked(type(ResolvingProxy).creationCode, abi.encode(admin)); bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256(bytecode))); return address(uint160(uint256(hash))); } diff --git a/contracts/test/ResolvingProxyFactory.t.sol b/contracts/test/ResolvingProxyFactory.t.sol index 069ecf7..36b3a1d 100644 --- a/contracts/test/ResolvingProxyFactory.t.sol +++ b/contracts/test/ResolvingProxyFactory.t.sol @@ -40,7 +40,8 @@ contract ResolvingProxyFactoryTest is Test { admin = new ProxyAdmin(address(this)); proxy = new Proxy(address(admin)); admin.upgrade(payable(address(proxy)), address(implementation1)); - resolvingProxy = ResolvingProxyFactory.setupProxy(address(proxy), address(admin), 0x00); + resolvingProxy = ResolvingProxyFactory.setupProxy(address(admin), 0x00); + admin.upgrade(payable(address(resolvingProxy)), address(proxy)); Implementation1(resolvingProxy).set("world"); } @@ -86,7 +87,7 @@ contract ResolvingProxyFactoryTest is Test { } function test_proxyAddress() public view { - address predicted = ResolvingProxyFactory.proxyAddress(address(proxy), address(admin), 0x00); + address predicted = ResolvingProxyFactory.proxyAddress(address(admin), 0x00); assertEq(predicted, resolvingProxy); } }