Expand description
Finds raw environment reads whose values can cross a Foundry environment mutation.
A bounded source-level interpreter follows scalar locals, tuple assignments, internal calls, and modifier placeholders. An environment setter marks matching live origins; a subsequent use reports the original read. Reads on both sides of a mutation are also reported because a compiler may reuse the earlier read. Branches retain separate states, and return, revert, break, and continue stop the corresponding path. External calls are not inlined: the callee has a separate EVM frame and its return data is already materialized. Differing helper return values and conditional-expression values are discarded instead of combining components from mutually exclusive outcomes.
This analysis runs before optimization and never changes executable code. Cheatcodes are recognized by their resolved signature and constant receiver address, including local aliases and helper arguments, rather than by a variable or interface name. Getter results carry no raw-read origin. Heap/storage aliases, indirect calls, low-level cheatcode calls, recursion, and paths beyond the explicit analysis limits are not modeled. This is a source warning, not a proof of a particular optimizerβs scheduling decisions.
StructsΒ§
EnumsΒ§
- Environment π
- Flow π
- Scalar π
- Exact unsigned and boolean locals used to prune exhausted loops and constant branches.
ConstantsΒ§
- CHEATCODE_
ADDRESS π - MAX_
CALL_ πDEPTH - MAX_
LOOP_ πITERATIONS - MAX_
PATHS π - MAX_
STEPS π