EEVM.Transaction.IntrinsicGas (eevm v0.1.0)

Copy Markdown View Source

Intrinsic transaction gas calculation.

Covers the base transaction envelope plus static costs derived from calldata, contract creation, access-list entries, and EIP-7702 authorizations — the upfront gas charged before EVM execution begins.

Summary

Functions

Returns the intrinsic gas of tx under hardfork: the 21,000 base, its calldata, contract creation (32,000 from Homestead, EIP-2, plus 2 per initcode word from Shanghai, EIP-3860), access-list entries (EIP-2930), and 25,000 per authorization (EIP-7702).

EIP-7623 calldata floor from Prague, 0 before.

Lowest valid gas limit: the larger of intrinsic gas and the calldata floor.

Functions

calculate(tx, hardfork)

Returns the intrinsic gas of tx under hardfork: the 21,000 base, its calldata, contract creation (32,000 from Homestead, EIP-2, plus 2 per initcode word from Shanghai, EIP-3860), access-list entries (EIP-2930), and 25,000 per authorization (EIP-7702).

calldata_floor_gas_cost(tx, hardfork)

@spec calldata_floor_gas_cost(EEVM.TxEnv.t(), EEVM.HardforkConfig.t()) ::
  non_neg_integer()

EIP-7623 calldata floor from Prague, 0 before.

minimum_gas_limit(tx, hardfork)

@spec minimum_gas_limit(EEVM.TxEnv.t(), EEVM.HardforkConfig.t()) :: non_neg_integer()

Lowest valid gas limit: the larger of intrinsic gas and the calldata floor.