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

Incorrect storage slots for arrays declared with a constant or expression #74

Open
naddison36 opened this issue Jul 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@naddison36
Copy link
Owner

naddison36 commented Jul 24, 2022

The TestStorage contract has two examples

    uint256 public constant N_COINS = 3;

    address[N_COINS] coins;
    IERC20[2 * N_COINS] doubleTokens;
    IERC20[N_COINS ** 2] powerTokens;

The coins variable is currently showing as only taking one slot but it actually takes three.
The doubleTokens variable is currently showing as only taking one slot but it actually takes six.

@naddison36 naddison36 changed the title Incorrect storage slots for arrays declared with a constant, immutable or expression Incorrect storage slots for arrays declared with a constant or expression Jul 25, 2022
@naddison36 naddison36 added the bug Something isn't working label Jul 25, 2022
Repository owner deleted a comment from Cultivatedbrand Dec 12, 2022
@Joey139
Copy link

Joey139 commented Jun 7, 2024

uint256 public constant N_COINS = 3;

address[N_COINS] coins;
IERC20[2 * N_COINS] doubleTokens;
IERC20[N_COINS ** 2] powerTokens;

@Loveyourself38
Copy link

0xd36C0AaA05bfbf77425F43dF9912f3B6c4717340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants