diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 509b874003..aba7a24a69 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -74,6 +74,11 @@ jobs: with: submodules: recursive + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: Setup node/yarn uses: actions/setup-node@v3 with: @@ -85,7 +90,7 @@ jobs: run: yarn - name: Build - run: yarn build + run: forge build - name: Test Storage Layouts run: yarn run test:storage diff --git a/.gitignore b/.gitignore index ae5e00a019..a024a9429f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ forge-cache/ #Storage layout test files test/storage/*-old.dot +test/storage/*-old # local deployment files network.json diff --git a/scripts/storage_layout_test.bash b/scripts/storage_layout_test.bash index 825c7c8e48..850b71460f 100755 --- a/scripts/storage_layout_test.bash +++ b/scripts/storage_layout_test.bash @@ -3,9 +3,9 @@ output_dir="./test/storage" for CONTRACTNAME in L1ERC20Gateway L1CustomGateway L1ReverseCustomGateway L1WethGateway L2ERC20Gateway L2CustomGateway L2ReverseCustomGateway L2WethGateway L1GatewayRouter L2GatewayRouter StandardArbERC20 do echo "Checking storage change of $CONTRACTNAME" - [ -f "$output_dir/$CONTRACTNAME.dot" ] && mv "$output_dir/$CONTRACTNAME.dot" "$output_dir/$CONTRACTNAME-old.dot" - yarn sol2uml storage ./ -c "$CONTRACTNAME" -o "$output_dir/$CONTRACTNAME.dot" -f dot - diff "$output_dir/$CONTRACTNAME-old.dot" "$output_dir/$CONTRACTNAME.dot" + [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" + forge inspect "$CONTRACTNAME" --pretty storage > "$output_dir/$CONTRACTNAME" + diff "$output_dir/$CONTRACTNAME-old" "$output_dir/$CONTRACTNAME" if [[ $? != "0" ]] then CHANGED=1 diff --git a/test-foundry/L1ArbitrumExtendedGateway.t.sol b/test-foundry/L1ArbitrumExtendedGateway.t.sol index 128e5b86db..0f7007110e 100644 --- a/test-foundry/L1ArbitrumExtendedGateway.t.sol +++ b/test-foundry/L1ArbitrumExtendedGateway.t.sol @@ -186,16 +186,18 @@ abstract contract L1ArbitrumExtendedGatewayTest is Test { ); } - function test_supportsInterface(bytes4 iface) public { - bool expected = false; - if ( - iface == type(IERC165).interfaceId || - iface == IL1ArbitrumGateway.outboundTransferCustomRefund.selector - ) { - expected = true; - } - - assertEq(l1Gateway.supportsInterface(iface), expected, "Interface shouldn't be supported"); + function test_supportsInterface() public { + bytes4 iface = type(IERC165).interfaceId; + assertEq(l1Gateway.supportsInterface(iface), true, "Interface should be supported"); + + iface = IL1ArbitrumGateway.outboundTransferCustomRefund.selector; + assertEq(l1Gateway.supportsInterface(iface), true, "Interface should be supported"); + + iface = bytes4(0); + assertEq(l1Gateway.supportsInterface(iface), false, "Interface shouldn't be supported"); + + iface = IL1ArbitrumGateway.inbox.selector; + assertEq(l1Gateway.supportsInterface(iface), false, "Interface shouldn't be supported"); } function test_transferExitAndCall_EmptyData_NotRedirected( diff --git a/test-foundry/L1GatewayRouter.t.sol b/test-foundry/L1GatewayRouter.t.sol index ad53629525..53f9d9f0e9 100644 --- a/test-foundry/L1GatewayRouter.t.sol +++ b/test-foundry/L1GatewayRouter.t.sol @@ -664,16 +664,18 @@ contract L1GatewayRouterTest is GatewayRouterTest { l1Router.setOwner(address(300)); } - function test_supportsInterface(bytes4 iface) public { - bool expected = false; - if ( - iface == type(IERC165).interfaceId || - iface == L1GatewayRouter.outboundTransferCustomRefund.selector - ) { - expected = true; - } + function test_supportsInterface() public { + bytes4 iface = type(IERC165).interfaceId; + assertEq(l1Router.supportsInterface(iface), true, "Interface should be supported"); + + iface = L1GatewayRouter.outboundTransferCustomRefund.selector; + assertEq(l1Router.supportsInterface(iface), true, "Interface should be supported"); + + iface = bytes4(0); + assertEq(l1Router.supportsInterface(iface), false, "Interface shouldn't be supported"); - assertEq(l1Router.supportsInterface(iface), expected, "Interface shouldn't be supported"); + iface = L1GatewayRouter.setGateways.selector; + assertEq(l1Router.supportsInterface(iface), false, "Interface shouldn't be supported"); } function test_outboundTransfer() public virtual { diff --git a/test/storage/L1CustomGateway b/test/storage/L1CustomGateway new file mode 100644 index 0000000000..80ca4f35c7 --- /dev/null +++ b/test/storage/L1CustomGateway @@ -0,0 +1,10 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|---------------------------------------------------------------|------|--------|-------|----------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| inbox | address | 2 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| redirectedExits | mapping(bytes32 => struct L1ArbitrumExtendedGateway.ExitData) | 3 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| l1ToL2Token | mapping(address => address) | 4 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| owner | address | 5 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| whitelist | address | 6 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | +| _status | uint256 | 7 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1CustomGateway.sol:L1CustomGateway | diff --git a/test/storage/L1CustomGateway.dot b/test/storage/L1CustomGateway.dot deleted file mode 100644 index 70cca4d589..0000000000 --- a/test/storage/L1CustomGateway.dot +++ /dev/null @@ -1,13 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -2 [label="L1CustomGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { unallocated (12) | address: L1ArbitrumGateway.inbox (20) } | { <7> mapping\(bytes32=\>ExitData\): L1ArbitrumExtendedGateway.redirectedExits (32) } | { mapping\(address=\>address\): l1ToL2Token (32) } | { unallocated (12) | address: owner (20) } | { unallocated (12) | address: whitelist (20) } | { uint256: _status (32) }}}"] - -1 [label="ExitData \<\\>\n | {{ offset | 0 | 1} | { type: variable (bytes) | { unallocated (11) | address: _newTo (20) | bool: isExit (1) } | { bytes: _newData (32) }}}"] - - 2:7 -> 1 -} \ No newline at end of file diff --git a/test/storage/L1ERC20Gateway b/test/storage/L1ERC20Gateway new file mode 100644 index 0000000000..21e1ff0fed --- /dev/null +++ b/test/storage/L1ERC20Gateway @@ -0,0 +1,10 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|----------------------|---------------------------------------------------------------|------|--------|-------|--------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| inbox | address | 2 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| redirectedExits | mapping(bytes32 => struct L1ArbitrumExtendedGateway.ExitData) | 3 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| cloneableProxyHash | bytes32 | 4 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| l2BeaconProxyFactory | address | 5 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| whitelist | address | 6 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | +| _status | uint256 | 7 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ERC20Gateway.sol:L1ERC20Gateway | diff --git a/test/storage/L1ERC20Gateway.dot b/test/storage/L1ERC20Gateway.dot deleted file mode 100644 index 614407c712..0000000000 --- a/test/storage/L1ERC20Gateway.dot +++ /dev/null @@ -1,13 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -2 [label="L1ERC20Gateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { unallocated (12) | address: L1ArbitrumGateway.inbox (20) } | { <7> mapping\(bytes32=\>ExitData\): L1ArbitrumExtendedGateway.redirectedExits (32) } | { bytes32: cloneableProxyHash (32) } | { unallocated (12) | address: l2BeaconProxyFactory (20) } | { unallocated (12) | address: whitelist (20) } | { uint256: _status (32) }}}"] - -1 [label="ExitData \<\\>\n | {{ offset | 0 | 1} | { type: variable (bytes) | { unallocated (11) | address: _newTo (20) | bool: isExit (1) } | { bytes: _newData (32) }}}"] - - 2:7 -> 1 -} \ No newline at end of file diff --git a/test/storage/L1GatewayRouter b/test/storage/L1GatewayRouter new file mode 100644 index 0000000000..b4ed170557 --- /dev/null +++ b/test/storage/L1GatewayRouter @@ -0,0 +1,9 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|-----------------------------|------|--------|-------|----------------------------------------------------------------------------| +| whitelist | address | 0 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| counterpartGateway | address | 1 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| router | address | 2 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| l1TokenToGateway | mapping(address => address) | 3 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| defaultGateway | address | 4 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| owner | address | 5 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | +| inbox | address | 6 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol:L1GatewayRouter | diff --git a/test/storage/L1GatewayRouter.dot b/test/storage/L1GatewayRouter.dot deleted file mode 100644 index b21a30f983..0000000000 --- a/test/storage/L1GatewayRouter.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L1GatewayRouter \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4 | 5 | 6} | { type: \.variable (bytes) | { unallocated (12) | address: WhitelistConsumer.whitelist (20) } | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { mapping\(address=\>address\): GatewayRouter.l1TokenToGateway (32) } | { unallocated (12) | address: GatewayRouter.defaultGateway (20) } | { unallocated (12) | address: owner (20) } | { unallocated (12) | address: inbox (20) }}}"] - -} \ No newline at end of file diff --git a/test/storage/L1ReverseCustomGateway b/test/storage/L1ReverseCustomGateway new file mode 100644 index 0000000000..71204210f9 --- /dev/null +++ b/test/storage/L1ReverseCustomGateway @@ -0,0 +1,10 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|---------------------------------------------------------------|------|--------|-------|------------------------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| inbox | address | 2 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| redirectedExits | mapping(bytes32 => struct L1ArbitrumExtendedGateway.ExitData) | 3 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| l1ToL2Token | mapping(address => address) | 4 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| owner | address | 5 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| whitelist | address | 6 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | +| _status | uint256 | 7 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1ReverseCustomGateway.sol:L1ReverseCustomGateway | diff --git a/test/storage/L1ReverseCustomGateway.dot b/test/storage/L1ReverseCustomGateway.dot deleted file mode 100644 index 10967d1ad2..0000000000 --- a/test/storage/L1ReverseCustomGateway.dot +++ /dev/null @@ -1,13 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -2 [label="L1ReverseCustomGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { unallocated (12) | address: L1ArbitrumGateway.inbox (20) } | { <7> mapping\(bytes32=\>ExitData\): L1ArbitrumExtendedGateway.redirectedExits (32) } | { mapping\(address=\>address\): L1CustomGateway.l1ToL2Token (32) } | { unallocated (12) | address: L1CustomGateway.owner (20) } | { unallocated (12) | address: L1CustomGateway.whitelist (20) } | { uint256: L1CustomGateway._status (32) }}}"] - -1 [label="ExitData \<\\>\n | {{ offset | 0 | 1} | { type: variable (bytes) | { unallocated (11) | address: _newTo (20) | bool: isExit (1) } | { bytes: _newData (32) }}}"] - - 2:7 -> 1 -} \ No newline at end of file diff --git a/test/storage/L1WethGateway b/test/storage/L1WethGateway new file mode 100644 index 0000000000..84f914b308 --- /dev/null +++ b/test/storage/L1WethGateway @@ -0,0 +1,8 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|---------------------------------------------------------------|------|--------|-------|------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | +| inbox | address | 2 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | +| redirectedExits | mapping(bytes32 => struct L1ArbitrumExtendedGateway.ExitData) | 3 | 0 | 32 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | +| l1Weth | address | 4 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | +| l2Weth | address | 5 | 0 | 20 | contracts/tokenbridge/ethereum/gateway/L1WethGateway.sol:L1WethGateway | diff --git a/test/storage/L1WethGateway.dot b/test/storage/L1WethGateway.dot deleted file mode 100644 index 517a5d1be2..0000000000 --- a/test/storage/L1WethGateway.dot +++ /dev/null @@ -1,13 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -2 [label="L1WethGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4 | 5} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { unallocated (12) | address: L1ArbitrumGateway.inbox (20) } | { <7> mapping\(bytes32=\>ExitData\): L1ArbitrumExtendedGateway.redirectedExits (32) } | { unallocated (12) | address: l1Weth (20) } | { unallocated (12) | address: l2Weth (20) }}}"] - -1 [label="ExitData \<\\>\n | {{ offset | 0 | 1} | { type: variable (bytes) | { unallocated (11) | address: _newTo (20) | bool: isExit (1) } | { bytes: _newData (32) }}}"] - - 2:7 -> 1 -} \ No newline at end of file diff --git a/test/storage/L2CustomGateway b/test/storage/L2CustomGateway new file mode 100644 index 0000000000..e937d3f09d --- /dev/null +++ b/test/storage/L2CustomGateway @@ -0,0 +1,6 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|-----------------------------|------|--------|-------|----------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2CustomGateway.sol:L2CustomGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2CustomGateway.sol:L2CustomGateway | +| exitNum | uint256 | 2 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2CustomGateway.sol:L2CustomGateway | +| l1ToL2Token | mapping(address => address) | 3 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2CustomGateway.sol:L2CustomGateway | diff --git a/test/storage/L2CustomGateway.dot b/test/storage/L2CustomGateway.dot deleted file mode 100644 index eb8dd9f716..0000000000 --- a/test/storage/L2CustomGateway.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L2CustomGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { uint256: L2ArbitrumGateway.exitNum (32) } | { mapping\(address=\>address\): l1ToL2Token (32) }}}"] - -} \ No newline at end of file diff --git a/test/storage/L2ERC20Gateway b/test/storage/L2ERC20Gateway new file mode 100644 index 0000000000..710d97dba2 --- /dev/null +++ b/test/storage/L2ERC20Gateway @@ -0,0 +1,6 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|---------|------|--------|-------|--------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2ERC20Gateway.sol:L2ERC20Gateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2ERC20Gateway.sol:L2ERC20Gateway | +| exitNum | uint256 | 2 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2ERC20Gateway.sol:L2ERC20Gateway | +| beaconProxyFactory | address | 3 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2ERC20Gateway.sol:L2ERC20Gateway | diff --git a/test/storage/L2ERC20Gateway.dot b/test/storage/L2ERC20Gateway.dot deleted file mode 100644 index d971800a69..0000000000 --- a/test/storage/L2ERC20Gateway.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L2ERC20Gateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { uint256: L2ArbitrumGateway.exitNum (32) } | { unallocated (12) | address: beaconProxyFactory (20) }}}"] - -} \ No newline at end of file diff --git a/test/storage/L2GatewayRouter b/test/storage/L2GatewayRouter new file mode 100644 index 0000000000..7838e97625 --- /dev/null +++ b/test/storage/L2GatewayRouter @@ -0,0 +1,6 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|-----------------------------|------|--------|-------|----------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2GatewayRouter.sol:L2GatewayRouter | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2GatewayRouter.sol:L2GatewayRouter | +| l1TokenToGateway | mapping(address => address) | 2 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2GatewayRouter.sol:L2GatewayRouter | +| defaultGateway | address | 3 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2GatewayRouter.sol:L2GatewayRouter | diff --git a/test/storage/L2GatewayRouter.dot b/test/storage/L2GatewayRouter.dot deleted file mode 100644 index ac91e6071d..0000000000 --- a/test/storage/L2GatewayRouter.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L2GatewayRouter \<\\>\n | {{ slot | 0 | 1 | 2 | 3} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { mapping\(address=\>address\): GatewayRouter.l1TokenToGateway (32) } | { unallocated (12) | address: GatewayRouter.defaultGateway (20) }}}"] - -} \ No newline at end of file diff --git a/test/storage/L2ReverseCustomGateway b/test/storage/L2ReverseCustomGateway new file mode 100644 index 0000000000..d17e1a3a7f --- /dev/null +++ b/test/storage/L2ReverseCustomGateway @@ -0,0 +1,6 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|-----------------------------|------|--------|-------|------------------------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2ReverseCustomGateway.sol:L2ReverseCustomGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2ReverseCustomGateway.sol:L2ReverseCustomGateway | +| exitNum | uint256 | 2 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2ReverseCustomGateway.sol:L2ReverseCustomGateway | +| l1ToL2Token | mapping(address => address) | 3 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2ReverseCustomGateway.sol:L2ReverseCustomGateway | diff --git a/test/storage/L2ReverseCustomGateway.dot b/test/storage/L2ReverseCustomGateway.dot deleted file mode 100644 index 6109ae95e4..0000000000 --- a/test/storage/L2ReverseCustomGateway.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L2ReverseCustomGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { uint256: L2ArbitrumGateway.exitNum (32) } | { mapping\(address=\>address\): L2CustomGateway.l1ToL2Token (32) }}}"] - -} \ No newline at end of file diff --git a/test/storage/L2WethGateway b/test/storage/L2WethGateway new file mode 100644 index 0000000000..703723384e --- /dev/null +++ b/test/storage/L2WethGateway @@ -0,0 +1,7 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|--------------------|---------|------|--------|-------|------------------------------------------------------------------------| +| counterpartGateway | address | 0 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2WethGateway.sol:L2WethGateway | +| router | address | 1 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2WethGateway.sol:L2WethGateway | +| exitNum | uint256 | 2 | 0 | 32 | contracts/tokenbridge/arbitrum/gateway/L2WethGateway.sol:L2WethGateway | +| l1Weth | address | 3 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2WethGateway.sol:L2WethGateway | +| l2Weth | address | 4 | 0 | 20 | contracts/tokenbridge/arbitrum/gateway/L2WethGateway.sol:L2WethGateway | diff --git a/test/storage/L2WethGateway.dot b/test/storage/L2WethGateway.dot deleted file mode 100644 index a2c70f8e5d..0000000000 --- a/test/storage/L2WethGateway.dot +++ /dev/null @@ -1,10 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -1 [label="L2WethGateway \<\\>\n | {{ slot | 0 | 1 | 2 | 3 | 4} | { type: \.variable (bytes) | { unallocated (12) | address: TokenGateway.counterpartGateway (20) } | { unallocated (12) | address: TokenGateway.router (20) } | { uint256: L2ArbitrumGateway.exitNum (32) } | { unallocated (12) | address: l1Weth (20) } | { unallocated (12) | address: l2Weth (20) }}}"] - -} \ No newline at end of file diff --git a/test/storage/StandardArbERC20 b/test/storage/StandardArbERC20 new file mode 100644 index 0000000000..9b33d4682a --- /dev/null +++ b/test/storage/StandardArbERC20 @@ -0,0 +1,22 @@ +| Name | Type | Slot | Offset | Bytes | Contract | +|----------------------------------|--------------------------------------------------------|------|--------|-------|----------------------------------------------------------------------| +| _initialized | uint8 | 0 | 0 | 1 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _initializing | bool | 0 | 1 | 1 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| __gap | uint256[50] | 1 | 0 | 1600 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _balances | mapping(address => uint256) | 51 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _allowances | mapping(address => mapping(address => uint256)) | 52 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _totalSupply | uint256 | 53 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _name | string | 54 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _symbol | string | 55 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _decimals | uint8 | 56 | 0 | 1 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| __gap | uint256[44] | 57 | 0 | 1408 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _HASHED_NAME | bytes32 | 101 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _HASHED_VERSION | bytes32 | 102 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| __gap | uint256[50] | 103 | 0 | 1600 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 153 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 154 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| __gap | uint256[49] | 155 | 0 | 1568 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| l2Gateway | address | 204 | 0 | 20 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| l1Address | address | 205 | 0 | 20 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| isMasterCopy | bool | 205 | 20 | 1 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | +| availableGetters | struct StandardArbERC20.ERC20Getters | 206 | 0 | 32 | contracts/tokenbridge/arbitrum/StandardArbERC20.sol:StandardArbERC20 | diff --git a/test/storage/StandardArbERC20.dot b/test/storage/StandardArbERC20.dot deleted file mode 100644 index 3a9831ac50..0000000000 --- a/test/storage/StandardArbERC20.dot +++ /dev/null @@ -1,28 +0,0 @@ - -digraph StorageDiagram { -rankdir=LR -arrowhead=open -bgcolor="white" -edge [color="black"] -node [shape=record, style=filled, color="black", fillcolor="gray95", fontcolor="black", fontname="Courier New"] -7 [label="StandardArbERC20 \<\\>\n | {{ slot | 0 | 1-50 | 51 | 52 | 53 | 54 | 55 | 56 | 57-100 | 101 | 102 | 103-152 | 153 | 154 | 155-203 | 204 | 205 | 206} | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | uint8: Initializable._initialized (1) } | { <8> uint256[50]: ContextUpgradeable.__gap (1600) } | { mapping\(address=\>uint256\): ERC20Upgradeable._balances (32) } | { mapping\(address=\>mapping\(address=\>uint256\)\): ERC20Upgradeable._allowances (32) } | { uint256: ERC20Upgradeable._totalSupply (32) } | { string: ERC20Upgradeable._name (32) } | { string: ERC20Upgradeable._symbol (32) } | { unallocated (31) | uint8: ERC20Upgradeable._decimals (1) } | { <20> uint256[44]: ERC20Upgradeable.__gap (1408) } | { bytes32: EIP712Upgradeable._HASHED_NAME (32) } | { bytes32: EIP712Upgradeable._HASHED_VERSION (32) } | { <28> uint256[50]: EIP712Upgradeable.__gap (1600) } | { <30> mapping\(address=\>CountersUpgradeable.Counter\): ERC20PermitUpgradeable._nonces (32) } | { bytes32: ERC20PermitUpgradeable._PERMIT_TYPEHASH_DEPRECATED_SLOT (32) } | { <37> uint256[49]: ERC20PermitUpgradeable.__gap (1568) } | { unallocated (12) | address: L2GatewayToken.l2Gateway (20) } | { unallocated (11) | bool: Cloneable.isMasterCopy (1) | address: L2GatewayToken.l1Address (20) } | { <44> ERC20Getters: availableGetters (32) }}}"] - -1 [label="uint256[50]: __gap \<\\>\n | {{ slot | 1 | 2 | 3-48 | 49 | 50} | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { ---- (1472) } | { uint256 (32) } | { uint256 (32) }}}"] - -2 [label="uint256[44]: __gap \<\\>\n | {{ slot | 57 | 58 | 59-98 | 99 | 100} | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { ---- (1280) } | { uint256 (32) } | { uint256 (32) }}}"] - -3 [label="uint256[50]: __gap \<\\>\n | {{ slot | 103 | 104 | 105-150 | 151 | 152} | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { ---- (1472) } | { uint256 (32) } | { uint256 (32) }}}"] - -4 [label="Counter \<\\>\n | {{ offset | 0} | { type: variable (bytes) | { uint256: _value (32) }}}"] - -5 [label="uint256[49]: __gap \<\\>\n | {{ slot | 155 | 156 | 157-201 | 202 | 203} | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { ---- (1440) } | { uint256 (32) } | { uint256 (32) }}}"] - -6 [label="ERC20Getters \<\\>\n | {{ slot | 206} | { type: variable (bytes) | { unallocated (29) | bool: ignoreSymbol (1) | bool: ignoreName (1) | bool: ignoreDecimals (1) }}}"] - - 7:8 -> 1 - 7:20 -> 2 - 7:28 -> 3 - 7:30 -> 4 - 7:37 -> 5 - 7:44 -> 6 -} \ No newline at end of file