Skip to content

Commit

Permalink
Add storage snapshot script
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed Nov 28, 2023
1 parent 63a2d0c commit 67d04dc
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 0 deletions.
16 changes: 16 additions & 0 deletions solidity/storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

CONTRACTS=(
Mailbox \
MailboxClient Router GasRouter \
InterchainGasPaymaster StorageGasOracle \
MerkleTreeHook \
HypERC20 HypERC20Collateral \
HypERC721 HypERC721Collateral \
HypNative HypNativeScaled
)

for contract in "${CONTRACTS[@]}";
do
forge inspect "$contract" storage --pretty > "storage/$contract.md"
done
13 changes: 13 additions & 0 deletions solidity/storage/GasRouter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | --------------------------------------------- | ---- | ------ | ----- | ---------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/client/GasRouter.sol:GasRouter |
| \_initializing | bool | 0 | 1 | 1 | contracts/client/GasRouter.sol:GasRouter |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/client/GasRouter.sol:GasRouter |
| \_owner | address | 51 | 0 | 20 | contracts/client/GasRouter.sol:GasRouter |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/client/GasRouter.sol:GasRouter |
| hook | contract IPostDispatchHook | 101 | 0 | 20 | contracts/client/GasRouter.sol:GasRouter |
| interchainSecurityModule | contract IInterchainSecurityModule | 102 | 0 | 20 | contracts/client/GasRouter.sol:GasRouter |
| \_\_GAP | uint256[48] | 103 | 0 | 1536 | contracts/client/GasRouter.sol:GasRouter |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 151 | 0 | 96 | contracts/client/GasRouter.sol:GasRouter |
| \_\_GAP | uint256[48] | 154 | 0 | 1536 | contracts/client/GasRouter.sol:GasRouter |
| destinationGas | mapping(uint32 => uint256) | 202 | 0 | 32 | contracts/client/GasRouter.sol:GasRouter |
19 changes: 19 additions & 0 deletions solidity/storage/HypERC20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | ----------------------------------------------- | ---- | ------ | ----- | ------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/HypERC20.sol:HypERC20 |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/HypERC20.sol:HypERC20 |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/HypERC20.sol:HypERC20 |
| \_balances | mapping(address => uint256) | 51 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
| \_allowances | mapping(address => mapping(address => uint256)) | 52 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
| \_totalSupply | uint256 | 53 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
| \_name | string | 54 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
| \_symbol | string | 55 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
| \_\_gap | uint256[45] | 56 | 0 | 1440 | contracts/token/HypERC20.sol:HypERC20 |
| \_owner | address | 101 | 0 | 20 | contracts/token/HypERC20.sol:HypERC20 |
| \_\_gap | uint256[49] | 102 | 0 | 1568 | contracts/token/HypERC20.sol:HypERC20 |
| hook | contract IPostDispatchHook | 151 | 0 | 20 | contracts/token/HypERC20.sol:HypERC20 |
| interchainSecurityModule | contract IInterchainSecurityModule | 152 | 0 | 20 | contracts/token/HypERC20.sol:HypERC20 |
| \_\_GAP | uint256[48] | 153 | 0 | 1536 | contracts/token/HypERC20.sol:HypERC20 |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 201 | 0 | 96 | contracts/token/HypERC20.sol:HypERC20 |
| \_\_GAP | uint256[48] | 204 | 0 | 1536 | contracts/token/HypERC20.sol:HypERC20 |
| destinationGas | mapping(uint32 => uint256) | 252 | 0 | 32 | contracts/token/HypERC20.sol:HypERC20 |
13 changes: 13 additions & 0 deletions solidity/storage/HypERC20Collateral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | --------------------------------------------- | ---- | ------ | ----- | --------------------------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_owner | address | 51 | 0 | 20 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| hook | contract IPostDispatchHook | 101 | 0 | 20 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| interchainSecurityModule | contract IInterchainSecurityModule | 102 | 0 | 20 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_\_GAP | uint256[48] | 103 | 0 | 1536 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 151 | 0 | 96 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| \_\_GAP | uint256[48] | 154 | 0 | 1536 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
| destinationGas | mapping(uint32 => uint256) | 202 | 0 | 32 | contracts/token/HypERC20Collateral.sol:HypERC20Collateral |
26 changes: 26 additions & 0 deletions solidity/storage/HypERC721.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | ----------------------------------------------- | ---- | ------ | ----- | --------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/HypERC721.sol:HypERC721 |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_gap | uint256[50] | 51 | 0 | 1600 | contracts/token/HypERC721.sol:HypERC721 |
| \_name | string | 101 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_symbol | string | 102 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_owners | mapping(uint256 => address) | 103 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_balances | mapping(address => uint256) | 104 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_tokenApprovals | mapping(uint256 => address) | 105 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_operatorApprovals | mapping(address => mapping(address => bool)) | 106 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_gap | uint256[44] | 107 | 0 | 1408 | contracts/token/HypERC721.sol:HypERC721 |
| \_ownedTokens | mapping(address => mapping(uint256 => uint256)) | 151 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_ownedTokensIndex | mapping(uint256 => uint256) | 152 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_allTokens | uint256[] | 153 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_allTokensIndex | mapping(uint256 => uint256) | 154 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_gap | uint256[46] | 155 | 0 | 1472 | contracts/token/HypERC721.sol:HypERC721 |
| \_owner | address | 201 | 0 | 20 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_gap | uint256[49] | 202 | 0 | 1568 | contracts/token/HypERC721.sol:HypERC721 |
| hook | contract IPostDispatchHook | 251 | 0 | 20 | contracts/token/HypERC721.sol:HypERC721 |
| interchainSecurityModule | contract IInterchainSecurityModule | 252 | 0 | 20 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_GAP | uint256[48] | 253 | 0 | 1536 | contracts/token/HypERC721.sol:HypERC721 |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 301 | 0 | 96 | contracts/token/HypERC721.sol:HypERC721 |
| \_\_GAP | uint256[48] | 304 | 0 | 1536 | contracts/token/HypERC721.sol:HypERC721 |
| destinationGas | mapping(uint32 => uint256) | 352 | 0 | 32 | contracts/token/HypERC721.sol:HypERC721 |
13 changes: 13 additions & 0 deletions solidity/storage/HypERC721Collateral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | --------------------------------------------- | ---- | ------ | ----- | ----------------------------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_owner | address | 51 | 0 | 20 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| hook | contract IPostDispatchHook | 101 | 0 | 20 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| interchainSecurityModule | contract IInterchainSecurityModule | 102 | 0 | 20 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_\_GAP | uint256[48] | 103 | 0 | 1536 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 151 | 0 | 96 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| \_\_GAP | uint256[48] | 154 | 0 | 1536 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
| destinationGas | mapping(uint32 => uint256) | 202 | 0 | 32 | contracts/token/HypERC721Collateral.sol:HypERC721Collateral |
13 changes: 13 additions & 0 deletions solidity/storage/HypNative.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | --------------------------------------------- | ---- | ------ | ----- | --------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/HypNative.sol:HypNative |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/HypNative.sol:HypNative |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/HypNative.sol:HypNative |
| \_owner | address | 51 | 0 | 20 | contracts/token/HypNative.sol:HypNative |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/token/HypNative.sol:HypNative |
| hook | contract IPostDispatchHook | 101 | 0 | 20 | contracts/token/HypNative.sol:HypNative |
| interchainSecurityModule | contract IInterchainSecurityModule | 102 | 0 | 20 | contracts/token/HypNative.sol:HypNative |
| \_\_GAP | uint256[48] | 103 | 0 | 1536 | contracts/token/HypNative.sol:HypNative |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 151 | 0 | 96 | contracts/token/HypNative.sol:HypNative |
| \_\_GAP | uint256[48] | 154 | 0 | 1536 | contracts/token/HypNative.sol:HypNative |
| destinationGas | mapping(uint32 => uint256) | 202 | 0 | 32 | contracts/token/HypNative.sol:HypNative |
13 changes: 13 additions & 0 deletions solidity/storage/HypNativeScaled.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| ------------------------ | --------------------------------------------- | ---- | ------ | ----- | -------------------------------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_initializing | bool | 0 | 1 | 1 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_owner | address | 51 | 0 | 20 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| hook | contract IPostDispatchHook | 101 | 0 | 20 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| interchainSecurityModule | contract IInterchainSecurityModule | 102 | 0 | 20 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_\_GAP | uint256[48] | 103 | 0 | 1536 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_routers | struct EnumerableMapExtended.UintToBytes32Map | 151 | 0 | 96 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| \_\_GAP | uint256[48] | 154 | 0 | 1536 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
| destinationGas | mapping(uint32 => uint256) | 202 | 0 | 32 | contracts/token/extensions/HypNativeScaled.sol:HypNativeScaled |
9 changes: 9 additions & 0 deletions solidity/storage/InterchainGasPaymaster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
| Name | Type | Slot | Offset | Bytes | Contract |
| --------------------- | ---------------------------------------------------------------- | ---- | ------ | ----- | --------------------------------------------------------------------- |
| \_initialized | uint8 | 0 | 0 | 1 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| \_initializing | bool | 0 | 1 | 1 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| \_\_gap | uint256[50] | 1 | 0 | 1600 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| \_owner | address | 51 | 0 | 20 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| \_\_gap | uint256[49] | 52 | 0 | 1568 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| destinationGasConfigs | mapping(uint32 => struct InterchainGasPaymaster.DomainGasConfig) | 101 | 0 | 32 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
| beneficiary | address | 102 | 0 | 20 | contracts/hooks/igp/InterchainGasPaymaster.sol:InterchainGasPaymaster |
Loading

0 comments on commit 67d04dc

Please sign in to comment.