Module invariant

Source

Modules§

IInvariantTest
Module containing a contract’s types and functions.
error 🔒
replay 🔒
result 🔒
shrink 🔒

Structs§

InvariantExecutor
Wrapper around any Executor implementer which provides fuzzing support using [proptest].
InvariantFailures
Stores information about failures and reverts of the invariant tests.
InvariantFuzzTestResult
The outcome of an invariant fuzz test
InvariantMetrics
Contains invariant metrics for a single fuzzed selector.
InvariantTest
Contains invariant test data.
InvariantTestData
Contains data collected during invariant test runs.
InvariantTestRun
Contains data for an invariant test run.

Enums§

InvariantFuzzError

Functions§

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.
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.
replay_error
Replays the error case, shrinks the failing sequence and collects all necessary traces.
replay_run
Replays a call sequence for collecting logs and traces. Returns counterexample to be used when the call sequence is a failed scenario.