-
Notifications
You must be signed in to change notification settings - Fork 74
/
opcodes.go
885 lines (829 loc) · 14.5 KB
/
opcodes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
package evmdis
import (
"fmt"
)
type OpCode byte
func (op OpCode) IsPush() bool {
switch op {
case PUSH1, PUSH2, PUSH3, PUSH4, PUSH5, PUSH6, PUSH7, PUSH8, PUSH9, PUSH10, PUSH11, PUSH12, PUSH13, PUSH14, PUSH15, PUSH16, PUSH17, PUSH18, PUSH19, PUSH20, PUSH21, PUSH22, PUSH23, PUSH24, PUSH25, PUSH26, PUSH27, PUSH28, PUSH29, PUSH30, PUSH31, PUSH32:
return true
}
return false
}
func (op OpCode) HasSideEffects() bool {
switch op {
case CALL:
return true
}
return false
}
func (op OpCode) IsDup() bool {
switch op {
case DUP1, DUP2, DUP3, DUP4, DUP5, DUP6, DUP7, DUP8, DUP9, DUP10, DUP11, DUP12, DUP13, DUP14, DUP15, DUP16:
return true
}
return false
}
func (op OpCode) IsSwap() bool {
switch op {
case SWAP1, SWAP2, SWAP3, SWAP4, SWAP5, SWAP6, SWAP7, SWAP8, SWAP9, SWAP10, SWAP11, SWAP12, SWAP13, SWAP14, SWAP15, SWAP16:
return true
}
return false
}
func (op OpCode) OperandSize() int {
if !op.IsPush() {
return 0
}
return int(byte(op) - byte(PUSH1) + 1)
}
func (op OpCode) IsJump() bool {
return op == JUMP || op == JUMPI
}
const (
// 0x0 range - arithmetic ops
STOP OpCode = iota
ADD
MUL
SUB
DIV
SDIV
MOD
SMOD
ADDMOD
MULMOD
EXP
SIGNEXTEND
)
const (
LT OpCode = iota + 0x10
GT
SLT
SGT
EQ
ISZERO
AND
OR
XOR
NOT
BYTE
SHL
SHR
SAR
SHA3 = 0x20
)
const (
// 0x30 range - closure state
ADDRESS OpCode = 0x30 + iota
BALANCE
ORIGIN
CALLER
CALLVALUE
CALLDATALOAD
CALLDATASIZE
CALLDATACOPY
CODESIZE
CODECOPY
GASPRICE
EXTCODESIZE
EXTCODECOPY
RETURNDATASIZE
RETURNDATACOPY
EXTCODEHASH
)
const (
// 0x40 range - block operations
BLOCKHASH OpCode = 0x40 + iota
COINBASE
TIMESTAMP
NUMBER
DIFFICULTY
GASLIMIT
CHAINID
SELFBALANCE
BASEFEE
)
const (
// 0x50 range - 'storage' and execution
POP OpCode = 0x50 + iota
MLOAD
MSTORE
MSTORE8
SLOAD
SSTORE
JUMP
JUMPI
PC
MSIZE
GAS
JUMPDEST
)
const (
// 0x60 range
PUSH1 OpCode = 0x60 + iota
PUSH2
PUSH3
PUSH4
PUSH5
PUSH6
PUSH7
PUSH8
PUSH9
PUSH10
PUSH11
PUSH12
PUSH13
PUSH14
PUSH15
PUSH16
PUSH17
PUSH18
PUSH19
PUSH20
PUSH21
PUSH22
PUSH23
PUSH24
PUSH25
PUSH26
PUSH27
PUSH28
PUSH29
PUSH30
PUSH31
PUSH32
DUP1
DUP2
DUP3
DUP4
DUP5
DUP6
DUP7
DUP8
DUP9
DUP10
DUP11
DUP12
DUP13
DUP14
DUP15
DUP16
SWAP1
SWAP2
SWAP3
SWAP4
SWAP5
SWAP6
SWAP7
SWAP8
SWAP9
SWAP10
SWAP11
SWAP12
SWAP13
SWAP14
SWAP15
SWAP16
)
const (
LOG0 OpCode = 0xa0 + iota
LOG1
LOG2
LOG3
LOG4
)
const (
// 0xf0 range - closures
CREATE OpCode = 0xf0 + iota
CALL
CALLCODE
RETURN
DELEGATECALL
CREATE2
INVALID = 0xfe
REVERT = 0xfd
SELFDESTRUCT = 0xff
)
// Since the opcodes aren't all in order we can't use a regular slice
var opCodeToString = map[OpCode]string{
// 0x0 range - arithmetic ops
STOP: "STOP",
ADD: "ADD",
MUL: "MUL",
SUB: "SUB",
DIV: "DIV",
SDIV: "SDIV",
MOD: "MOD",
SMOD: "SMOD",
EXP: "EXP",
NOT: "NOT",
LT: "LT",
GT: "GT",
SLT: "SLT",
SGT: "SGT",
EQ: "EQ",
ISZERO: "ISZERO",
SIGNEXTEND: "SIGNEXTEND",
// 0x10 range - bit ops
AND: "AND",
OR: "OR",
XOR: "XOR",
BYTE: "BYTE",
SHL: "SHL",
SHR: "SHR",
SAR: "SAR",
ADDMOD: "ADDMOD",
MULMOD: "MULMOD",
// 0x20 range - crypto
SHA3: "SHA3",
// 0x30 range - closure state
ADDRESS: "ADDRESS",
BALANCE: "BALANCE",
ORIGIN: "ORIGIN",
CALLER: "CALLER",
CALLVALUE: "CALLVALUE",
CALLDATALOAD: "CALLDATALOAD",
CALLDATASIZE: "CALLDATASIZE",
CALLDATACOPY: "CALLDATACOPY",
CODESIZE: "CODESIZE",
CODECOPY: "CODECOPY",
GASPRICE: "TXGASPRICE",
// 0x40 range - block operations
BLOCKHASH: "BLOCKHASH",
COINBASE: "COINBASE",
TIMESTAMP: "TIMESTAMP",
NUMBER: "NUMBER",
DIFFICULTY: "DIFFICULTY",
GASLIMIT: "GASLIMIT",
CHAINID: "CHAINID",
SELFBALANCE: "SELFBALANCE",
BASEFEE: "BASEFEE",
EXTCODESIZE: "EXTCODESIZE",
EXTCODECOPY: "EXTCODECOPY",
RETURNDATASIZE: "RETURNDATASIZE",
RETURNDATACOPY: "RETURNDATACOPY",
EXTCODEHASH: "EXTCODEHASH",
// 0x50 range - 'storage' and execution
POP: "POP",
//DUP: "DUP",
//SWAP: "SWAP",
MLOAD: "MLOAD",
MSTORE: "MSTORE",
MSTORE8: "MSTORE8",
SLOAD: "SLOAD",
SSTORE: "SSTORE",
JUMP: "JUMP",
JUMPI: "JUMPI",
PC: "PC",
MSIZE: "MSIZE",
GAS: "GAS",
JUMPDEST: "JUMPDEST",
// 0x60 range - push
PUSH1: "PUSH1",
PUSH2: "PUSH2",
PUSH3: "PUSH3",
PUSH4: "PUSH4",
PUSH5: "PUSH5",
PUSH6: "PUSH6",
PUSH7: "PUSH7",
PUSH8: "PUSH8",
PUSH9: "PUSH9",
PUSH10: "PUSH10",
PUSH11: "PUSH11",
PUSH12: "PUSH12",
PUSH13: "PUSH13",
PUSH14: "PUSH14",
PUSH15: "PUSH15",
PUSH16: "PUSH16",
PUSH17: "PUSH17",
PUSH18: "PUSH18",
PUSH19: "PUSH19",
PUSH20: "PUSH20",
PUSH21: "PUSH21",
PUSH22: "PUSH22",
PUSH23: "PUSH23",
PUSH24: "PUSH24",
PUSH25: "PUSH25",
PUSH26: "PUSH26",
PUSH27: "PUSH27",
PUSH28: "PUSH28",
PUSH29: "PUSH29",
PUSH30: "PUSH30",
PUSH31: "PUSH31",
PUSH32: "PUSH32",
DUP1: "DUP1",
DUP2: "DUP2",
DUP3: "DUP3",
DUP4: "DUP4",
DUP5: "DUP5",
DUP6: "DUP6",
DUP7: "DUP7",
DUP8: "DUP8",
DUP9: "DUP9",
DUP10: "DUP10",
DUP11: "DUP11",
DUP12: "DUP12",
DUP13: "DUP13",
DUP14: "DUP14",
DUP15: "DUP15",
DUP16: "DUP16",
SWAP1: "SWAP1",
SWAP2: "SWAP2",
SWAP3: "SWAP3",
SWAP4: "SWAP4",
SWAP5: "SWAP5",
SWAP6: "SWAP6",
SWAP7: "SWAP7",
SWAP8: "SWAP8",
SWAP9: "SWAP9",
SWAP10: "SWAP10",
SWAP11: "SWAP11",
SWAP12: "SWAP12",
SWAP13: "SWAP13",
SWAP14: "SWAP14",
SWAP15: "SWAP15",
SWAP16: "SWAP16",
LOG0: "LOG0",
LOG1: "LOG1",
LOG2: "LOG2",
LOG3: "LOG3",
LOG4: "LOG4",
// 0xf0 range
CREATE: "CREATE",
CALL: "CALL",
RETURN: "RETURN",
CALLCODE: "CALLCODE",
DELEGATECALL: "DELEGATECALL",
INVALID: "INVALID",
REVERT: "REVERT",
SELFDESTRUCT: "SELFDESTRUCT",
CREATE2: "CREATE2",
}
func (o OpCode) String() string {
str := opCodeToString[o]
if len(str) == 0 {
return fmt.Sprintf("Missing opcode 0x%x", int(o))
}
return str
}
var opCodeToStackReads = map[OpCode]int{
// 0x0 range - arithmetic ops
STOP: 0,
ADD: 2,
MUL: 2,
SUB: 2,
DIV: 2,
SDIV: 2,
MOD: 2,
SMOD: 2,
EXP: 2,
NOT: 1,
LT: 2,
GT: 2,
SLT: 2,
SGT: 2,
EQ: 2,
ISZERO: 1,
SIGNEXTEND: 1,
// 0x10 range - bit ops
AND: 2,
OR: 2,
XOR: 2,
BYTE: 2,
SHL: 2,
SHR: 2,
SAR: 2,
ADDMOD: 3,
MULMOD: 3,
// 0x20 range - crypto
SHA3: 2,
// 0x30 range - closure state
ADDRESS: 0,
BALANCE: 1,
ORIGIN: 0,
CALLER: 0,
CALLVALUE: 0,
CALLDATALOAD: 1,
CALLDATASIZE: 0,
CALLDATACOPY: 3,
CODESIZE: 0,
CODECOPY: 3,
GASPRICE: 0,
// 0x40 range - block operations
BLOCKHASH: 1,
COINBASE: 0,
TIMESTAMP: 0,
NUMBER: 0,
DIFFICULTY: 0,
GASLIMIT: 0,
CHAINID: 0,
SELFBALANCE: 0,
BASEFEE: 0,
EXTCODESIZE: 1,
EXTCODECOPY: 4,
RETURNDATASIZE: 0,
RETURNDATACOPY: 3,
EXTCODEHASH: 1,
// 0x50 range - 'storage' and execution
POP: 1,
//DUP: "DUP",
//SWAP: "SWAP",
MLOAD: 1,
MSTORE: 2,
MSTORE8: 2,
SLOAD: 1,
SSTORE: 2,
JUMP: 1,
JUMPI: 2,
PC: 0,
MSIZE: 0,
GAS: 0,
JUMPDEST: 0,
// 0x60 range - push
PUSH1: 0,
PUSH2: 0,
PUSH3: 0,
PUSH4: 0,
PUSH5: 0,
PUSH6: 0,
PUSH7: 0,
PUSH8: 0,
PUSH9: 0,
PUSH10: 0,
PUSH11: 0,
PUSH12: 0,
PUSH13: 0,
PUSH14: 0,
PUSH15: 0,
PUSH16: 0,
PUSH17: 0,
PUSH18: 0,
PUSH19: 0,
PUSH20: 0,
PUSH21: 0,
PUSH22: 0,
PUSH23: 0,
PUSH24: 0,
PUSH25: 0,
PUSH26: 0,
PUSH27: 0,
PUSH28: 0,
PUSH29: 0,
PUSH30: 0,
PUSH31: 0,
PUSH32: 0,
DUP1: 1,
DUP2: 2,
DUP3: 3,
DUP4: 4,
DUP5: 5,
DUP6: 6,
DUP7: 7,
DUP8: 8,
DUP9: 9,
DUP10: 10,
DUP11: 11,
DUP12: 12,
DUP13: 13,
DUP14: 14,
DUP15: 15,
DUP16: 16,
SWAP1: 2,
SWAP2: 3,
SWAP3: 4,
SWAP4: 5,
SWAP5: 6,
SWAP6: 7,
SWAP7: 8,
SWAP8: 9,
SWAP9: 10,
SWAP10: 11,
SWAP11: 12,
SWAP12: 13,
SWAP13: 14,
SWAP14: 15,
SWAP15: 16,
SWAP16: 17,
LOG0: 2,
LOG1: 3,
LOG2: 4,
LOG3: 5,
LOG4: 6,
// 0xf0 range
CREATE: 3,
CALL: 7,
RETURN: 2,
CALLCODE: 7,
DELEGATECALL: 6,
INVALID: 0,
REVERT: 0,
SELFDESTRUCT: 1,
CREATE2: 4,
}
func (o OpCode) StackReads() int {
return opCodeToStackReads[o]
}
var opCodeToStackWrites = map[OpCode]int{
// 0x0 range - arithmetic ops
STOP: 0,
ADD: 1,
MUL: 1,
SUB: 1,
DIV: 1,
SDIV: 1,
MOD: 1,
SMOD: 1,
EXP: 1,
NOT: 1,
LT: 1,
GT: 1,
SLT: 1,
SGT: 1,
EQ: 1,
ISZERO: 1,
SIGNEXTEND: 1,
// 0x10 range - bit ops
AND: 1,
OR: 1,
XOR: 1,
BYTE: 1,
SHL: 1,
SHR: 1,
SAR: 1,
ADDMOD: 1,
MULMOD: 1,
// 0x20 range - crypto
SHA3: 1,
// 0x30 range - closure state
ADDRESS: 1,
BALANCE: 1,
ORIGIN: 1,
CALLER: 1,
CALLVALUE: 1,
CALLDATALOAD: 1,
CALLDATASIZE: 1,
CALLDATACOPY: 0,
CODESIZE: 1,
CODECOPY: 0,
GASPRICE: 1,
// 0x40 range - block operations
BLOCKHASH: 1,
COINBASE: 1,
TIMESTAMP: 1,
NUMBER: 1,
DIFFICULTY: 1,
GASLIMIT: 1,
CHAINID: 1,
SELFBALANCE: 1,
BASEFEE: 1,
EXTCODESIZE: 1,
EXTCODECOPY: 0,
RETURNDATASIZE: 1,
RETURNDATACOPY: 0,
EXTCODEHASH: 1,
// 0x50 range - 'storage' and execution
POP: 0,
//DUP: "DUP",
//SWAP: "SWAP",
MLOAD: 1,
MSTORE: 0,
MSTORE8: 0,
SLOAD: 1,
SSTORE: 0,
JUMP: 0,
JUMPI: 0,
PC: 1,
MSIZE: 1,
GAS: 1,
JUMPDEST: 0,
// 0x60 range - push
PUSH1: 1,
PUSH2: 1,
PUSH3: 1,
PUSH4: 1,
PUSH5: 1,
PUSH6: 1,
PUSH7: 1,
PUSH8: 1,
PUSH9: 1,
PUSH10: 1,
PUSH11: 1,
PUSH12: 1,
PUSH13: 1,
PUSH14: 1,
PUSH15: 1,
PUSH16: 1,
PUSH17: 1,
PUSH18: 1,
PUSH19: 1,
PUSH20: 1,
PUSH21: 1,
PUSH22: 1,
PUSH23: 1,
PUSH24: 1,
PUSH25: 1,
PUSH26: 1,
PUSH27: 1,
PUSH28: 1,
PUSH29: 1,
PUSH30: 1,
PUSH31: 1,
PUSH32: 1,
DUP1: 2,
DUP2: 3,
DUP3: 4,
DUP4: 5,
DUP5: 6,
DUP6: 7,
DUP7: 8,
DUP8: 9,
DUP9: 10,
DUP10: 11,
DUP11: 12,
DUP12: 13,
DUP13: 14,
DUP14: 15,
DUP15: 16,
DUP16: 17,
SWAP1: 2,
SWAP2: 3,
SWAP3: 4,
SWAP4: 5,
SWAP5: 6,
SWAP6: 7,
SWAP7: 8,
SWAP8: 9,
SWAP9: 10,
SWAP10: 11,
SWAP11: 12,
SWAP12: 13,
SWAP13: 14,
SWAP14: 15,
SWAP15: 16,
SWAP16: 17,
LOG0: 0,
LOG1: 0,
LOG2: 0,
LOG3: 0,
LOG4: 0,
// 0xf0 range
CREATE: 1,
CALL: 1,
RETURN: 0,
CALLCODE: 1,
DELEGATECALL: 1,
INVALID: 0,
REVERT: 0,
SELFDESTRUCT: 0,
CREATE2: 1,
}
func (o OpCode) StackWrites() int {
return opCodeToStackWrites[o]
}
var stringToOp = map[string]OpCode{
"STOP": STOP,
"ADD": ADD,
"MUL": MUL,
"SUB": SUB,
"DIV": DIV,
"SDIV": SDIV,
"MOD": MOD,
"SMOD": SMOD,
"EXP": EXP,
"NOT": NOT,
"LT": LT,
"GT": GT,
"SLT": SLT,
"SGT": SGT,
"EQ": EQ,
"ISZERO": ISZERO,
"SIGNEXTEND": SIGNEXTEND,
"AND": AND,
"OR": OR,
"XOR": XOR,
"BYTE": BYTE,
"SHL": SHL,
"SHR": SHR,
"SAR": SAR,
"ADDMOD": ADDMOD,
"MULMOD": MULMOD,
"SHA3": SHA3,
"ADDRESS": ADDRESS,
"BALANCE": BALANCE,
"ORIGIN": ORIGIN,
"CALLER": CALLER,
"CALLVALUE": CALLVALUE,
"CALLDATALOAD": CALLDATALOAD,
"CALLDATASIZE": CALLDATASIZE,
"CALLDATACOPY": CALLDATACOPY,
"DELEGATECALL": DELEGATECALL,
"CODESIZE": CODESIZE,
"CODECOPY": CODECOPY,
"GASPRICE": GASPRICE,
"BLOCKHASH": BLOCKHASH,
"COINBASE": COINBASE,
"TIMESTAMP": TIMESTAMP,
"NUMBER": NUMBER,
"DIFFICULTY": DIFFICULTY,
"GASLIMIT": GASLIMIT,
"CHAINID": CHAINID,
"SELFBALANCE": SELFBALANCE,
"BASEFEE": BASEFEE,
"EXTCODESIZE": EXTCODESIZE,
"EXTCODECOPY": EXTCODECOPY,
"RETURNDATASIZE": RETURNDATASIZE,
"RETURNDATACOPY": RETURNDATACOPY,
"EXTCODEHASH": EXTCODEHASH,
"POP": POP,
"MLOAD": MLOAD,
"MSTORE": MSTORE,
"MSTORE8": MSTORE8,
"SLOAD": SLOAD,
"SSTORE": SSTORE,
"JUMP": JUMP,
"JUMPI": JUMPI,
"PC": PC,
"MSIZE": MSIZE,
"GAS": GAS,
"JUMPDEST": JUMPDEST,
"PUSH1": PUSH1,
"PUSH2": PUSH2,
"PUSH3": PUSH3,
"PUSH4": PUSH4,
"PUSH5": PUSH5,
"PUSH6": PUSH6,
"PUSH7": PUSH7,
"PUSH8": PUSH8,
"PUSH9": PUSH9,
"PUSH10": PUSH10,
"PUSH11": PUSH11,
"PUSH12": PUSH12,
"PUSH13": PUSH13,
"PUSH14": PUSH14,
"PUSH15": PUSH15,
"PUSH16": PUSH16,
"PUSH17": PUSH17,
"PUSH18": PUSH18,
"PUSH19": PUSH19,
"PUSH20": PUSH20,
"PUSH21": PUSH21,
"PUSH22": PUSH22,
"PUSH23": PUSH23,
"PUSH24": PUSH24,
"PUSH25": PUSH25,
"PUSH26": PUSH26,
"PUSH27": PUSH27,
"PUSH28": PUSH28,
"PUSH29": PUSH29,
"PUSH30": PUSH30,
"PUSH31": PUSH31,
"PUSH32": PUSH32,
"DUP1": DUP1,
"DUP2": DUP2,
"DUP3": DUP3,
"DUP4": DUP4,
"DUP5": DUP5,
"DUP6": DUP6,
"DUP7": DUP7,
"DUP8": DUP8,
"DUP9": DUP9,
"DUP10": DUP10,
"DUP11": DUP11,
"DUP12": DUP12,
"DUP13": DUP13,
"DUP14": DUP14,
"DUP15": DUP15,
"DUP16": DUP16,
"SWAP1": SWAP1,
"SWAP2": SWAP2,
"SWAP3": SWAP3,
"SWAP4": SWAP4,
"SWAP5": SWAP5,
"SWAP6": SWAP6,
"SWAP7": SWAP7,
"SWAP8": SWAP8,
"SWAP9": SWAP9,
"SWAP10": SWAP10,
"SWAP11": SWAP11,
"SWAP12": SWAP12,
"SWAP13": SWAP13,
"SWAP14": SWAP14,
"SWAP15": SWAP15,
"SWAP16": SWAP16,
"LOG0": LOG0,
"LOG1": LOG1,
"LOG2": LOG2,
"LOG3": LOG3,
"LOG4": LOG4,
"CREATE": CREATE,
"CALL": CALL,
"RETURN": RETURN,
"CALLCODE": CALLCODE,
"INVALID": INVALID,
"REVERT": REVERT,
"SELFDESTRUCT": SELFDESTRUCT,
"CREATE2": CREATE2,
}
func StringToOp(str string) OpCode {
return stringToOp[str]
}