Skip to main content
@tevm/voltaire
@tevm/voltaire / evm / Block

Block

Functions

handler_0x40_BLOCKHASH()

handler_0x40_BLOCKHASH(frame): EvmError | null
Defined in: src/evm/block/0x40_BLOCKHASH.js:17 BLOCKHASH opcode (0x40) - Get hash of recent block Per Python reference (cancun/vm/instructions/block.py:21-64):
  • Charges GAS_BLOCK_HASH (20 gas)
  • Returns hash of one of the 256 most recent complete blocks
  • Returns 0 if block number is out of range (too old or >= current)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x41_COINBASE()

handler_0x41_COINBASE(frame): EvmError | null
Defined in: src/evm/block/0x41_COINBASE.js:11 COINBASE opcode (0x41) - Get block coinbase address

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x42_TIMESTAMP()

handler_0x42_TIMESTAMP(frame): EvmError | null
Defined in: src/evm/block/0x42_TIMESTAMP.js:11 TIMESTAMP opcode (0x42) - Get block timestamp

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x43_NUMBER()

handler_0x43_NUMBER(frame): EvmError | null
Defined in: src/evm/block/0x43_NUMBER.js:11 NUMBER opcode (0x43) - Get block number

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x44_DIFFICULTY()

handler_0x44_DIFFICULTY(frame): EvmError | null
Defined in: src/evm/block/0x44_DIFFICULTY.js:14 DIFFICULTY/PREVRANDAO opcode (0x44) - Get block difficulty or prevrandao Pre-Merge: returns block difficulty Post-Merge: returns prevrandao value

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x45_GASLIMIT()

handler_0x45_GASLIMIT(frame): EvmError | null
Defined in: src/evm/block/0x45_GASLIMIT.js:11 GASLIMIT opcode (0x45) - Get block gas limit

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x46_CHAINID()

handler_0x46_CHAINID(frame): EvmError | null
Defined in: src/evm/block/0x46_CHAINID.js:11 CHAINID opcode (0x46) - Get chain ID (EIP-1344, Istanbul+)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x47_SELFBALANCE()

handler_0x47_SELFBALANCE(frame): EvmError | null
Defined in: src/evm/block/0x47_SELFBALANCE.js:11 SELFBALANCE opcode (0x47) - Get balance of currently executing account (EIP-1884, Istanbul+)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x48_BASEFEE()

handler_0x48_BASEFEE(frame): EvmError | null
Defined in: src/evm/block/0x48_BASEFEE.js:11 BASEFEE opcode (0x48) - Get base fee per gas (EIP-3198, London+)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x49_BLOBHASH()

handler_0x49_BLOBHASH(frame): EvmError | null
Defined in: src/evm/block/0x49_BLOBHASH.js:15 BLOBHASH opcode (0x49) - Get versioned blob hash (EIP-4844, Cancun+) Per Python reference (cancun/vm/gas.py:68):
  • GAS_BLOBHASH_OPCODE = 3 (same as GasFastestStep)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails

handler_0x4a_BLOBBASEFEE()

handler_0x4a_BLOBBASEFEE(frame): EvmError | null
Defined in: src/evm/block/0x4a_BLOBBASEFEE.js:15 BLOBBASEFEE opcode (0x4a) - Get blob base fee (EIP-7516, Cancun+) Per Python reference (cancun/vm/gas.py and BlobBaseFeeGas constant):
  • GAS_BASE = 2 (same as GasQuickStep)
  • Returns blob_base_fee calculated from excess_blob_gas

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if operation fails