Skip to main content

Module utils

Module utils 

Source

Re-exportsยง

use crate::EvmEnv; ๐Ÿ”’
use crate::FoundryBlock; ๐Ÿ”’
use crate::hardfork::FoundryHardfork; ๐Ÿ”’
use alloy_chains::Chain; ๐Ÿ”’
use alloy_consensus::BlockHeader; ๐Ÿ”’
use alloy_consensus::private::alloy_eips::eip7840::BlobParams; ๐Ÿ”’
use alloy_hardforks::EthereumHardfork; ๐Ÿ”’
use alloy_json_abi::Function; ๐Ÿ”’
use alloy_json_abi::JsonAbi; ๐Ÿ”’
use alloy_primitives::ChainId; ๐Ÿ”’
use alloy_primitives::Selector; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_provider::Network; ๐Ÿ”’
use alloy_provider::network::BlockResponse; ๐Ÿ”’
use foundry_config::NamedChain; ๐Ÿ”’
use foundry_config::NamedChain::Avalanche; ๐Ÿ”’
use foundry_config::NamedChain::AvalancheFuji; ๐Ÿ”’
use foundry_config::NamedChain::BinanceSmartChain; ๐Ÿ”’
use foundry_config::NamedChain::BinanceSmartChainTestnet; ๐Ÿ”’
use foundry_config::NamedChain::Polygon; ๐Ÿ”’
use foundry_config::NamedChain::PolygonAmoy; ๐Ÿ”’
use foundry_evm_networks::NetworkConfigs; ๐Ÿ”’
use revm::primitives::hardfork::SpecId; ๐Ÿ”’

Functionsยง

apply_chain_and_block_specific_env_changes_for_chain
Applies block normalization for the provided source chain.
apply_chain_specific_tx_replay_env_changes_for_chain
Applies replay normalization for the provided source chain.
block_env_from_header
Constructs a generic FoundryBlock from a block header.
cold_path
Hints to the compiler that this is a cold path, i.e. unlikely to be taken.
get_blob_base_fee_update_fraction
Derive the blob base fee update fraction based on the chain and timestamp by checking the hardfork.
get_blob_base_fee_update_fraction_by_spec_id
Returns the blob base fee update fraction based on the spec id.
get_blob_params
Derives the active [BlobParams] based on the given timestamp.
get_blob_params_by_hardfork
Returns the blob parameters selected by an explicit Foundry hardfork.
get_blob_params_by_spec_id
Returns the blob params based on the spec id.
get_function
Given an ABI and selector, it tries to find the respective function.

Type Aliasesยง

StateChangeset
EVM State is a mapping from addresses to accounts.