00 | STOP | - | - | STOP() | halts execution of the contract |
01 | ADD | | | a + b | (u)int256 addition modulo 2**256 |
02 | MUL | | | a * b | (u)int256 multiplication modulo 2**256 |
03 | SUB | | | a - b | (u)int256 subtraction modulo 2**256 |
04 | DIV | | | a // b | uint256 division |
05 | SDIV | | | a // b | int256 division |
06 | MOD | | | a % b | uint256 modulus |
07 | SMOD | | | a % b | int256 modulus |
08 | ADDMOD | | | (a + b) % N | (u)int256 addition modulo N |
09 | MULMOD | | | (a * b) % N | (u)int256 multiplication modulo N |
0A | EXP | | | a ** b | uint256 exponentiation modulo 2**256 |
0B | SIGNEXTEND | | | y = SIGNEXTEND(x, b) | sign extends x from (b + 1) * 8 bits to 256 bits. |
0C | Invalid | - | - | - | - |
0D | Invalid | - | - | - | - |
0E | Invalid | - | - | - | - |
0F | Invalid | - | - | - | - |
10 | LT | | | a < b | uint256 comparison |
11 | GT | | | a > b | uint256 comparison |
12 | SLT | | | a < b | int256 comparison |
13 | SGT | | | a > b | int256 comparison |
14 | EQ | | | a == b | (u)int256 equality |
15 | ISZERO | | | a == 0 | (u)int256 is zero |
16 | AND | | | a & b | 256-bit bitwise and |
17 | OR | | | a | b | 256-bit bitwise or |
18 | XOR | | | a ^ b | 256-bit bitwise xor |
19 | NOT | | | ~a | 256-bit bitwise not |
1A | BYTE | | | y = (x >> (248 - i * 8)) & 0xFF | ith byte of (u)int256 x, counting from most significant byte |
1B | SHL | | | value << shift | 256-bit shift left |
1C | SHR | | | value >> shift | 256-bit shift right |
1D | SAR | | | value >> shift | int256 shift right |
1E | Invalid | - | - | - | - |
1F | Invalid | - | - | - | - |
20 | SHA3 | | | hash = keccak256(memory[offset:offset+length]) | keccak256 |
21 | Invalid | - | - | - | - |
22 | Invalid | - | - | - | - |
23 | Invalid | - | - | - | - |
24 | Invalid | - | - | - | - |
25 | Invalid | - | - | - | - |
26 | Invalid | - | - | - | - |
27 | Invalid | - | - | - | - |
28 | Invalid | - | - | - | - |
29 | Invalid | - | - | - | - |
2A | Invalid | - | - | - | - |
2B | Invalid | - | - | - | - |
2C | Invalid | - | - | - | - |
2D | Invalid | - | - | - | - |
2E | Invalid | - | - | - | - |
2F | Invalid | - | - | - | - |
30 | ADDRESS | - | | address(this) | address of the executing contract |
31 | BALANCE | | | address(addr).balance | address balance in wei |
32 | ORIGIN | - | | tx.origin | transaction origin address |
33 | CALLER | - | | msg.caller | message caller address |
34 | CALLVALUE | - | | msg.value | message funds in wei |
35 | CALLDATALOAD | | | msg.data[i:i+32] | reads a (u)int256 from message data |
36 | CALLDATASIZE | - | | msg.data.size | message data length in bytes |
37 | CALLDATACOPY | | - | memory[destOffset:destOffset+length] =
msg.data[offset:offset+length] | copy message data |
38 | CODESIZE | - | | address(this).code.size | length of the executing contract's code in bytes |
39 | CODECOPY | | - | memory[destOffset:destOffset+length] =
address(this).code[offset:offset+length] | copy executing contract's bytecode |
3A | GASPRICE | - | | tx.gasprice | gas price of the executing transaction, in wei per unit of gas |
3B | EXTCODESIZE | | | address(addr).code.size | length of the contract bytecode at addr, in bytes |
3C | EXTCODECOPY | addr | destOffset | offset | length | |
| - | memory[destOffset:destOffset+length] =
address(addr).code[offset:offset+length] | copy contract's bytecode |
3D | RETURNDATASIZE | - | | size = RETURNDATASIZE() | Byzantium hardfork, EIP-211: the size of the returned data from the last external call, in bytes |
3E | RETURNDATACOPY | | - | memory[destOffset:destOffset+length] =
RETURNDATA[offset:offset+length] | Byzantium hardfork, EIP-211: copy returned data |
3F | EXTCODEHASH | | | hash = address(addr).exists ?
keccak256(address(addr).code) : 0 | Constantinople hardfork, EIP-1052: hash of the contract bytecode at addr |
40 | BLOCKHASH | | | hash = block.blockHash(blockNumber) | hash of the specific block, only valid for the 256 most recent blocks, excluding the current one |
41 | COINBASE | - | | block.coinbase | address of the current block's miner |
42 | TIMESTAMP | - | | block.timestamp | current block's Unix timestamp in seconds |
43 | NUMBER | - | | block.number | current block's number |
44 | DIFFICULTY | - | | block.difficulty | current block's difficulty |
45 | GASLIMIT | - | | block.gaslimit | current block's gas limit |
46 | CHAINID | - | | chain_id = { 1 // mainnet
{ 2 // Morden testnet (disused)
{ 2 // Expanse mainnet
{ 3 // Ropsten testnet
{ 4 // Rinkeby testnet
{ 5 // Goerli testnet
{ 42 // Kovan testnet
{ ... | Istanbul hardfork, EIP-1344: current network's chain id |
47 | SELFBALANCE | - | | address(this).balance | Istanbul hardfork, EIP-1884: balance of the executing contract in wei |
48 | BASEFEE | - | | base_fee = BASEFEE() | London hardfork, EIP-3198: current block's base fee |
49 | BLOBHASH | | tx.blob_versioned_hashes[index] | |
| tx.blob_versioned_hashes[index] | Cancun hardfork, EIP-4844: the executing transaction's indexth blob versioned hash |
4A | BLOBBASEFEE | - | | blob_base_fee = BLOBBASEFEE() | Cancun hardfork, EIP-7516: current block's blob base fee |
4B | Invalid | - | - | - | - |
4C | Invalid | - | - | - | - |
4D | Invalid | - | - | - | - |
4E | Invalid | - | - | - | - |
4F | Invalid | - | - | - | - |
50 | POP | | - | POP() | pops a (u)int256 off the stack and discards it |
51 | MLOAD | | | value = memory[offset:offset+32] | reads a (u)int256 from memory |
52 | MSTORE | | - | memory[offset:offset+32] = value | writes a (u)int256 to memory |
53 | MSTORE8 | | - | memory[offset] = value & 0xFF | writes a uint8 to memory |
54 | SLOAD | | | value = storage[key] | reads a (u)int256 from storage |
55 | SSTORE | | - | storage[key] = value | writes a (u)int256 to storage |
56 | JUMP | | - | $pc = destination | unconditional jump |
57 | JUMPI | | - | $pc = cond ? destination : $pc + 1 | conditional jump if condition is truthy |
58 | PC | - | | $pc | program counter |
59 | MSIZE | - | | size = MSIZE() | size of memory for this contract execution, in bytes |
5A | GAS | - | | gasRemaining = GAS() | remaining gas |
5B | JUMPDEST | - | - | | metadata to annotate possible jump destinations |
5C | TLOAD | | | value = transient[key] | Cancun hardfork, EIP-1153: reads a (u)int256 from transient storage |
5D | TSTORE | | - | transient[key] = value | Cancun hardfork, EIP-1153: writes a (u)int256 to transient storage |
5E | MCOPY | | - | memory[destOffset:destOffset+length] =
memory[offset:offset+length] | Cancun hardfork, EIP-5656: copy memory |
5F | PUSH0 | - | | PUSH(0) | Shanghai hardfork, EIP-3855: pushes 0 onto the stack |
60 | PUSH1 | - | | PUSH(uint8) | pushes a 1-byte value onto the stack |
61 | PUSH2 | - | | PUSH(uint16) | pushes a 2-byte value onto the stack |
62 | PUSH3 | - | | PUSH(uint24) | pushes a 3-byte value onto the stack |
63 | PUSH4 | - | | PUSH(uint32) | pushes a 4-byte value onto the stack |
64 | PUSH5 | - | | PUSH(uint40) | pushes a 5-byte value onto the stack |
65 | PUSH6 | - | | PUSH(uint48) | pushes a 6-byte value onto the stack |
66 | PUSH7 | - | | PUSH(uint56) | pushes a 7-byte value onto the stack |
67 | PUSH8 | - | | PUSH(uint64) | pushes a 8-byte value onto the stack |
68 | PUSH9 | - | | PUSH(uint72) | pushes a 9-byte value onto the stack |
69 | PUSH10 | - | | PUSH(uint80) | pushes a 10-byte value onto the stack |
6A | PUSH11 | - | | PUSH(uint88) | pushes a 11-byte value onto the stack |
6B | PUSH12 | - | | PUSH(uint96) | pushes a 12-byte value onto the stack |
6C | PUSH13 | - | | PUSH(uint104) | pushes a 13-byte value onto the stack |
6D | PUSH14 | - | | PUSH(uint112) | pushes a 14-byte value onto the stack |
6E | PUSH15 | - | | PUSH(uint120) | pushes a 15-byte value onto the stack |
6F | PUSH16 | - | | PUSH(uint128) | pushes a 16-byte value onto the stack |
70 | PUSH17 | - | | PUSH(uint136) | pushes a 17-byte value onto the stack |
71 | PUSH18 | - | | PUSH(uint144) | pushes a 18-byte value onto the stack |
72 | PUSH19 | - | | PUSH(uint152) | pushes a 19-byte value onto the stack |
73 | PUSH20 | - | | PUSH(uint160) | pushes a 20-byte value onto the stack |
74 | PUSH21 | - | | PUSH(uint168) | pushes a 21-byte value onto the stack |
75 | PUSH22 | - | | PUSH(uint176) | pushes a 22-byte value onto the stack |
76 | PUSH23 | - | | PUSH(uint184) | pushes a 23-byte value onto the stack |
77 | PUSH24 | - | | PUSH(uint192) | pushes a 24-byte value onto the stack |
78 | PUSH25 | - | | PUSH(uint200) | pushes a 25-byte value onto the stack |
79 | PUSH26 | - | | PUSH(uint208) | pushes a 26-byte value onto the stack |
7A | PUSH27 | - | | PUSH(uint216) | pushes a 27-byte value onto the stack |
7B | PUSH28 | - | | PUSH(uint224) | pushes a 28-byte value onto the stack |
7C | PUSH29 | - | | PUSH(uint232) | pushes a 29-byte value onto the stack |
7D | PUSH30 | - | | PUSH(uint240) | pushes a 30-byte value onto the stack |
7E | PUSH31 | - | | PUSH(uint248) | pushes a 31-byte value onto the stack |
7F | PUSH32 | - | | PUSH(uint256) | pushes a 32-byte value onto the stack |
80 | DUP1 | | | PUSH(value) | clones the last value on the stack |
81 | DUP2 | | | PUSH(value) | clones the 2nd last value on the stack |
82 | DUP3 | | | PUSH(value) | clones the 3rd last value on the stack |
83 | DUP4 | | | PUSH(value) | clones the 4th last value on the stack |
84 | DUP5 | | | PUSH(value) | clones the 5th last value on the stack |
85 | DUP6 | | | PUSH(value) | clones the 6th last value on the stack |
86 | DUP7 | | | PUSH(value) | clones the 7th last value on the stack |
87 | DUP8 | | | PUSH(value) | clones the 8th last value on the stack |
88 | DUP9 | | | PUSH(value) | clones the 9th last value on the stack |
89 | DUP10 | | | PUSH(value) | clones the 10th last value on the stack |
8A | DUP11 | | | PUSH(value) | clones the 11th last value on the stack |
8B | DUP12 | | | PUSH(value) | clones the 12th last value on the stack |
8C | DUP13 | | | PUSH(value) | clones the 13th last value on the stack |
8D | DUP14 | | | PUSH(value) | clones the 14th last value on the stack |
8E | DUP15 | | | PUSH(value) | clones the 15th last value on the stack |
8F | DUP16 | | | PUSH(value) | clones the 16th last value on the stack |
90 | SWAP1 | | | a, b = b, a | swaps the last two values on the stack |
91 | SWAP2 | | | a, b = b, a | swaps the top of the stack with the 3rd last element |
92 | SWAP3 | | | a, b = b, a | swaps the top of the stack with the 4th last element |
93 | SWAP4 | | | a, b = b, a | swaps the top of the stack with the 5th last element |
94 | SWAP5 | | | a, b = b, a | swaps the top of the stack with the 6th last element |
95 | SWAP6 | | | a, b = b, a | swaps the top of the stack with the 7th last element |
96 | SWAP7 | | | a, b = b, a | swaps the top of the stack with the 8th last element |
97 | SWAP8 | | | a, b = b, a | swaps the top of the stack with the 9th last element |
98 | SWAP9 | | | a, b = b, a | swaps the top of the stack with the 10th last element |
99 | SWAP10 | | | a, b = b, a | swaps the top of the stack with the 11th last element |
9A | SWAP11 | | | a, b = b, a | swaps the top of the stack with the 12th last element |
9B | SWAP12 | | | a, b = b, a | swaps the top of the stack with the 13th last element |
9C | SWAP13 | | | a, b = b, a | swaps the top of the stack with the 14th last element |
9D | SWAP14 | | | a, b = b, a | swaps the top of the stack with the 15th last element |
9E | SWAP15 | | | a, b = b, a | swaps the top of the stack with the 16th last element |
9F | SWAP16 | | | a, b = b, a | swaps the top of the stack with the 17th last element |
A0 | LOG0 | | - | LOG0(memory[offset:offset+length]) | fires an event |
A1 | LOG1 | | - | LOG1(memory[offset:offset+length], topic0) | fires an event |
A2 | LOG2 | | - | LOG2(memory[offset:offset+length], topic0, topic1) | fires an event |
A3 | LOG3 | offset | length | topic0 | topic1 | topic2 | |
| - | LOG3(memory[offset:offset+length], topic0, topic1,
topic2) | fires an event |
A4 | LOG4 | offset | length | topic0 | topic1 | topic2 | topic3 | |
| - | LOG4(memory[offset:offset+length], topic0, topic1,
topic2, topic3) | fires an event |
A5 | Invalid | - | - | - | - |
A6 | Invalid | - | - | - | - |
A7 | Invalid | - | - | - | - |
A8 | Invalid | - | - | - | - |
A9 | Invalid | - | - | - | - |
AA | Invalid | - | - | - | - |
AB | Invalid | - | - | - | - |
AC | Invalid | - | - | - | - |
AD | Invalid | - | - | - | - |
AE | Invalid | - | - | - | - |
AF | Invalid | - | - | - | - |
B0 | PUSH | - | - | ??? | ??? |
B1 | DUP | - | - | ??? | ??? |
B2 | SWAP | - | - | ??? | ??? |
B3 | Invalid | - | - | - | - |
B4 | Invalid | - | - | - | - |
B5 | Invalid | - | - | - | - |
B6 | Invalid | - | - | - | - |
B7 | Invalid | - | - | - | - |
B8 | Invalid | - | - | - | - |
B9 | Invalid | - | - | - | - |
BA | Invalid | - | - | - | - |
BB | Invalid | - | - | - | - |
BC | Invalid | - | - | - | - |
BD | Invalid | - | - | - | - |
BE | Invalid | - | - | - | - |
BF | Invalid | - | - | - | - |
C0 | Invalid | - | - | - | - |
C1 | Invalid | - | - | - | - |
C2 | Invalid | - | - | - | - |
C3 | Invalid | - | - | - | - |
C4 | Invalid | - | - | - | - |
C5 | Invalid | - | - | - | - |
C6 | Invalid | - | - | - | - |
C7 | Invalid | - | - | - | - |
C8 | Invalid | - | - | - | - |
C9 | Invalid | - | - | - | - |
CA | Invalid | - | - | - | - |
CB | Invalid | - | - | - | - |
CC | Invalid | - | - | - | - |
CD | Invalid | - | - | - | - |
CE | Invalid | - | - | - | - |
CF | Invalid | - | - | - | - |
D0 | Invalid | - | - | - | - |
D1 | Invalid | - | - | - | - |
D2 | Invalid | - | - | - | - |
D3 | Invalid | - | - | - | - |
D4 | Invalid | - | - | - | - |
D5 | Invalid | - | - | - | - |
D6 | Invalid | - | - | - | - |
D7 | Invalid | - | - | - | - |
D8 | Invalid | - | - | - | - |
D9 | Invalid | - | - | - | - |
DA | Invalid | - | - | - | - |
DB | Invalid | - | - | - | - |
DC | Invalid | - | - | - | - |
DD | Invalid | - | - | - | - |
DE | Invalid | - | - | - | - |
DF | Invalid | - | - | - | - |
E0 | Invalid | - | - | - | - |
E1 | Invalid | - | - | - | - |
E2 | Invalid | - | - | - | - |
E3 | Invalid | - | - | - | - |
E4 | Invalid | - | - | - | - |
E5 | Invalid | - | - | - | - |
E6 | Invalid | - | - | - | - |
E7 | Invalid | - | - | - | - |
E8 | Invalid | - | - | - | - |
E9 | Invalid | - | - | - | - |
EA | Invalid | - | - | - | - |
EB | Invalid | - | - | - | - |
EC | Invalid | - | - | - | - |
ED | Invalid | - | - | - | - |
EE | Invalid | - | - | - | - |
EF | Invalid | - | - | - | - |
F0 | CREATE | | | addr = new memory[offset:offset+length].value(value) | creates a child contract |
F1 | CALL | gas | addr | value | argsOffset | argsLength | retOffset | retLength | |
| | success, memory[retOffset:retOffset+retLength] =
address(addr).call.gas(gas).value(value)
(memory[argsOffset:argsOffset+argsLength]) | calls a method in another contract |
F2 | CALLCODE | gas | addr | value | argsOffset | argsLength | retOffset | retLength | |
| | success, memory[retOffset:retOffset+retLength] =
address(addr).callcode.gas(gas).value(value)
(memory[argsOffset:argsOffset+argsLength]) | ??? |
F3 | RETURN | | - | return memory[offset:offset+length] | returns from this contract call |
F4 | DELEGATECALL | gas | addr | argsOffset | argsLength | retOffset | retLength | |
| | success, memory[retOffset:retOffset+retLength] =
address(addr).delegatecall.gas(gas)
(memory[argsOffset:argsOffset+argsLength]) | Homestead hardfork, EIP-7: calls a method in another contract, using the storage of the current contract |
F5 | CREATE2 | | | addr = new memory[offset:offset+length].value(value) | Constantinople harfork, EIP-1014: creates a child contract with a deterministic address |
F6 | Invalid | - | - | - | - |
F7 | Invalid | - | - | - | - |
F8 | Invalid | - | - | - | - |
F9 | Invalid | - | - | - | - |
FA | STATICCALL | gas | addr | argsOffset | argsLength | retOffset | retLength | |
| | success, memory[retOffset:retOffset+retLength] =
address(addr).staticcall.gas(gas)
(memory[argsOffset:argsOffset+argsLength]) | Byzantium hardfork, EIP-214: calls a method in another contract with state changes such as contract creation, event emission, storage modification and contract destruction disallowed |
FB | Invalid | - | - | - | - |
FC | Invalid | - | - | - | - |
FD | REVERT | | - | revert(memory[offset:offset+length]) | Byzantium hardfork, EIP-140: reverts with return data |
FE | Invalid | - | - | - | - |
FF | SELFDESTRUCT | | - | selfdestruct(address(addr)) | sends all funds to addr and pre-Cancun hardfork, EIP-7680: destroys the contract |