Expand description
EVM hardfork definitions for Foundry.
Provides FoundryHardfork, a unified enum over Ethereum, Optimism, Tempo, and Monad hardforks
with FromStr/Serialize/Deserialize support for CLI and config usage.
Re-exportsยง
pub(crate) use alloy_chains::Chain;๐pub(crate) use alloy_rpc_types::BlockNumberOrTag;๐pub(crate) use foundry_compilers::artifacts::EvmVersion;๐pub(crate) use revm::primitives::hardfork::SpecId;๐pub(crate) use Deserialize;๐pub(crate) use Deserialize;๐pub(crate) use Serialize;๐pub(crate) use Serialize;๐pub(crate) use str::FromStr;๐pub(crate) use SystemTime;๐pub(crate) use UNIX_EPOCH;๐pub(crate) use op_revm::OpSpecId;๐
Structsยง
- Base
Spec Id - EVM-facing Base spec id.
Enumsยง
- Base
Upgrade - The canonical Base network upgrade.
- Ethereum
Hardfork - The name of an Ethereum hardfork.
- Foundry
Hardfork - Monad
Hardfork - Monad hardfork identifier.
- OpHardfork
- The name of an optimism hardfork.
- Tempo
Hardfork - Tempo-specific hardforks for network upgrades.
Traitsยง
- Execution
Spec - Conversion, hardfork scheduling, and trace metadata for a concrete execution spec.
- From
EvmVersion - Trait for converting an [
EvmVersion] into a network-specific spec type.
Functionsยง
- eth_
spec_ id_ from_ optimism_ hardfork - Map an
OptimismHardforkenum into its corresponding EthereumSpecId. - ethereum_
hardfork_ from_ block_ tag - Convert a
BlockNumberOrTaginto anEthereumHardfork. - evm_
spec_ id - Returns the spec id derived from [
EvmVersion] for a given spec type. - evm_
spec_ id_ from_ str - latest_
active_ tempo_ hardfork - Returns the latest Tempo hardfork that has an activation on a known Tempo network.
- spec_
id_ from_ ethereum_ hardfork - Map an
EthereumHardforkenum into its correspondingSpecId. - spec_
id_ from_ optimism_ hardfork - Map an
OptimismHardforkenum into its correspondingOpSpecId. - spec_
id_ from_ tempo_ hardfork - Map a
TempoHardforkenum into its corresponding EthereumSpecId.