Skip to content
opcodes

Opcodes Overview

The instruction set of the EVM.

Opcodes are the individual instructions that the EVM understands. There are over 140 unique opcodes, ranging from simple arithmetic (ADD, MUL) to environment queries (BALANCE, BLOCKHASH) and state manipulation (SSTORE, LOG). Each opcode is represented by a single byte (0x00 to 0xff).

Execution Simulation

Assistant Note

"Currently at PUSH instruction. It's going to place a value on top of the stack."

Program

8 bytes
0000
PUSH10x05
Place 1-byte item on stack
0002
PUSH10x04
0004
MUL
0005
PUSH10x03
0007
ADD

Stack

LIFO
0 / 1024
Stack is empty

Most opcodes pop their arguments from here.

Memory

0 bytes
00-0708-1516-2324-31
Memory is uninitialized
Memory is byte-addressable and volatile. It expands as you write to new offsets.

Gas Meter

Consumed0 / 1,000,000
Last Op Cost
-0
Refund
0
* Gas prevents infinite loops and DDoS. SSTORE is the most expensive opcode (20,000 gas for new slots).