Skip to main contentModule equivalence
Source use alloy_dyn_abi::DynSolValue; π use alloy_json_abi::Function; π use alloy_network::TransactionBuilder; π use alloy_primitives::Address; π use alloy_primitives::B256; π use alloy_primitives::Bytes; π use alloy_primitives::KECCAK256_EMPTY; π 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 clap::Parser; π use clap::ValueHint; π use evm2::EvmFeatures; π use evm2::bytecode::Bytecode; π use evm2::interpreter::InstrStop; π use eyre::Result; π use eyre::WrapErr; π use eyre::bail; π use foundry_common::sh_println; π use foundry_common::shell; π use foundry_config::Config; π use foundry_config::SymbolicStorageLayout; π use foundry_evm::backend::Backend; π use foundry_evm::constants::CALLER; π use foundry_evm::constants::TEST_CONTRACT_ADDRESS; π use foundry_evm::core::evm::EthEvmNetwork; π use foundry_evm::executors::Executor; π use foundry_evm::executors::ExecutorBuilder; π use foundry_evm::opts::EvmOpts; π use foundry_evm_symbolic::ExecutorView; π use foundry_evm_symbolic::SymbolicEquivalenceEnv; π use foundry_evm_symbolic::SymbolicEquivalenceInput; π use foundry_evm_symbolic::SymbolicEquivalenceResult; π use foundry_evm_symbolic::SymbolicExecutor; π use foundry_evm_symbolic::SymbolicStats; π use foundry_evm_symbolic::SymbolicStorageAssignment; π use serde_json::json; π use std::collections::BTreeSet; π use std::path::PathBuf; π
- AccountMap π
- Maps the accounts that stand for the symbolic address and sender to the modelβs choices.
- ConcreteRun π
- One concrete run of either contract on the counterexample.
- EquivalenceArgs
- CLI arguments for
forge equivalence.
- describe π
- env_json π
- final_account π
- Returns an accountβs nonce and code hash after
run, falling back to the shared pre-state. - final_balance π
- Returns an accountβs balance after
run, falling back to the shared pre-state. - final_slot π
- Returns a slotβs value after
run, falling back to the shared pre-state. - format_value π
- log_json π
- prepare_replay π
- Puts the counterexampleβs pre-state and block environment into the concrete executor.
- print_logs π
- print_stats π
- read_code π
- Reads hex bytecode from a flag or a file.
- replay π
- Runs
code at the counterexampleβs address on calldata without committing state.