Skip to main content

Module inspector

Module inspector 

Source
Expand description

Cheatcode EVM inspector.

Re-exportsΒ§

use crate::Cheatcode; πŸ”’
use crate::CheatcodesBackend; πŸ”’
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::GasRecord; πŸ”’
use crate::evm::RecordAccess; πŸ”’
use crate::evm::append_storage_access; πŸ”’
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::evm::touch_account; πŸ”’
use crate::expected_emit; πŸ”’
use crate::expected_emit::ExpectedEmitTracker; πŸ”’
use crate::script::Broadcast; πŸ”’
use crate::test::assert::FailureProvenance; πŸ”’
use crate::test::assert::FailureTrace; πŸ”’
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_consensus::transaction::Recovered; πŸ”’
use alloy_eips::eip7702::SignedAuthorization; πŸ”’
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_rpc_types::AccessList; πŸ”’
use alloy_sol_types::SolCall; πŸ”’
use alloy_sol_types::SolInterface; πŸ”’
use evm2::ExecutionError; πŸ”’
use evm2::OpcodeSet; πŸ”’
use evm2::evm::State; πŸ”’
use evm2::evm::StateSnapshot; πŸ”’
use evm2::interpreter::Gas; πŸ”’
use evm2::interpreter::GasTracker; πŸ”’
use evm2::interpreter::Host; πŸ”’
use evm2::interpreter::InstrStop; πŸ”’
use evm2::interpreter::Interpreter; πŸ”’
use evm2::interpreter::MessageExt; πŸ”’
use evm2::interpreter::MessageKind; πŸ”’
use evm2::interpreter::MessageResultExt; πŸ”’
use evm2::interpreter::derive_create_destination; πŸ”’
use evm2::interpreter::op; πŸ”’
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::abi::Vm::stopExpectSafeMemoryCall; πŸ”’
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::evm::BlockEnvFor; πŸ”’
use foundry_evm_core::evm::EthEvmNetwork; πŸ”’
use foundry_evm_core::evm::EvmEnvFor; πŸ”’
use foundry_evm_core::evm::FoundryEvmFor; πŸ”’
use foundry_evm_core::evm::FoundryEvmNetwork; πŸ”’
use foundry_evm_core::evm::InterpreterFor; πŸ”’
use foundry_evm_core::evm::MessageFor; πŸ”’
use foundry_evm_core::evm::MessageResultFor; πŸ”’
use foundry_evm_core::evm::PersistentWrite; πŸ”’
use foundry_evm_core::evm::SnapshotRestores; πŸ”’
use foundry_evm_core::evm::SpecFor; πŸ”’
use foundry_evm_core::evm::TransactionRequestFor; πŸ”’
use foundry_evm_core::evm::TxFor; πŸ”’
use foundry_evm_core::evm::TxResultFor; πŸ”’
use foundry_evm_core::evm::restore_access_warmth; πŸ”’
use foundry_evm_core::utils::opcodes; πŸ”’
use foundry_evm_traces::TracingInspector; πŸ”’
use foundry_evm_traces::TracingInspectorConfig; πŸ”’
use foundry_evm_traces::identifier::SignaturesIdentifier; πŸ”’
use itertools::Itertools; πŸ”’
use rand::Rng; πŸ”’
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; πŸ”’
use std::sync::atomic::Ordering; πŸ”’

ModulesΒ§

analysis
Cheatcode information, extracted from the syntactic and semantic analysis of the sources.
env_overrides πŸ”’
Cheatcode overrides of the BASEFEE, GASPRICE, BLOBHASH and CHAINID opcode values.

MacrosΒ§

try_or_return πŸ”’

StructsΒ§

ActiveStorageHook πŸ”’
The storage-hook callback frame currently executing.
ArbitraryStorage
Holds data about arbitrary storage.
BroadcastableTransaction
Helps collecting transactions from different forks.
CheatcodeAnalysis
Provides cached, on-demand syntactic and semantic analysis of a completed Compiler instance.
Cheatcodes
An EVM inspector that handles calls to various cheatcodes, each with their own behavior.
CreatedAccountChange πŸ”’
CreatedAccountsFrame πŸ”’
CreatedAccountsSnapshot πŸ”’
EnvOverrideState
Per-fork environment overrides and their state-snapshot copies.
GasMetering
Holds gas metering state.
RecordDebugStepInfo
StorageHook
A callback registered for a storage access hook.
StorageHookInspectorState πŸ”’

EnumsΒ§

CreatedAccountsFrameKind πŸ”’
PendingStorageHook πŸ”’

ConstantsΒ§

FRAME_END_OPCODES πŸ”’
The instructions that end a frame with a result its caller reads: a halt discards the gas and refund of the frame.
LOG_EMITTING_OPCODES πŸ”’
The instructions during which the running frame can emit a log: LOG*, and the message and self-destruct instructions, such as for logs of precompiles and value transfers.
MEMORY_OPCODES πŸ”’
The instructions that read or write memory, which expectSafeMemory checks.
STATE_DIFF_OPCODES πŸ”’
The instructions that startStateDiffRecording records.

TraitsΒ§

CheatcodesExecutor
Runs nested executions on behalf of cheatcodes.

FunctionsΒ§

access_is_call πŸ”’
Returns true if the kind of account access is a call.
apply_authorization_nonces πŸ”’
Bumps the nonces of the authorities of authorizations that the transaction will apply, as EIP-7702 does, for a transaction that is broadcast but not executed.
apply_dispatch πŸ”’
Dispatches the cheatcode call to the appropriate function.
cheatcode_id πŸ”’
cheatcode_of πŸ”’
Returns the spec::Cheatcode definition for a given spec::CheatcodeDef implementor.
cheatcode_signature πŸ”’
decode_cheatcode_call
Decodes a cheatcode call, reporting an unknown selector as a Vm interface mismatch.
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 πŸ”’
Executes the given CREATE message as a nested frame with the whole inspector stack.
frame_gas πŸ”’
Returns the gas a frame used, as reported by lastCallGas and lastFrameGas.
has_host_effects πŸ”’
Returns whether call writes to files or environment variables, runs a command, sends an arbitrary RPC request, creates a fork at the latest block, which can be newer than the campaign’s, prompts for input, or reads the clock, which skipped sleeps would make disagree with the campaign’s.
message_result
Returns the result of a message that did not execute, keeping its whole execution gas.
record_logs πŸ”’
Records a log into the recorded logs vector, if it exists.
recorded_call_state_account πŸ”’
Returns the account whose balance and nonce a call’s AccountAccess records.
revert_frame
Stops the running frame with a revert carrying output, before its current instruction runs or after it ran.
set_return πŸ”’
Turns outcome into a successful return with output.
set_revert πŸ”’
Turns outcome into a revert with output.
transfer_value πŸ”’
Returns the value a call message transfers, if it transfers one.

Type AliasesΒ§

BroadcastableTransactions
List of transactions that can be broadcasted.