Expand description
Implementations of Evm cheatcodes.
Re-exportsΒ§
use crate::BroadcastableTransaction;πuse crate::Cheatcode;πuse crate::Cheatcodes;πuse crate::CheatcodesCore;πuse crate::CheatcodesExecutor;πuse crate::CheatsCtxt;πuse crate::Error;πuse crate::Result;πuse crate::env::FORGE_CONTEXT;πuse crate::inspector::RecordDebugStepInfo;πuse alloy_consensus::Transaction as _;πuse alloy_consensus::Typed2718;πuse alloy_consensus::transaction::SignerRecoverable;πuse alloy_evm::FromRecoveredTx;πuse alloy_genesis::Genesis;πuse alloy_genesis::GenesisAccount;πuse alloy_network::eip2718::EIP4844_TX_TYPE_ID;πuse alloy_primitives::Address;πuse alloy_primitives::B256;πuse alloy_primitives::Bytes;πuse alloy_primitives::U256;πuse alloy_primitives::hex;πuse alloy_primitives::hex;πuse alloy_primitives::keccak256;πuse alloy_primitives::map::AddressMap;πuse alloy_primitives::map::AddressSet;πuse alloy_primitives::map::B256Map;πuse alloy_primitives::map::HashMap;πuse alloy_rlp::Decodable;πuse alloy_sol_types::SolValue;πuse foundry_common::TransactionMaybeSigned;πuse foundry_common::fs::read_json_file;πuse foundry_common::fs::write_json_file;πuse foundry_common::slot_identifier::ENCODING_BYTES;πuse foundry_common::slot_identifier::ENCODING_DYN_ARRAY;πuse foundry_common::slot_identifier::ENCODING_INPLACE;πuse foundry_common::slot_identifier::ENCODING_MAPPING;πuse foundry_common::slot_identifier::SlotIdentifier;πuse foundry_common::slot_identifier::SlotInfo;πuse foundry_common::tempo::TIP20_MAX_LOGO_URI_BYTES;πuse foundry_common::tempo::Tip20LogoUriValidationError;πuse foundry_common::tempo::validate_tip20_logo_uri;πuse foundry_evm_core::FoundryBlock;πuse foundry_evm_core::FoundryChain;πuse foundry_evm_core::FoundryTransaction;πuse foundry_evm_core::backend::DatabaseError;πuse foundry_evm_core::backend::DatabaseExt;πuse foundry_evm_core::backend::JournaledState;πuse foundry_evm_core::backend::RevertStateSnapshotAction;πuse foundry_evm_core::constants::CALLER;πuse foundry_evm_core::constants::CHEATCODE_ADDRESS;πuse foundry_evm_core::constants::HARDHAT_CONSOLE_ADDRESS;πuse foundry_evm_core::constants::TEST_CONTRACT_ADDRESS;πuse foundry_evm_core::eip2935::HISTORY_SERVE_WINDOW;πuse foundry_evm_core::eip2935::HISTORY_STORAGE_ADDRESS;πuse foundry_evm_core::eip2935::HISTORY_STORAGE_CODE;πuse foundry_evm_core::eip2935::forward_fill_start;πuse foundry_evm_core::eip2935::history_storage_slot;πuse foundry_evm_core::eip2935::history_storage_value;πuse foundry_evm_core::env::FoundryContextExt;πuse foundry_evm_core::evm::FoundryEvmNetwork;πuse foundry_evm_core::evm::TxEnvFor;πuse foundry_evm_core::evm::TxEnvelopeFor;πuse foundry_evm_core::evm::merge_child_state;πuse foundry_evm_core::evm::prepare_child_state;πuse foundry_evm_traces::TraceRequirements;πuse itertools::Itertools;πuse rand::Rng;πuse revm::Database;πuse revm::bytecode::Bytecode;πuse revm::context::Block;πuse revm::context::ContextTr;πuse revm::context::JournalTr;πuse revm::context::Transaction;πuse revm::context::result::ExecutionResult;πuse revm::inspector::JournalExt;πuse revm::primitives::hardfork::SpecId;πuse revm::state::Account;πuse std::collections::BTreeMap;πuse std::collections::btree_map::Entry;πuse std::fmt::Display;πuse std::path::Path;πuse std::str::FromStr;πuse foundry_common::fmt::format_token_raw;πuse foundry_config::ExecutionSpec;πuse foundry_config::evm_spec_id_from_str;πuse foundry_config::fs_permissions::FsAccessKind;πuse record_debug_step::convert_call_trace_ctx_to_debug_step;πuse record_debug_step::flatten_call_trace;πuse serde::Serialize;πuse serde::Serialize;πuse serde::Serializer;πuse serde::ser::SerializeMap;πuse foundry_evm_core::evm::refresh_chain_journal;πmonaduse crate::Vm::*;π
ModulesΒ§
- fork π
- mapping π
- mock π
- prank π
- record_
debug_ πstep
StructsΒ§
- Account
State πDiffs - Account state diff info.
- Balance
Diff π - Balance diff info.
- Deal
Record - Records
dealcheatcodes - GasRecord
- Records the
snapshotGas*cheatcodes. - LogJson π
- JSON-serializable log entry for
getRecordedLogsJson. - Nonce
Diff π - Nonce diff info.
- Record
Access - Records storage slots reads and writes.
- Slot
State πDiff - Storage slot diff info.
- State
Dump π
ConstantsΒ§
- EIP1822_
PROXIABLE_ πSLOT - EIP-1822 UUPS implementation storage slot: keccak256(βPROXIABLEβ)
- EIP1967_
IMPL_ πSLOT - EIP-1967 implementation storage slot
- TIP20_
LOGO_ πURI_ SLOT_ INDEX
FunctionsΒ§
- append_
storage_ πaccess - Appends an AccountAccess that resumes the recording of the current context.
- cleanup_
long_ πstring_ tail - clear_
eip2935_ πhistory_ storage - Clears the EIP-2935 history ring buffer with journaled writes, so that reverting the enclosing frame restores the previous history storage.
- derive_
snapshot_ πname - encode_
short_ πstring - ensure_
loaded_ πaccount - genesis_
account π - Helper function that creates a
GenesisAccountfrom a regularAccount. - get_
contract_ πdata - Helper function to get the contract data from the deployed code at an address.
- get_
nonce π - get_
recorded_ πstate_ diffs - Helper function to returns state diffs recorded for each changed account.
- get_
state_ πdiff - Consumes recorded account accesses and returns them as an abi encoded array of AccountAccess. If there are no accounts were recorded as accessed, an abi encoded empty array is returned.
- inner_
last_ πgas_ snapshot - inner_
revert_ πto_ state - inner_
revert_ πto_ state_ and_ delete - inner_
snapshot_ πstate - inner_
start_ πgas_ snapshot - inner_
stop_ πgas_ snapshot - inner_
value_ πsnapshot - is_
long_ πstring - journaled_
account π - Ensures the
Accountis loaded and touched. - long_
string_ πlength - mark_
account_ πaccesses_ reverted - Marks a reverted frameβs account accesses, including their storage accesses, as reverted.
- merge_
recorded_ πframe - Moves a finished frameβs account accesses into the enclosing recorded frame, or back onto the stack when no enclosing frame was recorded, preserving the order of the accesses.
- read_
callers π - Reads the current caller information and returns the current CallerMode,
msg.senderandtx.origin. - restore_
eip2935_ πcold_ state - restore_
isolation_ πfee_ accounting - set_
cold_ πslot - Helper function to set / unset cold storage slot of the target address.
- set_
eip2935_ πblockhash - set_
tip20_ πlogo_ uri - solidity_
dynamic_ πdata_ slot - store_
solidity_ πstring - string_
chunks π - sync_
tx_ πafter_ env_ override_ restore - Syncs the real
txfields to match restoredenv_overrides. - track_
snapshot_ πrestore - Records the live journal replaced by a snapshot restoration so that a failing enclosing frame can reinstate it and unwind its journaled writes.