EEVM.Interpreter.Instructions.ControlFlow (eevm v0.1.0)

Copy Markdown View Source

Opcodes for program counter manipulation and stack data loading.

Covers:

  • Branching: JUMP (0x56), JUMPI (0x57) — destination must land on a JUMPDEST (0x5B) byte.
  • PUSH: PUSH0 (0x5F, EIP-3855), PUSH1-PUSH32 (0x60-0x7F).
  • DUP: DUP1-DUP16 (0x80-0x8F).
  • SWAP: SWAP1-SWAP16 (0x90-0x9F).
  • PC (0x58) and JUMPDEST (0x5B).

Summary

Functions

Dispatches a control flow opcode to its implementation.

Functions

execute(op, state)

Dispatches a control flow opcode to its implementation.

Called by the executor for JUMP, JUMPI, PC, JUMPDEST, PUSH0, PUSH1-PUSH32, DUP1-DUP16, and SWAP1-SWAP16. Returns {:ok, new_state} on success or {:error, reason, state} on failure.