Skip to main content

Module fork

Module fork 

Source

Re-exportsΒ§

use crate::Cheatcode; πŸ”’
use crate::Cheatcodes; πŸ”’
use crate::CheatcodesCore; πŸ”’
use crate::CheatcodesExecutor; πŸ”’
use crate::CheatsCtxt; πŸ”’
use crate::Result; πŸ”’
use crate::json::json_value_to_token; πŸ”’
use alloy_dyn_abi::DynSolValue; πŸ”’
use alloy_network::AnyNetwork; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::U256; πŸ”’
use alloy_provider::Provider; πŸ”’
use alloy_provider::RootProvider; πŸ”’
use alloy_rpc_types::Filter; πŸ”’
use alloy_sol_types::SolValue; πŸ”’
use foundry_common::provider::ProviderBuilder; πŸ”’
use foundry_evm_core::backend::Backend; πŸ”’
use foundry_evm_core::backend::ForkAccountField; πŸ”’
use foundry_evm_core::backend::LocalForkId; πŸ”’
use foundry_evm_core::evm::ExecutionPhase; πŸ”’
use foundry_evm_core::evm::FoundryEvmFor; πŸ”’
use foundry_evm_core::evm::FoundryEvmNetwork; πŸ”’
use foundry_evm_core::fork::CreateFork; πŸ”’
use crate::Vm::*; πŸ”’

FunctionsΒ§

active_fork_provider πŸ”’
Returns a provider for the active fork, configured with the RPC options the fork was created with (e.g. auth headers, retries and timeouts).
check_broadcast πŸ”’
convert_to_bytes πŸ”’
Convert fixed bytes and address values to bytes in order to prevent encoding issues.
create_fork πŸ”’
Creates a new fork
create_fork_at_transaction πŸ”’
Creates a new fork at the given transaction
create_fork_request πŸ”’
Creates the request object for a new fork request
create_select_fork πŸ”’
Creates and then also selects the new fork
create_select_fork_at_transaction πŸ”’
Creates and then also selects the new fork at the given transaction
fork_op πŸ”’
Runs a fork operation that switches or replaces the running context, such as rollFork, selectFork or createSelectFork.
persist_caller πŸ”’
persistent_created_accounts πŸ”’
record_fork_roll πŸ”’
record_fork_switch πŸ”’
refresh_active_fork_state πŸ”’
Refreshes cached fork and journal state after a vm.rpc call on the active fork that mutates the node directly. Only well-known Anvil/Hardhat account/storage setters are handled; chain-advancing methods (e.g. eth_sendTransaction) need re-forking, not synchronization.
rpc_call πŸ”’
Performs an Ethereum JSON-RPC request to the given endpoint.
rpc_json_call πŸ”’
Performs an Ethereum JSON-RPC request to the given endpoint and returns the JSON result.
rpc_result πŸ”’
sync_chain_id_override πŸ”’
Makes CHAINID on the fork fork_id just switched to or rolled read the fork’s chain ID at once, replacing an earlier vm.chainId.
transact πŸ”’