Skip to main content
Cubipods implements a subset of Ethereum Virtual Machine (EVM) opcodes. These opcodes are the fundamental instructions that make up EVM bytecode and define how smart contracts execute.

What are Opcodes?

Opcodes (operation codes) are single-byte instructions that the EVM executes. Each opcode performs a specific operation such as arithmetic, logic, stack manipulation, memory/storage access, or cryptographic operations. In bytecode, opcodes appear as two-digit hexadecimal values (e.g., 0x01 for ADD, 0x60 for PUSH1). Some opcodes, like PUSH, take additional bytes as operands.

Categories

Opcodes are organized into the following categories:
  • Arithmetic - Mathematical operations (ADD, MUL, SUB, DIV, MOD, EXP)
  • Comparison - Comparison and equality operations (LT, GT, EQ, ISZERO)
  • Bitwise - Bitwise logical operations (AND, OR, XOR, NOT, BYTE)
  • Stack - Stack manipulation (POP, PUSH, DUP, SWAP)
  • Memory - Memory operations (MLOAD, MSTORE)
  • Storage - Persistent storage operations (SLOAD, SSTORE)
  • Cryptographic - Hash functions (KECCAK256)

Supported Opcodes

Here is the complete list of opcodes currently supported by Cubipods:
OpcodeHexCategoryDescription
STOP0x00ControlHalts execution
ADD0x01ArithmeticAddition
MUL0x02ArithmeticMultiplication
SUB0x03ArithmeticSubtraction
DIV0x04ArithmeticInteger division
MOD0x06ArithmeticModulo operation
EXP0x0aArithmeticExponentiation
LT0x10ComparisonLess than
GT0x11ComparisonGreater than
EQ0x14ComparisonEquality
ISZERO0x15ComparisonIs zero
AND0x16BitwiseBitwise AND
OR0x17BitwiseBitwise OR
XOR0x18BitwiseBitwise XOR
NOT0x19BitwiseBitwise NOT
BYTE0x1aBitwiseExtract byte
KECCAK2560x20CryptoKeccak-256 hash
POP0x50StackRemove top item
MLOAD0x51MemoryLoad from memory
MSTORE0x52MemoryStore to memory
SLOAD0x54StorageLoad from storage
SSTORE0x55StorageStore to storage
PUSH0-PUSH320x5f-0x7fStackPush N bytes onto stack
DUP1-DUP160x80-0x8fStackDuplicate stack item
SWAP1-SWAP160x90-0x9fStackSwap stack items

Implementation Reference

All opcode implementations can be found in the source code:
  • Opcode definitions: src/instruction.rs:11-37
  • Opcode execution: src/vm.rs:144-343

Next Steps

Arithmetic Opcodes

Learn about mathematical operations

Stack Opcodes

Understand stack manipulation

Memory Opcodes

Work with volatile memory

Storage Opcodes

Manage persistent storage

Build docs developers (and LLMs) love