-
Notifications
You must be signed in to change notification settings - Fork 4
/
wrc20ChallengeFiller.yml
765 lines (674 loc) · 56 KB
/
wrc20ChallengeFiller.yml
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
wrc20Challenge:
env:
currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba
currentDifficulty: '0x020000'
currentGasLimit: '89128960'
currentNumber: '1'
currentTimestamp: '1000'
previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6
pre:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: '100000000000'
code: ''
nonce: '0x4'
storage: {}
# WRC20 contract, compiled using Rust
a000000000000000000000000000000000000000:
balance: '0'
nonce: ''
storage: {
# Hardcoded token balances: as specified in the prompt
# balanceOf[0xeD09375DC6B20050d242d1611af97eE4A6E93CAd]: 1000000
0xfcd2f76724ed5243064dd923bd8cf6cfa3ea0d6a9137903fd479deb7a7714b4e: 1000000,
# Harcode allowance
# allowance[0xe929CF2544363bdCEE4a976515d5F97758Ef476c][0xeD09375DC6B20050d242d1611af97eE4A6E93CAd] = 100
0x8536ba5bd1e9e92f54241983ac85ea294c0beb843f933dd37e1970093be0979d: 100,
}
code: '0x0061736d0100000001400b60037f7f7f017f60027f7f017f60027f7f006000017f60037f7f7f0060017f0060000060057f7f7f7f7f0060047f7f7f7f0060047f7f7f7f017f60017f017f029c010708657468657265756d0c73746f7261676553746f7265000208657468657265756d0f67657443616c6c4461746153697a65000308657468657265756d0c63616c6c44617461436f7079000408657468657265756d0967657443616c6c6572000508657468657265756d06726576657274000208657468657265756d0666696e697368000208657468657265756d0b73746f726167654c6f61640002032c2b0605020204080504020a04040202020602020405050604080200070802020504080408040109030104020605030100110609017f01418080c0000b071102066d656d6f72790200046d61696e00070aef422b801902057f047e230041f0036b2200240020004199a78ad00136009c01200041ddeafcec7b3600a00120004186fafb1e3600a40120004195b1ef8c043600a801200041b1f894bf063600ac0120004198acb4e87d3600b001200041908ca6d57a3600b401200041ddc5b5f7033600b801200041aec0fe8e7e3600bc011001210220004190016a10012201102420002802940121032000280290012204410020011002200020013602c801200020033602c401200020043602c0010240024002400240200241034d0d0020004188016a200041c0016a410041041027200041d0016a200028028801200028028c01101d200041d0016a2000419c016a102e044020024118470d0120004180016a200041c0016a41041026200041f0026a200028028001200028028401101d200041a0036a410036020020004198036a42003703002000420037039003200041f8006a200041f0026a41004114102720004190036a41142000280278200028027c100c200041b0036a20004190036a1013200041e8036a4200370300200041e0036a4200370300200041d8036a4200370300200042003703d003200041b0036a4120200041d0036a4120102c450d02050b024002400240024002400240200041d0016a200041a0016a102e044020014120470d0720004190026a101b200041f0006a200041c0016a410441181027200041f8016a20002802702000280274101d41002101200041c0026a4100360200200041b8026a4200370300200042003703b002200041e8006a200041f8016a410041141027200041b0026a41142000280268200028026c100c200042003703e001200041e0006a200041c0016a41181026200041e0016a410820002802602000280264100c200041e8026a22034200370300200041e0026a4200370300200041d8026a4200370300200042003703d0020340200141186a411f4d0440200141084f0d03200120036a200041e0016a20016a2d00003a0000200141016a21010c01050b0b200041f0026a20004190026a101320004190036a200041b0026a1013200029038803210520002903e8022106200041c0036a4200370300200041b8036a4200370300200042003703b0032000200542288642808080808080c0ff00832005423886842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe03832005423888848484200642288642808080808080c0ff00832006423886842006421886428080808080e03f8320064208864280808080f01f838484200642088842808080f80f832006421888428080fc07838420064228884280fe0383200642388884848422067d2205423886200542288642808080808080c0ff0083842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe038320054238888484843703c80320002903a8032105200041e0036a4200370300200041d8036a4200370300200042003703d0032000200542288642808080808080c0ff00832005423886842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe0383200542388884848420067c2205423886200542288642808080808080c0ff0083842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe038320054238888484843703e80320004190026a200041b0036a1015200041b0026a200041d0036a1015050b200041d0016a200041a4016a102e0d01200041d0016a200041a8016a102e0d02200041d0016a200041ac016a102e0d03200041d0016a200041b0016a102e0d04200041d0016a200041b4016a102e044020004190036a101b200041d8006a200041c0016a410441181027200041d0026a2000280258200028025c101d200041c0036a4100360200200041b8036a4200370300200042003703b003200041d0006a200041d0026a410041141027200041b0036a411420002802502000280254100c200041c8006a200041c0016a411841201027200041f0026a2000280248200028024c101d200041e8036a22014200370300200041e0036a4200370300200041d8036a4200370300200042003703d003200041406b200041f0026a4100410810272001410820002802402000280244100c20004190036a200041b0036a200041d0036a1012050b200041d0016a200041b8016a102e0d05200041d0016a200041bc016a102e044020024134470d07200041e0016a101b20004188026a410036020020004180026a4200370300200042003703f801200041386a200041c0016a410441181027200041f8016a41142000280238200028023c100c200041a0026a410036020020004198026a42003703002000420037039002200041306a200041c0016a4118412c102720004190026a411420002802302000280234100c200042003703a802200041286a200041c0016a412c41341027200041a8026a41082000280228200028022c100c20002903a8022105200041b0026a200041f8016a101320002903c8022206423886200642288642808080808080c0ff0083842006421886428080808080e03f8320064208864280808080f01f838484200642088842808080f80f832006421888428080fc07838420064228884280fe038320064238888484842206200542288642808080808080c0ff00832005423886842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe038320054238888484842207540d07200041d0026a200041f8016a200041e0016a101120002903e8022205423886200542288642808080808080c0ff0083842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe0383200542388884848422082007540d07200041f0026a20004190026a10132000290388032105200041a0036a420037030020004198036a420037030020004200370390032000200620077d2206423886200642288642808080808080c0ff0083842006421886428080808080e03f8320064208864280808080f01f838484200642088842808080f80f832006421888428080fc07838420064228884280fe038320064238888484843703a803200041c0036a4200370300200041b8036a4200370300200042003703b0032000200542288642808080808080c0ff00832005423886842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe0383200542388884848420077c2205423886200542288642808080808080c0ff0083842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe038320054238888484843703c803200041e0036a4200370300200041d8036a4200370300200042003703d0032000200820077d2205423886200542288642808080808080c0ff0083842005421886428080808080e03f8320054208864280808080f01f838484200542088842808080f80f832005421888428080fc07838420054228884280fe038320054238888484843703e803200041f8016a20004190036a101520004190026a200041b0036a1015200041f8016a200041e0016a200041d0036a1012050b200041f0036a24000f0b419480c000200141081019000b200041d0036a41a480c0004109102f0c060b200041d0036a41ad80c0004103102f0c050b200042003703d0030c050b20004280808080d0a0fdf0003703d0030c040b2002412c470d00200041206a200041c0016a410441181027200041d0026a20002802202000280224101d200041a0036a410036020020004198036a42003703002000420037039003200041186a200041d0026a41004114102720004190036a41142000280218200028021c100c200041106a200041c0016a4118412c1027200041f0026a20002802102000280214101d200041c0036a4100360200200041b8036a4200370300200042003703b003200041086a200041f0026a410041141027200041b0036a41142000280208200028020c100c200041d0036a20004190036a200041b0036a1011200041d0036a41201030000b410041001004000b200041b0036a41201030000b20002802d00320002802d8031030000b200041d0036a41081030000bf00902047f2b7e230041f0076b22022400200241c8076a4128102b1a0340200141c00746450440200241086a20016a200241c8076a41281028200141286a21010c01050b0b20002903c0012113200029039801210520002903702114200029034821152000290320210620002903b8012107200029039001210b20002903682108200029034021092000290318210c20002903b0012116200029038801211720002903602118200029033821192000290310210a20002903a801210e200029038001211a2000290358211b2000290330211c2000290308211d20002903a001210d2000290378210f2000290350211e2000290328211f2000290300212041a882c00021040340200341c00746450440200241086a20036a2201201f202085201e85200f85200d852210370300200141086a200a2019852018852017852016852211200620158520148520058520138522124201898522212009854237892222370300200141206a20114201892010852211200e854202892223370300200141186a2012201c201d85201b85201a85200e85220e420189852212200f854229892224370300200141106a20142009200c85200885200b85200785220f20104201898522098542278922103703002001200a200f420189200e85220a85423e8922253703002011201c852009201385212f20222025427f85832023852113202220242010427f858385210e2011201b85420a89222620072021854238892227200a201785420f892228427f85838521172006200985421b89222920262012201f85422489222a427f858385210f200d201285421289220d200a201985420689222b2011201d85420189222c427f85838521142005200985420889222d2008202185421989222e427f8583202b85211b200a201685423d89220520092015854214892206200c202185421c892207427f85838521152011201a85422d89220820072005427f85838521092012201e85420389220c20052008427f85838521192008200c427f8583200685211c2007200c2006427f858385211f200b202185421589220520122020852206202f420e892207427f858385210c200a201885422b89220b20072005427f858385210a422c8922082005200b427f858385211d20042903002006200b2008427f858385852120200441086a2104200341286a21032027202a2029427f858385210520082006427f85832007852106202420252023427f858385210720292027427f8583202885210b202c200d427f8583202d85210820232024427f85832010852116202e200d202d427f8583852118202a20282026427f858385211a20102022427f8583202585210d202e202b427f8583202c85211e0c01050b0b20002020370300200041a0016a200d370300200041f8006a200f370300200041d0006a201e370300200041286a201f370300200041a8016a200e37030020004180016a201a370300200041d8006a201b370300200041306a201c370300200041086a201d370300200041b0016a201637030020004188016a2017370300200041e0006a2018370300200041386a2019370300200041106a200a370300200041b8016a200737030020004190016a200b370300200041e8006a2008370300200041406b2009370300200041186a200c370300200041c0016a201337030020004198016a2005370300200041f0006a2014370300200041c8006a2015370300200041206a2006370300200241f0076a24000bb00301037f230041e0036b22022400200241186a200141d802102820022802e0012201418801490440200241e4016a220320016a41013a0000200241106a2003200141016a102a4100210120022802102002280214102b1a200241eb026a220320032d0000418001723a0000200241003602e0010340200141880146450440200241186a20016a220320032d0000200341cc016a2d0000733a0000200141016a21010c01050b0b200241186a1008200241003602900320024190036a41047221034100210103402001412046450440200120036a41003a0000200220022802900341016a36029003200141016a21010c01050b0b200241b8036a20024190036a4124102820024188036a2201200241d4036a29020037030020024180036a2203200241cc036a290200370300200241f8026a2204200241c4036a290200370300200220022902bc033703f002200241086a200241186a41c80141201029200241f0026a41202002280208200228020c100c200041186a2001290300370000200041106a2003290300370000200041086a2004290300370000200020022903f002370000200241e0036a24000f050b1016000bb10201057f230041306b2202240020012802082104200128020021012002200036021820002802c80121032002200241186a36021c02402003450d0041880120036b220320044b0d00200241206a200120042003101e2002412c6a2802002104200228022821012002280224210320022802202105200241106a200041cc016a220620002802c801102a2002280210200228021420052003100c200041003602c8012002411c6a2006101f0b2002412c6a2103200241286a21050340200441880149450440200241206a20012004418801101e20032802002104200528020021012002411c6a2002280220101f0c01050b0b200241086a20002802c8012203200320046a200041cc016a10222002280208200228020c20012004100c200020002802c80120046a3602c801200241306a24000bc40101047f0240024002400240024020002802042204200028020822036b2002490440200220036a22052003490d0320044101742203200520052003491b22034100480d032004450d012000280200210620031010220504402005200620032004200420034b1b1028050b20052204450d020c04050b200028020021040c040b2003101022040d020b000b1031000b20002004360200200041046a2003360200200041086a28020021030b200041086a200220036a360200200320046a200220012002100c0bdd0101017f230041e0006b22042400200420013602082004200336020c200120034604402000200220011028200441e0006a24000f050b2004200441086a36024020042004410c6a360244200441dc006a41003602002004413c6a4102360200200441346a4103360200200441246a4103360200200441b884c0003602582004420137024c200441d481c0003602482004410336022c200442033702142004418081c0003602102004200441c8006a3602382004200441c4006a3602302004200441406b3602282004200441286a360220200441106a419082c0001023000b9b0101027f230041b0036b22012400200041c801102b210220014100360290014104210003402000418c014645044020014190016a20006a41003a0000200120012802900141016a36029001200041016a21000c01050b0b200141a0026a20014190016a418c011028200141086a200141a0026a4104724188011028200241003602c801200241cc016a200141086a4188011028200141b0036a24000baa0101027f230041e0056b22032400102d220441e5003a0008200442e1d8b1fbf6ae98b7e30037000020034289808080900137020420032004360200200320014114100b200320024114100b200341106a100d20034190036a20032802083602002003200329030037038803200341106a20034188036a100a20034188036a200341106a41d8021028200341e8026a20034188036a10092000200341e8026a4120101d200341e0056a24000ba20101027f230041e0056b22022400102d220341e6003a0008200342e2c2b18be6edd8b2cf0037000020024289808080900137020420022003360200200220014114100b200241106a100d20024190036a20022802083602002002200229030037038803200241106a20024188036a100a20024188036a200241106a41d8021028200241e8026a20024188036a10092000200241e8026a4120101d200241e0056a24000b7901037f027f41002000450d001a200021013f0022034110742102418889c0002802002200450440418889c000200236020020022100050b200020016a220120024b0440410041808004200141ffff037122026b410020021b20016a41107620036b4000417f460d011a050b418889c000200136020020000b0b7001017f230041406a22032400200341106a20012002100e200341386a4200370300200341306a4200370300200341286a420037030020034200370320200341086a200341106a410041201027200341206a41202003280208200328020c100c2000200341206a1014200341406b24000b7001017f230041406a22032400200341106a20002001100e200341386a4200370300200341306a4200370300200341286a420037030020034200370320200341086a200341106a410041201027200341206a41202003280208200328020c100c200341206a20021000200341406b24000b6e01017f230041406a22022400200241106a2001100f200241386a4200370300200241306a4200370300200241286a420037030020024200370320200241086a200241106a410041201027200241206a41202002280208200228020c100c2000200241206a1014200241406b24000b7601047f230041206b22022400200241186a22034200370300200241106a22044200370300200241086a2205420037030020024200370300200120021006200041186a2003290300370000200041106a2004290300370000200041086a200529030037000020002002290300370000200241206a24000b6e01017f230041406a22022400200241106a2000100f200241386a4200370300200241306a4200370300200241286a420037030020024200370320200241086a200241106a410041201027200241206a41202002280208200228020c100c200241206a20011000200241406b24000b7501017f230041406a220024002000411736020c200041e780c000360208200041346a4104360200200041246a41023602002000410536022c20004202370214200041b080c0003602102000200041386a3602302000200041086a3602282000200041286a360220200041106a41c080c0001023000b6f01017f230041306b2202240020022001360204200220003602002002412c6a41013602002002411c6a4102360200200241013602242002420237020c200241a487c0003602082002200241046a360228200220023602202002200241206a360218200241086a41b487c0001023000b6f01017f230041306b2202240020022001360204200220003602002002412c6a41013602002002411c6a4102360200200241013602242002420237020c200241c486c0003602082002200241046a360228200220023602202002200241206a360218200241086a41d486c0001023000b6c01017f230041306b2203240020032002360204200320013602002003412c6a41013602002003411c6a4102360200200341013602242003420237020c200341a884c000360208200320033602282003200341046a3602202003200341206a360218200341086a20001023000b6802017f037e230041306b22012400200029020821022000290210210320002902002104200141146a410036020020012004370318200141b884c000360210200142013702042001200141186a36020020012003370328200120023703202001200141206a1023000b5e01037f230041206b22012400200141186a22024100360200200141106a2203420037030020014200370308200141086a1003200041106a2002280200360000200041086a200329030037000020002001290308370000200141206a24000b6e01027f41012100024002400240419089c0002802004101460440419489c000419489c00028020041016a220036020020004103490d010c02050b419089c0004281808080103703000b419889c0002802002201417f4c0d00419889c000200136020020004102490d010b000b000b5001017f230041206b22032400200341086a200210242003410036021820032003290308370310200341106a20012002100b200041086a200328021836020020002003290310370200200341206a24000b4b02017f027e230041106b22042400200441086a200120022003102920042903082105200420032002200120021021200429030021062000200537020020002006370208200441106a24000b4501027f20002802002802002102410021000340200041880146450440200020026a220320032d0000200020016a2d0000733a0000200041016a21000c01050b0b200210080b3e01037f0240200204400340200020036a2d00002204200120036a2d00002205470d02200341016a22032002490d000b41000f050b41000f0b200420056b0b38000240200220014f044020042002490d012000200220016b3602042000200120036a3602000f050b200120021017000b200220041018000b3a000240200220014f044020024189014f0d012000200220016b3602042000200120036a3602000f050b200120021017000b20024188011018000b4a02017f017e230041206b2202240020012902002103200241146a20012902083702002002200337020c20022000360208200241b884c000360204200241b884c00036020020021025000b3501017f2001417f4a04400240200104402001101022020d0100050b410121020b20002001360204200020023602000f050b1031000b3901017f230041106b22012400200028020845044041ec87c000101a00050b2001200041146a2902003703082001200029020c370300101c000b3501017f230041106b22032400200341086a20022001280208220220012802002002102120002003290308370200200341106a24000b3301017f230041106b22042400200441086a2002200320012802002001280208102120002004290308370200200441106a24000b2c00200204400340200020012d00003a0000200041016a2100200141016a21012002417f6a22020d000b050b0b2d01017f230041106b22042400200441086a4100200320012002102120002004290308370200200441106a24000b2c01017f230041106b22032400200341086a20024188012001102220002003290308370200200341106a24000b2a01017f20010440200021020340200241003a0000200241016a21022001417f6a22010d000b050b20000b230002402001200346047f20002002460d012000200220011020450541000b0f0b41010b1201017f410910102200044020000f050b000b12002000280200200028020820014104102c0b0a00200020012002101d0b0900200020011005000b0a0041e883c000101a000b0b89090200418080c0000ba1087372632f657761736d5f746f6b656e2e727300000000100012000000910000001e000000457761736d436f696e455743380210000000000065001000020000005000100015000000e7030000050000007372632f6c6962636f72652f726573756c742e72733a207765206e657665722075736520696e7075745f6c617a790000980010002d000000c50010000c000000d100100003000000617373657274696f6e206661696c65643a2060286c656674203d3d20726967687429600a20206c6566743a2060602c0a2072696768743a2060603a20dc0010003400000064657374696e6174696f6e20616e6420736f7572636520736c69636573206861766520646966666572656e74206c656e6774687364031000180000004b080000090000005061644572726f72010000000000000082800000000000008a8000000000008000800080000000808b800000000000000100008000000000818000800000008009800000000000808a00000000000000880000000000000009800080000000000a000080000000008b800080000000008b0000000000008089800000000000800380000000000080028000000000008080000000000000800a800000000000000a00008000000080818000800000008080800000000000800100008000000000088000800000008000021000110000001102100017000000ec020000050000006361706163697479206f766572666c6f777372632f6c6962616c6c6f632f7261775f7665632e72734802100020000000680210001200000007000000000000000100000008000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e64657820697320303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393900007c0310000600000082031000220000006403100018000000090a0000050000007372632f6c6962636f72652f736c6963652f6d6f642e7273696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e67746820c403100016000000da0310000d00000064031000180000000f0a000005000000736c69636520696e64657820737461727473206174202062757420656e6473206174203078000000460410002b00000071041000150000005b0100001500000030041000160000005404000011000000300410001600000048040000280041b088c0000b567372632f6c6962636f72652f666d742f6d6f642e727363616c6c656420604f7074696f6e3a3a756e77726170282960206f6e206120604e6f6e65602076616c75657372632f6c6962636f72652f6f7074696f6e2e7273'
eD09375DC6B20050d242d1611af97eE4A6E93CAd:
balance: '100000000000'
nonce: ''
storage: {}
code: |
(module
(import "ethereum" "storageStore" (func $storageStore (param i32 i32)))
(import "ethereum" "call" (func $call (param i64 i32 i32 i32 i32) (result i32)))
(import "ethereum" "getReturnDataSize" (func $getReturnDataSize (result i32)))
(import "ethereum" "returnDataCopy" (func $returnDataCopy (param i32 i32 i32)))
(import "debug" "printMemHex" (func $printMemHex (param i32 i32)))
;;(import "debug" "print32" (func $print32 (param i32))) ;; wabt fails with this
(memory 1)
;; CONTRACT ADDRESS LENGTH = 20
(data (i32.const 0) "\a0\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
;; COMMAND 1: query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd LENGTH = 24
(data (i32.const 20) "\99\93\02\1a\ed\09\37\5d\c6\b2\00\50\d2\42\d1\61\1a\f9\7e\e4\a6\e9\3c\ad")
;; COMMAND 2: Transfer 500000 to 0xe929CF2544363bdCEE4a976515d5F97758Ef476c LENGTH = 32
(data (i32.const 44) "\5d\35\9f\bd\e9\29\CF\25\44\36\3b\dC\EE\4a\97\65\15\d5\F9\77\58\Ef\47\6c\00\00\00\00\00\07\a1\20")
;; COMMAND 3: Query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd LENGTH = 24
(data (i32.const 76) "\99\93\02\1a\ed\09\37\5d\c6\b2\00\50\d2\42\d1\61\1a\f9\7e\e4\a6\e9\3c\ad")
;; COMMAND 4: Query balance of 0xe929CF2544363bdCEE4a976515d5F97758Ef476c LENGTH = 24
(data (i32.const 100) "\99\93\02\1a\e9\29\CF\25\44\36\3b\dC\EE\4a\97\65\15\d5\F9\77\58\Ef\47\6c")
;; COMMAND 5: Query token name LENGTH = 4
(data (i32.const 124) "\06\fd\de\03")
;; COMMAND 6: Query token symbol LENGTH = 4
(data (i32.const 128) "\95\d8\9b\41")
;; COMMAND 7: Query decimals LENGTH = 4
(data (i32.const 132) "\31\3c\e5\67")
;; COMMAND 8: Approve 100 tokens to 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b LENGTH = 32
(data (i32.const 136) "\10\86\a9\aa\a9\4f\53\74\fc\e5\ed\bc\8e\2a\86\97\c1\53\31\67\7e\6e\bf\0b\00\00\00\00\00\00\00\64")
;; COMMAND 9: Check allowance from 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd to 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b LENGTH = 44
(data (i32.const 168) "\dd\62\ed\3e\ed\09\37\5d\c6\b2\00\50\d2\42\d1\61\1a\f9\7e\e4\a6\e9\3c\ad\a9\4f\53\74\fc\e5\ed\bc\8e\2a\86\97\c1\53\31\67\7e\6e\bf\0b")
;; COMMAND 10: LENGTH = 52
;; Transfer 50
;; From (owner): 0xe929CF2544363bdCEE4a976515d5F97758Ef476c
;; To (recipient): 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b
(data (i32.const 216) "\2e\a0\df\e1\e9\29\cf\25\44\36\3b\dc\ee\4a\97\65\15\d5\f9\77\58\ef\47\6c\a9\4f\53\74\fc\e5\ed\bc\8e\2a\86\97\c1\53\31\67\7e\6e\bf\0b\00\00\00\00\00\00\00\32")
;; COMMAND 11: Get balanceOf[0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b] LENGTH = 24
(data (i32.const 268) "\99\93\02\1a\a9\4f\53\74\fc\e5\ed\bc\8e\2a\86\97\c1\53\31\67\7e\6e\bf\0b")
;; COMMAND 12: Query total supply LENGTH = 4
(data (i32.const 292) "\18\16\0d\dd")
;; COMMAND XX: ???
(data (i32.const 296) "")
;; storage keys
(data (i32.const 704) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01") ;; 01
(data (i32.const 736) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02") ;; 02
(data (i32.const 768) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03") ;; 03
(data (i32.const 800) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04") ;; 04
(data (i32.const 832) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\05") ;; 05
(data (i32.const 864) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\06") ;; 06
(data (i32.const 896) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\07") ;; 07
(data (i32.const 928) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08") ;; 08
(data (i32.const 960) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\09") ;; 09
(data (i32.const 992) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0a") ;; 10
(data (i32.const 1024) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0b") ;; 11
(data (i32.const 1056) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0c") ;; 12
(data (i32.const 1088) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0d") ;; 13
(data (i32.const 1120) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0e") ;; 14
(data (i32.const 1152) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0f") ;; 15
(data (i32.const 1184) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10") ;; 16
(data (i32.const 1216) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\11") ;; 17
(data (i32.const 1248) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\12") ;; 18
(data (i32.const 1280) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\13") ;; 19
(data (i32.const 1312) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\14") ;; 20
(data (i32.const 1344) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\15") ;; 21
(data (i32.const 1376) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\16") ;; 22
(data (i32.const 1408) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\17") ;; 23
(data (i32.const 1440) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\18") ;; 24
(export "memory" (memory 0))
(export "main" (func $main))
(func $main
;; locals
(local $memOffset i32)
(local $ptrAddress i32)
(local $ptrValueZero i32)
(local $ptrCommand1 i32)
(local $ptrCommand2 i32)
(local $ptrCommand3 i32)
(local $ptrCommand4 i32)
(local $ptrCommand5 i32)
(local $ptrCommand6 i32)
(local $ptrCommand7 i32)
(local $ptrCommand8 i32)
(local $ptrCommand9 i32)
(local $ptrCommand10 i32)
(local $ptrCommand11 i32)
(local $ptrCommand12 i32)
(local $lenCommand1 i32)
(local $lenCommand2 i32)
(local $lenCommand3 i32)
(local $lenCommand4 i32)
(local $lenCommand5 i32)
(local $lenCommand6 i32)
(local $lenCommand7 i32)
(local $lenCommand8 i32)
(local $lenCommand9 i32)
(local $lenCommand10 i32)
(local $lenCommand11 i32)
(local $lenCommand12 i32)
(local $ptrCallResult1 i32)
(local $ptrCallResult2 i32)
(local $ptrCallResult3 i32)
(local $ptrCallResult4 i32)
(local $ptrCallResult5 i32)
(local $ptrCallResult6 i32)
(local $ptrCallResult7 i32)
(local $ptrCallResult8 i32)
(local $ptrCallResult9 i32)
(local $ptrCallResult10 i32)
(local $ptrCallResult11 i32)
(local $ptrCallResult12 i32)
(local $ptrStorageKey1 i32)
(local $ptrStorageKey2 i32)
(local $ptrStorageKey3 i32)
(local $ptrStorageKey4 i32)
(local $ptrStorageKey5 i32)
(local $ptrStorageKey6 i32)
(local $ptrStorageKey7 i32)
(local $ptrStorageKey8 i32)
(local $ptrStorageKey9 i32)
(local $ptrStorageKey10 i32)
(local $ptrStorageKey11 i32)
(local $ptrStorageKey12 i32)
(local $ptrStorageKey13 i32)
(local $ptrStorageKey14 i32)
(local $ptrStorageKey15 i32)
(local $ptrStorageKey16 i32)
(local $ptrStorageKey17 i32)
(local $ptrStorageKey18 i32)
(local $ptrStorageKey19 i32)
(local $ptrStorageKey20 i32)
(local $ptrStorageKey21 i32)
(local $ptrStorageKey22 i32)
(local $ptrStorageKey23 i32)
(local $ptrStorageKey24 i32)
(local $ptrReturnData1 i32)
(local $ptrReturnData2 i32)
(local $ptrReturnData3 i32)
(local $ptrReturnData4 i32)
(local $ptrReturnData5 i32)
(local $ptrReturnData6 i32)
(local $ptrReturnData7 i32)
(local $ptrReturnData8 i32)
(local $ptrReturnData9 i32)
(local $ptrReturnData10 i32)
(local $ptrReturnData11 i32)
(local $ptrReturnData12 i32)
;; init data pointers
(set_local $ptrAddress (i32.const 0))
(set_local $ptrCommand1 (i32.const 20))
(set_local $ptrCommand2 (i32.const 44))
(set_local $ptrCommand3 (i32.const 76))
(set_local $ptrCommand4 (i32.const 100))
(set_local $ptrCommand5 (i32.const 124))
(set_local $ptrCommand6 (i32.const 128))
(set_local $ptrCommand7 (i32.const 132))
(set_local $ptrCommand8 (i32.const 136))
(set_local $ptrCommand9 (i32.const 168))
(set_local $ptrCommand10 (i32.const 216))
(set_local $ptrCommand11 (i32.const 268))
(set_local $ptrCommand12 (i32.const 292))
(set_local $lenCommand1 (i32.const 24))
(set_local $lenCommand2 (i32.const 32))
(set_local $lenCommand3 (i32.const 24))
(set_local $lenCommand4 (i32.const 24))
(set_local $lenCommand5 (i32.const 4))
(set_local $lenCommand6 (i32.const 4))
(set_local $lenCommand7 (i32.const 4))
(set_local $lenCommand8 (i32.const 32))
(set_local $lenCommand9 (i32.const 44))
(set_local $lenCommand10 (i32.const 52))
(set_local $lenCommand11 (i32.const 24))
(set_local $lenCommand12 (i32.const 4))
;; memory layout and pointers
(set_local $memOffset (i32.const 704))
(set_local $ptrStorageKey1 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 0)))) ;; 704
(set_local $ptrStorageKey2 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 1)))) ;; 736
(set_local $ptrStorageKey3 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 2)))) ;; 768
(set_local $ptrStorageKey4 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 3)))) ;; 800
(set_local $ptrStorageKey5 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 4)))) ;; 832
(set_local $ptrStorageKey6 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 5)))) ;; 864
(set_local $ptrStorageKey7 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 6)))) ;; 896
(set_local $ptrStorageKey8 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 7)))) ;; 928
(set_local $ptrStorageKey9 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 8)))) ;; 960
(set_local $ptrStorageKey10 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 9)))) ;; 992
(set_local $ptrStorageKey11 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 10)))) ;; 1024
(set_local $ptrStorageKey12 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 11)))) ;; 1056
(set_local $ptrStorageKey13 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 12)))) ;; 1088
(set_local $ptrStorageKey14 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 13)))) ;; 1120
(set_local $ptrStorageKey15 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 14)))) ;; 1152
(set_local $ptrStorageKey16 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 15)))) ;; 1184
(set_local $ptrStorageKey17 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 16)))) ;; 1216
(set_local $ptrStorageKey18 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 17)))) ;; 1248
(set_local $ptrStorageKey19 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 18)))) ;; 1280
(set_local $ptrStorageKey20 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 19)))) ;; 1312
(set_local $ptrStorageKey21 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 20)))) ;; 1344
(set_local $ptrStorageKey22 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 21)))) ;; 1376
(set_local $ptrStorageKey23 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 22)))) ;; 1408
(set_local $ptrStorageKey24 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 23)))) ;; 1440
(set_local $ptrReturnData1 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 24)))) ;;
(set_local $ptrReturnData2 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 25)))) ;;
(set_local $ptrReturnData3 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 26)))) ;;
(set_local $ptrReturnData4 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 27)))) ;;
(set_local $ptrReturnData5 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 28))))
(set_local $ptrReturnData6 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 29))))
(set_local $ptrReturnData7 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 30))))
(set_local $ptrReturnData8 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 31))))
(set_local $ptrReturnData9 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 32))))
(set_local $ptrReturnData10 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 33))))
(set_local $ptrReturnData11 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 34))))
(set_local $ptrReturnData12 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 35))))
(set_local $ptrCallResult1 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 36)))) ;;
(set_local $ptrCallResult2 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 37)))) ;;
(set_local $ptrCallResult3 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 38)))) ;;
(set_local $ptrCallResult4 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 39)))) ;;
(set_local $ptrCallResult5 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 40))))
(set_local $ptrCallResult6 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 41))))
(set_local $ptrCallResult7 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 42))))
(set_local $ptrCallResult8 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 43))))
(set_local $ptrCallResult9 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 44))))
(set_local $ptrCallResult10 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 45))))
(set_local $ptrCallResult11 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 46))))
(set_local $ptrCallResult12 (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 47))))
(set_local $ptrValueZero (i32.add (get_local $memOffset) (i32.mul (i32.const 32) (i32.const 48)))) ;;
;; ====================================================================================================
;; COMMAND 1: Query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd
(call $printMemHex (get_local $ptrCommand1) (get_local $lenCommand1))
(i32.store
(get_local $ptrCallResult1)
(call $call
;; gas
(i64.const 100000)
;; address offset
(get_local $ptrAddress)
;; value offset
(get_local $ptrValueZero)
;; data offset
(get_local $ptrCommand1)
;; data length
(get_local $lenCommand1)
)
)
;; [ 1 ] Command 1: call exit code
;; receives 0 = success, stored in key 1
;; store it
(call $printMemHex (get_local $ptrCallResult1) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey1) (get_local $ptrCallResult1))
;; read return val
(call $returnDataCopy
;; resultOffset
(get_local $ptrReturnData1)
;; dataOffset
(i32.const 0)
;; length
(call $getReturnDataSize)
)
;; [ 2 ] Command 1: call result
;; receives balance, stored in key 2
;; store it
(call $printMemHex (get_local $ptrReturnData1) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey2) (get_local $ptrReturnData1))
;; ====================================================================================================
;; COMMAND 2: Transfer 500000 to 0xe929CF2544363bdCEE4a976515d5F97758Ef476c
(call $printMemHex (get_local $ptrCommand2) (get_local $lenCommand2))
(i32.store
(get_local $ptrCallResult2)
(call $call
;; gas
(i64.const 1000000)
;; address offset
(get_local $ptrAddress)
;; value offset
(get_local $ptrValueZero)
;; data offset
(get_local $ptrCommand2)
;; data length
(get_local $lenCommand2)
)
)
;; [ 3 ] 2nd call exit code
;; store it
(call $printMemHex (get_local $ptrCallResult2) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey3) (get_local $ptrCallResult2))
;; read return val
(call $returnDataCopy
;; resultOffset
(get_local $ptrReturnData2)
;; dataOffset
(i32.const 0)
;; length
(call $getReturnDataSize)
)
(call $printMemHex (get_local $ptrReturnData2) (i32.const 32))
;; [ 4 ] 2nd call no output
;; store it
(call $storageStore (get_local $ptrStorageKey4) (get_local $ptrReturnData2))
;; ====================================================================================================
;; COMMAND 3: Query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd
(call $printMemHex (get_local $ptrCommand3) (get_local $lenCommand3))
(i32.store
(get_local $ptrCallResult3)
(call $call
;; gas
(i64.const 100000)
;; address offset
(get_local $ptrAddress)
;; value offset
(get_local $ptrValueZero)
;; data offset
(get_local $ptrCommand3)
;; data length
(get_local $lenCommand3)
)
)
;; [ 5 ] 3rd call exit code
;; store it
(call $printMemHex (get_local $ptrCallResult3) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey5) (get_local $ptrCallResult3))
;; read return val
(call $returnDataCopy
;; resultOffset
(get_local $ptrReturnData3)
;; dataOffset
(i32.const 0)
;; length
(call $getReturnDataSize)
)
;; [ 6 ] 3rd call result
;; store it
(call $printMemHex (get_local $ptrReturnData3) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey6) (get_local $ptrReturnData3))
;; ====================================================================================================
;; COMMAND 4: Query balance of 0xe929CF2544363bdCEE4a976515d5F97758Ef476c
(call $printMemHex (get_local $ptrCommand4) (get_local $lenCommand4))
(i32.store
(get_local $ptrCallResult4)
(call $call
;; gas
(i64.const 100000)
;; address offset
(get_local $ptrAddress)
;; value offset
(get_local $ptrValueZero)
;; data offset
(get_local $ptrCommand4)
;; data length
(get_local $lenCommand4)
)
)
;; [ 7 ] 4th call exit code
;; store it
(call $printMemHex (get_local $ptrCallResult4) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey7) (get_local $ptrCallResult4))
;; read return val
(call $returnDataCopy
;; resultOffset
(get_local $ptrReturnData4)
;; dataOffset
(i32.const 0)
;; length
(call $getReturnDataSize)
)
;; [ 8 ] 4th call result
;; store it
(call $printMemHex (get_local $ptrReturnData4) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey8) (get_local $ptrReturnData4))
;; ====================================================================================================
;; COMMAND 5: Query token name
(call $printMemHex (get_local $ptrCommand5) (get_local $lenCommand5))
(i32.store
(get_local $ptrCallResult5)
(call $call
;; gas
(i64.const 100000)
;; address offset
(get_local $ptrAddress)
;; value offset
(get_local $ptrValueZero)
;; data offset
(get_local $ptrCommand5)
;; data length
(get_local $lenCommand5)
)
)
;; [ 9 ] 5th exit code
(call $printMemHex (get_local $ptrCallResult5) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey9) (get_local $ptrCallResult5))
;; read return val
(call $returnDataCopy
;; resultOffset
(get_local $ptrReturnData5)
;; dataOffset
(i32.const 0)
(call $getReturnDataSize))
;; [ 10 ] 5th call result
(call $printMemHex (get_local $ptrReturnData5) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey10) (get_local $ptrReturnData5))
;; ====================================================================================================
;; COMMAND 6: Query token symbol
(call $printMemHex (get_local $ptrCommand6) (get_local $lenCommand6))
(i32.store
(get_local $ptrCallResult6)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand6)
(get_local $lenCommand6)
)
)
;; [ 11 ] 6th call exit code
(call $printMemHex (get_local $ptrCallResult6) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey11) (get_local $ptrCallResult6))
;; read return val
(call $returnDataCopy
(get_local $ptrReturnData6)
(i32.const 0)
(call $getReturnDataSize))
;; [ 12 ] 6th call result
(call $printMemHex (get_local $ptrReturnData6) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey12) (get_local $ptrReturnData6))
;; ====================================================================================================
;; COMMAND 7: Query number of decimals
(call $printMemHex (get_local $ptrCommand7) (get_local $lenCommand7))
(i32.store
(get_local $ptrCallResult7)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand7)
(get_local $lenCommand7)
)
)
;; [ 13 ] 7th call exit code
(call $printMemHex (get_local $ptrCallResult7) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey13) (get_local $ptrCallResult7))
;; read return val
(call $returnDataCopy
(get_local $ptrReturnData7)
(i32.const 0)
(call $getReturnDataSize))
;; [ 14 ] 7th call result
(call $printMemHex (get_local $ptrReturnData7) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey14) (get_local $ptrReturnData7))
;; ====================================================================================================
;; COMMAND 8:
(call $printMemHex (get_local $ptrCommand8) (get_local $lenCommand8))
(i32.store
(get_local $ptrCallResult8)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand8)
(get_local $lenCommand8)
)
)
;; [ 15 ] 8th call exit code
(call $printMemHex (get_local $ptrCallResult8) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey15) (get_local $ptrCallResult8))
;; read return value
(call $returnDataCopy
(get_local $ptrReturnData8)
(i32.const 0)
(call $getReturnDataSize)
)
;; [ 16 ] 8th call result
(call $printMemHex (get_local $ptrReturnData8) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey16) (get_local $ptrReturnData8))
;; ====================================================================================================
;; COMMAND 9:
(call $printMemHex (get_local $ptrCommand9) (get_local $lenCommand9))
(i32.store
(get_local $ptrCallResult9)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand9)
(get_local $lenCommand9)
)
)
;; [ 17 ] 9th call exit code
(call $printMemHex (get_local $ptrCallResult9) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey17) (get_local $ptrCallResult9))
;; read return value
(call $returnDataCopy
(get_local $ptrReturnData9)
(i32.const 0)
(call $getReturnDataSize)
)
;; [ 18 ] 9th call result
(call $printMemHex (get_local $ptrReturnData9) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey18) (get_local $ptrReturnData9))
;; ====================================================================================================
;; COMMAND 10:
(call $printMemHex (get_local $ptrCommand10) (get_local $lenCommand10))
(i32.store
(get_local $ptrCallResult10)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand10)
(get_local $lenCommand10)
)
)
;; [ 19 ] 10th call exit code
(call $printMemHex (get_local $ptrCallResult10) (i32.const 32))
(call $storageStore (get_local $ptrStorageKey19) (get_local $ptrCallResult10))
;; resd return value
(call $returnDataCopy
(get_local $ptrReturnData10)
(i32.const 0)
(call $getReturnDataSize))
;; [ 20 ] 10th call result
(call $printMemHex (get_local $ptrReturnData10) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey20) (get_local $ptrReturnData10))
;; ====================================================================================================
;; COMMAND 11:
(call $printMemHex (get_local $ptrCommand11) (get_local $lenCommand11))
(i32.store
(get_local $ptrCallResult11)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand11)
(get_local $lenCommand11)
)
)
;; [ 21 ] 11th call exit code
(call $printMemHex (get_local $ptrCallResult11) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey21) (get_local $ptrCallResult11))
;; read return value
(call $returnDataCopy
(get_local $ptrReturnData11)
(i32.const 0)
(call $getReturnDataSize))
;; [ 22 ] 11th call result
(call $printMemHex (get_local $ptrReturnData11) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey22) (get_local $ptrReturnData11))
;; ====================================================================================================
;; COMMAND 12:
(call $printMemHex (get_local $ptrCommand12) (get_local $lenCommand12))
(i32.store
(get_local $ptrCallResult12)
(call $call
(i64.const 100000)
(get_local $ptrAddress)
(get_local $ptrValueZero)
(get_local $ptrCommand12)
(get_local $lenCommand12)
)
)
;; [ 23 ] 12th call exit code
(call $printMemHex (get_local $ptrCallResult12) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey23) (get_local $ptrCallResult12))
;; [ 24 ] 12th call result
(call $printMemHex (get_local $ptrReturnData12) (i32.const 32))
;;(call $storageStore (get_local $ptrStorageKey24) (get_local $ptrReturnData12))
)
)
expect:
- indexes:
data: !!int -1
gas: !!int -1
value: !!int -1
network:
- ALL
result:
#a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
#balance: '99999853295'
eD09375DC6B20050d242d1611af97eE4A6E93CAd:
storage: {
# Command 1:
# Query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd
1: 0, # Exit code 0 = success
2: 1000000, # Result: balance
# Command 2:
# Transfer 500000 to 0xe929CF2544363bdCEE4a976515d5F97758Ef476c
3: 0, # Exit code
4: '', # Result empty
# Command 3:
# Query balance of 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd
5: 0, # Exit code
6: 500000, # Result: balance
# Command 4:
# Query balance of 0xe929CF2544363bdCEE4a976515d5F97758Ef476c
7: 0, # Exit code
8: 500000, # Result: balance
# Command 5:
# Query token name
9: 0, # Exit code
10: 0x457761736d436f696e0000000000000000000000000000000000000000000000, # Result: "EwasmCoin"
# Command 6:
# Query token symbol
11: 0, # Exit code
12: 0x4557430000000000000000000000000000000000000000000000000000000000, # Result: "EWC"
# Command 7:
# Query decimals
13: 0, # Exit code
14: 0, # Result: 0
# Command 8:
# Approve 100 tokens to 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b from 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd
15: 0, # Exit code
16: '', # Result: empty
# Command 9:
# Check allowance from 0xeD09375DC6B20050d242d1611af97eE4A6E93CAd to 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b
17: 0, # Exit code
18: 100, # Result: 100 allowance
# Command 10:
# Transfer 50 from 0xe929CF2544363bdCEE4a976515d5F97758Ef476c to 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b
19: 0, # Exit code
20: '', # Result: empty
# Command 11:
# Get balanceOf[0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b]
21: 0, # Exit code
#22: 50, # Result: balance
# Command 12:
# Query total supply
23: 0, # Exit code
#24: 100000, # Result: total supply
}
a000000000000000000000000000000000000000:
storage: {
# Token balances
0xfcd2f76724ed5243064dd923bd8cf6cfa3ea0d6a9137903fd479deb7a7714b4e: 500000, # balanceOf[0xeD09375DC6B20050d242d1611af97eE4A6E93CAd]
0xd7b2af2af2edabd4a832e5bd494f330b89bd4193bbc293d88aad25856e172df3: 499950, # balanceOf[0xe929cf2544363bdcee4a976515d5f97758ef476c]
0x3d6fe7cea7fc59a29adaf5aad1cf25136135ad72b2eca2fdcc80ee9f418d8393: 50, # balanceOf[0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b]
# Allowance
0x8536ba5bd1e9e92f54241983ac85ea294c0beb843f933dd37e1970093be0979d: 50, # hardcoded in prestate, reduced in command 10
0x2d47ea74e3c262d1fc6ebb801f17ee0874a926fab956d269ed0619dadc44f377: 100, # added in command 8
}
transaction:
data:
- '0x'
gasLimit:
- '0x5500000'
gasPrice: '0x01'
nonce: '0x04'
secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8"
to: 'eD09375DC6B20050d242d1611af97eE4A6E93CAd'
value:
- '0'