Expand description
Cheatcode EVM inspector.
Re-exportsΒ§
use crate::Cheatcode;πuse crate::CheatcodesCore;πuse crate::CheatsConfig;πuse crate::CheatsCtxt;πuse crate::Error;πuse crate::Result;πuse crate::Vm;πuse crate::Vm::AccountAccess;πuse crate::evm::DealRecord;πuse crate::evm::GasRecord;πuse crate::evm::RecordAccess;πuse crate::evm::append_storage_access;πuse crate::evm::journaled_account;πuse crate::evm::mark_account_accesses_reverted;πuse crate::evm::merge_recorded_frame;πuse crate::evm::mock;πuse crate::evm::mock::MockCallDataContext;πuse crate::evm::mock::MockCallReturnData;πuse crate::evm::prank::Prank;πuse crate::expected_emit;πuse crate::expected_emit::ExpectedEmitTracker;πuse crate::inspector::utils::CommonCreateInput;πuse crate::script::Broadcast;πuse crate::test::assume::AssumeNoRevert;πuse crate::test::expect;πuse crate::test::expect::ExpectedCallTracker;πuse crate::test::expect::ExpectedCreate;πuse crate::test::expect::ExpectedRevert;πuse crate::test::expect::ExpectedRevertKind;πuse crate::test::revert_handlers;πuse crate::utils::IgnoredTraces;πuse alloy_consensus::BlobTransactionSidecarVariant;πuse alloy_network::Ethereum;πuse alloy_network::Network;πuse alloy_network::TransactionBuilder;π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::hex;πuse alloy_primitives::hex;πuse alloy_primitives::map::HashMap;πuse alloy_primitives::map::HashSet;πuse alloy_sol_types::SolCall;πuse alloy_sol_types::SolInterface;πuse foundry_common::FoundryTransactionBuilder;πuse foundry_common::SELECTOR_LEN;πuse foundry_common::TransactionMaybeSigned;πuse foundry_common::mapping_slots::MappingSlots;πuse foundry_common::mapping_slots::PendingMappingHash;πuse foundry_common::mapping_slots::capture_hash as capture_mapping_hash;πuse foundry_common::mapping_slots::record_hash as record_mapping_hash;πuse foundry_common::mapping_slots::step as mapping_step;πuse foundry_evm_core::Breakpoints;πuse foundry_evm_core::EvmEnv;πuse foundry_evm_core::FoundryTransaction;πuse foundry_evm_core::InspectorExt;πuse foundry_evm_core::abi::Vm::stopExpectSafeMemoryCall;πuse foundry_evm_core::backend::ContextUpdateFor;πuse foundry_evm_core::backend::DatabaseError;πuse foundry_evm_core::backend::DatabaseExt;πuse foundry_evm_core::backend::JournaledState;πuse foundry_evm_core::backend::LocalForkId;πuse foundry_evm_core::backend::RevertDiagnostic;πuse foundry_evm_core::constants::CHEATCODE_ADDRESS;πuse foundry_evm_core::constants::HARDHAT_CONSOLE_ADDRESS;πuse foundry_evm_core::constants::MAGIC_ASSUME;πuse foundry_evm_core::env::FoundryContextExt;πuse foundry_evm_core::evm::BlockEnvFor;πuse foundry_evm_core::evm::ChainFor;πuse foundry_evm_core::evm::EthEvmNetwork;πuse foundry_evm_core::evm::EvmFactoryFor;πuse foundry_evm_core::evm::FoundryContextFor;πuse foundry_evm_core::evm::FoundryEvmFactory;πuse foundry_evm_core::evm::FoundryEvmNetwork;πuse foundry_evm_core::evm::NestedEvmClosureFor;πuse foundry_evm_core::evm::SpecFor;πuse foundry_evm_core::evm::TransactionRequestFor;πuse foundry_evm_core::evm::TxEnvFor;πuse foundry_evm_core::evm::with_inherited_evm;πuse foundry_evm_traces::TracingInspector;πuse foundry_evm_traces::TracingInspectorConfig;πuse foundry_evm_traces::identifier::SignaturesIdentifier;πuse itertools::Itertools;πuse rand::Rng;πuse revm::Inspector;πuse revm::JournalEntry;πuse revm::bytecode::opcode as op;πuse revm::context::Cfg;πuse revm::context::ContextTr;πuse revm::context::Host;πuse revm::context::JournalTr;πuse revm::context::Transaction;πuse revm::context::TransactionType;πuse revm::context::result::EVMError;πuse revm::context_interface::CreateScheme;πuse revm::context_interface::transaction::SignedAuthorization;πuse revm::handler::FrameResult;πuse revm::interpreter::CallInput;πuse revm::interpreter::CallInputs;πuse revm::interpreter::CallOutcome;πuse revm::interpreter::CallScheme;πuse revm::interpreter::CallValue;πuse revm::interpreter::CreateInputs;πuse revm::interpreter::CreateOutcome;πuse revm::interpreter::FrameInput;πuse revm::interpreter::Gas;πuse revm::interpreter::InstructionResult;πuse revm::interpreter::Interpreter;πuse revm::interpreter::InterpreterAction;πuse revm::interpreter::InterpreterResult;πuse revm::interpreter::interpreter_types::Jumps;πuse revm::interpreter::interpreter_types::LoopControl;πuse revm::interpreter::interpreter_types::MemoryTr;πuse revm::interpreter::interpreter_types::ReturnData;πuse revm::primitives::hardfork::SpecId;πuse std::cmp::max;πuse std::collections::BTreeMap;πuse std::collections::VecDeque;πuse std::fmt::Debug;πuse std::fmt::Debug;πuse std::ops::Range;πuse std::sync::Arc;πuse std::sync::OnceLock;π
ModulesΒ§
- analysis
- Cheatcode information, extracted from the syntactic and semantic analysis of the sources.
- env_
overrides π - Cheatcode overrides of the
BASEFEE,GASPRICEandBLOBHASHopcode values. - utils π
MacrosΒ§
- try_
or_ πreturn
StructsΒ§
- Active
Storage πHook - Arbitrary
Storage - Holds data about arbitrary storage.
- Broadcastable
Transaction - Helps collecting transactions from different forks.
- Cheatcode
Analysis - Provides cached, on-demand syntactic and semantic analysis of a completed
Compilerinstance. - Cheatcodes
- An EVM inspector that handles calls to various cheatcodes, each with their own behavior.
- Created
Account πChange - Created
Accounts πFrame - Created
Accounts πSnapshot - EnvOverride
State - Per-fork environment overrides and their state-snapshot copies.
- GasMetering
- Holds gas metering state.
- Record
Debug Step Info - Storage
Hook - A callback registered for a storage access hook.
- Storage
Hook πInspector State - Transparent
Cheatcodes πExecutor - Basic implementation of CheatcodesExecutor that simply returns the Cheatcodes instance as an inspector.
EnumsΒ§
- Created
Accounts πFrame Kind - Pending
Storage πHook
TraitsΒ§
- Cheatcodes
Executor - Helper trait for running nested EVM operations from inside cheatcode implementations.
FunctionsΒ§
- access_
is_ πcall - Returns true if the kind of account access is a call.
- apply_
authorization_ πnonces - Increments the nonce of every authority whose authorization would be applied on-chain.
- apply_
dispatch π - Dispatches the cheatcode call to the appropriate function.
- cheatcode_
id π - cheatcode_
of π - Returns the
spec::Cheatcodedefinition for a givenspec::CheatcodeDefimplementor. - cheatcode_
signature π - disallowed_
mem_ πwrite - Helper that expands memory, stores a revert string pertaining to a disallowed memory write, and sets the return range to the revert stringβs location in memory.
- exec_
create π - Builds a sub-EVM from the current context and executes the given CREATE frame.
- frame_
gas π - record_
logs π - Records a log into the recorded logs vector, if it exists.
- will_
exit π - Helper function to check if frame execution will exit.
Type AliasesΒ§
- Broadcastable
Transactions - List of transactions that can be broadcasted.