BCD

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