Open ScreamingHawk opened 11 months ago
Solidity's output does not return the max length of the enum, so the fuzzer can't know the max value to use. As a workaround for now you should pass a uint8, bound it, then cast to your enum. See https://github.com/foundry-rs/foundry/issues/871 for more info
I'll leave this issue open as the tracking issue better enum support as discussed in #871
Solidity's output does not return the max length of the enum, so the fuzzer can't know the max value to use. As a workaround for now you should pass a uint8, bound it, then cast to your enum. See #871 for more info
I'll leave this issue open as the tracking issue better enum support as discussed in #871
What if the fuzz test has a struct parameter containing an enum? See my comment on #871 for more clarity to the problem.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (73fb616 2023-12-19T00:16:21.131413571Z)
What command(s) is the bug in?
forge test
Operating System
Windows
Describe the bug
When fuzzing an array of enums, forge supplies a value out of range.
Example:
Output:
The argument
3
is outside the bounds ofEnumVal
.Note: I am running forge on WSL.