evm package

Subpackages

Submodules

evm.constants module

evm.exceptions module

exception evm.exceptions.BlockNotFound

Bases: evm.exceptions.PyEVMError

The block with the given number/hash does not exist.

exception evm.exceptions.CanonicalHeadNotFound

Bases: evm.exceptions.PyEVMError

The chain has no canonical head.

exception evm.exceptions.ContractCreationCollision

Bases: evm.exceptions.VMError

Error signaling that there was an address collision during contract creation.

exception evm.exceptions.FullStack

Bases: evm.exceptions.VMError

Error signaling that the stack is full.

exception evm.exceptions.Halt

Bases: evm.exceptions.PyEVMError

Raised by opcode function to halt vm execution.

exception evm.exceptions.InsufficientFunds

Bases: evm.exceptions.VMError

Error signaling that an account has insufficient funds to transfer the requested value.

exception evm.exceptions.InsufficientStack

Bases: evm.exceptions.VMError

Error signaling that the stack is empty.

exception evm.exceptions.InvalidInstruction

Bases: evm.exceptions.VMError

Error signaling that an opcode is invalid.

exception evm.exceptions.InvalidJumpDestination

Bases: evm.exceptions.VMError

Error signaling that the jump destination for a JUMPDEST operation is invalid.

exception evm.exceptions.OutOfBoundsRead

Bases: evm.exceptions.VMError

Error raised to indicate an attempt was made to read data beyond the boundaries of the buffer (such as with RETURNDATACOPY)

exception evm.exceptions.OutOfGas

Bases: evm.exceptions.VMError

Error signaling that VM execution has run out of gas.

exception evm.exceptions.ParentNotFound

Bases: evm.exceptions.PyEVMError

The parent of a given block does not exist.

exception evm.exceptions.PyEVMError

Bases: Exception

Base error class for all py-evm errors.

exception evm.exceptions.Revert

Bases: evm.exceptions.VMError

Error used by the REVERT opcode

burns_gas = False
zeros_return_data = False
exception evm.exceptions.StackDepthLimit

Bases: evm.exceptions.VMError

Error signaling that the call stack has exceeded it’s maximum allowed depth.

exception evm.exceptions.VMError

Bases: evm.exceptions.PyEVMError

Class of errors which can be raised during VM execution.

burns_gas = True
zeros_return_data = True
exception evm.exceptions.VMNotFound

Bases: evm.exceptions.PyEVMError

No VM available for the provided block number.

exception evm.exceptions.ValidationError

Bases: evm.exceptions.PyEVMError

Error to signal something does not pass a validation check.

exception evm.exceptions.WriteProtection

Bases: evm.exceptions.VMError

Error raised if an attempt to modify the state database is made while operating inside of a STATICCALL context.

evm.lightchain_shell module

evm.mnemonics module

evm.opcode module

class evm.opcode.Opcode

Bases: object

classmethod as_opcode(logic_fn, mnemonic, gas_cost)

Class factory method for turning vanilla functions into Opcode classes.

classmethod configure(name, **overrides)

Class factory method for simple inline subclassing.

gas_cost = None
logger
mnemonic = None

evm.opcode_values module

evm.validation module

evm.validation.validate_block_number(block_number, title='Block Number')
evm.validation.validate_canonical_address(value, title='Value')
evm.validation.validate_gt(value, minimum, title='Value')
evm.validation.validate_gte(value, minimum, title='Value')
evm.validation.validate_header_params_for_configuration(header_params)
evm.validation.validate_is_boolean(value, title='Value')
evm.validation.validate_is_bytes(value, title='Value')
evm.validation.validate_is_integer(value, title='Value')
evm.validation.validate_length(value, length, title='Value')
evm.validation.validate_length_lte(value, maximum_length, title='Value')
evm.validation.validate_lt(value, maximum, title='Value')
evm.validation.validate_lte(value, maximum, title='Value')
evm.validation.validate_multiple_of(value, multiple_of, title='Value')
evm.validation.validate_stack_item(value)
evm.validation.validate_uint256(value, title='Value')
evm.validation.validate_unique(values, title='Value')
evm.validation.validate_vm_block_numbers(vm_block_numbers)
evm.validation.validate_word(value, title='Value')

Module contents