1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// === YELLOW PAPER constants ===
/// Base gas cost for each non contract creating transaction
pub const TX_GAS_COST: u64 = 21000;
/// Base gas cost for each contract creating transaction
pub const TX_CREATE_GAS_COST: u64 = 53000;
// Gas cost for each zero byte on transaction data
pub const TX_DATA_ZERO_GAS_COST: u64 = 4;
// Gas cost for each init code word on transaction data
pub const TX_INIT_CODE_WORD_GAS_COST: u64 = 2;
// Gas cost for each address specified on access lists
pub const TX_ACCESS_LIST_ADDRESS_GAS: u64 = 2400;
// Gas cost for each storage key specified on access lists
pub const TX_ACCESS_LIST_STORAGE_KEY_GAS: u64 = 1900;
// Gas cost for each non zero byte on transaction data
pub const TX_DATA_NON_ZERO_GAS: u64 = 68;
// === EIP-170 constants ===
// Max bytecode size
pub const MAX_CODE_SIZE: u32 = 0x6000;
// EIP-7954 (Amsterdam): increased max bytecode size
pub const AMSTERDAM_MAX_CODE_SIZE: u32 = 0x8000;
// === EIP-3860 constants ===
// Max contract creation bytecode size
pub const MAX_INITCODE_SIZE: u32 = 2 * MAX_CODE_SIZE;
// EIP-7954 (Amsterdam): increased max initcode size
pub const AMSTERDAM_MAX_INITCODE_SIZE: u32 = 2 * AMSTERDAM_MAX_CODE_SIZE;
// === EIP-2028 constants ===
// Gas cost for each non zero byte on transaction data
pub const TX_DATA_NON_ZERO_GAS_EIP2028: u64 = 16;
// === EIP-4844 constants ===
pub const GAS_LIMIT_BOUND_DIVISOR: u64 = 1024;
pub const MIN_GAS_LIMIT: u64 = 5000;
// === EIP-7825 constants ===
// https://eips.ethereum.org/EIPS/eip-7825
pub const POST_OSAKA_GAS_LIMIT_CAP: u64 = 16777216;
// === EIP-7981 / EIP-7976 constants (Amsterdam+) ===
// access_list_bytes * STANDARD_TOKEN_COST(4) * TOTAL_COST_FLOOR_PER_TOKEN(16) = access_list_bytes * 64
// Per address entry: 20 bytes * 64 = 1280
pub const TX_ACCESS_LIST_ADDRESS_DATA_GAS_AMSTERDAM: u64 = 1280;
// Per storage key entry: 32 bytes * 64 = 2048
pub const TX_ACCESS_LIST_STORAGE_KEY_DATA_GAS_AMSTERDAM: u64 = 2048;