-
Notifications
You must be signed in to change notification settings - Fork 0
/
EVMVaultMechanism.sol.disassembled
387 lines (330 loc) · 8.05 KB
/
EVMVaultMechanism.sol.disassembled
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
# Constructor part -------------------------
# Stack: []
0x8 CODECOPY(0x0, 0x10, 0x2C5)
0xE RETURN(0x0, 0x2C5)
# Code part -------------------------
# Stack: []
0x8 JUMPI(:label0, !(CALLDATASIZE() < 0x8))
# Stack: []
0x9 PUSH(0x0)
0xB PUSH(0x0)
0xD REVERT()
:label0
# Stack: []
0x12 JUMP(:label10)
:label1
# Stack: [@0x174 :label14 @0x16E @0x174 @0x16E]
0x14 PUSH(0x0)
0x1D DUP1
0x1E PUSH(POP(@0x174) + 0x69B135A06C3)
0x21 DUP1
0x22 PUSH(POP(@0x1E) * 0x80)
0x23 SWAP1
0x24 POP()
0x2C DUP1
0x2D PUSH(POP(@0x22) ^ 0xB3ABDCEF1F1)
0x2E SWAP1
0x2F POP()
0x30 DUP1
0x3A PUSH(!(0x346D81803D471 == POP(@0x2D)))
0x3B SWAP2
0x3C POP()
0x3D POP()
# Stack: [@0x3A @0x174 :label14 @0x16E @0x174 @0x16E]
0x3F SWAP2
0x40 SWAP1
0x41 POP()
0x42 JUMP(POP(:label14))
:label2
# Stack: [@0x174 :label17 @0x16E @0x174 @0x16E]
0x44 PUSH(0x0)
0x46 DUP1
0x49 MSTORE(0xF, POP(@0x174))
0x4E PUSH(SHA3(0xF, 0x4))
0x57 DUP1
0x5C PUSH(!(SHR(0xC8, POP(@0x4E)) == 0xFD28448C97D19C))
0x5D SWAP2
0x5E POP()
0x5F POP()
# Stack: [@0x5C @0x174 :label17 @0x16E @0x174 @0x16E]
0x61 SWAP2
0x62 SWAP1
0x63 POP()
0x64 JUMP(POP(:label17))
:label3
# Stack: [@0x174 :label20 @0x16E @0x174 @0x16E]
0x66 PUSH(0x0)
0x68 PUSH(CALLER())
0x69 DUP1
0x6A PUSH(BALANCE(POP(@0x68)))
0x6B DUP2
0x6C PUSH(EXTCODESIZE(POP(@0x68)))
0x6D DUP3
0x6E PUSH(EXTCODEHASH(POP(@0x68)))
0x74 DUP1
0x78 PUSH(SHR(0x18, POP(@0x6E) & 0xFF000000))
0x7F DUP5
0x80 EXTCODECOPY(POP(@0x68), 0x7, 0xB, 0x4)
0x85 PUSH(SHA3(0x7, 0x4))
0x88 DUP1
0x89 PUSH(POP(@0x85) & 0xFF)
0x8C DUP1
0x8E DUP3
0x8F DUP6
0x9A DUP6
0xA0 DUP7
0xA6 PUSH(!((POP(@0x68) & 0xFF == 0x77) * (POP(@0x6A) > 0xDE0B6B3A7640000) * (POP(@0x6C) == POP(@0x78)) * (POP(@0x89) == 0x77)))
0xA7 SWAP8
0xA8 POP()
0xA9 POP()
0xAA POP()
0xAB POP()
0xAC POP()
0xAD POP()
0xAE POP()
0xAF POP()
# Stack: [@0xA6 @0x174 :label20 @0x16E @0x174 @0x16E]
0xB1 SWAP2
0xB2 SWAP1
0xB3 POP()
0xB4 JUMP(POP(:label20))
:label4
# Stack: [@0x174 :label23 @0x16E @0x174 @0x16E]
0xB6 PUSH(0x0)
0xBC DUP1
0xC0 PUSH(SHR(0x8, POP(@0x174) & 0xFFFF00))
0xC3 DUP1
0xCA PUSH(0x2 * (SHL(0x7, POP(@0xC0)) + 0xD))
0xCD DUP3
0xD5 PUSH(0x101 * (SHR(0x18, POP(@0x174)) & 0xFF))
0xDA DUP4
0xE5 PUSH(BLOCKHASH(NUMBER() - 0x3 + (0x2 * (POP(@0x174) & 0xFF) & 0xFF)))
0xE6 DUP1
0xE7 DUP4
0xE9 DUP2
0xEE PUSH(!(0x0 == POP(@0xD5) ^ POP(@0xCA) + POP(@0xE5)))
0xEF SWAP5
0xF0 POP()
0xF1 POP()
0xF2 POP()
0xF3 POP()
0xF4 POP()
# Stack: [@0xEE @0x174 :label23 @0x16E @0x174 @0x16E]
0xF6 SWAP2
0xF7 SWAP1
0xF8 POP()
0xF9 JUMP(POP(:label23))
:label5
# Stack: [@0x174 :label26 @0x16E @0x174 @0x16E]
0xFB PUSH(0x0)
0xFE PUSH(EXTCODEHASH(ADDRESS()))
0xFF DUP1
0x102 MSTORE(0x7, POP(@0xFE))
0x103 PUSH(0x0)
0x105 PUSH(0x0)
0x107 PUSH(0x0)
:label6
# Stack: [[@0x13B | 0x0] [0x0 | @0x133] [0x0 | @0x12D] @0xFE 0x0 @0x174 :label26 @0x16E @0x174 @0x16E]
0x10C DUP1
0x112 JUMPI(:label8, !(POP() < 0x20))
# Stack: [[@0x13B | 0x0] [0x0 | @0x133] [0x0 | @0x12D] @0xFE 0x0 @0x174 :label26 @0x16E @0x174 @0x16E]
0x117 DUP6
0x118 DUP2
0x120 JUMPI(:label7, !(SHR(POP(), POP(@0x174)) & 0x1 == 0x1))
# Stack: [[0x0 | @0x13B] [0x0 | @0x133] [0x0 | @0x12D] @0xFE 0x0 @0x174 :label26 @0x16E @0x174 @0x16E]
0x128 DUP1
0x12C DUP3
0x12D PUSH(POP() + (SHR(POP() * 0x8, MLOAD(0x7)) & 0xFF))
0x12E SWAP3
0x12F POP()
0x132 DUP2
0x133 PUSH(POP() + 0x1)
0x134 SWAP2
0x135 POP()
:label7
# Stack: [[0x0 | @0x13B] [@0x133 | 0x0] [@0x12D | 0x0] @0xFE 0x0 @0x174 :label26 @0x16E @0x174 @0x16E]
0x13A DUP1
0x13B PUSH(POP() + 0x1)
0x13C SWAP1
0x13D POP()
0x141 JUMP(:label6)
:label8
# Stack: [[@0x13B | 0x0] [@0x133 | 0x0] [@0x12D | 0x0] @0xFE 0x0 @0x174 :label26 @0x16E @0x174 @0x16E]
0x143 POP()
0x146 DUP1
0x14B DUP2
0x151 PUSH((0x309 == POP() % 0x539) * (POP() == 0x11))
0x152 SWAP4
0x153 POP()
0x154 POP()
0x155 POP()
0x156 POP()
# Stack: [@0x151 @0x174 :label26 @0x16E @0x174 @0x16E]
0x158 SWAP2
0x159 SWAP1
0x15A POP()
0x15B JUMP(POP(:label26))
:label9
# Stack: [@0x174 :label29 @0x16E @0x174 @0x16E]
0x15D PUSH(0x0)
0x15F PUSH(0x0)
0x161 SWAP1
0x162 POP()
# Stack: [0x0 @0x174 :label29 @0x16E @0x174 @0x16E]
0x164 SWAP2
0x165 SWAP1
0x166 POP()
0x167 JUMP(POP(:label29))
:label10
# Stack: []
0x16E PUSH(SHR(0xE0, CALLDATALOAD(0x0)))
0x174 PUSH(SHR(0xE0, CALLDATALOAD(0x4)))
0x175 DUP2
0x17B DUP1
0x180 JUMPI(:label11, POP(@0x16E) == 0x76726679)
# Stack: [@0x16E @0x174 @0x16E]
0x186 DUP1
0x18B JUMPI(:label13, POP(@0x16E) == 0x41414141)
# Stack: [@0x16E @0x174 @0x16E]
0x191 DUP1
0x196 JUMPI(:label16, POP(@0x16E) == 0x42424242)
# Stack: [@0x16E @0x174 @0x16E]
0x19C DUP1
0x1A1 JUMPI(:label19, POP(@0x16E) == 0x43434343)
# Stack: [@0x16E @0x174 @0x16E]
0x1A7 DUP1
0x1AC JUMPI(:label22, POP(@0x16E) == 0x44444444)
# Stack: [@0x16E @0x174 @0x16E]
0x1B2 DUP1
0x1B7 JUMPI(:label25, POP(@0x16E) == 0x45454545)
# Stack: [@0x16E @0x174 @0x16E]
0x1BD DUP1
0x1C2 JUMPI(:label28, POP(@0x16E) == 0x46464646)
# Stack: [@0x16E @0x174 @0x16E]
0x1C3 PUSH(0x0)
0x1C5 PUSH(0x0)
0x1C7 REVERT()
# Stack: []
0x1C8 PUSH(:label31)
:label11
# Stack: [@0x16E @0x174 @0x16E]
0x1D0 PUSH(SLOAD(0x1337))
0x1D3 DUP1
0x1D9 JUMPI(:label12, !(POP(@0x1D0) == 0xFF))
# Stack: [@0x1D0 @0x16E @0x174 @0x16E]
0x1E3 SSTORE(0x736F6C766564, 0x1)
:label12
# Stack: [@0x1D0 @0x16E @0x174 @0x16E]
0x1E5 POP()
0x1E9 JUMP(:label31)
:label13
# Stack: [@0x16E @0x174 @0x16E]
0x1EB PUSH(:label14)
0x1EE DUP3
0x1F2 JUMP(:label1)
:label14
# Stack: [@0x3A @0x16E @0x174 @0x16E]
0x1F4 DUP1
0x1FA JUMPI(:label15, !!POP(@0x3A))
# Stack: [@0x3A @0x16E @0x174 @0x16E]
0x1FE PUSH(SLOAD(0x1337))
0x201 DUP1
0x206 SSTORE(0x1337, POP(@0x1FE) ^ 0x4A)
0x207 POP()
:label15
# Stack: [@0x3A @0x16E @0x174 @0x16E]
0x209 POP()
0x20D JUMP(:label31)
:label16
# Stack: [@0x16E @0x174 @0x16E]
0x20F PUSH(:label17)
0x212 DUP3
0x216 JUMP(:label2)
:label17
# Stack: [@0x5C @0x16E @0x174 @0x16E]
0x218 DUP1
0x21E JUMPI(:label18, !!POP(@0x5C))
# Stack: [@0x5C @0x16E @0x174 @0x16E]
0x222 PUSH(SLOAD(0x1337))
0x225 DUP1
0x22A SSTORE(0x1337, POP(@0x222) ^ 0xD1)
0x22B POP()
:label18
# Stack: [@0x5C @0x16E @0x174 @0x16E]
0x22D POP()
0x231 JUMP(:label31)
:label19
# Stack: [@0x16E @0x174 @0x16E]
0x233 PUSH(:label20)
0x236 DUP3
0x23A JUMP(:label3)
:label20
# Stack: [@0xA6 @0x16E @0x174 @0x16E]
0x23C DUP1
0x242 JUMPI(:label21, !!POP(@0xA6))
# Stack: [@0xA6 @0x16E @0x174 @0x16E]
0x246 PUSH(SLOAD(0x1337))
0x249 DUP1
0x24E SSTORE(0x1337, POP(@0x246) ^ 0x64)
0x24F POP()
:label21
# Stack: [@0xA6 @0x16E @0x174 @0x16E]
0x251 POP()
0x255 JUMP(:label31)
:label22
# Stack: [@0x16E @0x174 @0x16E]
0x257 PUSH(:label23)
0x25A DUP3
0x25E JUMP(:label4)
:label23
# Stack: [@0xEE @0x16E @0x174 @0x16E]
0x260 DUP1
0x266 JUMPI(:label24, !!POP(@0xEE))
# Stack: [@0xEE @0x16E @0x174 @0x16E]
0x26A PUSH(SLOAD(0x1337))
0x26D DUP1
0x272 SSTORE(0x1337, POP(@0x26A) ^ 0xB2)
0x273 POP()
:label24
# Stack: [@0xEE @0x16E @0x174 @0x16E]
0x275 POP()
0x279 JUMP(:label31)
:label25
# Stack: [@0x16E @0x174 @0x16E]
0x27B PUSH(:label26)
0x27E DUP3
0x282 JUMP(:label5)
:label26
# Stack: [@0x151 @0x16E @0x174 @0x16E]
0x286 DUP1
0x28C JUMPI(:label27, !(POP(@0x151) == 0x1))
# Stack: [@0x151 @0x16E @0x174 @0x16E]
0x290 PUSH(SLOAD(0x1337))
0x293 DUP1
0x298 SSTORE(0x1337, POP(@0x290) ^ 0x63)
0x299 POP()
:label27
# Stack: [@0x151 @0x16E @0x174 @0x16E]
0x29B POP()
0x29F JUMP(:label31)
:label28
# Stack: [@0x16E @0x174 @0x16E]
0x2A1 PUSH(:label29)
0x2A4 DUP3
0x2A8 JUMP(:label9)
:label29
# Stack: [0x0 @0x16E @0x174 @0x16E]
0x2AA DUP1
0x2B0 JUMPI(:label30, !!POP(0x0))
# Stack: [0x0 @0x16E @0x174 @0x16E]
0x2B4 PUSH(SLOAD(0x1337))
0x2B7 DUP1
0x2BC SSTORE(0x1337, POP(@0x2B4) ^ 0xC4)
0x2BD POP()
:label30
# Stack: [0x0 @0x16E @0x174 @0x16E]
0x2BF POP()
:label31
# Stack: [@0x16E @0x174 @0x16E]
0x2C1 POP()
0x2C2 STOP()