revm_statetest_types/
env.rs

1use revm::primitives::{Address, B256, U256};
2use serde::Deserialize;
3
4/// Environment variables
5#[derive(Debug, PartialEq, Eq, Deserialize)]
6#[serde(rename_all = "camelCase", deny_unknown_fields)]
7pub struct Env {
8    /// Chain ID for the current execution
9    #[serde(rename = "currentChainID")]
10    pub current_chain_id: Option<U256>,
11    /// Block coinbase address (miner/validator)
12    pub current_coinbase: Address,
13    /// Block difficulty (pre-merge) or prevrandao (post-merge)
14    #[serde(default)]
15    pub current_difficulty: U256,
16    /// Block gas limit
17    pub current_gas_limit: U256,
18    /// Current block number
19    pub current_number: U256,
20    /// Current block timestamp
21    pub current_timestamp: U256,
22    /// EIP-1559 base fee per gas
23    pub current_base_fee: Option<U256>,
24    /// Previous block hash
25    pub previous_hash: Option<B256>,
26
27    /// Current block randomness (EIP-4399 prevrandao)
28    pub current_random: Option<B256>,
29    /// Current beacon chain root (EIP-4788)
30    pub current_beacon_root: Option<B256>,
31    /// Current withdrawals root
32    pub current_withdrawals_root: Option<B256>,
33
34    /// Parent block blob gas used (EIP-4844)
35    pub parent_blob_gas_used: Option<U256>,
36    /// Parent block excess blob gas (EIP-4844)
37    pub parent_excess_blob_gas: Option<U256>,
38    /// Parent block target blobs per block (EIP-4844)
39    pub parent_target_blobs_per_block: Option<U256>,
40    /// Current block excess blob gas (EIP-4844)
41    pub current_excess_blob_gas: Option<U256>,
42}