-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathquestionable.teal
467 lines (456 loc) Β· 4.62 KB
/
questionable.teal
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
#pragma version 6
txn NumAppArgs
int 0
==
bnz main_l20
txna ApplicationArgs 0
method "add(uint64,uint64)uint64"
==
bnz main_l19
txna ApplicationArgs 0
method "sub(uint64,uint64)uint64"
==
bnz main_l18
txna ApplicationArgs 0
method "mul(uint64,uint64)uint64"
==
bnz main_l17
txna ApplicationArgs 0
method "div(uint64,uint64)uint64"
==
bnz main_l16
txna ApplicationArgs 0
method "mod(uint64,uint64)uint64"
==
bnz main_l15
txna ApplicationArgs 0
method "all_laid_to_args(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)uint64"
==
bnz main_l14
txna ApplicationArgs 0
method "empty_return_subroutine()void"
==
bnz main_l13
txna ApplicationArgs 0
method "log_1()uint64"
==
bnz main_l12
txna ApplicationArgs 0
method "log_creation()string"
==
bnz main_l11
err
main_l11:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
==
&&
assert
callsub logcreation_8
store 67
byte 0x151f7c75
load 67
concat
log
int 1
return
main_l12:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
txn OnCompletion
int OptIn
==
txn ApplicationID
int 0
!=
&&
||
assert
callsub log1_7
store 65
byte 0x151f7c75
load 65
itob
concat
log
int 1
return
main_l13:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
txn OnCompletion
int OptIn
==
||
assert
callsub emptyreturnsubroutine_6
int 1
return
main_l14:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 30
txna ApplicationArgs 2
btoi
store 31
txna ApplicationArgs 3
btoi
store 32
txna ApplicationArgs 4
btoi
store 33
txna ApplicationArgs 5
btoi
store 34
txna ApplicationArgs 6
btoi
store 35
txna ApplicationArgs 7
btoi
store 36
txna ApplicationArgs 8
btoi
store 37
txna ApplicationArgs 9
btoi
store 38
txna ApplicationArgs 10
btoi
store 39
txna ApplicationArgs 11
btoi
store 40
txna ApplicationArgs 12
btoi
store 41
txna ApplicationArgs 13
btoi
store 42
txna ApplicationArgs 14
btoi
store 43
txna ApplicationArgs 15
store 46
load 46
int 0
extract_uint64
store 44
load 46
int 8
extract_uint64
store 45
load 30
load 31
load 32
load 33
load 34
load 35
load 36
load 37
load 38
load 39
load 40
load 41
load 42
load 43
load 44
load 45
callsub alllaidtoargs_5
store 47
byte 0x151f7c75
load 47
itob
concat
log
int 1
return
main_l15:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 24
txna ApplicationArgs 2
btoi
store 25
load 24
load 25
callsub mod_4
store 26
byte 0x151f7c75
load 26
itob
concat
log
int 1
return
main_l16:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 18
txna ApplicationArgs 2
btoi
store 19
load 18
load 19
callsub div_3
store 20
byte 0x151f7c75
load 20
itob
concat
log
int 1
return
main_l17:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 12
txna ApplicationArgs 2
btoi
store 13
load 12
load 13
callsub mul_2
store 14
byte 0x151f7c75
load 14
itob
concat
log
int 1
return
main_l18:
txn OnCompletion
int NoOp
==
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 6
txna ApplicationArgs 2
btoi
store 7
load 6
load 7
callsub sub_1
store 8
byte 0x151f7c75
load 8
itob
concat
log
int 1
return
main_l19:
txn OnCompletion
int NoOp
== // I believe there ahould be an assertion here to ensure that this is actually a NoOp
txn ApplicationID
int 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 0
txna ApplicationArgs 2
btoi
store 1
load 0
load 1
callsub add_0
store 2
byte 0x151f7c75
load 2
itob
concat
log
int 1
return
main_l20:
txn OnCompletion
int OptIn
==
bnz main_l22
err
main_l22:
txn ApplicationID
int 0
!=
assert
byte "optin call"
log
int 1
return
// add
add_0:
store 4
store 3
load 3
load 4
+
store 5
load 5
retsub
// sub
sub_1:
store 10
store 9
load 9
load 10
-
store 11
load 11
retsub
// mul
mul_2:
store 16
store 15
load 15
load 16
*
store 17
load 17
retsub
// div
div_3:
store 22
store 21
load 21
load 22
/
store 23
load 23
retsub
// mod
mod_4:
store 28
store 27
load 27
load 28
%
store 29
load 29
retsub
// all_laid_to_args
alllaidtoargs_5:
store 63
store 62
store 61
store 60
store 59
store 58
store 57
store 56
store 55
store 54
store 53
store 52
store 51
store 50
store 49
store 48
load 48
load 49
+
load 50
+
load 51
+
load 52
+
load 53
+
load 54
+
load 55
+
load 56
+
load 57
+
load 58
+
load 59
+
load 60
+
load 61
+
load 62
+
load 63
+
store 64
load 64
retsub
// empty_return_subroutine
emptyreturnsubroutine_6:
byte "appear in both approval and clear state"
log
retsub
// log_1
log1_7:
int 1
store 66
load 66
retsub
// log_creation
logcreation_8:
byte "logging creation"
len
itob
extract 6 0
byte "logging creation"
concat
store 68
load 68
retsub