@@ -39,68 +39,68 @@ func (op OpCode) IsStaticJump() bool {
3939
4040// 0x0 range - arithmetic ops.
4141const (
42- STOP OpCode = iota
43- ADD
44- MUL
45- SUB
46- DIV
47- SDIV
48- MOD
49- SMOD
50- ADDMOD
51- MULMOD
52- EXP
53- SIGNEXTEND
42+ STOP OpCode = 0x0
43+ ADD OpCode = 0x1
44+ MUL OpCode = 0x2
45+ SUB OpCode = 0x3
46+ DIV OpCode = 0x4
47+ SDIV OpCode = 0x5
48+ MOD OpCode = 0x6
49+ SMOD OpCode = 0x7
50+ ADDMOD OpCode = 0x8
51+ MULMOD OpCode = 0x9
52+ EXP OpCode = 0xa
53+ SIGNEXTEND OpCode = 0xb
5454)
5555
5656// 0x10 range - comparison ops.
5757const (
58- LT OpCode = iota + 0x10
59- GT
60- SLT
61- SGT
62- EQ
63- ISZERO
64- AND
65- OR
66- XOR
67- NOT
68- BYTE
69- SHL
70- SHR
71- SAR
58+ LT OpCode = 0x10
59+ GT OpCode = 0x11
60+ SLT OpCode = 0x12
61+ SGT OpCode = 0x13
62+ EQ OpCode = 0x14
63+ ISZERO OpCode = 0x15
64+ AND OpCode = 0x16
65+ OR OpCode = 0x17
66+ XOR OpCode = 0x18
67+ NOT OpCode = 0x19
68+ BYTE OpCode = 0x1a
69+ SHL OpCode = 0x1b
70+ SHR OpCode = 0x1c
71+ SAR OpCode = 0x1d
7272
7373 SHA3 OpCode = 0x20
7474)
7575
7676// 0x30 range - closure state.
7777const (
78- ADDRESS OpCode = 0x30 + iota
79- BALANCE
80- ORIGIN
81- CALLER
82- CALLVALUE
83- CALLDATALOAD
84- CALLDATASIZE
85- CALLDATACOPY
86- CODESIZE
87- CODECOPY
88- GASPRICE
89- EXTCODESIZE
90- EXTCODECOPY
91- RETURNDATASIZE
92- RETURNDATACOPY
93- EXTCODEHASH
78+ ADDRESS OpCode = 0x30
79+ BALANCE OpCode = 0x31
80+ ORIGIN OpCode = 0x32
81+ CALLER OpCode = 0x33
82+ CALLVALUE OpCode = 0x34
83+ CALLDATALOAD OpCode = 0x35
84+ CALLDATASIZE OpCode = 0x36
85+ CALLDATACOPY OpCode = 0x37
86+ CODESIZE OpCode = 0x38
87+ CODECOPY OpCode = 0x39
88+ GASPRICE OpCode = 0x3a
89+ EXTCODESIZE OpCode = 0x3b
90+ EXTCODECOPY OpCode = 0x3c
91+ RETURNDATASIZE OpCode = 0x3d
92+ RETURNDATACOPY OpCode = 0x3e
93+ EXTCODEHASH OpCode = 0x3f
9494)
9595
9696// 0x40 range - block operations.
9797const (
98- BLOCKHASH OpCode = 0x40 + iota
99- COINBASE
100- TIMESTAMP
101- NUMBER
102- DIFFICULTY
103- GASLIMIT
98+ BLOCKHASH OpCode = 0x40
99+ COINBASE OpCode = 0x41
100+ TIMESTAMP OpCode = 0x42
101+ NUMBER OpCode = 0x43
102+ DIFFICULTY OpCode = 0x44
103+ GASLIMIT OpCode = 0x45
104104 CHAINID OpCode = 0x46
105105 SELFBALANCE OpCode = 0x47
106106 BASEFEE OpCode = 0x48
@@ -122,7 +122,7 @@ const (
122122 JUMPDEST OpCode = 0x5b
123123)
124124
125- // 0x60 range.
125+ // 0x60 range - pushes .
126126const (
127127 PUSH1 OpCode = 0x60 + iota
128128 PUSH2
@@ -156,7 +156,11 @@ const (
156156 PUSH30
157157 PUSH31
158158 PUSH32
159- DUP1
159+ )
160+
161+ // 0x80 range - dups.
162+ const (
163+ DUP1 = 0x80 + iota
160164 DUP2
161165 DUP3
162166 DUP4
@@ -172,7 +176,11 @@ const (
172176 DUP14
173177 DUP15
174178 DUP16
175- SWAP1
179+ )
180+
181+ // 0x90 range - swaps.
182+ const (
183+ SWAP1 = 0x90 + iota
176184 SWAP2
177185 SWAP3
178186 SWAP4
@@ -208,12 +216,13 @@ const (
208216
209217// 0xf0 range - closures.
210218const (
211- CREATE OpCode = 0xf0 + iota
212- CALL
213- CALLCODE
214- RETURN
215- DELEGATECALL
216- CREATE2
219+ CREATE OpCode = 0xf0
220+ CALL OpCode = 0xf1
221+ CALLCODE OpCode = 0xf2
222+ RETURN OpCode = 0xf3
223+ DELEGATECALL OpCode = 0xf4
224+ CREATE2 OpCode = 0xf5
225+
217226 STATICCALL OpCode = 0xfa
218227 REVERT OpCode = 0xfd
219228 SELFDESTRUCT OpCode = 0xff
0 commit comments