BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Mainnet
  • /
  • KT1T1nF...Dfg9
FA2Ledger
operations (355)Storage Code Interact Tokens Metadata Fork Views Statistics Details
Latest
​x
593
1258
 
1
{ parameter (or
2
              (or
3
                (pair %balance_of
4
                  (list %requests (pair (address %owner) (nat %token_id)))
5
                  (contract %callback (list (pair
6
                                            (pair %request (address %owner)
7
                                                           (nat %token_id))
8
                                            (nat %balance)))))
9
                (list %mint (pair (nat %amount)
10
                                 (pair (bytes %metadata_uri)
11
                                       (pair (nat %royalties) (address %to_))))))
12
              (or (address %set_administrator)
13
                  (or
14
                    (list %transfer (pair (address %from_)
15
                                         (list %txs (pair (address %to_)
16
                                                         (pair (nat %token_id)
17
                                                               (nat %amount))))))
18
                    (list %update_operators (or
19
                                             (pair %add_operator (address %owner)
20
                                                                 (pair
21
                                                                   (address %operator)
22
                                                                   (nat %token_id)))
23
                                             (pair %remove_operator (address %owner)
24
                                                                    (pair
25
                                                                      (address %operator)
26
                                                                      (nat %token_id)))))))) ;
27
  storage (pair (address %administrator)
28
                (pair (nat %last_token_id)
29
                      (pair (big_map %ledger (pair address nat) nat)
30
                            (pair (big_map %metadata string bytes)
31
                                  (pair (nat %next_token_id)
32
                                        (pair
33
                                          (big_map %operators
34
                                            (pair (address %owner)
35
                                                  (pair (address %operator)
36
                                                        (nat %token_id)))
37
                                            unit)
38
                                          (pair
39
                                            (big_map %royalties nat (map address nat))
40
                                            (pair (big_map %supply nat nat)
41
                                                  (big_map %token_metadata nat
42
                                                                           (pair
43
                                                                             (nat %token_id)
44
                                                                             (map %token_info
45
                                                                               string
46
                                                                               bytes))))))))))) ;
47
  code { LAMBDA
48
           (pair
49
             (pair
50
               (lambda
51
                 (pair nat
52
                       (pair address
53
                             (pair nat
54
                                   (pair (big_map (pair address nat) nat)
55
                                         (pair (big_map string bytes)
56
                                               (pair nat
57
                                                     (pair
58
                                                       (big_map
59
                                                         (pair address
60
                                                               (pair address nat))
61
                                                         unit)
62
                                                       (pair
63
                                                         (big_map nat (map address nat))
64
                                                         (pair (big_map nat nat)
65
                                                               (big_map nat
66
                                                                        (pair nat
67
                                                                              (map
68
                                                                                string
69
                                                                                bytes))))))))))))
70
                 (pair bool
71
                       (pair address
72
                             (pair nat
73
                                   (pair (big_map (pair address nat) nat)
74
                                         (pair (big_map string bytes)
75
                                               (pair nat
76
                                                     (pair
77
                                                       (big_map
78
                                                         (pair address
79
                                                               (pair address nat))
80
                                                         unit)
81
                                                       (pair
82
                                                         (big_map nat (map address nat))
83
                                                         (pair (big_map nat nat)
84
                                                               (big_map nat
85
                                                                        (pair nat
86
                                                                              (map
87
                                                                                string
88
                                                                                bytes)))))))))))))
89
               (pair address nat))
90
             (pair address
91
                   (pair nat
92
                         (pair (big_map (pair address nat) nat)
93
                               (pair (big_map string bytes)
94
                                     (pair nat
95
                                           (pair
96
                                             (big_map (pair address (pair address nat))
97
                                                      unit)
98
                                             (pair (big_map nat (map address nat))
99
                                                   (pair (big_map nat nat)
100
                                                         (big_map nat
101
                                                                  (pair nat
102
                                                                        (map string
103
                                                                             bytes))))))))))))
104
           (pair nat
105
                 (pair address
106
                       (pair nat
107
                             (pair (big_map (pair address nat) nat)
108
                                   (pair (big_map string bytes)
109
                                         (pair nat
110
                                               (pair
111
                                                 (big_map
112
                                                   (pair address (pair address nat))
113
                                                   unit)
114
                                                 (pair (big_map nat (map address nat))
115
                                                       (pair (big_map nat nat)
116
                                                             (big_map nat
117
                                                                      (pair nat
118
                                                                            (map string
119
                                                                                 bytes))))))))))))
120
           { UNPAIR ;
121
             UNPAIR ;
122
             SWAP ;
123
             DUP ;
124
             CDR ;
125
             DIG 2 ;
126
             DIG 3 ;
127
             DIG 2 ;
128
             PAIR ;
129
             EXEC ;
130
             UNPAIR ;
131
             SWAP ;
132
             DUG 2 ;
133
             IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ;
134
             SWAP ;
135
             DUP ;
136
             GET 5 ;
137
             DIG 2 ;
138
             GET ;
139
             IF_NONE { PUSH nat 0 } {} ;
140
             PAIR } ;
141
         SWAP ;
142
         LAMBDA
143
           (pair address (pair address nat))
144
           unit
145
           { CAR ; SENDER ; COMPARE ; EQ ; IF {} { PUSH string "FA2_NOT_OWNER" ; FAILWITH } ; UNIT } ;
146
         SWAP ;
147
         LAMBDA
148
           (pair (pair address (pair address nat))
149
                 (pair address
150
                       (pair nat
151
                             (pair (big_map (pair address nat) nat)
152
                                   (pair (big_map string bytes)
153
                                         (pair nat
154
                                               (pair
155
                                                 (big_map
156
                                                   (pair address (pair address nat))
157
                                                   unit)
158
                                                 (pair (big_map nat (map address nat))
159
                                                       (pair (big_map nat nat)
160
                                                             (big_map nat
161
                                                                      (pair nat
162
                                                                            (map string
163
                                                                                 bytes))))))))))))
164
           (pair unit
165
                 (pair address
166
                       (pair nat
167
                             (pair (big_map (pair address nat) nat)
168
                                   (pair (big_map string bytes)
169
                                         (pair nat
170
                                               (pair
171
                                                 (big_map
172
                                                   (pair address (pair address nat))
173
                                                   unit)
174
                                                 (pair (big_map nat (map address nat))
175
                                                       (pair (big_map nat nat)
176
                                                             (big_map nat
177
                                                                      (pair nat
178
                                                                            (map string
179
                                                                                 bytes))))))))))))
180
           { UNPAIR ;
181
             DUP ;
182
             CAR ;
183
             SENDER ;
184
             COMPARE ;
185
             EQ ;
186
             IF
187
               { DROP ; PUSH bool True }
188
               { DUP 2 ; GET 11 ; DUP 2 ; GET 4 ; SENDER ; DIG 3 ; CAR ; PAIR 3 ; MEM } ;
189
             IF {} { PUSH string "FA2_NOT_OPERATOR" ; FAILWITH } ;
190
             UNIT ;
191
             PAIR } ;
192
         SWAP ;
193
         LAMBDA
194
           (pair unit
195
                 (pair address
196
                       (pair nat
197
                             (pair (big_map (pair address nat) nat)
198
                                   (pair (big_map string bytes)
199
                                         (pair nat
200
                                               (pair
201
                                                 (big_map
202
                                                   (pair address (pair address nat))
203
                                                   unit)
204
                                                 (pair (big_map nat (map address nat))
205
                                                       (pair (big_map nat nat)
206
                                                             (big_map nat
207
                                                                      (pair nat
208
                                                                            (map string
209
                                                                                 bytes))))))))))))
210
           (pair bool
211
                 (pair address
212
                       (pair nat
213
                             (pair (big_map (pair address nat) nat)
214
                                   (pair (big_map string bytes)
215
                                         (pair nat
216
                                               (pair
217
                                                 (big_map
218
                                                   (pair address (pair address nat))
219
                                                   unit)
220
                                                 (pair (big_map nat (map address nat))
221
                                                       (pair (big_map nat nat)
222
                                                             (big_map nat
223
                                                                      (pair nat
224
                                                                            (map string
225
                                                                                 bytes))))))))))))
226
           { CDR ; DUP ; CAR ; SENDER ; COMPARE ; EQ ; PAIR } ;
227
         SWAP ;
228
         LAMBDA
229
           (pair nat
230
                 (pair address
231
                       (pair nat
232
                             (pair (big_map (pair address nat) nat)
233
                                   (pair (big_map string bytes)
234
                                         (pair nat
235
                                               (pair
236
                                                 (big_map
237
                                                   (pair address (pair address nat))
238
                                                   unit)
239
                                                 (pair (big_map nat (map address nat))
240
                                                       (pair (big_map nat nat)
241
                                                             (big_map nat
242
                                                                      (pair nat
243
                                                                            (map string
244
                                                                                 bytes))))))))))))
245
           (pair bool
246
                 (pair address
247
                       (pair nat
248
                             (pair (big_map (pair address nat) nat)
249
                                   (pair (big_map string bytes)
250
                                         (pair nat
251
                                               (pair
252
                                                 (big_map
253
                                                   (pair address (pair address nat))
254
                                                   unit)
255
                                                 (pair (big_map nat (map address nat))
256
                                                       (pair (big_map nat nat)
257
                                                             (big_map nat
258
                                                                      (pair nat
259
                                                                            (map string
260
                                                                                 bytes))))))))))))
261
           { UNPAIR ; SWAP ; DUP ; GET 16 ; DIG 2 ; MEM ; PAIR } ;
262
         SWAP ;
263
         LAMBDA
264
           (pair (pair address (pair address nat))
265
                 (pair address
266
                       (pair nat
267
                             (pair (big_map (pair address nat) nat)
268
                                   (pair (big_map string bytes)
269
                                         (pair nat
270
                                               (pair
271
                                                 (big_map
272
                                                   (pair address (pair address nat))
273
                                                   unit)
274
                                                 (pair (big_map nat (map address nat))
275
                                                       (pair (big_map nat nat)
276
                                                             (big_map nat
277
                                                                      (pair nat
278
                                                                            (map string
279
                                                                                 bytes))))))))))))
280
           (pair bool
281
                 (pair address
282
                       (pair nat
283
                             (pair (big_map (pair address nat) nat)
284
                                   (pair (big_map string bytes)
285
                                         (pair nat
286
                                               (pair
287
                                                 (big_map
288
                                                   (pair address (pair address nat))
289
                                                   unit)
290
                                                 (pair (big_map nat (map address nat))
291
                                                       (pair (big_map nat nat)
292
                                                             (big_map nat
293
                                                                      (pair nat
294
                                                                            (map string
295
                                                                                 bytes))))))))))))
296
           { UNPAIR ; SWAP ; DUP ; GET 11 ; DIG 2 ; MEM ; PAIR } ;
297
         SWAP ;
298
         LAMBDA
299
           (pair
300
             (pair
301
               (lambda
302
                 (pair nat
303
                       (pair address
304
                             (pair nat
305
                                   (pair (big_map (pair address nat) nat)
306
                                         (pair (big_map string bytes)
307
                                               (pair nat
308
                                                     (pair
309
                                                       (big_map
310
                                                         (pair address
311
                                                               (pair address nat))
312
                                                         unit)
313
                                                       (pair
314
                                                         (big_map nat (map address nat))
315
                                                         (pair (big_map nat nat)
316
                                                               (big_map nat
317
                                                                        (pair nat
318
                                                                              (map
319
                                                                                string
320
                                                                                bytes))))))))))))
321
                 (pair bool
322
                       (pair address
323
                             (pair nat
324
                                   (pair (big_map (pair address nat) nat)
325
                                         (pair (big_map string bytes)
326
                                               (pair nat
327
                                                     (pair
328
                                                       (big_map
329
                                                         (pair address
330
                                                               (pair address nat))
331
                                                         unit)
332
                                                       (pair
333
                                                         (big_map nat (map address nat))
334
                                                         (pair (big_map nat nat)
335
                                                               (big_map nat
336
                                                                        (pair nat
337
                                                                              (map
338
                                                                                string
339
                                                                                bytes)))))))))))))
340
               nat)
341
             (pair address
342
                   (pair nat
343
                         (pair (big_map (pair address nat) nat)
344
                               (pair (big_map string bytes)
345
                                     (pair nat
346
                                           (pair
347
                                             (big_map (pair address (pair address nat))
348
                                                      unit)
349
                                             (pair (big_map nat (map address nat))
350
                                                   (pair (big_map nat nat)
351
                                                         (big_map nat
352
                                                                  (pair nat
353
                                                                        (map string
354
                                                                             bytes))))))))))))
355
           (pair nat
356
                 (pair address
357
                       (pair nat
358
                             (pair (big_map (pair address nat) nat)
359
                                   (pair (big_map string bytes)
360
                                         (pair nat
361
                                               (pair
362
                                                 (big_map
363
                                                   (pair address (pair address nat))
364
                                                   unit)
365
                                                 (pair (big_map nat (map address nat))
366
                                                       (pair (big_map nat nat)
367
                                                             (big_map nat
368
                                                                      (pair nat
369
                                                                            (map string
370
                                                                                 bytes))))))))))))
371
           { UNPAIR ;
372
             UNPAIR ;
373
             DUP 2 ;
374
             SWAP ;
375
             DIG 3 ;
376
             DIG 2 ;
377
             PAIR ;
378
             EXEC ;
379
             UNPAIR ;
380
             SWAP ;
381
             DUG 2 ;
382
             IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ;
383
             SWAP ;
384
             DUP ;
385
             GET 15 ;
386
             DIG 2 ;
387
             GET ;
388
             IF_NONE { PUSH int 444 ; FAILWITH } {} ;
389
             PAIR } ;
390
         SWAP ;
391
         LAMBDA
392
           (pair (pair address (pair address (pair nat nat)))
393
                 (pair address
394
                       (pair nat
395
                             (pair (big_map (pair address nat) nat)
396
                                   (pair (big_map string bytes)
397
                                         (pair nat
398
                                               (pair
399
                                                 (big_map
400
                                                   (pair address (pair address nat))
401
                                                   unit)
402
                                                 (pair (big_map nat (map address nat))
403
                                                       (pair (big_map nat nat)
404
                                                             (big_map nat
405
                                                                      (pair nat
406
                                                                            (map string
407
                                                                                 bytes))))))))))))
408
           (pair unit
409
                 (pair address
410
                       (pair nat
411
                             (pair (big_map (pair address nat) nat)
412
                                   (pair (big_map string bytes)
413
                                         (pair nat
414
                                               (pair
415
                                                 (big_map
416
                                                   (pair address (pair address nat))
417
                                                   unit)
418
                                                 (pair (big_map nat (map address nat))
419
                                                       (pair (big_map nat nat)
420
                                                             (big_map nat
421
                                                                      (pair nat
422
                                                                            (map string
423
                                                                                 bytes))))))))))))
424
           { UNPAIR ;
425
             DUP ;
426
             GET 5 ;
427
             DUP 2 ;
428
             CAR ;
429
             PAIR ;
430
             DUP 3 ;
431
             DUP ;
432
             GET 5 ;
433
             DUP 4 ;
434
             GET 6 ;
435
             DIG 5 ;
436
             GET 5 ;
437
             DUP 5 ;
438
             GET ;
439
             IF_NONE { PUSH nat 0 } {} ;
440
             SUB ;
441
             ISNAT ;
442
             IF_NONE { PUSH string "FA2_INSUFFICIENT_BALANCE" ; FAILWITH } {} ;
443
             SOME ;
444
             DIG 3 ;
445
             UPDATE ;
446
             UPDATE 5 ;
447
             SWAP ;
448
             DUP ;
449
             GET 5 ;
450
             DUP 2 ;
451
             GET 3 ;
452
             PAIR ;
453
             DUP 3 ;
454
             DUP ;
455
             GET 5 ;
456
             DIG 3 ;
457
             GET 6 ;
458
             DIG 4 ;
459
             GET 5 ;
460
             DUP 5 ;
461
             GET ;
462
             IF_NONE { PUSH nat 0 } {} ;
463
             ADD ;
464
             SOME ;
465
             DIG 3 ;
466
             UPDATE ;
467
             UPDATE 5 ;
468
             UNIT ;
469
             PAIR } ;
470
         SWAP ;
471
         PUSH (pair (string %ledger_type)
472
                 (pair %policy (string %name)
473
                               (pair (bool %supports_operator) (bool %supports_transfer)))) (Pair "Fungible" (Pair "owner-or-operator-transfer" (Pair True True))) ;
474
         SWAP ;
475
         UNPAIR ;
476
         IF_LEFT
477
           { IF_LEFT
478
               { LAMBDA
479
                   (pair
480
                     (pair (pair address nat)
481
                           (pair
482
                             (lambda
483
                               (pair nat
484
                                     (pair address
485
                                           (pair nat
486
                                                 (pair (big_map (pair address nat) nat)
487
                                                       (pair (big_map string bytes)
488
                                                             (pair nat
489
                                                                   (pair
490
                                                                     (big_map
491
                                                                       (pair address
492
                                                                             (pair
493
                                                                               address
494
                                                                               nat))
495
                                                                       unit)
496
                                                                     (pair
497
                                                                       (big_map nat
498
                                                                                (map
499
                                                                                  address
500
                                                                                  nat))
501
                                                                       (pair
502
                                                                         (big_map nat
503
                                                                                  nat)
504
                                                                         (big_map nat
505
                                                                                  (pair
506
                                                                                    nat
507
                                                                                    (map
508
                                                                                      string
509
                                                                                      bytes))))))))))))
510
                               (pair bool
511
                                     (pair address
512
                                           (pair nat
513
                                                 (pair (big_map (pair address nat) nat)
514
                                                       (pair (big_map string bytes)
515
                                                             (pair nat
516
                                                                   (pair
517
                                                                     (big_map
518
                                                                       (pair address
519
                                                                             (pair
520
                                                                               address
521
                                                                               nat))
522
                                                                       unit)
523
                                                                     (pair
524
                                                                       (big_map nat
525
                                                                                (map
526
                                                                                  address
527
                                                                                  nat))
528
                                                                       (pair
529
                                                                         (big_map nat
530
                                                                                  nat)
531
                                                                         (big_map nat
532
                                                                                  (pair
533
                                                                                    nat
534
                                                                                    (map
535
                                                                                      string
536
                                                                                      bytes)))))))))))))
537
                             (lambda
538
                               (pair
539
                                 (pair
540
                                   (lambda
541
                                     (pair nat
542
                                           (pair address
543
                                                 (pair nat
544
                                                       (pair
545
                                                         (big_map (pair address nat) nat)
546
                                                         (pair (big_map string bytes)
547
                                                               (pair nat
548
                                                                     (pair
549
                                                                       (big_map
550
                                                                         (pair address
551
                                                                               (pair
552
                                                                                 address
553
                                                                                 nat))
554
                                                                         unit)
555
                                                                       (pair
556
                                                                         (big_map nat
557
                                                                                  (map
558
                                                                                    address
559
                                                                                    nat))
560
                                                                         (pair
561
                                                                           (big_map nat
562
                                                                                    nat)
563
                                                                           (big_map nat
564
                                                                                    (pair
565
                                                                                      nat
566
                                                                                      (map
567
                                                                                        string
568
                                                                                        bytes))))))))))))
569
                                     (pair bool
570
                                           (pair address
571
                                                 (pair nat
572
                                                       (pair
573
                                                         (big_map (pair address nat) nat)
574
                                                         (pair (big_map string bytes)
575
                                                               (pair nat
576
                                                                     (pair
577
                                                                       (big_map
578
                                                                         (pair address
579
                                                                               (pair
580
                                                                                 address
581
                                                                                 nat))
582
                                                                         unit)
583
                                                                       (pair
584
                                                                         (big_map nat
585
                                                                                  (map
586
                                                                                    address
587
                                                                                    nat))
588
                                                                         (pair
589
                                                                           (big_map nat
590
                                                                                    nat)
591
                                                                           (big_map nat
592
                                                                                    (pair
593
                                                                                      nat
594
                                                                                      (map
595
                                                                                        string
596
                                                                                        bytes)))))))))))))
597
                                   (pair address nat))
598
                                 (pair address
599
                                       (pair nat
600
                                             (pair (big_map (pair address nat) nat)
601
                                                   (pair (big_map string bytes)
602
                                                         (pair nat
603
                                                               (pair
604
                                                                 (big_map
605
                                                                   (pair address
606
                                                                         (pair address
607
                                                                               nat))
608
                                                                   unit)
609
                                                                 (pair
610
                                                                   (big_map nat
611
                                                                            (map address
612
                                                                                 nat))
613
                                                                   (pair
614
                                                                     (big_map nat nat)
615
                                                                     (big_map nat
616
                                                                              (pair nat
617
                                                                                    (map
618
                                                                                      string
619
                                                                                      bytes))))))))))))
620
                               (pair nat
621
                                     (pair address
622
                                           (pair nat
623
                                                 (pair (big_map (pair address nat) nat)
624
                                                       (pair (big_map string bytes)
625
                                                             (pair nat
626
                                                                   (pair
627
                                                                     (big_map
628
                                                                       (pair address
629
                                                                             (pair
630
                                                                               address
631
                                                                               nat))
632
                                                                       unit)
633
                                                                     (pair
634
                                                                       (big_map nat
635
                                                                                (map
636
                                                                                  address
637
                                                                                  nat))
638
                                                                       (pair
639
                                                                         (big_map nat
640
                                                                                  nat)
641
                                                                         (big_map nat
642
                                                                                  (pair
643
                                                                                    nat
644
                                                                                    (map
645
                                                                                      string
646
                                                                                      bytes)))))))))))))))
647
                     (pair address
648
                           (pair nat
649
                                 (pair (big_map (pair address nat) nat)
650
                                       (pair (big_map string bytes)
651
                                             (pair nat
652
                                                   (pair
653
                                                     (big_map
654
                                                       (pair address (pair address nat))
655
                                                       unit)
656
                                                     (pair
657
                                                       (big_map nat (map address nat))
658
                                                       (pair (big_map nat nat)
659
                                                             (big_map nat
660
                                                                      (pair nat
661
                                                                            (map string
662
                                                                                 bytes))))))))))))
663
                   (pair (pair (pair address nat) nat)
664
                         (pair address
665
                               (pair nat
666
                                     (pair (big_map (pair address nat) nat)
667
                                           (pair (big_map string bytes)
668
                                                 (pair nat
669
                                                       (pair
670
                                                         (big_map
671
                                                           (pair address
672
                                                                 (pair address nat))
673
                                                           unit)
674
                                                         (pair
675
                                                           (big_map nat
676
                                                                    (map address nat))
677
                                                           (pair (big_map nat nat)
678
                                                                 (big_map nat
679
                                                                          (pair nat
680
                                                                                (map
681
                                                                                  string
682
                                                                                  bytes))))))))))))
683
                   { UNPAIR ;
684
                     UNPAIR 3 ;
685
                     DIG 2 ;
686
                     DUP 2 ;
687
                     DIG 3 ;
688
                     PAIR ;
689
                     SWAP ;
690
                     DIG 3 ;
691
                     DIG 2 ;
692
                     PAIR ;
693
                     EXEC ;
694
                     UNPAIR ;
695
                     SWAP ;
696
                     DUG 2 ;
697
                     SWAP ;
698
                     PAIR ;
699
                     PAIR } ;
700
                 DUP 2 ;
701
                 CAR ;
702
                 MAP { DUP 2 ;
703
                       DUP 14 ;
704
                       DUP 11 ;
705
                       PAIR ;
706
                       DIG 2 ;
707
                       PAIR ;
708
                       SWAP ;
709
                       DIG 4 ;
710
                       DIG 2 ;
711
                       PAIR ;
712
                       EXEC ;
713
                       UNPAIR ;
714
                       DUG 12 ;
715
                       DUG 12 ;
716
                       DUG 12 ;
717
                       DUG 12 ;
718
                       DIG 10 ;
719
                       DIG 12 ;
720
                       DIG 12 ;
721
                       DIG 12 } ;
722
                 SWAP ;
723
                 DROP ;
724
                 DIG 3 ;
725
                 DROP ;
726
                 DIG 3 ;
727
                 DROP ;
728
                 DIG 3 ;
729
                 DROP ;
730
                 DIG 3 ;
731
                 DROP ;
732
                 DIG 3 ;
733
                 DROP ;
734
                 DIG 3 ;
735
                 DROP ;
736
                 DIG 3 ;
737
                 DROP ;
738
                 DIG 3 ;
739
                 DROP ;
740
                 DIG 3 ;
741
                 DROP ;
742
                 NIL operation ;
743
                 DIG 2 ;
744
                 CDR ;
745
                 PUSH mutez 0 ;
746
                 DIG 3 ;
747
                 TRANSFER_TOKENS ;
748
                 CONS }
749
               { DUP ;
750
                 ITER { DUP 3 ;
751
                        GET 3 ;
752
                        DIG 3 ;
753
                        DUP ;
754
                        GET 16 ;
755
                        EMPTY_MAP string bytes ;
756
                        DUP 5 ;
757
                        GET 3 ;
758
                        SOME ;
759
                        PUSH string "" ;
760
                        UPDATE ;
761
                        DUP 4 ;
762
                        PAIR ;
763
                        SOME ;
764
                        DUP 4 ;
765
                        UPDATE ;
766
                        UPDATE 16 ;
767
                        DUP ;
768
                        GET 5 ;
769
                        DUP 4 ;
770
                        CAR ;
771
                        SOME ;
772
                        DUP 4 ;
773
                        DUP 6 ;
774
                        GET 6 ;
775
                        PAIR ;
776
                        UPDATE ;
777
                        UPDATE 5 ;
778
                        DUP ;
779
                        GET 13 ;
780
                        EMPTY_MAP address nat ;
781
                        DUP 5 ;
782
                        GET 5 ;
783
                        SOME ;
784
                        DIG 5 ;
785
                        GET 6 ;
786
                        UPDATE ;
787
                        SOME ;
788
                        DIG 3 ;
789
                        UPDATE ;
790
                        UPDATE 13 ;
791
                        DUP ;
792
                        GET 3 ;
793
                        PUSH nat 1 ;
794
                        ADD ;
795
                        UPDATE 3 ;
796
                        SWAP } ;
797
                 DROP ;
798
                 SWAP ;
799
                 DROP ;
800
                 SWAP ;
801
                 DROP ;
802
                 SWAP ;
803
                 DROP ;
804
                 SWAP ;
805
                 DROP ;
806
                 SWAP ;
807
                 DROP ;
808
                 SWAP ;
809
                 DROP ;
810
                 SWAP ;
811
                 DROP ;
812
                 SWAP ;
813
                 DROP ;
814
                 SWAP ;
815
                 DROP ;
816
                 NIL operation } }
817
           { IF_LEFT
818
               { DIG 2 ;
819
                 DROP ;
820
                 DIG 2 ;
821
                 DROP ;
822
                 DIG 2 ;
823
                 DROP ;
824
                 DIG 2 ;
825
                 DROP ;
826
                 DIG 2 ;
827
                 DROP ;
828
                 DIG 3 ;
829
                 DROP ;
830
                 DIG 3 ;
831
                 DROP ;
832
                 DIG 3 ;
833
                 DROP ;
834
                 DIG 2 ;
835
                 UNIT ;
836
                 SWAP ;
837
                 DIG 3 ;
838
                 DIG 2 ;
839
                 PAIR ;
840
                 EXEC ;
841
                 UNPAIR ;
842
                 SWAP ;
843
                 DUG 2 ;
844
                 IF {} { PUSH string "FA2_NOT_ADMIN" ; FAILWITH } ;
845
                 UPDATE 1 }
846
               { IF_LEFT
847
                   { DUP 3 ;
848
                     GET 6 ;
849
                     IF
850
                       { DUP ;
851
                         ITER { DUP ;
852
                                CDR ;
853
                                ITER { DUP 9 ;
854
                                       SWAP ;
855
                                       DUP ;
856
                                       GET 3 ;
857
                                       DIG 2 ;
858
                                       DIG 5 ;
859
                                       DIG 2 ;
860
                                       PAIR ;
861
                                       EXEC ;
862
                                       UNPAIR ;
863
                                       DUG 13 ;
864
                                       DUG 13 ;
865
                                       DUG 13 ;
866
                                       DUG 13 ;
867
                                       DUG 13 ;
868
                                       DIG 10 ;
869
                                       DIG 13 ;
870
                                       DIG 13 ;
871
                                       DIG 13 ;
872
                                       DIG 13 ;
873
                                       IF
874
                                         {}
875
                                         { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ;
876
                                       DUP 11 ;
877
                                       DUP 2 ;
878
                                       GET 3 ;
879
                                       DUP 3 ;
880
                                       CAR ;
881
                                       DUP 5 ;
882
                                       CAR ;
883
                                       PAIR 3 ;
884
                                       SWAP ;
885
                                       DIG 5 ;
886
                                       DIG 2 ;
887
                                       PAIR ;
888
                                       EXEC ;
889
                                       CDR ;
890
                                       DUG 12 ;
891
                                       DUG 12 ;
892
                                       DUG 12 ;
893
                                       DUG 12 ;
894
                                       DIG 9 ;
895
                                       DIG 12 ;
896
                                       DIG 12 ;
897
                                       DIG 12 ;
898
                                       PUSH nat 0 ;
899
                                       DUP 2 ;
900
                                       GET 4 ;
901
                                       COMPARE ;
902
                                       GT ;
903
                                       IF
904
                                         { DUP 2 ;
905
                                           CAR ;
906
                                           PAIR ;
907
                                           DUP 6 ;
908
                                           DIG 4 ;
909
                                           DIG 2 ;
910
                                           PAIR ;
911
                                           EXEC ;
912
                                           CDR ;
913
                                           DUG 11 ;
914
                                           DUG 11 ;
915
                                           DUG 11 ;
916
                                           DIG 9 ;
917
                                           DIG 11 ;
918
                                           DIG 11 }
919
                                         { DROP } } ;
920
                                DROP } ;
921
                         DROP ;
922
                         SWAP ;
923
                         DROP ;
924
                         SWAP ;
925
                         DROP ;
926
                         SWAP ;
927
                         DROP ;
928
                         SWAP ;
929
                         DROP ;
930
                         SWAP ;
931
                         DROP ;
932
                         SWAP ;
933
                         DROP ;
934
                         SWAP ;
935
                         DROP ;
936
                         SWAP ;
937
                         DROP ;
938
                         SWAP ;
939
                         DROP }
940
                       { PUSH string "FA2_TX_DENIED" ; FAILWITH } }
941
                   { DUP 3 ;
942
                     GET 5 ;
943
                     IF
944
                       { DUP ;
945
                         ITER { IF_LEFT
946
                                  { DUP 11 ;
947
                                    DUP 2 ;
948
                                    EXEC ;
949
                                    DROP ;
950
                                    DIG 2 ;
951
                                    DUP ;
952
                                    GET 11 ;
953
                                    PUSH (option unit) (Some Unit) ;
954
                                    DIG 3 ;
955
                                    UPDATE ;
956
                                    UPDATE 11 ;
957
                                    SWAP }
958
                                  { DUP 11 ;
959
                                    DUP 2 ;
960
                                    EXEC ;
961
                                    DROP ;
962
                                    DIG 2 ;
963
                                    DUP ;
964
                                    GET 11 ;
965
                                    NONE unit ;
966
                                    DIG 3 ;
967
                                    UPDATE ;
968
                                    UPDATE 11 ;
969
                                    SWAP } } ;
970
                         DROP ;
971
                         SWAP ;
972
                         DROP ;
973
                         SWAP ;
974
                         DROP ;
975
                         SWAP ;
976
                         DROP ;
977
                         SWAP ;
978
                         DROP ;
979
                         SWAP ;
980
                         DROP ;
981
                         SWAP ;
982
                         DROP ;
983
                         SWAP ;
984
                         DROP ;
985
                         SWAP ;
986
                         DROP ;
987
                         SWAP ;
988
                         DROP }
989
                       { PUSH string "FA2_OPERATORS_UNSUPPORTED" ; FAILWITH } } } ;
990
             NIL operation } ;
991
         PAIR } ;
992
  view "get_balance_of" (list (pair (address %owner) (nat %token_id)))
993
        (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance)))
994
        { UNPAIR ;
995
          LAMBDA
996
            (pair
997
              (pair
998
                (lambda
999
                  (pair nat
1000
                        (pair address
1001
                              (pair nat
1002
                                    (pair (big_map (pair address nat) nat)
1003
                                          (pair (big_map string bytes)
1004
                                                (pair nat
1005
                                                      (pair
1006
                                                        (big_map
1007
                                                          (pair address
1008
                                                                (pair address nat))
1009
                                                          unit)
1010
                                                        (pair
1011
                                                          (big_map nat (map address nat))
1012
                                                          (pair (big_map nat nat)
1013
                                                                (big_map nat
1014
                                                                         (pair nat
1015
                                                                               (map
1016
                                                                                 string
1017
                                                                                 bytes))))))))))))
1018
                  (pair bool
1019
                        (pair address
1020
                              (pair nat
1021
                                    (pair (big_map (pair address nat) nat)
1022
                                          (pair (big_map string bytes)
1023
                                                (pair nat
1024
                                                      (pair
1025
                                                        (big_map
1026
                                                          (pair address
1027
                                                                (pair address nat))
1028
                                                          unit)
1029
                                                        (pair
1030
                                                          (big_map nat (map address nat))
1031
                                                          (pair (big_map nat nat)
1032
                                                                (big_map nat
1033
                                                                         (pair nat
1034
                                                                               (map
1035
                                                                                 string
1036
                                                                                 bytes)))))))))))))
1037
                (pair address nat))
1038
              (pair address
1039
                    (pair nat
1040
                          (pair (big_map (pair address nat) nat)
1041
                                (pair (big_map string bytes)
1042
                                      (pair nat
1043
                                            (pair
1044
                                              (big_map (pair address (pair address nat))
1045
                                                       unit)
1046
                                              (pair (big_map nat (map address nat))
1047
                                                    (pair (big_map nat nat)
1048
                                                          (big_map nat
1049
                                                                   (pair nat
1050
                                                                         (map string
1051
                                                                              bytes))))))))))))
1052
            (pair nat
1053
                  (pair address
1054
                        (pair nat
1055
                              (pair (big_map (pair address nat) nat)
1056
                                    (pair (big_map string bytes)
1057
                                          (pair nat
1058
                                                (pair
1059
                                                  (big_map
1060
                                                    (pair address (pair address nat))
1061
                                                    unit)
1062
                                                  (pair (big_map nat (map address nat))
1063
                                                        (pair (big_map nat nat)
1064
                                                              (big_map nat
1065
                                                                       (pair nat
1066
                                                                             (map string
1067
                                                                                  bytes))))))))))))
1068
            { UNPAIR ;
1069
              UNPAIR ;
1070
              SWAP ;
1071
              DUP ;
1072
              CDR ;
1073
              DIG 2 ;
1074
              DIG 3 ;
1075
              DIG 2 ;
1076
              PAIR ;
1077
              EXEC ;
1078
              UNPAIR ;
1079
              SWAP ;
1080
              DUG 2 ;
1081
              IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ;
1082
              SWAP ;
1083
              DUP ;
1084
              GET 5 ;
1085
              DIG 2 ;
1086
              GET ;
1087
              IF_NONE { PUSH nat 0 } {} ;
1088
              PAIR } ;
1089
          SWAP ;
1090
          LAMBDA
1091
            (pair nat
1092
                  (pair address
1093
                        (pair nat
1094
                              (pair (big_map (pair address nat) nat)
1095
                                    (pair (big_map string bytes)
1096
                                          (pair nat
1097
                                                (pair
1098
                                                  (big_map
1099
                                                    (pair address (pair address nat))
1100
                                                    unit)
1101
                                                  (pair (big_map nat (map address nat))
1102
                                                        (pair (big_map nat nat)
1103
                                                              (big_map nat
1104
                                                                       (pair nat
1105
                                                                             (map string
1106
                                                                                  bytes))))))))))))
1107
            (pair bool
1108
                  (pair address
1109
                        (pair nat
1110
                              (pair (big_map (pair address nat) nat)
1111
                                    (pair (big_map string bytes)
1112
                                          (pair nat
1113
                                                (pair
1114
                                                  (big_map
1115
                                                    (pair address (pair address nat))
1116
                                                    unit)
1117
                                                  (pair (big_map nat (map address nat))
1118
                                                        (pair (big_map nat nat)
1119
                                                              (big_map nat
1120
                                                                       (pair nat
1121
                                                                             (map string
1122
                                                                                  bytes))))))))))))
1123
            { UNPAIR ; SWAP ; DUP ; GET 16 ; DIG 2 ; MEM ; PAIR } ;
1124
          SWAP ;
1125
          LAMBDA
1126
            (pair
1127
              (pair (pair address nat)
1128
                    (pair
1129
                      (lambda
1130
                        (pair nat
1131
                              (pair address
1132
                                    (pair nat
1133
                                          (pair (big_map (pair address nat) nat)
1134
                                                (pair (big_map string bytes)
1135
                                                      (pair nat
1136
                                                            (pair
1137
                                                              (big_map
1138
                                                                (pair address
1139
                                                                      (pair address nat))
1140
                                                                unit)
1141
                                                              (pair
1142
                                                                (big_map nat
1143
                                                                         (map address
1144
                                                                              nat))
1145
                                                                (pair (big_map nat nat)
1146
                                                                      (big_map nat
1147
                                                                               (pair nat
1148
                                                                                     (map
1149
                                                                                       string
1150
                                                                                       bytes))))))))))))
1151
                        (pair bool
1152
                              (pair address
1153
                                    (pair nat
1154
                                          (pair (big_map (pair address nat) nat)
1155
                                                (pair (big_map string bytes)
1156
                                                      (pair nat
1157
                                                            (pair
1158
                                                              (big_map
1159
                                                                (pair address
1160
                                                                      (pair address nat))
1161
                                                                unit)
1162
                                                              (pair
1163
                                                                (big_map nat
1164
                                                                         (map address
1165
                                                                              nat))
1166
                                                                (pair (big_map nat nat)
1167
                                                                      (big_map nat
1168
                                                                               (pair nat
1169
                                                                                     (map
1170
                                                                                       string
1171
                                                                                       bytes)))))))))))))
1172
                      (lambda
1173
                        (pair
1174
                          (pair
1175
                            (lambda
1176
                              (pair nat
1177
                                    (pair address
1178
                                          (pair nat
1179
                                                (pair (big_map (pair address nat) nat)
1180
                                                      (pair (big_map string bytes)
1181
                                                            (pair nat
1182
                                                                  (pair
1183
                                                                    (big_map
1184
                                                                      (pair address
1185
                                                                            (pair
1186
                                                                              address
1187
                                                                              nat))
1188
                                                                      unit)
1189
                                                                    (pair
1190
                                                                      (big_map nat
1191
                                                                               (map
1192
                                                                                 address
1193
                                                                                 nat))
1194
                                                                      (pair
1195
                                                                        (big_map nat nat)
1196
                                                                        (big_map nat
1197
                                                                                 (pair
1198
                                                                                   nat
1199
                                                                                   (map
1200
                                                                                     string
1201
                                                                                     bytes))))))))))))
1202
                              (pair bool
1203
                                    (pair address
1204
                                          (pair nat
1205
                                                (pair (big_map (pair address nat) nat)
1206
                                                      (pair (big_map string bytes)
1207
                                                            (pair nat
1208
                                                                  (pair
1209
                                                                    (big_map
1210
                                                                      (pair address
1211
                                                                            (pair
1212
                                                                              address
1213
                                                                              nat))
1214
                                                                      unit)
1215
                                                                    (pair
1216
                                                                      (big_map nat
1217
                                                                               (map
1218
                                                                                 address
1219
                                                                                 nat))
1220
                                                                      (pair
1221
                                                                        (big_map nat nat)
1222
                                                                        (big_map nat
1223
                                                                                 (pair
1224
                                                                                   nat
1225
                                                                                   (map
1226
                                                                                     string
1227
                                                                                     bytes)))))))))))))
1228
                            (pair address nat))
1229
                          (pair address
1230
                                (pair nat
1231
                                      (pair (big_map (pair address nat) nat)
1232
                                            (pair (big_map string bytes)
1233
                                                  (pair nat
1234
                                                        (pair
1235
                                                          (big_map
1236
                                                            (pair address
1237
                                                                  (pair address nat))
1238
                                                            unit)
1239
                                                          (pair
1240
                                                            (big_map nat
1241
                                                                     (map address nat))
1242
                                                            (pair (big_map nat nat)
1243
                                                                  (big_map nat
1244
                                                                           (pair nat
1245
                                                                                 (map
1246
                                                                                   string
1247
                                                                                   bytes))))))))))))
1248
                        (pair nat
1249
                              (pair address
1250
                                    (pair nat
1251
                                          (pair (big_map (pair address nat) nat)
1252
                                                (pair (big_map string bytes)
1253
                                                      (pair nat
1254
                                                            (pair
1255
                                                              (big_map
1256
                                                                (pair address
1257
                                                                      (pair address nat))
1258
                                                                unit)
1259
                                                              (pair
1260
                                                                (big_map nat
1261
                                                                         (map address
1262
                                                                              nat))
1263
                                                                (pair (big_map nat nat)
1264
                                                                      (big_map nat
1265
                                                                               (pair nat
1266
                                                                                     (map
1267
                                                                                       string
1268
                                                                                       bytes)))))))))))))))
1269
              (pair address
1270
                    (pair nat
1271
                          (pair (big_map (pair address nat) nat)
1272
                                (pair (big_map string bytes)
1273
                                      (pair nat
1274
                                            (pair
1275
                                              (big_map (pair address (pair address nat))
1276
                                                       unit)
1277
                                              (pair (big_map nat (map address nat))
1278
                                                    (pair (big_map nat nat)
1279
                                                          (big_map nat
1280
                                                                   (pair nat
1281
                                                                         (map string
1282
                                                                              bytes))))))))))))
1283
            (pair (pair (pair address nat) nat)
1284
                  (pair address
1285
                        (pair nat
1286
                              (pair (big_map (pair address nat) nat)
1287
                                    (pair (big_map string bytes)
1288
                                          (pair nat
1289
                                                (pair
1290
                                                  (big_map
1291
                                                    (pair address (pair address nat))
1292
                                                    unit)
1293
                                                  (pair (big_map nat (map address nat))
1294
                                                        (pair (big_map nat nat)
1295
                                                              (big_map nat
1296
                                                                       (pair nat
1297
                                                                             (map string
1298
                                                                                  bytes))))))))))))
1299
            { UNPAIR ;
1300
              UNPAIR 3 ;
1301
              DIG 2 ;
1302
              DUP 2 ;
1303
              DIG 3 ;
1304
              PAIR ;
1305
              SWAP ;
1306
              DIG 3 ;
1307
              DIG 2 ;
1308
              PAIR ;
1309
              EXEC ;
1310
              UNPAIR ;
1311
              SWAP ;
1312
              DUG 2 ;
1313
              SWAP ;
1314
              PAIR ;
1315
              PAIR } ;
1316
          DUP 2 ;
1317
          MAP { DUP 2 ; DUP 6 ; DUP 6 ; PAIR ; DIG 2 ; PAIR ; SWAP ; DIG 6 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 5 } ;
1318
          SWAP ;
1319
          DROP ;
1320
          SWAP ;
1321
          DROP ;
1322
          SWAP ;
1323
          DROP ;
1324
          SWAP ;
1325
          DROP ;
1326
          SWAP ;
1327
          DROP } }