Re-exportsยง
use super::InvariantFailures;๐use super::InvariantFuzzError;๐use super::InvariantMetrics;๐use super::InvariantTest;๐use super::InvariantTestRun;๐use super::call_after_invariant_function;๐use super::call_invariant_function;๐use super::error::InvariantRunCtx;๐use super::error::record_handler_assertion_bug;๐use crate::executors::Executor;๐use crate::executors::RawCallResult;๐use alloy_json_abi::Function;๐use alloy_primitives::Address;๐use alloy_primitives::B256;๐use alloy_primitives::I256;๐use alloy_primitives::Selector;๐use alloy_sol_types::Panic;๐use alloy_sol_types::PanicKind;๐use alloy_sol_types::Revert;๐use alloy_sol_types::SolError;๐use alloy_sol_types::SolInterface;๐use eyre::Result;๐use foundry_config::InvariantConfig;๐use foundry_evm_core::abi::Vm;๐use foundry_evm_core::constants::CHEATCODE_ADDRESS;๐use foundry_evm_core::decode::ASSERTION_FAILED_PREFIX;๐use foundry_evm_core::decode::decode_console_log;๐use foundry_evm_core::evm::FoundryEvmNetwork;๐use foundry_evm_core::utils::StateChangeset;๐use foundry_evm_coverage::HitMaps;๐use foundry_evm_fuzz::BasicTxDetails;๐use foundry_evm_fuzz::invariant::FuzzRunIdentifiedContracts;๐use foundry_evm_fuzz::invariant::InvariantContract;๐use foundry_evm_traces::CallTraceArena;๐use proptest::test_runner::TestError;๐use revm::interpreter::InstructionResult;๐use std::borrow::Cow;๐use std::collections::HashMap;๐
Structsยง
- Continue
Outcome ๐ - Outcome of a per-call invariant check.
- Invariant
Fuzz Test Result - The outcome of an invariant fuzz test
Functionsยง
- assert_
after_ ๐invariant - Given the executor state, asserts conditions within
afterInvariantfunction. - assert_
invariants ๐ - Given the executor state, asserts that no invariant has been broken. Otherwise, it fills the
external
invariant_failures.failed_invariantmap. - can_
continue ๐ - Returns if invariant test can continue and last successful call result of the invariant test function (if it can continue).
- did_
fail_ on_ assert - Returns whether the current fuzz call should be treated as an assertion failure.
- invariant_
inner_ ๐sequence - Helper function to initialize invariant inner sequence.
- invariant_
preflight_ ๐check - Given the executor state, asserts that no invariant has been broken. Otherwise, it fills the
external
invariant_failures.failed_invariantmap and returns a generic error. Either returns the call result if successful, or nothing if there was an error. - is_
assert_ ๐panic - is_
assertion_ ๐failure - Returns true if this call failed due to a Solidity assertion:
- is_
cheatcode_ ๐assert_ revert - is_
revert_ ๐assertion_ failure - logged_
assertion_ ๐failure