Expand description
EVM executor abstractions, which can execute calls.
Used for running tests, scripts, and interacting with the inner backend which holds the state.
Re-exportsΒ§
use crate::inspectors::Cheatcodes;πuse crate::inspectors::CmpOperands;πuse crate::inspectors::EdgeCoverage;πuse crate::inspectors::EdgeIndexMap;πuse crate::inspectors::InspectorData;πuse crate::inspectors::InspectorStack;πuse crate::inspectors::cheatcodes::BroadcastableTransactions;πuse alloy_dyn_abi::DynSolValue;πuse alloy_dyn_abi::FunctionExt;πuse alloy_dyn_abi::JsonAbiExt;πuse alloy_eips::eip4788::BEACON_ROOTS_ADDRESS;πuse alloy_eips::eip4788::SYSTEM_ADDRESS;πuse alloy_evm::Evm;πuse alloy_json_abi::Function;πuse alloy_primitives::Address;πuse alloy_primitives::B256;πuse alloy_primitives::Bytes;πuse alloy_primitives::Log;πuse alloy_primitives::TxKind;πuse alloy_primitives::U256;πuse alloy_primitives::keccak256;πuse alloy_primitives::map::HashMap;πuse alloy_sol_types::SolCall;πuse alloy_sol_types::sol;πuse eyre::WrapErr;πuse foundry_evm_core::EvmEnv;πuse foundry_evm_core::FoundryBlock;πuse foundry_evm_core::FoundryChain;πuse foundry_evm_core::FoundryTransaction;πuse foundry_evm_core::backend::Backend;πuse foundry_evm_core::backend::BackendError;πuse foundry_evm_core::backend::BackendResult;πuse foundry_evm_core::backend::CowBackend;πuse foundry_evm_core::backend::DatabaseError;πuse foundry_evm_core::backend::DatabaseExt;πuse foundry_evm_core::backend::GLOBAL_FAIL_SLOT;πuse foundry_evm_core::constants::CALLER;πuse foundry_evm_core::constants::CHEATCODE_ADDRESS;πuse foundry_evm_core::constants::CHEATCODE_CONTRACT_HASH;πuse foundry_evm_core::constants::DEFAULT_CREATE2_DEPLOYER;πuse foundry_evm_core::constants::DEFAULT_CREATE2_DEPLOYER_CODE;πuse foundry_evm_core::constants::DEFAULT_CREATE2_DEPLOYER_DEPLOYER;πuse foundry_evm_core::decode::RevertDecoder;πuse foundry_evm_core::decode::SkipReason;πuse foundry_evm_core::eip2935::HISTORY_STORAGE_ADDRESS;πuse foundry_evm_core::eip2935::HISTORY_STORAGE_CODE;πuse foundry_evm_core::eip2935::history_storage_slot;πuse foundry_evm_core::eip2935::history_storage_value;πuse foundry_evm_core::eip2935::history_window_start;πuse foundry_evm_core::evm::ChainFor;πuse foundry_evm_core::evm::EthEvmNetwork;πuse foundry_evm_core::evm::EvmEnvFor;πuse foundry_evm_core::evm::FoundryEvmFactory;πuse foundry_evm_core::evm::FoundryEvmNetwork;πuse foundry_evm_core::evm::IntoInstructionResult;πuse foundry_evm_core::evm::SpecFor;πuse foundry_evm_core::evm::TxEnvFor;πuse foundry_evm_core::utils::StateChangeset;πuse foundry_evm_coverage::HitMaps;πuse foundry_evm_fuzz::ObservedCall;πuse foundry_evm_networks::NetworkConfigs;πuse foundry_evm_traces::SparsedTraceArena;πuse foundry_evm_traces::TraceRequirements;πuse revm::bytecode::Bytecode;πuse revm::context::Block;πuse revm::context::Cfg;πuse revm::context::ContextTr;πuse revm::context::Transaction;πuse revm::context_interface::cfg::gas_params::Eip2780TxInfo;πuse revm::context_interface::result::ExecutionResult;πuse revm::context_interface::result::Output;πuse revm::context_interface::result::ResultAndState;πuse revm::context_interface::transaction::SignedAuthorization;πuse revm::database::Database;πuse revm::database::DatabaseCommit;πuse revm::database::DatabaseRef;πuse revm::interpreter::InstructionResult;πuse revm::interpreter::gas::InitialAndFloorGas;πuse revm::primitives::hardfork::SpecId;πuse sancov::SancovGuard;πuse std::borrow::Cow;πuse std::sync::Arc;πuse std::sync::atomic::AtomicBool;πuse std::sync::atomic::Ordering;πuse std::time::Duration;πuse std::time::Instant;πuse alloy_monad_evm::MonadEvmFactory;πmonaduse foundry_common::SYSTEM_TRANSACTION_TYPE;πmonaduse foundry_common::is_known_system_sender;πmonaduse foundry_evm_core::evm::MonadEvmNetwork;πmonaduse foundry_evm_core::evm::refresh_chain_journal;πmonaduse foundry_evm_core::evm::try_transact_monad_system_replay;πmonaduse monad_revm::MonadChainContext;πmonaduse monad_revm::MonadHardfork;πmonaduse revm::context::TxEnv;πmonadpub use fuzz::FuzzedExecutor;pub use invariant::InvariantExecutor;
ModulesΒ§
- ITest
- Module containing a contractβs types and functions.
- builder π
- campaign π
- Worker-local call execution policy shared by stateless and invariant fuzz campaigns.
- corpus π
- Corpus management for parallel fuzzing with coverage-guided mutation.
- corpus_
io π - Shared helpers for reading on-disk corpus directories.
- fuzz
- invariant
- sancov π
- showmap π
- AFL-
afl-showmap-style corpus replay. - trace π
StructsΒ§
- Call
Result - The result of a call.
- Corpus
DirEntry - A single corpus file on disk.
- Deploy
Result - The result of a deployment.
- Dynamic
Target Ctx - Refs used during corpus replay to register contracts deployed mid-sequence as fuzz targets,
mirroring the campaign loop so follow-up calls into them arenβt dropped by
can_replay_tx. - Early
Exit - Helper struct to enable early exit behavior: when one test fails or run is interrupted, all other tests stop early.
- Execution
Err - Represents the context after an execution error occurred.
- Executor
- EVM executor.
- Executor
Builder - The builder that allows to configure an evm
Executorwhich a stack of optional [revm::Inspector]s, such asCheatcodes. - Fuzz
Test Timer - Timer for a fuzz test.
- Invariant
Replay Options - Invariant replay settings that affect when terminal checks run.
- Minimization
Replay Input - RawCall
Result - The result of a raw call.
- Replay
Observation - Facts observed while replaying one candidate for corpus minimization.
- Showmap
Opts - Per-replay options.
- Showmap
Replay Target - Test target metadata needed to replay corpus entries.
- Showmap
Stats - Stats returned from a single trial replay.
- Stateless
Replay Target - Tracing
Executor - A default executor with tracing enabled
- Tracing
Fork - Fork state and network context used to construct a tracing executor.
EnumsΒ§
- EvmError
- EvmExecution
Cancellation π - Shared cancellation state for an active EVM execution.
- Replay
Failure - A structured identity for a failure observed during corpus replay.
- Showmap
Domain - Which coverage bitmap(s) to dump.
ConstantsΒ§
FunctionsΒ§
- calculate_
initial_ πgas - Returns the intrinsic gas and EIP-7623 calldata floor of a transaction.
- calculate_
stipend π - canonical_
replay_ dirs - Returns every
worker*/corpus/underroot, or[root]if none exist. - collect_
debug_ πbytecodes - convert_
executed_ πresult - Converts the data aggregated in the
inspectorandcallto aRawCallResult. - parse_
corpus_ filename - Parses a corpus filename of the form
<uuid>-<timestamp>.json[.gz]. - persist_
corpus_ seed - Persists one call sequence as a corpus seed in the canonical worker0 corpus directory.
- read_
corpus_ dir - Iterate corpus files in
path, ignoring entries with unparsable names. - read_
corpus_ tree - Reads corpus files from a file, corpus directory, worker corpus directory, or generated corpus
root such as
<root>/<contract>/<test>/worker0/corpus. - replay_
corpus_ to_ showmap - Replay every corpus entry under
corpus_dirand emit showmap files. - replay_
sequence_ for_ minimization - Replays one candidate input and returns coverage/failure facts for minimizers.
- should_
ignore_ revert - Returns whether a nested revert can be ignored when fail-on-revert is disabled.
- worker_
seed π - Derives the deterministic RNG seed for a fuzz or invariant worker.