revm_interpreter/gas/
constants.rs

1pub const ZERO: u64 = 0;
2pub const BASE: u64 = 2;
3
4pub const VERYLOW: u64 = 3;
5pub const DATA_LOADN_GAS: u64 = 3;
6
7pub const CONDITION_JUMP_GAS: u64 = 4;
8pub const RETF_GAS: u64 = 3;
9pub const DATA_LOAD_GAS: u64 = 4;
10
11pub const LOW: u64 = 5;
12pub const MID: u64 = 8;
13pub const HIGH: u64 = 10;
14pub const JUMPDEST: u64 = 1;
15pub const SELFDESTRUCT: i64 = 24000;
16pub const CREATE: u64 = 32000;
17pub const CALLVALUE: u64 = 9000;
18pub const NEWACCOUNT: u64 = 25000;
19pub const EXP: u64 = 10;
20pub const MEMORY: u64 = 3;
21pub const LOG: u64 = 375;
22pub const LOGDATA: u64 = 8;
23pub const LOGTOPIC: u64 = 375;
24pub const KECCAK256: u64 = 30;
25pub const KECCAK256WORD: u64 = 6;
26pub const COPY: u64 = 3;
27pub const BLOCKHASH: u64 = 20;
28pub const CODEDEPOSIT: u64 = 200;
29
30/// EIP-1884: Repricing for trie-size-dependent opcodes
31pub const ISTANBUL_SLOAD_GAS: u64 = 800;
32pub const SSTORE_SET: u64 = 20000;
33pub const SSTORE_RESET: u64 = 5000;
34pub const REFUND_SSTORE_CLEARS: i64 = 15000;
35
36/// The standard cost of calldata token.
37pub const STANDARD_TOKEN_COST: u64 = 4;
38/// The cost of a non-zero byte in calldata.
39pub const NON_ZERO_BYTE_DATA_COST: u64 = 68;
40/// The multiplier for a non zero byte in calldata.
41pub const NON_ZERO_BYTE_MULTIPLIER: u64 = NON_ZERO_BYTE_DATA_COST / STANDARD_TOKEN_COST;
42/// The cost of a non-zero byte in calldata adjusted by [EIP-2028](https://eips.ethereum.org/EIPS/eip-2028).
43pub const NON_ZERO_BYTE_DATA_COST_ISTANBUL: u64 = 16;
44/// The multiplier for a non zero byte in calldata adjusted by [EIP-2028](https://eips.ethereum.org/EIPS/eip-2028).
45pub const NON_ZERO_BYTE_MULTIPLIER_ISTANBUL: u64 =
46    NON_ZERO_BYTE_DATA_COST_ISTANBUL / STANDARD_TOKEN_COST;
47// The cost floor per token as defined by [EIP-2028](https://eips.ethereum.org/EIPS/eip-2028).
48pub const TOTAL_COST_FLOOR_PER_TOKEN: u64 = 10;
49
50pub const EOF_CREATE_GAS: u64 = 32000;
51
52// Berlin eip2929 constants
53pub const ACCESS_LIST_ADDRESS: u64 = 2400;
54pub const ACCESS_LIST_STORAGE_KEY: u64 = 1900;
55pub const COLD_SLOAD_COST: u64 = 2100;
56pub const COLD_ACCOUNT_ACCESS_COST: u64 = 2600;
57pub const WARM_STORAGE_READ_COST: u64 = 100;
58pub const WARM_SSTORE_RESET: u64 = SSTORE_RESET - COLD_SLOAD_COST;
59
60/// EIP-3860 : Limit and meter initcode
61pub const INITCODE_WORD_COST: u64 = 2;
62
63pub const CALL_STIPEND: u64 = 2300;
64pub const MIN_CALLEE_GAS: u64 = CALL_STIPEND;