Skip to main content

revm_primitives/
eip2780.rs

1//! EIP-2780: Reduce intrinsic transaction gas
2//!
3//! Replaces the legacy `21,000` intrinsic base with a decomposed model that
4//! prices a reduced sender base plus additional `to`- and `value`-based
5//! charges. Composes with EIP-8037 (state gas) and EIP-8038 (state-access
6//! costs) starting at the Amsterdam hardfork.
7
8/// Reduced intrinsic base cost charged to `tx.sender` (execution-specs `TX_BASE`).
9pub const TX_BASE_COST: u64 = 12_000;
10
11/// Regular gas cost of the EIP-7708 transfer log emitted for every nonzero-value
12/// transfer to a different account.
13///
14/// `TRANSFER_LOG_COST = GAS_LOG + 3 * GAS_LOG_TOPIC + 32 * GAS_LOG_DATA_PER_BYTE`
15/// = `375 + 1_125 + 256 = 1_756`.
16pub const TRANSFER_LOG_COST: u64 = 1_756;
17
18/// Additional intrinsic regular-gas charge for a value-bearing (non-create,
19/// non-self) transaction (execution-specs `TX_VALUE_COST`), on top of
20/// [`TRANSFER_LOG_COST`].
21pub const TX_VALUE_COST: u64 = 4_244;