Stack

class eth.vm.stack.Stack

VM Stack

dup(position: int) None

Perform a DUP operation on the stack.

pop1_any() int | bytes

Pop and return an element from the stack. The type of each element will be int or bytes, depending on whether it was pushed with push_bytes or push_int.

Raise eth.exceptions.InsufficientStack if the stack was empty.

pop1_bytes() bytes

Pop and return a bytes element from the stack.

Raise eth.exceptions.InsufficientStack if the stack was empty.

pop1_int() int

Pop and return an integer from the stack.

Raise eth.exceptions.InsufficientStack if the stack was empty.

pop_any(num_items: int) Tuple[int | bytes, ...]

Pop and return a tuple of items of length num_items from the stack. The type of each element will be int or bytes, depending on whether it was pushed with stack_push_bytes or stack_push_int.

Raise eth.exceptions.InsufficientStack if there are not enough items on the stack.

Items are ordered with the top of the stack as the first item in the tuple.

pop_bytes(num_items: int) Tuple[bytes, ...]

Pop and return a tuple of bytes of length num_items from the stack.

Raise eth.exceptions.InsufficientStack if there are not enough items on the stack.

Items are ordered with the top of the stack as the first item in the tuple.

pop_ints(num_items: int) Tuple[int, ...]

Pop and return a tuple of integers of length num_items from the stack.

Raise eth.exceptions.InsufficientStack if there are not enough items on the stack.

Items are ordered with the top of the stack as the first item in the tuple.

push_bytes(value: bytes) None

Push a bytes item onto the stack.

push_int(value: int) None

Push an integer item onto the stack.

swap(position: int) None

Perform a SWAP operation on the stack.

logger = <Logger eth.vm.stack.Stack (WARNING)>
values