-
Notifications
You must be signed in to change notification settings - Fork 3
/
smart_asa_approval.teal
1606 lines (1581 loc) · 23 KB
/
smart_asa_approval.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
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
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma version 7
intcblock 0 1 8 4 65536 18446744073709551615
bytecblock 0x736d6172745f6173615f6964 0x66726f7a656e 0x726573657276655f61646472 0x667265657a655f61646472 0x636c61776261636b5f61646472 0x151f7c75 0x6d616e616765725f61646472 0x746f74616c 0x64656661756c745f66726f7a656e 0x 0x646563696d616c73 0x756e69745f6e616d65 0x6e616d65 0x75726c 0x6d657461646174615f68617368 0x00
txn NumAppArgs
intc_0 // 0
==
bnz main_l28
txna ApplicationArgs 0
pushbytes 0xf80f5591 // "asset_app_optin(asset,axfer)void"
==
bnz main_l27
txna ApplicationArgs 0
pushbytes 0xe7ecd5a8 // "asset_create(uint64,uint32,bool,string,string,string,byte[],address,address,address,address)uint64"
==
bnz main_l26
txna ApplicationArgs 0
pushbytes 0xee6a84aa // "asset_config(asset,uint64,uint32,bool,string,string,string,byte[],address,address,address,address)void"
==
bnz main_l25
txna ApplicationArgs 0
pushbytes 0x2fc743a8 // "asset_transfer(asset,uint64,account,account)void"
==
bnz main_l24
txna ApplicationArgs 0
pushbytes 0x15cf2ba3 // "asset_freeze(asset,bool)void"
==
bnz main_l23
txna ApplicationArgs 0
pushbytes 0x7b351ce5 // "account_freeze(asset,account,bool)void"
==
bnz main_l22
txna ApplicationArgs 0
pushbytes 0x7dfcf38c // "asset_app_closeout(asset,account)void"
==
bnz main_l21
txna ApplicationArgs 0
pushbytes 0x4b17bf20 // "asset_destroy(asset)void"
==
bnz main_l20
txna ApplicationArgs 0
pushbytes 0x127fb717 // "get_asset_is_frozen(asset)bool"
==
bnz main_l19
txna ApplicationArgs 0
pushbytes 0x026f8a9d // "get_account_is_frozen(asset,account)bool"
==
bnz main_l18
txna ApplicationArgs 0
pushbytes 0xe97483bf // "get_circulating_supply(asset)uint64"
==
bnz main_l17
txna ApplicationArgs 0
pushbytes 0x4b8f8cf9 // "get_optin_min_balance(asset)uint64"
==
bnz main_l16
txna ApplicationArgs 0
pushbytes 0xce2f05f3 // "get_asset_config(asset)(uint64,uint32,bool,string,string,string,byte[],address,address,address,address)"
==
bnz main_l15
err
main_l15:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
callsub getassetconfig_24
store 56
bytec 5 // 0x151f7c75
load 56
concat
log
intc_1 // 1
return
main_l16:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
callsub getoptinminbalance_23
store 55
bytec 5 // 0x151f7c75
load 55
itob
concat
log
intc_1 // 1
return
main_l17:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
callsub getcirculatingsupply_22
store 53
bytec 5 // 0x151f7c75
load 53
itob
concat
log
intc_1 // 1
return
main_l18:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 49
txna ApplicationArgs 2
intc_0 // 0
getbyte
store 50
load 49
load 50
callsub getaccountisfrozen_21
store 51
bytec 5 // 0x151f7c75
bytec 15 // 0x00
intc_0 // 0
load 51
setbit
concat
log
intc_1 // 1
return
main_l19:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
callsub getassetisfrozen_20
store 48
bytec 5 // 0x151f7c75
bytec 15 // 0x00
intc_0 // 0
load 48
setbit
concat
log
intc_1 // 1
return
main_l20:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
callsub assetdestroy_19
intc_1 // 1
return
main_l21:
txn OnCompletion
pushint 2 // CloseOut
==
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 46
txna ApplicationArgs 2
intc_0 // 0
getbyte
store 47
load 46
load 47
callsub assetappcloseout_18
intc_1 // 1
return
main_l22:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 43
txna ApplicationArgs 2
intc_0 // 0
getbyte
store 44
txna ApplicationArgs 3
intc_0 // 0
intc_2 // 8
*
getbit
store 45
load 43
load 44
load 45
callsub accountfreeze_17
intc_1 // 1
return
main_l23:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 41
txna ApplicationArgs 2
intc_0 // 0
intc_2 // 8
*
getbit
store 42
load 41
load 42
callsub assetfreeze_16
intc_1 // 1
return
main_l24:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 37
txna ApplicationArgs 2
btoi
store 38
txna ApplicationArgs 3
intc_0 // 0
getbyte
store 39
txna ApplicationArgs 4
intc_0 // 0
getbyte
store 40
load 37
load 38
load 39
load 40
callsub assettransfer_15
intc_1 // 1
return
main_l25:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 25
txna ApplicationArgs 2
btoi
store 26
txna ApplicationArgs 3
intc_0 // 0
extract_uint32
store 27
txna ApplicationArgs 4
intc_0 // 0
intc_2 // 8
*
getbit
store 28
txna ApplicationArgs 5
store 29
txna ApplicationArgs 6
store 30
txna ApplicationArgs 7
store 31
txna ApplicationArgs 8
store 32
txna ApplicationArgs 9
store 33
txna ApplicationArgs 10
store 34
txna ApplicationArgs 11
store 35
txna ApplicationArgs 12
store 36
load 25
load 26
load 27
load 28
load 29
load 30
load 31
load 32
load 33
load 34
load 35
load 36
callsub assetconfig_14
intc_1 // 1
return
main_l26:
txn OnCompletion
intc_0 // NoOp
==
txn ApplicationID
intc_0 // 0
!=
&&
assert
txna ApplicationArgs 1
btoi
store 2
txna ApplicationArgs 2
intc_0 // 0
extract_uint32
store 3
txna ApplicationArgs 3
intc_0 // 0
intc_2 // 8
*
getbit
store 4
txna ApplicationArgs 4
store 5
txna ApplicationArgs 5
store 6
txna ApplicationArgs 6
store 7
txna ApplicationArgs 7
store 8
txna ApplicationArgs 8
store 9
txna ApplicationArgs 9
store 10
txna ApplicationArgs 10
store 11
txna ApplicationArgs 11
store 12
load 2
load 3
load 4
load 5
load 6
load 7
load 8
load 9
load 10
load 11
load 12
callsub assetcreate_13
store 13
bytec 5 // 0x151f7c75
load 13
itob
concat
log
intc_1 // 1
return
main_l27:
txn OnCompletion
intc_1 // OptIn
==
assert
txna ApplicationArgs 1
intc_0 // 0
getbyte
store 0
txn GroupIndex
intc_1 // 1
-
store 1
load 1
gtxns TypeEnum
intc_3 // axfer
==
assert
load 0
load 1
callsub assetappoptin_12
intc_1 // 1
return
main_l28:
txn OnCompletion
intc_0 // NoOp
==
bnz main_l34
txn OnCompletion
intc_3 // UpdateApplication
==
bnz main_l33
txn OnCompletion
pushint 5 // DeleteApplication
==
bnz main_l32
err
main_l32:
intc_0 // 0
return
main_l33:
intc_0 // 0
return
main_l34:
txn ApplicationID
intc_0 // 0
==
assert
callsub assetappcreate_11
intc_1 // 1
return
// init_global_state
initglobalstate_0:
bytec_0 // "smart_asa_id"
intc_0 // 0
app_global_put
bytec 7 // "total"
intc_0 // 0
app_global_put
bytec 10 // "decimals"
intc_0 // 0
app_global_put
bytec 8 // "default_frozen"
intc_0 // 0
app_global_put
bytec 11 // "unit_name"
bytec 9 // ""
app_global_put
bytec 12 // "name"
bytec 9 // ""
app_global_put
bytec 13 // "url"
bytec 9 // ""
app_global_put
bytec 14 // "metadata_hash"
bytec 9 // ""
app_global_put
bytec 6 // "manager_addr"
global ZeroAddress
app_global_put
bytec_2 // "reserve_addr"
global ZeroAddress
app_global_put
bytec_3 // "freeze_addr"
global ZeroAddress
app_global_put
bytec 4 // "clawback_addr"
global ZeroAddress
app_global_put
bytec_1 // "frozen"
intc_0 // 0
app_global_put
retsub
// init_local_state
initlocalstate_1:
txn Sender
bytec_0 // "smart_asa_id"
bytec_0 // "smart_asa_id"
app_global_get
app_local_put
txn Sender
bytec_1 // "frozen"
intc_0 // 0
app_local_put
retsub
// digit_to_ascii
digittoascii_2:
store 78
pushbytes 0x30313233343536373839 // "0123456789"
load 78
intc_1 // 1
extract3
retsub
// itoa
itoa_3:
store 77
load 77
intc_0 // 0
==
bnz itoa_3_l5
load 77
pushint 10 // 10
/
intc_0 // 0
>
bnz itoa_3_l4
bytec 9 // ""
itoa_3_l3:
load 77
pushint 10 // 10
%
callsub digittoascii_2
concat
b itoa_3_l6
itoa_3_l4:
load 77
pushint 10 // 10
/
load 77
swap
callsub itoa_3
swap
store 77
b itoa_3_l3
itoa_3_l5:
pushbytes 0x30 // "0"
itoa_3_l6:
retsub
// strip_len_prefix
striplenprefix_4:
extract 2 0
retsub
// underlying_asa_create_inner_tx
underlyingasacreateinnertx_5:
itxn_begin
intc_0 // 0
itxn_field Fee
pushint 3 // acfg
itxn_field TypeEnum
intc 5 // 18446744073709551615
itxn_field ConfigAssetTotal
intc_0 // 0
itxn_field ConfigAssetDecimals
intc_1 // 1
itxn_field ConfigAssetDefaultFrozen
pushbytes 0x532d415341 // "S-ASA"
itxn_field ConfigAssetUnitName
pushbytes 0x534d4152542d415341 // "SMART-ASA"
itxn_field ConfigAssetName
pushbytes 0x736d6172742d6173612d6170702d69643a // "smart-asa-app-id:"
global CurrentApplicationID
callsub itoa_3
concat
itxn_field ConfigAssetURL
global CurrentApplicationAddress
itxn_field ConfigAssetManager
global CurrentApplicationAddress
itxn_field ConfigAssetReserve
global CurrentApplicationAddress
itxn_field ConfigAssetFreeze
global CurrentApplicationAddress
itxn_field ConfigAssetClawback
itxn_submit
itxn CreatedAssetID
retsub
// smart_asa_transfer_inner_txn
smartasatransferinnertxn_6:
store 101
store 100
store 99
store 98
itxn_begin
intc_0 // 0
itxn_field Fee
intc_3 // axfer
itxn_field TypeEnum
load 98
itxn_field XferAsset
load 99
itxn_field AssetAmount
load 100
itxn_field AssetSender
load 101
itxn_field AssetReceiver
itxn_submit
retsub
// smart_asa_destroy_inner_txn
smartasadestroyinnertxn_7:
store 114
itxn_begin
intc_0 // 0
itxn_field Fee
pushint 3 // acfg
itxn_field TypeEnum
load 114
itxn_field ConfigAsset
itxn_submit
retsub
// is_valid_address_bytes_length
isvalidaddressbyteslength_8:
len
pushint 32 // 32
==
// Invalid Address length (must be 32 bytes)
assert
retsub
// circulating_supply
circulatingsupply_9:
store 91
global CurrentApplicationAddress
load 91
asset_holding_get AssetBalance
store 93
store 92
intc 5 // 18446744073709551615
load 92
-
retsub
// getter_preconditions
getterpreconditions_10:
store 115
bytec_0 // "smart_asa_id"
app_global_get
// Smart ASA ID dose not exist
assert
bytec_0 // "smart_asa_id"
app_global_get
load 115
==
// Invalid Smart ASA ID
assert
retsub
// asset_app_create
assetappcreate_11:
txn GlobalNumUint
pushint 5 // 5
==
// Wrong State Schema - Expexted Global Ints: 5
assert
txn GlobalNumByteSlice
intc_2 // 8
==
// Wrong State Schema - Expexted Global Bytes: 8
assert
txn LocalNumUint
pushint 2 // 2
==
// Wrong State Schema - Expexted Local Ints: 2
assert
txn LocalNumByteSlice
intc_0 // 0
==
// Wrong State Schema - Expexted Local Bytes: 0
assert
callsub initglobalstate_0
intc_1 // 1
return
// asset_app_optin
assetappoptin_12:
store 74
store 73
bytec_0 // "smart_asa_id"
app_global_get
// Smart ASA ID dose not exist
assert
bytec_0 // "smart_asa_id"
app_global_get
load 73
txnas Assets
==
// Invalid Smart ASA ID
assert
load 74
gtxns TypeEnum
intc_3 // axfer
==
// Reference Opt-In Txn: Wrong Txn Type (Expected: Axfer)
assert
load 74
gtxns XferAsset
bytec_0 // "smart_asa_id"
app_global_get
==
// Reference Opt-In Txn: Wrong Asset ID (Expected: Smart ASA ID)
assert
load 74
gtxns Sender
txn Sender
==
// Reference Opt-In Txn: Wrong Sender (Expected: App Caller)
assert
load 74
gtxns AssetReceiver
txn Sender
==
// Reference Opt-In Txn: Wrong Asset Receiver (Expected: App Caller)
assert
load 74
gtxns AssetAmount
intc_0 // 0
==
// Reference Opt-In Txn: Wrong Asset Amount (Expected: 0)
assert
load 74
gtxns AssetCloseTo
global ZeroAddress
==
// Reference Opt-In Txn: Wrong Asset CloseTo (Expected: Zero Address)
assert
txn Sender
load 73
txnas Assets
asset_holding_get AssetBalance
store 76
store 75
load 76
// Missing Opt-In to Underlying ASA
assert
callsub initlocalstate_1
bytec 8 // "default_frozen"
app_global_get
load 75
intc_0 // 0
>
||
bz assetappoptin_12_l2
txn Sender
bytec_1 // "frozen"
intc_1 // 1
app_local_put
assetappoptin_12_l2:
intc_1 // 1
return
// asset_create
assetcreate_13:
store 24
store 23
store 22
store 21
store 20
store 19
store 18
store 17
store 16
store 15
store 14
txn Sender
global CreatorAddress
==
// Caller not authorized (must be: App Creator Address)
assert
bytec_0 // "smart_asa_id"
app_global_get
!
// Smart ASA ID already exists
assert
load 21
callsub isvalidaddressbyteslength_8
load 22
callsub isvalidaddressbyteslength_8
load 23
callsub isvalidaddressbyteslength_8
load 24
callsub isvalidaddressbyteslength_8
bytec_0 // "smart_asa_id"
callsub underlyingasacreateinnertx_5
app_global_put
bytec 7 // "total"
load 14
app_global_put
bytec 10 // "decimals"
load 15
app_global_put
bytec 8 // "default_frozen"
load 16
app_global_put
bytec 11 // "unit_name"
load 17
extract 2 0
app_global_put
bytec 12 // "name"
load 18
extract 2 0
app_global_put
bytec 13 // "url"
load 19
extract 2 0
app_global_put
bytec 14 // "metadata_hash"
load 20
callsub striplenprefix_4
app_global_put
bytec 6 // "manager_addr"
load 21
app_global_put
bytec_2 // "reserve_addr"
load 22
app_global_put
bytec_3 // "freeze_addr"
load 23
app_global_put
bytec 4 // "clawback_addr"
load 24
app_global_put
bytec_0 // "smart_asa_id"
app_global_get
retsub
// asset_config
assetconfig_14:
store 90
store 89
store 88
store 87
store 86
store 85
store 84
store 83
store 82
store 81
store 80
store 79
bytec_0 // "smart_asa_id"
app_global_get
// Smart ASA ID dose not exist
assert
bytec_0 // "smart_asa_id"
app_global_get
load 79
txnas Assets
==
// Invalid Smart ASA ID
assert
load 87
callsub isvalidaddressbyteslength_8
load 88
callsub isvalidaddressbyteslength_8
load 89
callsub isvalidaddressbyteslength_8
load 90
callsub isvalidaddressbyteslength_8
txn Sender
bytec 6 // "manager_addr"
app_global_get
==
// Caller not authorized (must be: Manager Address)
assert
bytec_2 // "reserve_addr"
app_global_get
load 88
!=
bnz assetconfig_14_l5
assetconfig_14_l1:
bytec_3 // "freeze_addr"
app_global_get
load 89
!=
bnz assetconfig_14_l4
assetconfig_14_l2:
bytec 4 // "clawback_addr"
app_global_get
load 90
!=
bz assetconfig_14_l6
bytec 4 // "clawback_addr"
app_global_get
global ZeroAddress
!=
// Clawback Address has been deleted
assert
b assetconfig_14_l6
assetconfig_14_l4:
bytec_3 // "freeze_addr"
app_global_get
global ZeroAddress
!=
// Freeze Address has been deleted
assert
b assetconfig_14_l2
assetconfig_14_l5:
bytec_2 // "reserve_addr"
app_global_get
global ZeroAddress
!=
// Reserve Address has been deleted
assert
b assetconfig_14_l1
assetconfig_14_l6:
load 80
bytec_0 // "smart_asa_id"
app_global_get
callsub circulatingsupply_9
>=
// Invalid Total (must be >= Circulating Supply)
assert
bytec 7 // "total"
load 80
app_global_put
bytec 10 // "decimals"
load 81
app_global_put
bytec 8 // "default_frozen"
load 82
app_global_put
bytec 11 // "unit_name"
load 83
extract 2 0
app_global_put
bytec 12 // "name"
load 84
extract 2 0
app_global_put
bytec 13 // "url"
load 85
extract 2 0
app_global_put
bytec 14 // "metadata_hash"
load 86
callsub striplenprefix_4
app_global_put
bytec 6 // "manager_addr"
load 87
app_global_put
bytec_2 // "reserve_addr"
load 88
app_global_put
bytec_3 // "freeze_addr"
load 89
app_global_put
bytec 4 // "clawback_addr"
load 90
app_global_put
retsub
// asset_transfer
assettransfer_15:
store 97
store 96
store 95
store 94
bytec_0 // "smart_asa_id"
app_global_get
// Smart ASA ID dose not exist
assert
bytec_0 // "smart_asa_id"
app_global_get
load 94
txnas Assets
==
// Invalid Smart ASA ID
assert
load 96
txnas Accounts
callsub isvalidaddressbyteslength_8
load 97
txnas Accounts
callsub isvalidaddressbyteslength_8
txn Sender
load 96