x
764
1044
{ parameter (or (or (pair %balance_of (list %requests (pair (address %owner) (nat %token_id))) (contract %callback (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))))) (or (list %burn (pair (address %from_) (pair (nat %token_id) (nat %amount)))) (list %mint (pair (address %to_) (map %metadata string bytes))))) (or (address %set_administrator) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (pair (nat %token_id) (nat %amount)))))) (list %update_operators (or (pair %add_operator (address %owner) (pair (address %operator) (nat %token_id))) (pair %remove_operator (address %owner) (pair (address %operator) (nat %token_id)))))))) ; storage (pair (address %administrator) (pair (big_map %ledger nat address) (pair (big_map %metadata string bytes) (pair (nat %next_token_id) (pair (big_map %operators (pair (address %owner) (pair (address %operator) (nat %token_id))) unit) (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes)))))))) ; code { LAMBDA (pair (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; UNPAIR ; SWAP ; DUP ; CDR ; DIG 2 ; DIG 3 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 2 ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DUP ; CAR ; DUP 3 ; GET 3 ; DIG 2 ; CDR ; GET ; IF_NONE { PUSH int 351 ; FAILWITH } {} ; COMPARE ; EQ ; IF { PUSH nat 1 } { PUSH nat 0 } ; PAIR } ; SWAP ; LAMBDA (pair address (pair address nat)) unit { CAR ; SENDER ; COMPARE ; EQ ; IF {} { PUSH string "FA2_NOT_OWNER" ; FAILWITH } ; UNIT } ; SWAP ; LAMBDA (pair (pair address (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair unit (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; DUP ; CAR ; SENDER ; COMPARE ; EQ ; IF { DROP ; PUSH bool True } { DUP 2 ; GET 9 ; DUP 2 ; GET 4 ; SENDER ; DIG 3 ; CAR ; PAIR 3 ; MEM } ; IF {} { PUSH string "FA2_NOT_OPERATOR" ; FAILWITH } ; UNIT ; PAIR } ; SWAP ; LAMBDA unit bool { DROP ; PUSH bool True } ; SWAP ; LAMBDA (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; SWAP ; DUP ; GET 10 ; DIG 2 ; MEM ; PAIR } ; SWAP ; LAMBDA (pair (pair address (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; SWAP ; DUP ; GET 9 ; DIG 2 ; MEM ; PAIR } ; SWAP ; LAMBDA (pair (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) nat) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; UNPAIR ; DUG 2 ; PAIR ; EXEC ; UNPAIR ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; PUSH nat 1 ; PAIR } ; SWAP ; LAMBDA (pair (pair address (pair address (pair nat nat))) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair unit (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; PUSH nat 1 ; DUP 2 ; GET 6 ; COMPARE ; EQ ; IF { DUP ; CAR ; DUP 3 ; GET 3 ; DUP 3 ; GET 5 ; GET ; IF_NONE { PUSH int 359 ; FAILWITH } {} ; COMPARE ; EQ } { PUSH bool False } ; IF {} { PUSH string "FA2_INSUFFICIENT_BALANCE" ; FAILWITH } ; SWAP ; DUP ; GET 3 ; DUP 3 ; GET 3 ; SOME ; DIG 3 ; GET 5 ; UPDATE ; UPDATE 3 ; UNIT ; PAIR } ; SWAP ; PUSH (pair (string %ledger_type) (pair %policy (string %name) (pair (bool %supports_operator) (bool %supports_transfer)))) (Pair "NFT" (Pair "owner-or-operator-transfer" (Pair True True))) ; SWAP ; UNPAIR ; IF_LEFT { IF_LEFT { LAMBDA (pair (pair (pair address nat) (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (lambda (pair (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))))) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair (pair (pair address nat) nat) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; UNPAIR 3 ; DIG 2 ; DUP 2 ; DIG 3 ; PAIR ; SWAP ; DIG 3 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 2 ; SWAP ; PAIR ; PAIR } ; DUP 2 ; CAR ; MAP { DUP 2 ; DUP 14 ; DUP 11 ; PAIR ; DIG 2 ; PAIR ; SWAP ; DIG 4 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; DUG 12 ; DUG 12 ; DUG 12 ; DUG 12 ; DIG 10 ; DIG 12 ; DIG 12 ; DIG 12 } ; SWAP ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; NIL operation ; DIG 2 ; CDR ; PUSH mutez 0 ; DIG 3 ; TRANSFER_TOKENS ; CONS } { IF_LEFT { DUP 3 ; GET 6 ; IF {} { PUSH string "FA2_TX_DENIED" ; FAILWITH } ; DUP ; ITER { DUP 8 ; SWAP ; DUP ; GET 3 ; DIG 2 ; DIG 4 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; DUG 12 ; DUG 12 ; DUG 12 ; DUG 12 ; DIG 10 ; DIG 12 ; DIG 12 ; DIG 12 ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DUP 10 ; DUP 2 ; GET 3 ; DUP 3 ; CAR ; DUP 4 ; CAR ; PAIR 3 ; SWAP ; DIG 4 ; DIG 2 ; PAIR ; EXEC ; CDR ; DUG 11 ; DUG 11 ; DUG 11 ; DIG 9 ; DIG 11 ; DIG 11 ; PUSH nat 0 ; DUP 2 ; GET 4 ; COMPARE ; GT ; IF { PUSH nat 1 ; DUP 2 ; GET 4 ; COMPARE ; EQ ; IF { DUP ; CAR ; DUP 4 ; GET 3 ; DUP 3 ; GET 3 ; GET ; IF_NONE { PUSH int 728 ; FAILWITH } {} ; COMPARE ; EQ } { PUSH bool False } ; IF {} { PUSH string "FA2_INSUFFICIENT_BALANCE" ; FAILWITH } ; DIG 2 ; DUP ; GET 3 ; NONE address ; DUP 4 ; GET 3 ; UPDATE ; UPDATE 3 ; DUP ; GET 10 ; NONE (pair nat (map string bytes)) ; DIG 3 ; GET 3 ; UPDATE ; UPDATE 10 ; SWAP } { DROP } } ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP } { DUP 8 ; UNIT ; EXEC ; IF {} { PUSH string "FA2_NOT_ADMIN" ; FAILWITH } ; DUP ; ITER { DUP 3 ; GET 7 ; DIG 3 ; DUP ; GET 10 ; DUP 4 ; CDR ; DUP 4 ; PAIR ; SOME ; DUP 4 ; UPDATE ; UPDATE 10 ; DUP ; GET 3 ; DIG 3 ; CAR ; SOME ; DIG 3 ; UPDATE ; UPDATE 3 ; DUP ; GET 7 ; PUSH nat 1 ; ADD ; UPDATE 7 ; SWAP } ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP } ; NIL operation } } { IF_LEFT { DIG 2 ; DROP ; DIG 2 ; DROP ; DIG 2 ; DROP ; DIG 2 ; DROP ; DIG 2 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 3 ; DROP ; DIG 2 ; UNIT ; EXEC ; IF {} { PUSH string "FA2_NOT_ADMIN" ; FAILWITH } ; UPDATE 1 } { IF_LEFT { DUP 3 ; GET 6 ; IF { DUP ; ITER { DUP ; CDR ; ITER { DUP 9 ; SWAP ; DUP ; GET 3 ; DIG 2 ; DIG 5 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; DUG 13 ; DUG 13 ; DUG 13 ; DUG 13 ; DUG 13 ; DIG 10 ; DIG 13 ; DIG 13 ; DIG 13 ; DIG 13 ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DUP 11 ; DUP 2 ; GET 3 ; DUP 3 ; CAR ; DUP 5 ; CAR ; PAIR 3 ; SWAP ; DIG 5 ; DIG 2 ; PAIR ; EXEC ; CDR ; DUG 12 ; DUG 12 ; DUG 12 ; DUG 12 ; DIG 9 ; DIG 12 ; DIG 12 ; DIG 12 ; PUSH nat 0 ; DUP 2 ; GET 4 ; COMPARE ; GT ; IF { DUP 2 ; CAR ; PAIR ; DUP 6 ; DIG 4 ; DIG 2 ; PAIR ; EXEC ; CDR ; DUG 11 ; DUG 11 ; DUG 11 ; DIG 9 ; DIG 11 ; DIG 11 } { DROP } } ; DROP } ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP } { PUSH string "FA2_TX_DENIED" ; FAILWITH } } { DUP 3 ; GET 5 ; IF { DUP ; ITER { IF_LEFT { DUP 11 ; DUP 2 ; EXEC ; DROP ; DIG 2 ; DUP ; GET 9 ; PUSH (option unit) (Some Unit) ; DIG 3 ; UPDATE ; UPDATE 9 ; SWAP } { DUP 11 ; DUP 2 ; EXEC ; DROP ; DIG 2 ; DUP ; GET 9 ; NONE unit ; DIG 3 ; UPDATE ; UPDATE 9 ; SWAP } } ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP } { PUSH string "FA2_OPERATORS_UNSUPPORTED" ; FAILWITH } } } ; NIL operation } ; PAIR } ; view "get_balance_of" (list (pair (address %owner) (nat %token_id))) (list (pair (pair %request (address %owner) (nat %token_id)) (nat %balance))) { UNPAIR ; LAMBDA (pair (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; UNPAIR ; SWAP ; DUP ; CDR ; DIG 2 ; DIG 3 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 2 ; IF {} { PUSH string "FA2_TOKEN_UNDEFINED" ; FAILWITH } ; DUP ; CAR ; DUP 3 ; GET 3 ; DIG 2 ; CDR ; GET ; IF_NONE { PUSH int 351 ; FAILWITH } {} ; COMPARE ; EQ ; IF { PUSH nat 1 } { PUSH nat 0 } ; PAIR } ; SWAP ; LAMBDA (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; SWAP ; DUP ; GET 10 ; DIG 2 ; MEM ; PAIR } ; SWAP ; LAMBDA (pair (pair (pair address nat) (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (lambda (pair (pair (lambda (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair bool (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))) (pair address nat)) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair nat (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes)))))))))))) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) (pair (pair (pair address nat) nat) (pair address (pair (big_map nat address) (pair (big_map string bytes) (pair nat (pair (big_map (pair address (pair address nat)) unit) (big_map nat (pair nat (map string bytes))))))))) { UNPAIR ; UNPAIR 3 ; DIG 2 ; DUP 2 ; DIG 3 ; PAIR ; SWAP ; DIG 3 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 2 ; SWAP ; PAIR ; PAIR } ; DUP 2 ; MAP { DUP 2 ; DUP 6 ; DUP 6 ; PAIR ; DIG 2 ; PAIR ; SWAP ; DIG 6 ; DIG 2 ; PAIR ; EXEC ; UNPAIR ; SWAP ; DUG 5 } ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP ; SWAP ; DROP } }