naddison36 / sol2uml

Solidity contract visualisation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect storage slots for arrays declared with a constant or expression

naddison36 opened this issue · comments

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.

uint256 public constant N_COINS = 3;

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