00
| STOP | - | - | STOP() | 停止合约执行 |
01
| ADD | | | a + b | (u)int256加法取模2256 |
02
| MUL | | | a b | (u)int256乘法取模2256 |
03
| SUB | | | a - b | (u)int256减法取模2256 |
04
| DIV | | | a // b | uint256除法 |
05
| SDIV | | | a // b | int256除法 |
06
| MOD | | | a % b | uint256取模 |
07
| SMOD | | | a % b | int256取模 |
08
| ADDMOD | | | (a + b) % N | (u)int256加法取模N |
09
| MULMOD | | | (a b) % N | (u)int256乘法取模N |
0A
| EXP | | | a b
| uint256指数结果取模2256 |
0B
| SIGNEXTEND | | | y = SIGNEXTEND(x, b) | 将x从 (b + 1) 8 位有符号扩展为 256位 |
0C
| Invalid | - | - | - | - |
0D
| Invalid | - | - | - | - |
0E
| Invalid | - | - | - | - |
0F
| Invalid | - | - | - | - |
10
| LT | | | a < b | uint256比较 |
11
| GT | | | a > b | uint256比较 |
12
| SLT | | | a < b | int256比较 |
13
| SGT | | | a > b | int256比较 |
14
| EQ | | | a == b | (u)int256相等比较 |
15
| ISZERO | | | a == 0 | (u)int256零比较 |
16
| AND | | | a & b | 256位的位与计算 |
17
| OR | | | a | b | 256位的位或计算 |
18
| XOR | | | a ^ b | 256位的异或计算 |
19
| NOT | | | ~a | 256位的位取反计算 |
1A
| BYTE | | | y = (x >> (248 - i 8)) & 0xFF | 返回(u)int256 x从最高字节开始的第i字节 |
1B
| SHL | | | value << shift | 256位左移 |
1C
| SHR | | | value >> shift | 256位右移 |
1D
| SAR | | | value >> shift | int256右移位 |
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) | 当前执行合约的地址 |
31
| BALANCE | | | address(addr).balance | 指定地址的余额,单位wei |
32
| ORIGIN | - | | tx.origin | 交易发起方地址 |
33
| CALLER | - | | msg.caller | 消息调用方地址 |
34
| CALLVALUE | - | | msg.value | 以wei为单位的消息携带金额 |
35
| CALLDATALOAD | | | msg.data[i:i+32] | 从消息数据读取一个(u)int256 |
36
| CALLDATASIZE | - | | msg.data.size | 以字节为单位的消息数据长度 |
37
| CALLDATACOPY | | - | memory[destOffset:destOffset+length] =
msg.data[offset:offset+length] | 拷贝消息数据 |
38
| CODESIZE | - | | address(this).code.size | 以字节为单位的当前执行合约的长度 |
39
| CODECOPY | | - | memory[destOffset:destOffset+length] =
address(this).code[offset:offset+length] | 拷贝当前执行合约的字节码 |
3A
| GASPRICE | - | | tx.gasprice | 当前执行交易的单位gas价格,以wei为单位 |
3B
| EXTCODESIZE | | | address(addr).code.size | 指定地址处的合约字节码长度,以字节为单位 |
3C
| EXTCODECOPY |
addr |
destOffset |
offset |
length | |
| - | memory[destOffset:destOffset+length] =
address(addr).code[offset:offset+length] | 拷贝合约字节码 |
3D
| RETURNDATASIZE | - | | size = RETURNDATASIZE() | 最后一个外部调用的返回数据的长度,以字节为单位 |
3E
| RETURNDATACOPY | | - | memory[destOffset:destOffset+length] =
RETURNDATA[offset:offset+length] | 拷贝返回的数据 |
3F
| EXTCODEHASH | | | hash = address(addr).exists ?
keccak256(address(addr).code) : 0 | 指定地址的合约字节码的哈希,请参考EIP-1052事件 |
40
| BLOCKHASH | | | hash = block.blockHash(blockNumber) | 指定区块的哈希,仅适用于最近的256个区块,不包括当前区块 |
41
| COINBASE | - | | block.coinbase | 当前区块矿工的地址 |
42
| TIMESTAMP | - | | block.timestamp | 当前区块的UNIX时间戳,以秒为单位 |
43
| NUMBER | - | | block.number | 当前区块号 |
44
| DIFFICULTY | - | | block.difficulty | 当前区块难度 |
45
| GASLIMIT | - | | block.gaslimit | 当前区块GAS上限 |
46
| Invalid | - | - | - | - |
47
| Invalid | - | - | - | - |
48
| Invalid | - | - | - | - |
49
| Invalid | - | - | - | - |
4A
| Invalid | - | - | - | - |
4B
| Invalid | - | - | - | - |
4C
| Invalid | - | - | - | - |
4D
| Invalid | - | - | - | - |
4E
| Invalid | - | - | - | - |
4F
| Invalid | - | - | - | - |
50
| POP | | - | POP() | 弹出栈顶(u)int256 并丢弃 |
51
| MLOAD | | | value = memory[offset:offset+32] | 从内存读取一个(u)int256 |
52
| MSTORE | | - | memory[offset:offset+32] = value | 向内存写入一个(u)int256 |
53
| MSTORE8 | | - | memory[offset] = value & 0xFF | 向内存写入一个uint8 |
54
| SLOAD | | | value = storage[key] | 从存储读取一个(u)int256 |
55
| SSTORE | | - | storage[key] = value | 向存储写入一个(u)int256 |
56
| JUMP | | - | $pc = destination | 无条件跳转 |
57
| JUMPI | | - | $pc = cond ? destination : $pc + 1 | 条件为真时跳转 |
58
| PC | - | | $pc | 程序计数器 |
59
| MSIZE | - | | size = MSIZE() | 当前合约执行的内存大小,以字节为单位 |
5A
| GAS | - | | gasRemaining = GAS() | 剩余的GAS |
5B
| JUMPDEST | - | - | | 用于注解可能的跳转目标的元数据 |
5C
| Invalid | - | - | - | - |
5D
| Invalid | - | - | - | - |
5E
| Invalid | - | - | - | - |
5F
| Invalid | - | - | - | - |
60
| PUSH1 | - | | PUSH(uint8) | 将1字节数值压入栈 |
61
| PUSH2 | - | | PUSH(uint16) | 将2字节数值压入栈 |
62
| PUSH3 | - | | PUSH(uint24) | 将3字节数值压入栈 |
63
| PUSH4 | - | | PUSH(uint32) | 将4字节数值压入栈 |
64
| PUSH5 | - | | PUSH(uint40) | 将5字节数值压入栈 |
65
| PUSH6 | - | | PUSH(uint48) | 将6字节数值压入栈 |
66
| PUSH7 | - | | PUSH(uint56) | 将7字节数值压入栈 |
67
| PUSH8 | - | | PUSH(uint64) | 将8字节数值压入栈 |
68
| PUSH9 | - | | PUSH(uint72) | 将9字节数值压入栈 |
69
| PUSH10 | - | | PUSH(uint80) | 将10字节数值压入栈 |
6A
| PUSH11 | - | | PUSH(uint88) | 将11字节数值压入栈 |
6B
| PUSH12 | - | | PUSH(uint96) | 将12字节数值压入栈 |
6C
| PUSH13 | - | | PUSH(uint104) | 将13字节数值压入栈 |
6D
| PUSH14 | - | | PUSH(uint112) | 将14字节数值压入栈 |
6E
| PUSH15 | - | | PUSH(uint120) | 将15字节数值压入栈 |
6F
| PUSH16 | - | | PUSH(uint128) | 将16字节数值压入栈 |
70
| PUSH17 | - | | PUSH(uint136) | 将17字节数值压入栈 |
71
| PUSH18 | - | | PUSH(uint144) | 将18字节数值压入栈 |
72
| PUSH19 | - | | PUSH(uint152) | 将19字节数值压入栈 |
73
| PUSH20 | - | | PUSH(uint160) | 将20字节数值压入栈 |
74
| PUSH21 | - | | PUSH(uint168) | 将21字节数值压入栈 |
75
| PUSH22 | - | | PUSH(uint176) | 将22字节数值压入栈 |
76
| PUSH23 | - | | PUSH(uint184) | 将23字节数值压入栈 |
77
| PUSH24 | - | | PUSH(uint192) | 将24字节数值压入栈 |
78
| PUSH25 | - | | PUSH(uint200) | 将25字节数值压入栈 |
79
| PUSH26 | - | | PUSH(uint208) | 将26字节数值压入栈 |
7A
| PUSH27 | - | | PUSH(uint216) | 将27字节数值压入栈 |
7B
| PUSH28 | - | | PUSH(uint224) | 将28字节数值压入栈 |
7C
| PUSH29 | - | | PUSH(uint232) | 将29字节数值压入栈 |
7D
| PUSH30 | - | | PUSH(uint240) | 将30字节数值压入栈 |
7E
| PUSH31 | - | | PUSH(uint248) | 将31字节数值压入栈 |
7F
| PUSH32 | - | | PUSH(uint256) | 将32字节数值压入栈 |
80
| DUP1 | | | PUSH(value) | 克隆栈上最后一个值 |
81
| DUP2 | | | PUSH(value) | 克隆栈上倒数第二个值 |
82
| DUP3 | | | PUSH(value) | 克隆栈上倒数第三个值 |
83
| DUP4 | | | PUSH(value) | 克隆栈上倒数第四个值 |
84
| DUP5 | | | PUSH(value) | 克隆栈上倒数第五个值 |
85
| DUP6 | | | PUSH(value) | 克隆栈上倒数第六个值 |
86
| DUP7 | | | PUSH(value) | 克隆栈上倒数第七个值 |
87
| DUP8 | | | PUSH(value) | 克隆栈上倒数第八个值 |
88
| DUP9 | | | PUSH(value) | 克隆栈上倒数第九个值 |
89
| DUP10 | | | PUSH(value) | 克隆栈上倒数第10个值 |
8A
| DUP11 | | | PUSH(value) | 克隆栈上倒数第11个值 |
8B
| DUP12 | | | PUSH(value) | 克隆栈上倒数第12个值 |
8C
| DUP13 | | | PUSH(value) | 克隆栈上倒数第13个值 |
8D
| DUP14 | | | PUSH(value) | 克隆栈上倒数第14个值 |
8E
| DUP15 | | | PUSH(value) | 克隆栈上倒数第15个值 |
8F
| DUP16 | | | PUSH(value) | 克隆栈上倒数第16个值 |
90
| SWAP1 | | | a, b = b, a | 交换栈顶两个成员 |
91
| SWAP2 | | | a, b = b, a | 交换栈顶与倒数第3个成员 |
92
| SWAP3 | | | a, b = b, a | 交换栈顶与倒数第4个成员 |
93
| SWAP4 | | | a, b = b, a | 交换栈顶与倒数第5个成员 |
94
| SWAP5 | | | a, b = b, a | 交换栈顶与倒数第6个成员 |
95
| SWAP6 | | | a, b = b, a | 交换栈顶与倒数第7个成员 |
96
| SWAP7 | | | a, b = b, a | 交换栈顶与倒数第8个成员 |
97
| SWAP8 | | | a, b = b, a | 交换栈顶与倒数第9个成员 |
98
| SWAP9 | | | a, b = b, a | 交换栈顶与倒数第10个成员 |
99
| SWAP10 | | | a, b = b, a | 交换栈顶与倒数第11个成员 |
9A
| SWAP11 | | | a, b = b, a | 交换栈顶与倒数第12个成员 |
9B
| SWAP12 | | | a, b = b, a | 交换栈顶与倒数第13个成员 |
9C
| SWAP13 | | | a, b = b, a | 交换栈顶与倒数第14个成员 |
9D
| SWAP14 | | | a, b = b, a | 交换栈顶与倒数第15个成员 |
9E
| SWAP15 | | | a, b = b, a | 交换栈顶与倒数第16个成员 |
9F
| SWAP16 | | | a, b = b, a | 交换栈顶与倒数第17个成员 |
A0
| LOG0 | | - | LOG0(memory[offset:offset+length]) | 触发事件 |
A1
| LOG1 | | - | LOG1(memory[offset:offset+length], topic0) | 触发事件 |
A2
| LOG2 |
offset |
length |
topic0 |
topic1 | |
| - | LOG2(memory[offset:offset+length], topic0, topic1) | 触发事件 |
A3
| LOG3 |
offset |
length |
topic0 |
topic1 |
topic2 | |
| - | LOG3(memory[offset:offset+length], topic0, topic1,
topic2) | 触发事件 |
A4
| LOG4 |
offset |
length |
topic0 |
topic1 |
topic2 |
topic3 | |
| - | LOG4(memory[offset:offset+length], topic0, topic1,
topic2, topic3) | 触发事件 |
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) | 创建子合约 |
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]) | 调用另一个合约中的方法 |
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] | 从这个合约调用返回 |
F4
| DELEGATECALL |
gas |
addr |
argsOffset |
argsLength |
retOffset |
retLength | |
| | success, memory[retOffset:retOffset+retLength] =
address(addr).delegatecall.gas(gas)
(memory[argsOffset:argsOffset+argsLength]) | 使用当前合约的存储调用另一个合约的方法 |
F5
| CREATE2 | | | addr = new memory[offset:offset+length].value(value) | 使用确定的地址创建子合约,参见see EIP-1014 |
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]) | 调用另一个合约的方法,不允许合约创建、事件发送、存储修改和合约销毁等引起状态改变的方法,参见EIP-214 |
FB
| Invalid | - | - | - | - |
FC
| Invalid | - | - | - | - |
FD
| REVERT | | - | revert(memory[offset:offset+length]) | 回滚交易并返回数据 |
FE
| Invalid | - | - | - | - |
FF
| SELFDESTRUCT | | - | selfdestruct(address(addr)) | 销毁合约并将所有资金发送给addr地址 |