ModulesΒ§
- IInvariant
Test - Module containing a contractβs types and functions.
- campaign π
- error π
- replay π
- result π
- shrink π
StructsΒ§
- Check
Sequence Options - Options controlling how
check_sequenceevaluates a candidate call sequence. - Handler
Assertion Failure - A handler-side assertion bug: a
require/assertinside a fuzzed handler that the campaign reached. Deduped by(reverter, selector)site (Echidna/Medusa semantics), shortest sequence wins on collision. - Handler
Replay Outcome - Result of a strict handler-bug replay: anchor asserts, no earlier call asserts, and the recomputed edge fingerprint identifies which path the assertion took.
- Invariant
Campaign πSeed - Immutable state selected once for a logical invariant campaign and cloned into each worker.
- Invariant
Executor - Wrapper around any
Executorimplementer which provides fuzzing support using [proptest]. - Invariant
Failure πMetrics - Tracks invariant failure counts during a campaign.
- Invariant
Failures - Stores invariant test failures and revert counts.
- Invariant
Fuzz Test Result - The outcome of an invariant fuzz test
- Invariant
Metrics - Contains invariant metrics for a single fuzzed selector.
- Invariant
Test π - Contains invariant test data.
- Invariant
Test πData - Contains data collected during invariant test runs.
- Invariant
Test πRun - Contains data for an invariant test run.
- Invariant
Throughput πMetrics - Campaign-level throughput metrics for invariant progress reporting.
EnumsΒ§
- Failure
Key - Identifies a single entry in the
InvariantFailuresmap. Invariant predicate failures and handler-side assertion bugs share one map keyed by this enum. - Invariant
Corpus πPersistence - Invariant
Fuzz Error
ConstantsΒ§
- DEFAULT_
DEPTH_ πFOR_ INVARIANT_ WORKER_ CAP - Baseline depth used to preserve the previous default-depth worker heuristic.
- MIN_
ESTIMATED_ πCALLS_ PER_ INVARIANT_ WORKER - Minimum estimated handler calls assigned to each auto invariant worker.
- MIN_
RUNS_ πPER_ INVARIANT_ WORKER - Minimum number of logical runs assigned to each auto invariant worker at the default invariant depth.
FunctionsΒ§
- auto_
invariant_ πworker_ count - build_
invariant_ πprogress_ json - Builds the machine-readable invariant progress payload emitted during a campaign.
- call_
after_ πinvariant_ function - Calls the
afterInvariant()function on a contract. Returns call result and if call succeeded. The state after the call is not persisted. - call_
invariant_ πfunction - Calls the invariant function and returns call result and if succeeded.
- check_
sequence - Checks if the given call sequence breaks the invariant.
- check_
sequence_ value - Executes a call sequence and returns the optimization value (int256) from the invariant function. Used during shrinking for optimization mode.
- collect_
data π - Collects data from call for fuzzing. However, it first verifies that the sender is not an EOA before inserting it into the dictionary. Otherwise, we flood the dictionary with randomly generated addresses.
- execute_
tx π - Executes a fuzz call and returns the result. Applies any block timestamp (warp) and block number (roll) adjustments before the call.
- gas_
report_ πsamples_ for_ worker - handler_
site_ already_ minimal - True iff there is already a
HandlerAssertionFailureforsiteno longer thancandidate_len. Used to skip inserting a not-strictly-shorter repro. - invariant_
worker_ πcount_ with_ threads - invariant_
worker_ πrunner - invariant_
worker_ πseed - max_
invariant_ πworkers_ for_ campaign - rate_
per_ πsec - Converts a cumulative campaign total into an average per-second rate.
- record_
new_ πinvariant_ failures - Bridges newly-recorded invariant breaks from
failures.errorsinto the pulsefailure_metricsso the live progress stream reflects breaks as they happen. Iterates in declaration order so the emitted βfailureβ events are deterministic. - replay_
error - Replays and shrinks a call sequence, collecting logs and traces.
- replay_
handler_ failure_ sequence - Replays a handler-bug sequence and returns whether the anchor still asserts on the same path. Rejects sequences with a pre-anchor assertion (would be a different bug).
- replay_
run - Replays a call sequence for collecting logs and traces. Returns counterexample to be used when the call sequence is a failed scenario.
- should_
continue_ πinvariant_ worker