Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storageLayout, readme): update hardhat config for storageLayout and updated readme #180

Closed
wants to merge 1 commit into from

Conversation

ahramy
Copy link
Contributor

@ahramy ahramy commented Aug 6, 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 npx hardhat 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       │
└───────────────────────────────────┴──────────────────────┴──────────────┴────────┴────────────────────────────────────────────────────────────────────────┴─────┴───────────────────────────────────────────────────┴───────────────┘

Note:

  • Additionally, updated readme file in gateway folder.

@ahramy ahramy requested a review from a team as a code owner August 6, 2024 15:48
@@ -4,6 +4,10 @@ Axelar Amplifier Gateway is a smart contract that lives on the external chain th

Please see the [INTEGRATION.md](INTEGRATION.md) for more details on how to implement and integrate the external gateway contract for a given chain.

## Documentation & Build

Please refer to [README.md](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/README.md) for documentation and build instructions.
Copy link
Member

Choose a reason for hiding this comment

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

use relative path instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it, updated.

@@ -35,11 +35,18 @@ const optimizerSettings = {
},
};

const outputSelectionSettings = {
"*": {
"*": ["storageLayout"],
Copy link
Member

Choose a reason for hiding this comment

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

can you exclude test contracts, and the build artifacts column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked up outputSelection option in detail, it enables outputs of storageLayout but does not have option to exclude test contracts and build artifacts.

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

const defaultSettings = {
version: '0.8.23',
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: optimizerSettings,
outputSelection: outputSelectionSettings,
Copy link
Member

Choose a reason for hiding this comment

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

coverage action is failing, maybe because this should only be set if the storage layout env is set?

@ahramy ahramy closed this Aug 22, 2024
@ahramy ahramy deleted the fix/storageLayout branch August 22, 2024 20:02
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.

2 participants