Skip to content

Conversation

@ahramy
Copy link
Contributor

@ahramy ahramy commented Aug 22, 2024

Issue:

AXE-4606

Executing the command STORAGE_LAYOUT=true npx hardhat check returns:

Table has empty fields

Fix

added outputSelection configuration for storageLayout.

After Fix:

STORAGE_LAYOUT=true npm run check

┌───────────────────────────────────┬──────────────────────┬──────────────┬────────┬────────────────────────────────────────────────────────────────────────┬─────┬───────────────────────────────────────────────────┬───────────────┐
│             contract              │    state_variable    │ storage_slot │ offset │                                  type                                  │ idx │                     artifact                      │ numberOfBytes │
├───────────────────────────────────┼──────────────────────┼──────────────┼────────┼────────────────────────────────────────────────────────────────────────┼─────┼───────────────────────────────────────────────────┼───────────────┤
│      AxelarServiceGovernance      │   governanceChain    │      0       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│      AxelarServiceGovernance      │  governanceAddress   │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│      AxelarServiceGovernance      │       multisig       │      2       │   0    │                               t_address                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│      AxelarServiceGovernance      │  multisigApprovals   │      3       │   0    │                      t_mapping(t_bytes32,t_bool)                       │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│ AxelarValuedExpressExecutableTest │      callValue       │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│ AxelarValuedExpressExecutableTest │  callWithTokenValue  │      1       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│ AxelarValuedExpressExecutableTest │     expressToken     │      2       │   0    │                               t_address                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│           BaseMultisig            │       signers        │      0       │   0    │                     t_struct(Signers)3567_storage                      │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      96       │
│           BaseMultisig            │     signerEpoch      │      3       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│           BaseMultisig            │    votingPerTopic    │      4       │   0    │ t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Voting)3557_storage)) │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│           BaseMultisig            │       signers        │      0       │   0    │                      t_struct(Signers)23_storage                       │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      96       │
│           BaseMultisig            │     signerEpoch      │      3       │   0    │                               t_uint256                                │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      32       │
│           BaseMultisig            │    votingPerTopic    │      4       │   0    │  t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Voting)13_storage))  │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      32       │
│   DestinationChainTokenSwapper    │        tokenA        │      0       │   0    │                               t_address                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│   DestinationChainTokenSwapper    │        tokenB        │      1       │   0    │                               t_address                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│   DifferentProxyImplementation    │        value         │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│   DifferentProxyImplementation    │         name         │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│               ERC20               │      balanceOf       │      0       │   0    │                     t_mapping(t_address,t_uint256)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│               ERC20               │      allowance       │      1       │   0    │          t_mapping(t_address,t_mapping(t_address,t_uint256))           │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│               ERC20               │     totalSupply      │      2       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│               ERC20               │         name         │      3       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│               ERC20               │        symbol        │      4       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       ERC20MintableBurnable       │      balanceOf       │      0       │   0    │                     t_mapping(t_address,t_uint256)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       ERC20MintableBurnable       │      allowance       │      1       │   0    │          t_mapping(t_address,t_mapping(t_address,t_uint256))           │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       ERC20MintableBurnable       │     totalSupply      │      2       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       ERC20MintableBurnable       │         name         │      3       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       ERC20MintableBurnable       │        symbol        │      4       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     ERC20MintableBurnableInit     │      balanceOf       │      0       │   0    │                     t_mapping(t_address,t_uint256)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     ERC20MintableBurnableInit     │      allowance       │      1       │   0    │          t_mapping(t_address,t_mapping(t_address,t_uint256))           │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     ERC20MintableBurnableInit     │     totalSupply      │      2       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     ERC20MintableBurnableInit     │         name         │      3       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     ERC20MintableBurnableInit     │        symbol        │      4       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         ExecutableSample          │        value         │      0       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         ExecutableSample          │     sourceChain      │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         ExecutableSample          │    sourceAddress     │      2       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│        FixedImplementation        │        value         │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       InterchainGovernance        │   governanceChain    │      0       │   0    │                            t_string_storage                            │  1  │ /build-info/37f6c6ce0b0dcaa7a2943902d1c8ce2f.json │      32       │
│       InterchainGovernance        │  governanceAddress   │      1       │   0    │                            t_string_storage                            │  1  │ /build-info/37f6c6ce0b0dcaa7a2943902d1c8ce2f.json │      32       │
│       InterchainGovernance        │   governanceChain    │      0       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       InterchainGovernance        │  governanceAddress   │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            MockGateway            │        bools         │      0       │   0    │                      t_mapping(t_bytes32,t_bool)                       │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            MockGateway            │      addresses       │      1       │   0    │                     t_mapping(t_bytes32,t_address)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            MockGateway            │        uints         │      2       │   0    │                     t_mapping(t_bytes32,t_uint256)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            MockGateway            │       strings        │      3       │   0    │                 t_mapping(t_bytes32,t_string_storage)                  │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            MockGateway            │       bytes32s       │      4       │   0    │                     t_mapping(t_bytes32,t_bytes32)                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│             Multisig              │       signers        │      0       │   0    │                      t_struct(Signers)23_storage                       │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      96       │
│             Multisig              │     signerEpoch      │      3       │   0    │                               t_uint256                                │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      32       │
│             Multisig              │    votingPerTopic    │      4       │   0    │  t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Voting)13_storage))  │  5  │ /build-info/62eedd0ba5425b53bf19cd779a831736.json │      32       │
│             Operators             │      operators       │      0       │   0    │                      t_mapping(t_address,t_bool)                       │  7  │ /build-info/c3a10429a6a58806b1f2f298138f183a.json │      32       │
│        ProxyImplementation        │        value         │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│        ProxyImplementation        │         name         │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         SourceChainSender         │       gateway        │      0       │   0    │                     t_contract(IAxelarGateway)6662                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│         SourceChainSender         │   destinationChain   │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         SourceChainSender         │  executableAddress   │      2       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       SourceChainSwapCaller       │       gateway        │      0       │   0    │                     t_contract(IAxelarGateway)6662                     │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      20       │
│       SourceChainSwapCaller       │   destinationChain   │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│       SourceChainSwapCaller       │  executableAddress   │      2       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         TestBaseMultisig          │       signers        │      0       │   0    │                     t_struct(Signers)3567_storage                      │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      96       │
│         TestBaseMultisig          │     signerEpoch      │      3       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│         TestBaseMultisig          │    votingPerTopic    │      4       │   0    │ t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Voting)3557_storage)) │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│        TestImplementation         │         val          │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│   TestInterchainAddressTracker    │         name         │      0       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     TestInterchainGovernance      │   governanceChain    │      0       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│     TestInterchainGovernance      │  governanceAddress   │      1       │   0    │                            t_string_storage                            │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│           TestMulticall           │        nonce         │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│           TestMulticall           │ lastMulticallReturns │      1       │   0    │                  t_array(t_bytes_storage)dyn_storage                   │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│            TestOwnable            │         num          │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│        TestReentrancyGuard        │        value         │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│             TestRoles             │         num          │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│          TestUpgradable           │         num          │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
│           TimeLockTest            │         num          │      0       │   0    │                               t_uint256                                │  4  │ /build-info/60bb168fe67f6c0d00e938528f838df5.json │      32       │
└───────────────────────────────────┴──────────────────────┴──────────────┴────────┴────────────────────────────────────────────────────────────────────────┴─────┴───────────────────────────────────────────────────┴───────────────┘

@ahramy ahramy requested a review from a team August 22, 2024 19:44
@ahramy ahramy changed the title fix storage layout command fix/storage_layout_command Aug 22, 2024
@ahramy ahramy changed the title fix/storage_layout_command fix(storageLayout, readme): update hardhat config for storageLayout and updated readme Aug 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (3eea612) to head (eda7312).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #182   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files          48       48           
  Lines         764      764           
  Branches      160      160           
=======================================
  Hits          754      754           
  Misses          1        1           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@ahramy ahramy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Looked up outputSelection option in detail, it enables outputs of storageLayout but does not have option to exclude test contracts and build artifacts. so I'd rather keep it this way.

https://docs.soliditylang.org/en/v0.8.20/using-the-compiler.html#input-description

@ahramy ahramy merged commit 6a86f3b into main Aug 22, 2024
@ahramy ahramy deleted the fix/storageLayoutCmd branch August 22, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants