foundry
foundry copied to clipboard
feat: `vm.depth()` cheatcode to return the depth of the current invariant run
Component
Forge
Describe the feature you would like
Two enables two use cases that I can't think of good workarounds for:
- Logging all sequences for all runs to a file with
vm.writeLine() - Skipping checks on
depth=0, i.e. skip the "invariant must hold at the start" check. The use case here is testing that a variable monotonically increases and before any calls are made, since at the start "last value" and "current value" are the same.
Additional context
No response