Skip to main content

Module opcode

Module opcode 

Source

Structs§

Opcode
An opcode and its immediate data. Returned by OpcodesIter.
OpcodesIter
An iterator that yields opcodes and their immediate data.
OpcodesIterWithPc
A bytecode iterator that yields opcodes and their immediate data, alongside the program counter.

Functions§

compute_stack_io 🔒
Returns the real (inputs, outputs) stack I/O for an opcode, decoding the immediate for DUPN, SWAPN, and EXCHANGE whose opcode-table entries are placeholders.
decode_pair
Decodes an EXCHANGE immediate byte into a pair of stack indices (n, m).
decode_single
Decodes a DUPN/SWAPN immediate byte into a stack index.
encode_pair
Encodes a pair of stack indices into an EXCHANGE immediate byte.
encode_single
Encodes a stack index into a DUPN/SWAPN immediate byte.
format_bytecode
Returns a string representation of the given bytecode.
format_bytecode_to
Formats an EVM bytecode to the given writer.
min_imm_len
Returns the length of the immediate data for the given opcode, or 0 if none.
stack_io
Returns the number of input and output stack elements of the given opcode.