forked from duneanalytics/evm.codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopcodes.json
More file actions
182 lines (182 loc) · 4.45 KB
/
opcodes.json
File metadata and controls
182 lines (182 loc) · 4.45 KB
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
{
"00": {
"input": "VAL",
"output": "",
"description": "Return",
"details": "Return, end program and send VAL to msg sender"
},
"01": {
"input": "A | B",
"output": "A + B",
"description": "ADD",
"details": "pop A and B, push A + B"
},
"02": {
"input": "A | B",
"output": "A - B",
"description": "SUB",
"details": "pop A and B, push A - B"
},
"03": {
"input": "A | B",
"output": "A * B",
"description": "MUL",
"details": "pop A and B, push A * B"
},
"04": {
"input": "A | B",
"output": "A / B",
"description": "DIV",
"details": "pop A and B, push A / B"
},
"05": {
"input": "A | B",
"output": "A % B",
"description": "MOD",
"details": "pop A and B, push A % B"
},
"06": {
"input": "A | B",
"output": "A < B",
"description": "LT",
"details": "pop A and B, push 1 if A < B else 0"
},
"07": {
"input": "A | B",
"output": "A > B",
"description": "GT",
"details": "pop A and B, push 1 if A > B else 0"
},
"08": {
"input": "A | B",
"output": "A == B",
"description": "EQ",
"details": "pop A and B, push 1 if A == B else 0"
},
"09": {
"input": "A",
"output": "A == 0",
"description": "isZERO",
"details": "pop A, push 1 if A == 0 else 0"
},
"0a": {
"input": "A | B",
"output": "A & B",
"description": "AND",
"details": "pop A and B, push A & B"
},
"0b": {
"input": "A | B",
"output": "A | B",
"description": "OR",
"details": "pop A and B, push A | B"
},
"0c": {
"input": "A | B",
"output": "A ^ B",
"description": "XOR",
"details": "pop A and B, push A ^ B"
},
"0d": {
"input": "A",
"output": "A",
"description": "NOT",
"details": "pop A, push !A"
},
"0e": {
"input": "",
"output": "BALANCE",
"description": "BALANCE",
"details": "push balance of current account"
},
"0f": {
"input": "",
"output": "CALLER",
"description": "CALLER",
"details": "push caller of current context"
},
"10": {
"input": "",
"output": "CALLVALUE",
"description": "CALLVALUE",
"details": "push call value of current context"
},
"11": {
"input": "IDX",
"output": "CALLDATALOAD[IDX]",
"description": "CALLDATALOAD",
"details": "push input data at index IDX"
},
"12": {
"input": "",
"output": "BLOCKNUM",
"description": "BLOCKNUM",
"details": "push current block number"
},
"13": {
"input": "",
"output": "",
"description": "POP",
"details": "pop top of stack"
},
"14": {
"input": "IDX",
"output": "MEM[IDX]",
"description": "MLOAD",
"details": "push memory at index IDX"
},
"15": {
"input": "IDX | VAL",
"output": "",
"description": "MSTORE",
"details": "pop VAL and IDX, store VAL at IDX"
},
"16": {
"input": "IDX",
"output": "STORAGE[IDX]",
"description": "SLOAD",
"details": "push storage at index IDX"
},
"17": {
"input": "IDX | VAL",
"output": "",
"description": "SSTORE",
"details": "pop VAL and IDX, store VAL at IDX"
},
"18": {
"input": "IDX",
"output": "",
"description": "JUMP",
"details": "pop IDX, jump to IDX"
},
"19": {
"input": "IDX | VAL",
"output": "",
"description": "JUMPI",
"details": "pop VAL and IDX, jump to IDX if VAL != 0"
},
"1a": {
"input": "",
"output": "VAL",
"description": "PUSH [VAL]",
"details": "push VAL to stack. this opcode is followed by VAL"
},
"1b": {
"input": "A",
"output": "A | A",
"description": "DUP",
"details": "push A to stack"
},
"1c": {
"input": "A | B",
"output": "B | A",
"description": "SWAP",
"details": "pop A and B, push B and A"
},
"1d": {
"input": "",
"output": "",
"description": "REVERT",
"details": "revert all state changes"
}
}