File tree Expand file tree Collapse file tree 1 file changed +20
-18
lines changed Expand file tree Collapse file tree 1 file changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,12 @@ const (
204204 LOG4
205205)
206206
207+ // 0xb0 range.
208+ const (
209+ TLOAD OpCode = 0xb3
210+ TSTORE OpCode = 0xb4
211+ )
212+
207213// 0xf0 range - closures.
208214const (
209215 CREATE OpCode = 0xf0
@@ -219,12 +225,6 @@ const (
219225 SELFDESTRUCT OpCode = 0xff
220226)
221227
222- // 0xb0 range.
223- const (
224- TLOAD OpCode = 0xb3
225- TSTORE OpCode = 0xb4
226- )
227-
228228// Since the opcodes aren't all in order we can't use a regular slice.
229229var opCodeToString = map [OpCode ]string {
230230 // 0x0 range - arithmetic ops.
@@ -290,9 +290,7 @@ var opCodeToString = map[OpCode]string{
290290 BASEFEE : "BASEFEE" ,
291291
292292 // 0x50 range - 'storage' and execution.
293- POP : "POP" ,
294- //DUP: "DUP",
295- //SWAP: "SWAP",
293+ POP : "POP" ,
296294 MLOAD : "MLOAD" ,
297295 MSTORE : "MSTORE" ,
298296 MSTORE8 : "MSTORE8" ,
@@ -306,7 +304,7 @@ var opCodeToString = map[OpCode]string{
306304 JUMPDEST : "JUMPDEST" ,
307305 PUSH0 : "PUSH0" ,
308306
309- // 0x60 range - push .
307+ // 0x60 range - pushes .
310308 PUSH1 : "PUSH1" ,
311309 PUSH2 : "PUSH2" ,
312310 PUSH3 : "PUSH3" ,
@@ -340,6 +338,7 @@ var opCodeToString = map[OpCode]string{
340338 PUSH31 : "PUSH31" ,
341339 PUSH32 : "PUSH32" ,
342340
341+ // 0x80 - dups.
343342 DUP1 : "DUP1" ,
344343 DUP2 : "DUP2" ,
345344 DUP3 : "DUP3" ,
@@ -357,6 +356,7 @@ var opCodeToString = map[OpCode]string{
357356 DUP15 : "DUP15" ,
358357 DUP16 : "DUP16" ,
359358
359+ // 0x90 - swaps.
360360 SWAP1 : "SWAP1" ,
361361 SWAP2 : "SWAP2" ,
362362 SWAP3 : "SWAP3" ,
@@ -373,17 +373,19 @@ var opCodeToString = map[OpCode]string{
373373 SWAP14 : "SWAP14" ,
374374 SWAP15 : "SWAP15" ,
375375 SWAP16 : "SWAP16" ,
376- LOG0 : "LOG0" ,
377- LOG1 : "LOG1" ,
378- LOG2 : "LOG2" ,
379- LOG3 : "LOG3" ,
380- LOG4 : "LOG4" ,
376+
377+ // 0xa0 range - logging ops.
378+ LOG0 : "LOG0" ,
379+ LOG1 : "LOG1" ,
380+ LOG2 : "LOG2" ,
381+ LOG3 : "LOG3" ,
382+ LOG4 : "LOG4" ,
381383
382384 // 0xb0 range.
383385 TLOAD : "TLOAD" ,
384386 TSTORE : "TSTORE" ,
385387
386- // 0xf0 range.
388+ // 0xf0 range - closures .
387389 CREATE : "CREATE" ,
388390 CALL : "CALL" ,
389391 RETURN : "RETURN" ,
@@ -473,8 +475,6 @@ var stringToOp = map[string]OpCode{
473475 "GAS" : GAS ,
474476 "JUMPDEST" : JUMPDEST ,
475477 "PUSH0" : PUSH0 ,
476- "TLOAD" : TLOAD ,
477- "TSTORE" : TSTORE ,
478478 "PUSH1" : PUSH1 ,
479479 "PUSH2" : PUSH2 ,
480480 "PUSH3" : PUSH3 ,
@@ -544,6 +544,8 @@ var stringToOp = map[string]OpCode{
544544 "LOG2" : LOG2 ,
545545 "LOG3" : LOG3 ,
546546 "LOG4" : LOG4 ,
547+ "TLOAD" : TLOAD ,
548+ "TSTORE" : TSTORE ,
547549 "CREATE" : CREATE ,
548550 "CREATE2" : CREATE2 ,
549551 "CALL" : CALL ,
You can’t perform that action at this time.
0 commit comments