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

issue: test not running? #1

Open
wei3erHase opened this issue Apr 12, 2023 · 1 comment
Open

issue: test not running? #1

wei3erHase opened this issue Apr 12, 2023 · 1 comment

Comments

@wei3erHase
Copy link

wei3erHase commented Apr 12, 2023

getting the following log when running ./slotmachine.sh Counter and forge test -vvv

--------
  
[SLOT] 0x0bec8ab077af1e12783ac8c970bca6dada042613c1ff87b4d0953dea6b0115fd 
[VALUE] 0x0000000000000000000000000000000000000000000000000000000000001234 
=> [keccack] 0xd80ad16edadc649234107b79b30fd0bd6b3dc724d12ebb3a6c085b65ac3620b2 [!OK!]
  

--------
  
[SLOT] 0x0bec8ab077af1e12783ac8c970bca6dada042613c1ff87b4d0953dea6b011600 
[VALUE] 0x0000000000000000000000000000000000000000000000000000000000000000 
=> [keccack] 0x5935cfefbbd8605fc2d5027f8ea298804734a63f6e8acc97a88d646e14f53be0 [!OK!]
  

--------
  
[SLOT] 0x5935cfefbbd8605fc2d5027f8ea298804734a63f6e8acc97a88d646e14f53be0 
[VALUE] 0x0000000000000000000000000000000000000000000000000000000000000000 
=> [keccack] 0xe0a0cdcf88a393a2db0b6bdb7abb6d52da1e1500c3523dc023b9046db782d20f [!OK!]
  

--------
  
[SLOT] 0x2031468f0c30f7087de4da9398818763b546d7f89935fa65485c24ff1df26bf4 
[VALUE] 0x0000000000000000000000000000000000000000000000000000000000077777 
=> [keccack] 0xed45ccd09931c6e422f2b385da45ff76edb71aea2a6e834fb421dde2ffe89b76 [!ALERT!]


Failing tests:
Encountered 1 failing test in test/SlotMachine.t.sol:CounterStorageTest
[FAIL. Reason: SLOTMACHINE_SSTORE_ALERT(0xed45ccd09931c6e422f2b385da45ff76edb71aea2a6e834fb421dde2ffe89b76)] testMapping() (gas: 1051524)

i'm failing to understand when it has so many entries as slot,value, and how to whitelist the one that's failing

interesting idea btw, is it only for testing or prod contracts?

@sebastiantf
Copy link
Contributor

sebastiantf commented Jul 14, 2023

The SLOTMACHINE_SSTORE_ALERT(bytes32 slot) error includes the (hash of?) the slot in violation.
It's part of the final FAIL. Reason: line from foundry. The same slot is also listed in the logs above. Eg. 0xed45ccd09931c6e422f2b385da45ff76edb71aea2a6e834fb421dde2ffe89b76

You could prolly directly whitelist that slot with slotWhitelist() too

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

No branches or pull requests

2 participants