stateful fuzz with foundry doesn't seem to call all functions in the contract #329
Replies: 3 comments 8 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
i am facing the same problem. The test is supposed to fail (Patrick's example did) with assertion violation as the reason, but it passed. |
Beta Was this translation helpful? Give feedback.
-
I was changing the runs under [fuzz] (stateless) and not under [invariant] (stateful). and hence it did not work for me. [fuzz]
runs = 1000000
seed = '0x2'
[invariant]
runs = 10000 ##this worked
depth = 32
fail_on_revert = false |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In this video at 6:12 Patrick says foundry is smart enough to fuzz all public fuzzable functions. so this is my contract:
this is my test file:
foundry.toml file has the following changes:
It is exactly like in the https://github.com/Cyfrin/sc-exploits-minimized/blob/main/test/invariant-break/StatefulFuzzCatchesTest.t.sol file, When I run invariant_testMathDoesntReturnZero it always passes and does't fail at all.
Am I doing anything wrong here or did Foundry have an update where it does not fuzz all public functions anymore after the course came out?
Beta Was this translation helpful? Give feedback.
All reactions