Commit a5ea3d29 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into sc/l2g-dump-fix

parents 5005da9a 8f531f20
---
'@eth-optimism/ci-builder': patch
---
Update geth to 1.10.25
# op-bindings
This package contains built go bindings of the smart contracts. It must be
updated after any changes to the smart contracts to ensure that the bindings are
up to date.
The bindings include the bytecode for each contract so that go based tests
can deploy the contracts. There are also `more` files that include the deployed
bytecode as well as the storage layout. These are used to dynamically set
bytecode and storage slots in state.
## Dependencies
- `abigen` version 1.10.25
- `make`
To check the version of `abigen`, run the command `abigen --version`.
## abigen
The `abigen` tool is part of `go-ethereum` and can be used to build go bindings
for smart contracts. It can be installed with go using the commands:
```bash
$ go get -u github.com/ethereum/go-ethereum
$ cd $GOPATH/src/github.com/ethereum/go-ethereum/
$ make devtools
```
The geth docs for `abigen` can be found [here](https://geth.ethereum.org/docs/dapp/native-bindings).
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const DeployerWhitelistStorageLayoutJSON = "{\"storage\":[{\"astId\":3252,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":3257,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"whitelist\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}" const DeployerWhitelistStorageLayoutJSON = "{\"storage\":[{\"astId\":3248,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":3253,\"contract\":\"contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist\",\"label\":\"whitelist\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}"
var DeployerWhitelistStorageLayout = new(solc.StorageLayout) var DeployerWhitelistStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":28501,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1951,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1954,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1957,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":1960,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"},{\"astId\":1963,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"decimals\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const GasPriceOracleStorageLayoutJSON = "{\"storage\":[{\"astId\":28509,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":1953,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_1_0_32\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":1956,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"spacer_2_0_32\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":1959,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"overhead\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint256\"},{\"astId\":1962,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"scalar\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_uint256\"},{\"astId\":1965,\"contract\":\"contracts/L2/GasPriceOracle.sol:GasPriceOracle\",\"label\":\"decimals\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var GasPriceOracleStorageLayout = new(solc.StorageLayout) var GasPriceOracleStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const GovernanceTokenStorageLayoutJSON = "{\"storage\":[{\"astId\":28851,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":28857,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":28859,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":28861,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":28863,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":30228,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_nonces\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_mapping(t_address,t_struct(Counter)32414_storage)\"},{\"astId\":30236,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_PERMIT_TYPEHASH_DEPRECATED_SLOT\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_bytes32\"},{\"astId\":29569,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_delegates\",\"offset\":0,\"slot\":\"7\",\"type\":\"t_mapping(t_address,t_address)\"},{\"astId\":29575,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_checkpoints\",\"offset\":0,\"slot\":\"8\",\"type\":\"t_mapping(t_address,t_array(t_struct(Checkpoint)29560_storage)dyn_storage)\"},{\"astId\":29579,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupplyCheckpoints\",\"offset\":0,\"slot\":\"9\",\"type\":\"t_array(t_struct(Checkpoint)29560_storage)dyn_storage\"},{\"astId\":28501,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"10\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_struct(Checkpoint)29560_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct ERC20Votes.Checkpoint[]\",\"numberOfBytes\":\"32\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_address)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e address)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_address\"},\"t_mapping(t_address,t_array(t_struct(Checkpoint)29560_storage)dyn_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct ERC20Votes.Checkpoint[])\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_array(t_struct(Checkpoint)29560_storage)dyn_storage\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(Counter)32414_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Counters.Counter)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Counter)32414_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_struct(Checkpoint)29560_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ERC20Votes.Checkpoint\",\"numberOfBytes\":\"32\"},\"t_struct(Counter)32414_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Counters.Counter\",\"numberOfBytes\":\"32\"},\"t_uint224\":{\"encoding\":\"inplace\",\"label\":\"uint224\",\"numberOfBytes\":\"28\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"}}}" const GovernanceTokenStorageLayoutJSON = "{\"storage\":[{\"astId\":28859,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":28865,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":28867,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":28869,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":28871,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":30236,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_nonces\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_mapping(t_address,t_struct(Counter)32422_storage)\"},{\"astId\":30244,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_PERMIT_TYPEHASH_DEPRECATED_SLOT\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_bytes32\"},{\"astId\":29577,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_delegates\",\"offset\":0,\"slot\":\"7\",\"type\":\"t_mapping(t_address,t_address)\"},{\"astId\":29583,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_checkpoints\",\"offset\":0,\"slot\":\"8\",\"type\":\"t_mapping(t_address,t_array(t_struct(Checkpoint)29568_storage)dyn_storage)\"},{\"astId\":29587,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_totalSupplyCheckpoints\",\"offset\":0,\"slot\":\"9\",\"type\":\"t_array(t_struct(Checkpoint)29568_storage)dyn_storage\"},{\"astId\":28509,\"contract\":\"contracts/L2/GovernanceToken.sol:GovernanceToken\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"10\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_struct(Checkpoint)29568_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct ERC20Votes.Checkpoint[]\",\"numberOfBytes\":\"32\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_address)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e address)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_address\"},\"t_mapping(t_address,t_array(t_struct(Checkpoint)29568_storage)dyn_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct ERC20Votes.Checkpoint[])\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_array(t_struct(Checkpoint)29568_storage)dyn_storage\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(Counter)32422_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Counters.Counter)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Counter)32422_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_struct(Checkpoint)29568_storage\":{\"encoding\":\"inplace\",\"label\":\"struct ERC20Votes.Checkpoint\",\"numberOfBytes\":\"32\"},\"t_struct(Counter)32422_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Counters.Counter\",\"numberOfBytes\":\"32\"},\"t_uint224\":{\"encoding\":\"inplace\",\"label\":\"uint224\",\"numberOfBytes\":\"28\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint32\":{\"encoding\":\"inplace\",\"label\":\"uint32\",\"numberOfBytes\":\"4\"}}}"
var GovernanceTokenStorageLayout = new(solc.StorageLayout) var GovernanceTokenStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L1BlockStorageLayoutJSON = "{\"storage\":[{\"astId\":2298,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"number\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2301,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"timestamp\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2304,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"basefee\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":2307,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"hash\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_bytes32\"},{\"astId\":2310,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"sequenceNumber\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint64\"}],\"types\":{\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"}}}" const L1BlockStorageLayoutJSON = "{\"storage\":[{\"astId\":2300,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"number\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2303,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"timestamp\",\"offset\":8,\"slot\":\"0\",\"type\":\"t_uint64\"},{\"astId\":2306,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"basefee\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_uint256\"},{\"astId\":2309,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"hash\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_bytes32\"},{\"astId\":2312,\"contract\":\"contracts/L2/L1Block.sol:L1Block\",\"label\":\"sequenceNumber\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_uint64\"}],\"types\":{\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint64\":{\"encoding\":\"inplace\",\"label\":\"uint64\",\"numberOfBytes\":\"8\"}}}"
var L1BlockStorageLayout = new(solc.StorageLayout) var L1BlockStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L1CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":24892,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27878,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":27881,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":28492,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":27750,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":27870,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28043,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":28148,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28163,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":28207,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":24944,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24949,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24954,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24957,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":24960,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":24965,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24970,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const L1CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":24900,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27886,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":27889,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":28500,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":27758,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":27878,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28051,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":28156,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28171,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":28215,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":24952,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24957,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24962,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24965,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":24968,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":24973,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24978,\"contract\":\"contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var L1CrossDomainMessengerStorageLayout = new(solc.StorageLayout) var L1CrossDomainMessengerStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":24892,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27878,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":27881,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":28492,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":27750,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":27870,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28043,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":28148,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28163,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":28207,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":24944,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24949,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24954,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24957,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":24960,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":24965,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24970,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" const L2CrossDomainMessengerStorageLayoutJSON = "{\"storage\":[{\"astId\":24900,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27886,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initialized\",\"offset\":20,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":27889,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_initializing\",\"offset\":21,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":28500,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)50_storage\"},{\"astId\":27758,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":27878,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28051,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_paused\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_bool\"},{\"astId\":28156,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":28171,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"_status\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_uint256\"},{\"astId\":28215,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_array(t_uint256)49_storage\"},{\"astId\":24952,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_201_0_32\",\"offset\":0,\"slot\":\"201\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24957,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"spacer_202_0_32\",\"offset\":0,\"slot\":\"202\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24962,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"successfulMessages\",\"offset\":0,\"slot\":\"203\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24965,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"xDomainMsgSender\",\"offset\":0,\"slot\":\"204\",\"type\":\"t_address\"},{\"astId\":24968,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"msgNonce\",\"offset\":0,\"slot\":\"205\",\"type\":\"t_uint240\"},{\"astId\":24973,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"receivedMessages\",\"offset\":0,\"slot\":\"206\",\"type\":\"t_mapping(t_bytes32,t_bool)\"},{\"astId\":24978,\"contract\":\"contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"207\",\"type\":\"t_array(t_uint256)42_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)42_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[42]\",\"numberOfBytes\":\"1344\"},\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)50_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"},\"t_uint240\":{\"encoding\":\"inplace\",\"label\":\"uint240\",\"numberOfBytes\":\"30\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}"
var L2CrossDomainMessengerStorageLayout = new(solc.StorageLayout) var L2CrossDomainMessengerStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":25398,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)49_storage\"}],\"types\":{\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2ERC721BridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":25406,\"contract\":\"contracts/L2/L2ERC721Bridge.sol:L2ERC721Bridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_array(t_uint256)49_storage\"}],\"types\":{\"t_array(t_uint256)49_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2ERC721BridgeStorageLayout = new(solc.StorageLayout) var L2ERC721BridgeStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const L2StandardBridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":27051,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27054,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_1_0_20\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_address\"},{\"astId\":27061,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"deposits\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":27066,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_uint256)47_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)47_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[47]\",\"numberOfBytes\":\"1504\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const L2StandardBridgeStorageLayoutJSON = "{\"storage\":[{\"astId\":27059,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_0_0_20\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"},{\"astId\":27062,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"spacer_1_0_20\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_address\"},{\"astId\":27069,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"deposits\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":27074,\"contract\":\"contracts/L2/L2StandardBridge.sol:L2StandardBridge\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_array(t_uint256)47_storage\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_uint256)47_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[47]\",\"numberOfBytes\":\"1504\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var L2StandardBridgeStorageLayout = new(solc.StorageLayout) var L2StandardBridgeStorageLayout = new(solc.StorageLayout)
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const LegacyERC20ETHStorageLayoutJSON = "{\"storage\":[{\"astId\":28851,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":28857,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":28859,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":28861,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":28863,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":25627,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"remoteToken\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_address\"},{\"astId\":25630,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"bridge\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}" const LegacyERC20ETHStorageLayoutJSON = "{\"storage\":[{\"astId\":28859,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_balances\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":28865,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_allowances\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":28867,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_totalSupply\",\"offset\":0,\"slot\":\"2\",\"type\":\"t_uint256\"},{\"astId\":28869,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_name\",\"offset\":0,\"slot\":\"3\",\"type\":\"t_string_storage\"},{\"astId\":28871,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"_symbol\",\"offset\":0,\"slot\":\"4\",\"type\":\"t_string_storage\"},{\"astId\":25635,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"remoteToken\",\"offset\":0,\"slot\":\"5\",\"type\":\"t_address\"},{\"astId\":25638,\"contract\":\"contracts/legacy/LegacyERC20ETH.sol:LegacyERC20ETH\",\"label\":\"bridge\",\"offset\":0,\"slot\":\"6\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_string_storage\":{\"encoding\":\"bytes\",\"label\":\"string\",\"numberOfBytes\":\"32\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"}}}"
var LegacyERC20ETHStorageLayout = new(solc.StorageLayout) var LegacyERC20ETHStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const LegacyMessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":3895,\"contract\":\"contracts/legacy/LegacyMessagePasser.sol:LegacyMessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"}}}" const LegacyMessagePasserStorageLayoutJSON = "{\"storage\":[{\"astId\":3891,\"contract\":\"contracts/legacy/LegacyMessagePasser.sol:LegacyMessagePasser\",\"label\":\"sentMessages\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_bytes32,t_bool)\"}],\"types\":{\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_bool\"}}}"
var LegacyMessagePasserStorageLayout = new(solc.StorageLayout) var LegacyMessagePasserStorageLayout = new(solc.StorageLayout)
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":26150,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}" const OptimismMintableERC721FactoryStorageLayoutJSON = "{\"storage\":[{\"astId\":26158,\"contract\":\"contracts/universal/OptimismMintableERC721Factory.sol:OptimismMintableERC721Factory\",\"label\":\"isOptimismMintableERC721\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_mapping(t_address,t_bool)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"}}}"
var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout) var OptimismMintableERC721FactoryStorageLayout = new(solc.StorageLayout)
......
This diff is collapsed.
This diff is collapsed.
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/solc" "github.com/ethereum-optimism/optimism/op-bindings/solc"
) )
const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":3093,\"contract\":\"contracts/L2/SequencerFeeVault.sol:SequencerFeeVault\",\"label\":\"l1FeeWallet\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"}}}" const SequencerFeeVaultStorageLayoutJSON = "{\"storage\":[{\"astId\":3089,\"contract\":\"contracts/L2/SequencerFeeVault.sol:SequencerFeeVault\",\"label\":\"l1FeeWallet\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_address\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"}}}"
var SequencerFeeVaultStorageLayout = new(solc.StorageLayout) var SequencerFeeVaultStorageLayout = new(solc.StorageLayout)
......
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
{ {
"address": "0x4200000000000000000000000000000000000016", "address": "0x4200000000000000000000000000000000000016",
"topics": [ "topics": [
"0x7744840cae4793a72467311120512aa98e4398bcd2b9d379b2b9c3b60fa03d72", "0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054",
"0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000004200000000000000000000000000000000000007", "0x0000000000000000000000004200000000000000000000000000000000000007",
"0x0000000000000000000000006900000000000000000000000000000000000002" "0x0000000000000000000000006900000000000000000000000000000000000002"
], ],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031b80000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e4d764ad0b0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000001000000000000000000000000069000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031b8000000000000000000000000000000000000000000000000000000000000000800d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce286828500000000000000000000000000000000000000000000000000000000000001e4d764ad0b0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000001000000000000000000000000069000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x36", "blockNumber": "0x36",
"transactionHash": "0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add", "transactionHash": "0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add",
"transactionIndex": "0x1", "transactionIndex": "0x1",
......
...@@ -17,12 +17,10 @@ import ( ...@@ -17,12 +17,10 @@ import (
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient/gethclient" "github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
var MessagePassedTopic = crypto.Keccak256Hash([]byte("MessagePassed(uint256,address,address,uint256,uint256,bytes)")) var MessagePassedTopic = crypto.Keccak256Hash([]byte("MessagePassed(uint256,address,address,uint256,uint256,bytes,bytes32)"))
var MessagePassedExtension1Topic = crypto.Keccak256Hash([]byte("MessagePassedExtension1(bytes32)"))
// WaitForFinalizationPeriod waits until there is OutputProof for an L2 block number larger than the supplied l2BlockNumber // WaitForFinalizationPeriod waits until there is OutputProof for an L2 block number larger than the supplied l2BlockNumber
// and that the output is finalized. // and that the output is finalized.
...@@ -159,7 +157,7 @@ type FinalizedWithdrawalParameters struct { ...@@ -159,7 +157,7 @@ type FinalizedWithdrawalParameters struct {
BlockNumber *big.Int BlockNumber *big.Int
Data []byte Data []byte
OutputRootProof bindings.TypesOutputRootProof OutputRootProof bindings.TypesOutputRootProof
WithdrawalProof []byte // RLP Encoded list of trie nodes to prove L2 storage WithdrawalProof [][]byte // List of trie nodes to prove L2 storage
} }
// FinalizeWithdrawalParameters queries L2 to generate all withdrawal parameters and proof necessary to finalize an withdrawal on L1. // FinalizeWithdrawalParameters queries L2 to generate all withdrawal parameters and proof necessary to finalize an withdrawal on L1.
...@@ -176,13 +174,9 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH ...@@ -176,13 +174,9 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH
if err != nil { if err != nil {
return FinalizedWithdrawalParameters{}, err return FinalizedWithdrawalParameters{}, err
} }
ev1, err := ParseMessagePassedExtension1(receipt)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
// Generate then verify the withdrawal proof // Generate then verify the withdrawal proof
withdrawalHash, err := WithdrawalHash(ev) withdrawalHash, err := WithdrawalHash(ev)
if !bytes.Equal(withdrawalHash[:], ev1.Hash[:]) { if !bytes.Equal(withdrawalHash[:], ev.WithdrawalHash[:]) {
return FinalizedWithdrawalParameters{}, errors.New("Computed withdrawal hash incorrectly") return FinalizedWithdrawalParameters{}, errors.New("Computed withdrawal hash incorrectly")
} }
if err != nil { if err != nil {
...@@ -208,11 +202,6 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH ...@@ -208,11 +202,6 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH
trieNodes[i] = common.FromHex(s) trieNodes[i] = common.FromHex(s)
} }
withdrawalProof, err := rlp.EncodeToBytes(trieNodes)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
return FinalizedWithdrawalParameters{ return FinalizedWithdrawalParameters{
Nonce: ev.Nonce, Nonce: ev.Nonce,
Sender: ev.Sender, Sender: ev.Sender,
...@@ -227,7 +216,7 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH ...@@ -227,7 +216,7 @@ func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txH
MessagePasserStorageRoot: p.StorageHash, MessagePasserStorageRoot: p.StorageHash,
LatestBlockhash: header.Hash(), LatestBlockhash: header.Hash(),
}, },
WithdrawalProof: withdrawalProof, WithdrawalProof: trieNodes,
}, nil }, nil
} }
...@@ -284,29 +273,6 @@ func ParseMessagePassed(receipt *types.Receipt) (*bindings.L2ToL1MessagePasserMe ...@@ -284,29 +273,6 @@ func ParseMessagePassed(receipt *types.Receipt) (*bindings.L2ToL1MessagePasserMe
return nil, errors.New("Unable to find MessagePassed event") return nil, errors.New("Unable to find MessagePassed event")
} }
// ParseMessagePassedExtension1 parses MessagePassedExtension1 events
// from a transaction receipt. It does not support multiple withdrawals per
// receipt.
func ParseMessagePassedExtension1(receipt *types.Receipt) (*bindings.L2ToL1MessagePasserMessagePassedExtension1, error) {
contract, err := bindings.NewL2ToL1MessagePasser(common.Address{}, nil)
if err != nil {
return nil, err
}
for _, log := range receipt.Logs {
if len(log.Topics) == 0 || log.Topics[0] != MessagePassedExtension1Topic {
continue
}
ev, err := contract.ParseMessagePassedExtension1(*log)
if err != nil {
return nil, fmt.Errorf("failed to parse log: %w", err)
}
return ev, nil
}
return nil, errors.New("Unable to find MessagePassedExtension1 event")
}
// StorageSlotOfWithdrawalHash determines the storage slot of the Withdrawer contract to look at // StorageSlotOfWithdrawalHash determines the storage slot of the Withdrawer contract to look at
// given a WithdrawalHash // given a WithdrawalHash
func StorageSlotOfWithdrawalHash(hash common.Hash) common.Hash { func StorageSlotOfWithdrawalHash(hash common.Hash) common.Hash {
......
...@@ -32,26 +32,26 @@ func TestParseMessagePassed(t *testing.T) { ...@@ -32,26 +32,26 @@ func TestParseMessagePassed(t *testing.T) {
GasLimit: big.NewInt(203648), GasLimit: big.NewInt(203648),
Data: hexutil.MustDecode( Data: hexutil.MustDecode(
"0xd764ad0b00010000000000000000000000000000000000000000000000000000" + "0xd764ad0b00010000000000000000000000000000000000000000000000000000" +
"0000000000000000000000000000000042000000000000000000000000000000" + "00000000000000000000000000000000420000000000000000000000000000000000" +
"0000001000000000000000000000000069000000000000000000000000000000" + "00100000000000000000000000006900000000000000000000000000000000000003" +
"0000000300000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000" +
"0000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000" +
"0000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000c0000000000000" +
"000000c000000000000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000e40166a07a00000000" +
"000000e40166a07a00000000000000000000000089d51be807d98fc974a0f41b" + "000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef000000000000" +
"2e67a8228d7846ef0000000000000000000000007c6b91d9be155a6db01f7492" + "0000000000007c6b91d9be155a6db01f749217d76ff02a7227f20000000000000000" +
"17d76ff02a7227f2000000000000000000000000c20c5ec92fda6e611a084851" + "00000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000000000000000" +
"23cdc0d5b84bd3a2000000000000000000000000c20c5ec92fda6e611a084851" + "0000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000000000000000" +
"23cdc0d5b84bd3a2000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000001f40000000000000000000000000000" +
"00000000000001f4000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000c000000000000000000000000000000000" +
"00000000000000c0000000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000000000000000000000000" +
"0000000000000000000000000000000000000000000000000000000000000000" + "00000000000000000000",
"00000000",
), ),
WithdrawalHash: common.HexToHash("0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"),
Raw: types.Log{ Raw: types.Log{
Address: common.HexToAddress("0x4200000000000000000000000000000000000016"), Address: common.HexToAddress("0x4200000000000000000000000000000000000016"),
Topics: []common.Hash{ Topics: []common.Hash{
common.HexToHash("0x7744840cae4793a72467311120512aa98e4398bcd2b9d379b2b9c3b60fa03d72"), common.HexToHash("0x02a52367d10742d8032712c1bb8e0144ff1ec5ffda1ed7d70bb05a2744955054"),
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"),
common.HexToHash("0x0000000000000000000000004200000000000000000000000000000000000007"), common.HexToHash("0x0000000000000000000000004200000000000000000000000000000000000007"),
common.HexToHash("0x0000000000000000000000006900000000000000000000000000000000000002"), common.HexToHash("0x0000000000000000000000006900000000000000000000000000000000000002"),
...@@ -59,24 +59,25 @@ func TestParseMessagePassed(t *testing.T) { ...@@ -59,24 +59,25 @@ func TestParseMessagePassed(t *testing.T) {
Data: hexutil.MustDecode( Data: hexutil.MustDecode(
"0x00000000000000000000000000000000000000000000000000000000000000" + "0x00000000000000000000000000000000000000000000000000000000000000" +
"000000000000000000000000000000000000000000000000000000000000031b80" + "000000000000000000000000000000000000000000000000000000000000031b80" +
"000000000000000000000000000000000000000000000000000000000000006000" + "00000000000000000000000000000000000000000000000000000000000000800d" +
"000000000000000000000000000000000000000000000000000000000001e4d764" + "827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce28682850000" +
"ad0b00010000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000001e4d764ad" +
"000000000000000000000000004200000000000000000000000000000000000010" + "0b0001000000000000000000000000000000000000000000000000000000000000" +
"000000000000000000000000690000000000000000000000000000000000000300" + "000000000000000000000000420000000000000000000000000000000000001000" +
"000000000000000000000069000000000000000000000000000000000000030000" +
"000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000" +
"000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000" +
"00000000000000000000000000000000000000000000000000000000c000000000" + "000000000000000000000000000000000000000000000000000000c00000000000" +
"000000000000000000000000000000000000000000000000000000e40166a07a00" + "0000000000000000000000000000000000000000000000000000e40166a07a0000" +
"000000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef0000" + "0000000000000000000089d51be807d98fc974a0f41b2e67a8228d7846ef000000" +
"000000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f2000000" + "0000000000000000007c6b91d9be155a6db01f749217d76ff02a7227f200000000" +
"000000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a200000000" +
"0000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a20000000000" + "0000000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a20000000000" +
"0000000000000000000000000000000000000000000000000001f4000000000000" + "00000000000000c20c5ec92fda6e611a08485123cdc0d5b84bd3a2000000000000" +
"00000000000000000000000000000000000000000000000000c000000000000000" + "00000000000000000000000000000000000000000000000001f400000000000000" +
"000000000000000000000000000000000000000000000000c00000000000000000" +
"000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000" +
"000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000" +
"000000000000000000000000000000", "0000000000000000000000000000",
), ),
BlockNumber: 0x36, BlockNumber: 0x36,
TxHash: common.HexToHash("0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"), TxHash: common.HexToHash("0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"),
...@@ -116,45 +117,3 @@ func TestParseMessagePassed(t *testing.T) { ...@@ -116,45 +117,3 @@ func TestParseMessagePassed(t *testing.T) {
}) })
} }
} }
func TestParseMessagePassedExtension1(t *testing.T) {
tests := []struct {
name string
file string
expected *bindings.L2ToL1MessagePasserMessagePassedExtension1
}{
{
"withdrawal through bridge",
"bridge-withdrawal.json",
&bindings.L2ToL1MessagePasserMessagePassedExtension1{
Hash: common.HexToHash("0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"),
Raw: types.Log{
Address: common.HexToAddress("0x4200000000000000000000000000000000000016"),
Topics: []common.Hash{
common.HexToHash("0xedd348f9c36ef1a5b0747bb5039752707059f0b934c8e508b3271e08fbd0122c"),
common.HexToHash("0x0d827f8148288e3a2466018f71b968ece4ea9f9e2a81c30da9bd46cce2868285"),
},
Data: []byte{},
BlockNumber: 0x36,
TxHash: common.HexToHash("0x9346381068b59d2098495baa72ed2f773c1e09458610a7a208984859dff73add"),
TxIndex: 0x1,
BlockHash: common.HexToHash("0xfdd4ad8a984b45687aca0463db491cbd0e85273d970019a3f8bf618b614938df"),
Index: 0x3,
Removed: false,
},
},
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
f, err := os.Open(path.Join("testdata", test.file))
require.NoError(t, err)
dec := json.NewDecoder(f)
receipt := new(types.Receipt)
require.NoError(t, dec.Decode(receipt))
parsed, err := ParseMessagePassedExtension1(receipt)
require.NoError(t, err)
require.EqualValues(t, test.expected, parsed)
})
}
}
...@@ -24,7 +24,7 @@ RUN source $HOME/.profile && \ ...@@ -24,7 +24,7 @@ RUN source $HOME/.profile && \
strip /opt/foundry/target/release/cast && \ strip /opt/foundry/target/release/cast && \
strip /opt/foundry/target/release/anvil strip /opt/foundry/target/release/anvil
FROM ethereum/client-go:alltools-v1.10.21 as geth FROM ethereum/client-go:alltools-v1.10.25 as geth
FROM python:3.8.13-slim-bullseye FROM python:3.8.13-slim-bullseye
......
This diff is collapsed.
...@@ -129,7 +129,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -129,7 +129,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
Types.WithdrawalTransaction memory _tx, Types.WithdrawalTransaction memory _tx,
uint256 _l2BlockNumber, uint256 _l2BlockNumber,
Types.OutputRootProof calldata _outputRootProof, Types.OutputRootProof calldata _outputRootProof,
bytes calldata _withdrawalProof bytes[] calldata _withdrawalProof
) external { ) external {
// Prevent nested withdrawals within withdrawals. // Prevent nested withdrawals within withdrawals.
require( require(
...@@ -293,7 +293,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -293,7 +293,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
function _verifyWithdrawalInclusion( function _verifyWithdrawalInclusion(
bytes32 _withdrawalHash, bytes32 _withdrawalHash,
bytes32 _storageRoot, bytes32 _storageRoot,
bytes memory _proof bytes[] memory _proof
) internal pure returns (bool) { ) internal pure returns (bool) {
bytes32 storageKey = keccak256( bytes32 storageKey = keccak256(
abi.encode( abi.encode(
......
...@@ -39,6 +39,7 @@ contract L2ToL1MessagePasser is Semver { ...@@ -39,6 +39,7 @@ contract L2ToL1MessagePasser is Semver {
* @param value The ETH value submitted for withdrawal, to be forwarded to the target. * @param value The ETH value submitted for withdrawal, to be forwarded to the target.
* @param gasLimit The minimum amount of gas that must be provided when withdrawing on L1. * @param gasLimit The minimum amount of gas that must be provided when withdrawing on L1.
* @param data The data to be forwarded to the target on L1. * @param data The data to be forwarded to the target on L1.
* @param withdrawalHash The hash of the withdrawal.
*/ */
event MessagePassed( event MessagePassed(
uint256 indexed nonce, uint256 indexed nonce,
...@@ -46,17 +47,10 @@ contract L2ToL1MessagePasser is Semver { ...@@ -46,17 +47,10 @@ contract L2ToL1MessagePasser is Semver {
address indexed target, address indexed target,
uint256 value, uint256 value,
uint256 gasLimit, uint256 gasLimit,
bytes data bytes data,
bytes32 withdrawalHash
); );
/**
* @notice Emitted any time a withdrawal is initiated. An extension to
* MessagePassed to allow for a 4th indexed argument.
*
* @param hash The hash of the withdrawal
*/
event MessagePassedExtension1(bytes32 indexed hash);
/** /**
* @notice Emitted when the balance of this contract is burned. * @notice Emitted when the balance of this contract is burned.
* *
...@@ -113,9 +107,7 @@ contract L2ToL1MessagePasser is Semver { ...@@ -113,9 +107,7 @@ contract L2ToL1MessagePasser is Semver {
sentMessages[withdrawalHash] = true; sentMessages[withdrawalHash] = true;
emit MessagePassed(nonce, msg.sender, _target, msg.value, _gasLimit, _data); emit MessagePassed(nonce, msg.sender, _target, msg.value, _gasLimit, _data, withdrawalHash);
emit MessagePassedExtension1(withdrawalHash);
unchecked { unchecked {
++nonce; ++nonce;
} }
......
...@@ -112,11 +112,19 @@ library Bytes { ...@@ -112,11 +112,19 @@ library Bytes {
* @return Resulting nibble array. * @return Resulting nibble array.
*/ */
function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) { function toNibbles(bytes memory _bytes) internal pure returns (bytes memory) {
bytes memory nibbles = new bytes(_bytes.length * 2); uint256 bytesLength = _bytes.length;
for (uint256 i = 0; i < _bytes.length; i++) { bytes memory nibbles = new bytes(bytesLength * 2);
nibbles[i * 2] = _bytes[i] >> 4; bytes1 b;
nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
for (uint256 i = 0; i < bytesLength; ) {
b = _bytes[i];
nibbles[i * 2] = b >> 4;
nibbles[i * 2 + 1] = b & 0x0f;
unchecked {
++i;
} }
}
return nibbles; return nibbles;
} }
......
...@@ -3,7 +3,6 @@ pragma solidity ^0.8.0; ...@@ -3,7 +3,6 @@ pragma solidity ^0.8.0;
import { Bytes } from "../Bytes.sol"; import { Bytes } from "../Bytes.sol";
import { RLPReader } from "../rlp/RLPReader.sol"; import { RLPReader } from "../rlp/RLPReader.sol";
import { RLPWriter } from "../rlp/RLPWriter.sol";
/** /**
* @title MerkleTrie * @title MerkleTrie
...@@ -58,7 +57,7 @@ library MerkleTrie { ...@@ -58,7 +57,7 @@ library MerkleTrie {
/** /**
* @notice RLP representation of `NULL`. * @notice RLP representation of `NULL`.
*/ */
bytes1 internal constant RLP_NULL = bytes1(0x80); bytes internal constant RLP_NULL = hex"80";
/** /**
* @notice Verifies a proof that a given key/value pair is present in the trie. * @notice Verifies a proof that a given key/value pair is present in the trie.
...@@ -76,7 +75,7 @@ library MerkleTrie { ...@@ -76,7 +75,7 @@ library MerkleTrie {
function verifyInclusionProof( function verifyInclusionProof(
bytes memory _key, bytes memory _key,
bytes memory _value, bytes memory _value,
bytes memory _proof, bytes[] memory _proof,
bytes32 _root bytes32 _root
) internal pure returns (bool) { ) internal pure returns (bool) {
(bool exists, bytes memory value) = get(_key, _proof, _root); (bool exists, bytes memory value) = get(_key, _proof, _root);
...@@ -95,7 +94,7 @@ library MerkleTrie { ...@@ -95,7 +94,7 @@ library MerkleTrie {
*/ */
function get( function get(
bytes memory _key, bytes memory _key,
bytes memory _proof, bytes[] memory _proof,
bytes32 _root bytes32 _root
) internal pure returns (bool, bytes memory) { ) internal pure returns (bool, bytes memory) {
TrieNode[] memory proof = _parseProof(_proof); TrieNode[] memory proof = _parseProof(_proof);
...@@ -105,13 +104,13 @@ library MerkleTrie { ...@@ -105,13 +104,13 @@ library MerkleTrie {
_root _root
); );
bool exists = keyRemainder.length == 0; bool noRemainder = keyRemainder.length == 0;
require(exists || isFinalNode, "MerkleTrie: provided proof is invalid"); require(noRemainder || isFinalNode, "MerkleTrie: provided proof is invalid");
bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes(""); bytes memory value = noRemainder ? _getNodeValue(proof[pathLength - 1]) : bytes("");
return (exists, value); return (value.length > 0, value);
} }
/** /**
...@@ -142,7 +141,7 @@ library MerkleTrie { ...@@ -142,7 +141,7 @@ library MerkleTrie {
uint256 pathLength = 0; uint256 pathLength = 0;
bytes memory key = Bytes.toNibbles(_key); bytes memory key = Bytes.toNibbles(_key);
bytes32 currentNodeID = _root; bytes memory currentNodeID = abi.encodePacked(_root);
uint256 currentKeyIndex = 0; uint256 currentKeyIndex = 0;
uint256 currentKeyIncrement = 0; uint256 currentKeyIncrement = 0;
TrieNode memory currentNode; TrieNode memory currentNode;
...@@ -159,19 +158,19 @@ library MerkleTrie { ...@@ -159,19 +158,19 @@ library MerkleTrie {
if (currentKeyIndex == 0) { if (currentKeyIndex == 0) {
// First proof element is always the root node. // First proof element is always the root node.
require( require(
keccak256(currentNode.encoded) == currentNodeID, Bytes.equal(abi.encodePacked(keccak256(currentNode.encoded)), currentNodeID),
"MerkleTrie: invalid root hash" "MerkleTrie: invalid root hash"
); );
} else if (currentNode.encoded.length >= 32) { } else if (currentNode.encoded.length >= 32) {
// Nodes 32 bytes or larger are hashed inside branch nodes. // Nodes 32 bytes or larger are hashed inside branch nodes.
require( require(
keccak256(currentNode.encoded) == currentNodeID, Bytes.equal(abi.encodePacked(keccak256(currentNode.encoded)), currentNodeID),
"MerkleTrie: invalid large internal hash" "MerkleTrie: invalid large internal hash"
); );
} else { } else {
// Nodes smaller than 31 bytes aren't hashed. // Nodes smaller than 32 bytes aren't hashed.
require( require(
bytes32(currentNode.encoded) == currentNodeID, Bytes.equal(currentNode.encoded, currentNodeID),
"MerkleTrie: invalid internal node hash" "MerkleTrie: invalid internal node hash"
); );
} }
...@@ -198,6 +197,11 @@ library MerkleTrie { ...@@ -198,6 +197,11 @@ library MerkleTrie {
bytes memory keyRemainder = Bytes.slice(key, currentKeyIndex); bytes memory keyRemainder = Bytes.slice(key, currentKeyIndex);
uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder); uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
require(
keyRemainder.length >= pathRemainder.length,
"MerkleTrie: invalid key length for leaf or extension node"
);
if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) { if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
if ( if (
pathRemainder.length == sharedNibbleLength && pathRemainder.length == sharedNibbleLength &&
...@@ -209,14 +213,14 @@ library MerkleTrie { ...@@ -209,14 +213,14 @@ library MerkleTrie {
} }
// We've hit a leaf node, so our next node should be NULL. // We've hit a leaf node, so our next node should be NULL.
currentNodeID = bytes32(RLP_NULL); currentNodeID = RLP_NULL;
break; break;
} else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) { } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
if (sharedNibbleLength != pathRemainder.length) { if (sharedNibbleLength != pathRemainder.length) {
// Our extension node is not identical to the remainder. // Our extension node is not identical to the remainder.
// We've hit the end of this path // We've hit the end of this path
// updates will need to modify this extension. // updates will need to modify this extension.
currentNodeID = bytes32(RLP_NULL); currentNodeID = RLP_NULL;
break; break;
} else { } else {
// Our extension shares some nibbles. // Our extension shares some nibbles.
...@@ -233,27 +237,30 @@ library MerkleTrie { ...@@ -233,27 +237,30 @@ library MerkleTrie {
} }
} }
// If our node ID is NULL, then we're at a dead end. return (
bool isFinalNode = currentNodeID == bytes32(RLP_NULL); pathLength,
return (pathLength, Bytes.slice(key, currentKeyIndex), isFinalNode); Bytes.slice(key, currentKeyIndex),
Bytes.equal(currentNodeID, RLP_NULL)
);
} }
/** /**
* @notice Parses an RLP-encoded proof into something more useful. * @notice Parses an array of proof elements into a new array that contains both the original
* encoded element and the RLP-decoded element.
* *
* @param _proof RLP-encoded proof to parse. * @param _proof Array of proof elements to parse.
* *
* @return Proof parsed into easily accessible structs. * @return Proof parsed into easily accessible structs.
*/ */
function _parseProof(bytes memory _proof) private pure returns (TrieNode[] memory) { function _parseProof(bytes[] memory _proof) private pure returns (TrieNode[] memory) {
RLPReader.RLPItem[] memory nodes = RLPReader.readList(_proof); uint256 length = _proof.length;
TrieNode[] memory proof = new TrieNode[](nodes.length); TrieNode[] memory proof = new TrieNode[](length);
for (uint256 i = 0; i < length; ) {
for (uint256 i = 0; i < nodes.length; i++) { proof[i] = TrieNode({ encoded: _proof[i], decoded: RLPReader.readList(_proof[i]) });
bytes memory encoded = RLPReader.readBytes(nodes[i]); unchecked {
proof[i] = TrieNode({ encoded: encoded, decoded: RLPReader.readList(encoded) }); ++i;
}
} }
return proof; return proof;
} }
...@@ -265,18 +272,8 @@ library MerkleTrie { ...@@ -265,18 +272,8 @@ library MerkleTrie {
* *
* @return ID for the node, depending on the size of its contents. * @return ID for the node, depending on the size of its contents.
*/ */
function _getNodeID(RLPReader.RLPItem memory _node) private pure returns (bytes32) { function _getNodeID(RLPReader.RLPItem memory _node) private pure returns (bytes memory) {
bytes memory nodeID; return _node.length < 32 ? RLPReader.readRawBytes(_node) : RLPReader.readBytes(_node);
if (_node.length < 32) {
// Nodes smaller than 32 bytes are RLP encoded.
nodeID = RLPReader.readRawBytes(_node);
} else {
// Nodes 32 bytes or larger are hashed.
nodeID = RLPReader.readBytes(_node);
}
return bytes32(nodeID);
} }
/** /**
...@@ -291,7 +288,7 @@ library MerkleTrie { ...@@ -291,7 +288,7 @@ library MerkleTrie {
} }
/** /**
* @notice Gets the path for a node. * @notice Gets the value for a node.
* *
* @param _node Node to get a value for. * @param _node Node to get a value for.
* *
...@@ -314,10 +311,13 @@ library MerkleTrie { ...@@ -314,10 +311,13 @@ library MerkleTrie {
pure pure
returns (uint256) returns (uint256)
{ {
uint256 i = 0; uint256 shared;
while (_a.length > i && _b.length > i && _a[i] == _b[i]) { uint256 max = (_a.length < _b.length) ? _a.length : _b.length;
i++; for (; shared < max && _a[shared] == _b[shared]; ) {
unchecked {
++shared;
}
} }
return i; return shared;
} }
} }
...@@ -26,7 +26,7 @@ library SecureMerkleTrie { ...@@ -26,7 +26,7 @@ library SecureMerkleTrie {
function verifyInclusionProof( function verifyInclusionProof(
bytes memory _key, bytes memory _key,
bytes memory _value, bytes memory _value,
bytes memory _proof, bytes[] memory _proof,
bytes32 _root bytes32 _root
) internal pure returns (bool) { ) internal pure returns (bool) {
bytes memory key = _getSecureKey(_key); bytes memory key = _getSecureKey(_key);
...@@ -45,7 +45,7 @@ library SecureMerkleTrie { ...@@ -45,7 +45,7 @@ library SecureMerkleTrie {
*/ */
function get( function get(
bytes memory _key, bytes memory _key,
bytes memory _proof, bytes[] memory _proof,
bytes32 _root bytes32 _root
) internal pure returns (bool, bytes memory) { ) internal pure returns (bool, bytes memory) {
bytes memory key = _getSecureKey(_key); bytes memory key = _getSecureKey(_key);
......
...@@ -187,7 +187,8 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { ...@@ -187,7 +187,8 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
address indexed target, address indexed target,
uint256 value, uint256 value,
uint256 gasLimit, uint256 gasLimit,
bytes data bytes data,
bytes32 withdrawalHash
); );
event RelayedMessage(bytes32 indexed msgHash); event RelayedMessage(bytes32 indexed msgHash);
...@@ -462,7 +463,7 @@ contract FFIInterface is Test { ...@@ -462,7 +463,7 @@ contract FFIInterface is Test {
bytes32, bytes32,
bytes32, bytes32,
bytes32, bytes32,
bytes memory bytes[] memory
) )
{ {
string[] memory cmds = new string[](9); string[] memory cmds = new string[](9);
...@@ -482,8 +483,8 @@ contract FFIInterface is Test { ...@@ -482,8 +483,8 @@ contract FFIInterface is Test {
bytes32 storageRoot, bytes32 storageRoot,
bytes32 outputRoot, bytes32 outputRoot,
bytes32 withdrawalHash, bytes32 withdrawalHash,
bytes memory withdrawalProof bytes[] memory withdrawalProof
) = abi.decode(result, (bytes32, bytes32, bytes32, bytes32, bytes)); ) = abi.decode(result, (bytes32, bytes32, bytes32, bytes32, bytes[]));
return (stateRoot, storageRoot, outputRoot, withdrawalHash, withdrawalProof); return (stateRoot, storageRoot, outputRoot, withdrawalHash, withdrawalProof);
} }
......
...@@ -10,6 +10,7 @@ import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol"; ...@@ -10,6 +10,7 @@ import { L2CrossDomainMessenger } from "../L2/L2CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol";
import { Hashing } from "../libraries/Hashing.sol"; import { Hashing } from "../libraries/Hashing.sol";
import { Encoding } from "../libraries/Encoding.sol"; import { Encoding } from "../libraries/Encoding.sol";
import { Types } from "../libraries/Types.sol";
contract L2CrossDomainMessenger_Test is Messenger_Initializer { contract L2CrossDomainMessenger_Test is Messenger_Initializer {
// Receiver address for testing // Receiver address for testing
...@@ -36,23 +37,25 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -36,23 +37,25 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer {
} }
function test_L2MessengerSendMessage() external { function test_L2MessengerSendMessage() external {
vm.expectCall( bytes memory xDomainCallData = Encoding.encodeCrossDomainMessage(
address(messagePasser),
abi.encodeWithSelector(
L2ToL1MessagePasser.initiateWithdrawal.selector,
address(L1Messenger),
L2Messenger.baseGas(hex"ff", 100),
Encoding.encodeCrossDomainMessage(
L2Messenger.messageNonce(), L2Messenger.messageNonce(),
alice, alice,
recipient, recipient,
0, 0,
100, 100,
hex"ff" hex"ff"
) );
vm.expectCall(
address(messagePasser),
abi.encodeWithSelector(
L2ToL1MessagePasser.initiateWithdrawal.selector,
address(L1Messenger),
L2Messenger.baseGas(hex"ff", 100),
xDomainCallData
) )
); );
// MessagePassed event // MessagePassed event
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit MessagePassed( emit MessagePassed(
...@@ -61,13 +64,16 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -61,13 +64,16 @@ contract L2CrossDomainMessenger_Test is Messenger_Initializer {
address(L1Messenger), address(L1Messenger),
0, 0,
L2Messenger.baseGas(hex"ff", 100), L2Messenger.baseGas(hex"ff", 100),
Encoding.encodeCrossDomainMessage( xDomainCallData,
L2Messenger.messageNonce(), Hashing.hashWithdrawal(
alice, Types.WithdrawalTransaction({
recipient, nonce: messagePasser.nonce(),
0, sender: address(L2Messenger),
100, target: address(L1Messenger),
hex"ff" value: 0,
gasLimit: L2Messenger.baseGas(hex"ff", 100),
data: xDomainCallData
})
) )
); );
......
...@@ -15,11 +15,10 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -15,11 +15,10 @@ contract L2ToL1MessagePasserTest is CommonTest {
address indexed target, address indexed target,
uint256 value, uint256 value,
uint256 gasLimit, uint256 gasLimit,
bytes data bytes data,
bytes32 withdrawalHash
); );
event MessagePassedExtension1(bytes32 indexed hash);
event WithdrawerBalanceBurnt(uint256 indexed amount); event WithdrawerBalanceBurnt(uint256 indexed amount);
function setUp() public virtual { function setUp() public virtual {
...@@ -35,9 +34,6 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -35,9 +34,6 @@ contract L2ToL1MessagePasserTest is CommonTest {
) external { ) external {
uint256 nonce = messagePasser.nonce(); uint256 nonce = messagePasser.nonce();
vm.expectEmit(true, true, true, true);
emit MessagePassed(nonce, _sender, _target, _value, _gasLimit, _data);
bytes32 withdrawalHash = Hashing.hashWithdrawal( bytes32 withdrawalHash = Hashing.hashWithdrawal(
Types.WithdrawalTransaction({ Types.WithdrawalTransaction({
nonce: nonce, nonce: nonce,
...@@ -50,7 +46,7 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -50,7 +46,7 @@ contract L2ToL1MessagePasserTest is CommonTest {
); );
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit MessagePassedExtension1(withdrawalHash); emit MessagePassed(nonce, _sender, _target, _value, _gasLimit, _data, withdrawalHash);
vm.deal(_sender, _value); vm.deal(_sender, _value);
vm.prank(_sender); vm.prank(_sender);
...@@ -65,9 +61,6 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -65,9 +61,6 @@ contract L2ToL1MessagePasserTest is CommonTest {
// Test: initiateWithdrawal should emit the correct log when called by a contract // Test: initiateWithdrawal should emit the correct log when called by a contract
function test_initiateWithdrawal_fromContract() external { function test_initiateWithdrawal_fromContract() external {
vm.expectEmit(true, true, true, true);
emit MessagePassed(messagePasser.nonce(), address(this), address(4), 100, 64000, hex"");
bytes32 withdrawalHash = Hashing.hashWithdrawal( bytes32 withdrawalHash = Hashing.hashWithdrawal(
Types.WithdrawalTransaction( Types.WithdrawalTransaction(
messagePasser.nonce(), messagePasser.nonce(),
...@@ -80,7 +73,15 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -80,7 +73,15 @@ contract L2ToL1MessagePasserTest is CommonTest {
); );
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit MessagePassedExtension1(withdrawalHash); emit MessagePassed(
messagePasser.nonce(),
address(this),
address(4),
100,
64000,
hex"",
withdrawalHash
);
vm.deal(address(this), 2**64); vm.deal(address(this), 2**64);
messagePasser.initiateWithdrawal{ value: 100 }(address(4), 64000, hex""); messagePasser.initiateWithdrawal{ value: 100 }(address(4), 64000, hex"");
...@@ -97,13 +98,13 @@ contract L2ToL1MessagePasserTest is CommonTest { ...@@ -97,13 +98,13 @@ contract L2ToL1MessagePasserTest is CommonTest {
// EOA emulation // EOA emulation
vm.prank(alice, alice); vm.prank(alice, alice);
vm.deal(alice, 2**64); vm.deal(alice, 2**64);
vm.expectEmit(true, true, true, true);
emit MessagePassed(nonce, alice, target, value, gasLimit, data);
bytes32 withdrawalHash = Hashing.hashWithdrawal( bytes32 withdrawalHash = Hashing.hashWithdrawal(
Types.WithdrawalTransaction(nonce, alice, target, value, gasLimit, data) Types.WithdrawalTransaction(nonce, alice, target, value, gasLimit, data)
); );
vm.expectEmit(true, true, true, true);
emit MessagePassed(nonce, alice, target, value, gasLimit, data, withdrawalHash);
messagePasser.initiateWithdrawal{ value: value }(target, gasLimit, data); messagePasser.initiateWithdrawal{ value: value }(target, gasLimit, data);
// the sent messages mapping is filled // the sent messages mapping is filled
......
...@@ -269,7 +269,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -269,7 +269,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
bytes32 _storageRoot; bytes32 _storageRoot;
bytes32 _outputRoot; bytes32 _outputRoot;
bytes32 _withdrawalHash; bytes32 _withdrawalHash;
bytes _withdrawalProof; bytes[] _withdrawalProof;
Types.OutputRootProof internal _outputRootProof; Types.OutputRootProof internal _outputRootProof;
event WithdrawalFinalized(bytes32 indexed, bool success); event WithdrawalFinalized(bytes32 indexed, bool success);
...@@ -422,7 +422,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -422,7 +422,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
gasLimit: gasLimit, gasLimit: gasLimit,
data: hex"" data: hex""
}); });
(bytes32 stateRoot, bytes32 storageRoot, , , bytes memory withdrawalProof) = ffi (bytes32 stateRoot, bytes32 storageRoot, , , bytes[] memory withdrawalProof) = ffi
.getFinalizeWithdrawalTransactionInputs(insufficientGasTx); .getFinalizeWithdrawalTransactionInputs(insufficientGasTx);
Types.OutputRootProof memory outputRootProof = Types.OutputRootProof({ Types.OutputRootProof memory outputRootProof = Types.OutputRootProof({
version: bytes32(0), version: bytes32(0),
...@@ -463,7 +463,8 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -463,7 +463,8 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
function callPortalAndExpectRevert() external payable { function callPortalAndExpectRevert() external payable {
vm.expectRevert("OptimismPortal: can only trigger one withdrawal per transaction"); vm.expectRevert("OptimismPortal: can only trigger one withdrawal per transaction");
// Arguments here don't matter, as the require check is the first thing that happens. // Arguments here don't matter, as the require check is the first thing that happens.
op.finalizeWithdrawalTransaction(_defaultTx, 0, _outputRootProof, hex""); bytes[] memory proof = new bytes[](1);
op.finalizeWithdrawalTransaction(_defaultTx, 0, _outputRootProof, proof);
// Assert that the withdrawal was not finalized. // Assert that the withdrawal was not finalized.
assertFalse(op.finalizedWithdrawals(Hashing.hashWithdrawal(_defaultTx))); assertFalse(op.finalizedWithdrawals(Hashing.hashWithdrawal(_defaultTx)));
} }
...@@ -484,7 +485,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -484,7 +485,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
bytes32 storageRoot, bytes32 storageRoot,
bytes32 outputRoot, bytes32 outputRoot,
bytes32 withdrawalHash, bytes32 withdrawalHash,
bytes memory withdrawalProof bytes[] memory withdrawalProof
) = ffi.getFinalizeWithdrawalTransactionInputs(_testTx); ) = ffi.getFinalizeWithdrawalTransactionInputs(_testTx);
Types.OutputRootProof memory outputRootProof = Types.OutputRootProof({ Types.OutputRootProof memory outputRootProof = Types.OutputRootProof({
version: bytes32(0), version: bytes32(0),
...@@ -544,7 +545,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -544,7 +545,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
bytes32 storageRoot, bytes32 storageRoot,
bytes32 outputRoot, bytes32 outputRoot,
bytes32 withdrawalHash, bytes32 withdrawalHash,
bytes memory withdrawalProof bytes[] memory withdrawalProof
) = ffi.getFinalizeWithdrawalTransactionInputs(_tx); ) = ffi.getFinalizeWithdrawalTransactionInputs(_tx);
Types.OutputRootProof memory proof = Types.OutputRootProof({ Types.OutputRootProof memory proof = Types.OutputRootProof({
......
...@@ -13,7 +13,7 @@ import { Account, Address, toBuffer, bufferToHex } from '@ethereumjs/util' ...@@ -13,7 +13,7 @@ import { Account, Address, toBuffer, bufferToHex } from '@ethereumjs/util'
import { predeploys } from '../src' import { predeploys } from '../src'
const { hexZeroPad, RLP, keccak256 } = utils const { hexZeroPad, keccak256 } = utils
const args = process.argv.slice(2) const args = process.argv.slice(2)
const command = args[0] const command = args[0]
...@@ -215,11 +215,9 @@ const command = args[0] ...@@ -215,11 +215,9 @@ const command = args[0]
latestBlockhash: constants.HashZero, latestBlockhash: constants.HashZero,
}) })
const encodedProof = RLP.encode(proof)
const output = utils.defaultAbiCoder.encode( const output = utils.defaultAbiCoder.encode(
['bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes'], ['bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes[]'],
[world.root, storage.root, outputRoot, withdrawalHash, encodedProof] [world.root, storage.root, outputRoot, withdrawalHash, proof]
) )
process.stdout.write(output) process.stdout.write(output)
break break
......
...@@ -34,7 +34,7 @@ export interface OutputRootProof { ...@@ -34,7 +34,7 @@ export interface OutputRootProof {
*/ */
export interface BedrockCrossChainMessageProof { export interface BedrockCrossChainMessageProof {
outputRootProof: OutputRootProof outputRootProof: OutputRootProof
withdrawalProof: string withdrawalProof: string[]
} }
/** /**
......
...@@ -311,7 +311,7 @@ export class CrossChainMessenger { ...@@ -311,7 +311,7 @@ export class CrossChainMessenger {
return parsed.name === 'SentMessage' return parsed.name === 'SentMessage'
}) })
.map((log) => { .map((log) => {
// Try to pull out the value field, but only if the very next log is a SentMessageExtraData // Try to pull out the value field, but only if the very next log is a SentMessageExtension1
// event which was introduced in the Bedrock upgrade. // event which was introduced in the Bedrock upgrade.
let value = ethers.BigNumber.from(0) let value = ethers.BigNumber.from(0)
const next = receipt.logs.find((l) => { const next = receipt.logs.find((l) => {
...@@ -1214,11 +1214,9 @@ export class CrossChainMessenger { ...@@ -1214,11 +1214,9 @@ export class CrossChainMessenger {
interface WithdrawalEntry { interface WithdrawalEntry {
MessagePassed: any MessagePassed: any
MessagePassedExtension1: any
} }
// Handle multiple withdrawals in the same tx and be backwards // Handle multiple withdrawals in the same tx
// compatible without MessagePassedExtension1
const logs: Partial<{ number: WithdrawalEntry }> = {} const logs: Partial<{ number: WithdrawalEntry }> = {}
for (const [i, log] of Object.entries(receipt.logs)) { for (const [i, log] of Object.entries(receipt.logs)) {
if (log.address === this.contracts.l2.BedrockMessagePasser.address) { if (log.address === this.contracts.l2.BedrockMessagePasser.address) {
...@@ -1228,16 +1226,6 @@ export class CrossChainMessenger { ...@@ -1228,16 +1226,6 @@ export class CrossChainMessenger {
if (decoded.name === 'MessagePassed') { if (decoded.name === 'MessagePassed') {
logs[log.logIndex] = { logs[log.logIndex] = {
MessagePassed: decoded.args, MessagePassed: decoded.args,
MessagePassedExtension1: null,
}
if (receipt.logs[i + 1]) {
const next =
this.contracts.l2.L2ToL1MessagePasser.interface.parseLog(
receipt.logs[i + 1]
)
if (next.name === 'MessagePassedExtension1') {
logs[log.logIndex].MessagePassedExtension1 = next.args
}
} }
} }
} }
...@@ -1262,11 +1250,9 @@ export class CrossChainMessenger { ...@@ -1262,11 +1250,9 @@ export class CrossChainMessenger {
) )
// Sanity check // Sanity check
if (withdrawal.MessagePassedExtension1) { if (withdrawal.MessagePassed.withdrawalHash !== withdrawalHash) {
if (withdrawal.MessagePassedExtension1.hash !== withdrawalHash) {
throw new Error(`Mismatched withdrawal hashes`) throw new Error(`Mismatched withdrawal hashes`)
} }
}
// TODO: turn into util // TODO: turn into util
const preimage = ethers.utils.defaultAbiCoder.encode( const preimage = ethers.utils.defaultAbiCoder.encode(
...@@ -1310,7 +1296,7 @@ export class CrossChainMessenger { ...@@ -1310,7 +1296,7 @@ export class CrossChainMessenger {
messagePasserStorageRoot: stateTrieProof.storageRoot, messagePasserStorageRoot: stateTrieProof.storageRoot,
latestBlockhash: block.hash, latestBlockhash: block.hash,
}, },
withdrawalProof: ethers.utils.RLP.encode(stateTrieProof.storageProof), withdrawalProof: stateTrieProof.storageProof,
}, },
output, output,
// TODO(tynes): use better type, typechain? // TODO(tynes): use better type, typechain?
......
...@@ -84,11 +84,10 @@ interface L2ToL1MessagePasser { ...@@ -84,11 +84,10 @@ interface L2ToL1MessagePasser {
address indexed target, address indexed target,
uint256 value, uint256 value,
uint256 gasLimit, uint256 gasLimit,
bytes data bytes data,
bytes32 withdrawalHash
); );
event MessagePassedExtension1(bytes32 indexed hash);
event WithdrawerBalanceBurnt(uint256 indexed amount); event WithdrawerBalanceBurnt(uint256 indexed amount);
function burn() external; function burn() external;
...@@ -103,12 +102,7 @@ interface L2ToL1MessagePasser { ...@@ -103,12 +102,7 @@ interface L2ToL1MessagePasser {
``` ```
The `MessagePassed` event includes all of the data that is hashed and The `MessagePassed` event includes all of the data that is hashed and
stored in the `sentMessages` mapping. The `MessagePassedExtension1` emits stored in the `sentMessages` mapping, as well as the hash itself.
the hash that was computed and used as part of the storage proof used to
finalize the withdrawal on L1.
The events are separate as to preserve backwards compatibility. The hashing
scheme could be upgraded in the future through a contract upgrade.
### Addresses are not Aliased on Withdrawals ### Addresses are not Aliased on Withdrawals
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment