Module gas

Source
Expand description

EVM gas calculation utilities.

Structs§

Gas
Represents the state of gas during execution.

Constants§

ACCESS_LIST_ADDRESS
ACCESS_LIST_STORAGE_KEY
BASE
BLOCKHASH
CALLVALUE
CALL_STIPEND
CODEDEPOSIT
COLD_ACCOUNT_ACCESS_COST
COLD_SLOAD_COST
CONDITION_JUMP_GAS
COPY
CREATE
DATA_LOADN_GAS
DATA_LOAD_GAS
EOF_CREATE_GAS
EXP
HIGH
INITCODE_WORD_COST
EIP-3860 : Limit and meter initcode
INSTANBUL_SLOAD_GAS
EIP-1884: Repricing for trie-size-dependent opcodes
JUMPDEST
KECCAK256
KECCAK256WORD
LOG
LOGDATA
LOGTOPIC
LOW
MEMORY
MID
MIN_CALLEE_GAS
NEWACCOUNT
REFUND_SSTORE_CLEARS
RETF_GAS
SELFDESTRUCT
SSTORE_RESET
SSTORE_SET
TRANSACTION_NON_ZERO_DATA_FRONTIER
TRANSACTION_NON_ZERO_DATA_INIT
TRANSACTION_ZERO_DATA
VERYLOW
WARM_SSTORE_RESET
WARM_STORAGE_READ_COST
ZERO

Functions§

call_cost
Calculate call gas cost for the call instruction.
cost_per_word
Calculate the cost of buffer per word.
create2_cost
CREATE2 opcode cost calculation.
exp_cost
EXP opcode cost calculation.
extcodecopy_cost
EXTCODECOPY opcode cost calculation.
initcode_cost
EIP-3860: Limit and meter initcode
keccak256_cost
KECCAK256 opcode cost calculation.
log_cost
LOG opcode cost calculation.
memory_gas
Memory expansion cost calculation for a given number of words.
memory_gas_for_len
Memory expansion cost calculation for a given memory length.
selfdestruct_cost
SELFDESTRUCT opcode cost calculation.
sload_cost
SLOAD opcode cost calculation.
sstore_cost
SSTORE opcode cost calculation.
sstore_refund
SSTORE opcode refund calculation.
validate_initial_tx_gas
Initial gas that is deducted for transaction to be included. Initial gas contains initial stipend gas, gas for access list and input data.
verylowcopy_cost
*COPY opcodes cost calculation.
warm_cold_cost
Berlin warm and cold storage access cost for account access.
warm_cold_cost_with_delegation
Berlin warm and cold storage access cost for account access.