x
364
parameter (or
(or (nat %flash_swap)
(or (unit %flash_swap_internal) (address %propose_administrator)))
(or (address %remove_administrator)
(or (unit %set_administrator)
(list %set_balance (pair
(pair %request (address %owner) (nat %token_id))
(nat %balance))))));
storage (pair
(pair (big_map %administrators address nat)
(pair (nat %amount) (nat %current_token_balance)))
(pair (pair (address %receiver) (address %swap))
(pair (address %token_address) (nat %token_id))));
code { LAMBDA
unit
unit
{ DROP ; SELF_ADDRESS ; SENDER ; COMPARE ; EQ ; IF {} { PUSH int 400 ; FAILWITH } ; UNIT } ;
SWAP ;
LAMBDA
(pair unit
(pair (pair (big_map address nat) (pair nat nat))
(pair (pair address address) (pair address nat))))
(pair unit
(pair (pair (big_map address nat) (pair nat nat))
(pair (pair address address) (pair address nat))))
{ CDR ;
PUSH nat 1 ;
DUP 2 ;
CAR ;
CAR ;
SENDER ;
GET ;
IF_NONE { PUSH int 21 ; FAILWITH } {} ;
COMPARE ;
EQ ;
IF {} { PUSH int 401 ; FAILWITH } ;
UNIT ;
PAIR } ;
SWAP ;
UNPAIR ;
IF_LEFT
{ IF_LEFT
{ DIG 3 ;
DROP ;
SWAP ;
UNPAIR ;
UNPAIR ;
SWAP ;
CDR ;
DIG 3 ;
PAIR ;
SWAP ;
PAIR ;
PAIR ;
UNIT ;
PAIR ;
EXEC ;
CDR ;
NIL operation ;
DUP 2 ;
GET 5 ;
CONTRACT %balance_of (pair
(list %requests (pair (address %owner)
(nat %token_id)))
(contract %callback (list (pair
(pair %request
(address %owner)
(nat %token_id))
(nat %balance))))) ;
IF_NONE { PUSH int 88 ; FAILWITH } {} ;
PUSH mutez 0 ;
SELF_ADDRESS ;
CONTRACT %set_balance (list (pair
(pair %request (address %owner)
(nat %token_id))
(nat %balance))) ;
IF_NONE { PUSH int 91 ; FAILWITH } {} ;
NIL (pair address nat) ;
DUP 6 ;
GET 6 ;
DUP 7 ;
GET 3 ;
CDR ;
PAIR ;
CONS ;
PAIR ;
TRANSFER_TOKENS ;
CONS ;
SELF %flash_swap_internal ;
PUSH mutez 0 ;
UNIT ;
TRANSFER_TOKENS ;
CONS }
{ IF_LEFT
{ DROP ;
SWAP ;
DROP ;
SWAP ;
UNIT ;
EXEC ;
DROP ;
NIL operation ;
DUP 2 ;
GET 5 ;
CONTRACT %mint (pair (address %owner)
(pair (nat %token_id) (nat %token_amount))) ;
IF_NONE { PUSH int 164 ; FAILWITH } {} ;
PUSH mutez 0 ;
DUP 4 ;
CAR ;
GET 3 ;
DUP 5 ;
GET 6 ;
SELF_ADDRESS ;
PAIR 3 ;
TRANSFER_TOKENS ;
CONS ;
DUP 2 ;
GET 5 ;
CONTRACT %mint (pair (address %owner)
(pair (nat %token_id) (nat %token_amount))) ;
IF_NONE { PUSH int 164 ; FAILWITH } {} ;
PUSH mutez 0 ;
DUP 4 ;
CAR ;
GET 4 ;
DUP 5 ;
GET 6 ;
DUP 6 ;
GET 3 ;
CAR ;
PAIR 3 ;
TRANSFER_TOKENS ;
CONS ;
DUP 2 ;
GET 5 ;
CONTRACT %update_operators (list (or
(pair %add_operator
(address %owner)
(pair (address %operator)
(nat %token_id)))
(pair %remove_operator
(address %owner)
(pair (address %operator)
(nat %token_id))))) ;
IF_NONE
{ PUSH string "Invalid entrypoint: Update operators" ; FAILWITH }
{} ;
PUSH mutez 0 ;
NIL (or (pair address (pair address nat))
(pair address (pair address nat))) ;
DUP 5 ;
GET 6 ;
DUP 6 ;
GET 3 ;
CDR ;
SELF_ADDRESS ;
PAIR 3 ;
LEFT (pair address (pair address nat)) ;
CONS ;
TRANSFER_TOKENS ;
CONS ;
DUP 2 ;
GET 3 ;
CDR ;
CONTRACT %tokenToCash (pair address (pair nat (pair nat timestamp))) ;
IF_NONE
{ PUSH string "Invalid entrypoint: tokenToCash" ; FAILWITH }
{} ;
PUSH mutez 0 ;
PUSH int 10 ;
NOW ;
ADD ;
PUSH nat 1 ;
PAIR ;
DUP 5 ;
CAR ;
GET 3 ;
PAIR ;
DUP 5 ;
GET 3 ;
CAR ;
PAIR ;
TRANSFER_TOKENS ;
CONS ;
DUP 2 ;
GET 5 ;
CONTRACT %update_operators (list (or
(pair %add_operator
(address %owner)
(pair (address %operator)
(nat %token_id)))
(pair %remove_operator
(address %owner)
(pair (address %operator)
(nat %token_id))))) ;
IF_NONE
{ PUSH string "Invalid entrypoint: Update operators" ; FAILWITH }
{} ;
PUSH mutez 0 ;
NIL (or (pair address (pair address nat))
(pair address (pair address nat))) ;
DUP 5 ;
GET 6 ;
DUP 6 ;
GET 3 ;
CDR ;
SELF_ADDRESS ;
PAIR 3 ;
RIGHT (pair address (pair address nat)) ;
CONS ;
TRANSFER_TOKENS ;
CONS ;
DUP 2 ;
GET 5 ;
CONTRACT %burn (pair (address %owner)
(pair (nat %token_id) (nat %token_amount))) ;
IF_NONE { PUSH int 164 ; FAILWITH } {} ;
PUSH mutez 0 ;
DUP 4 ;
CAR ;
GET 4 ;
DUP 5 ;
CAR ;
GET 3 ;
ADD ;
DUP 5 ;
GET 6 ;
DUP 6 ;
GET 3 ;
CDR ;
PAIR 3 ;
TRANSFER_TOKENS ;
CONS }
{ DIG 3 ;
DROP ;
AMOUNT ;
PUSH mutez 0 ;
COMPARE ;
EQ ;
IF {} { AMOUNT ; FAILWITH } ;
DIG 2 ;
UNIT ;
SWAP ;
DIG 3 ;
DIG 2 ;
PAIR ;
EXEC ;
CDR ;
UNPAIR ;
UNPAIR ;
PUSH (option nat) (Some 0) ;
DIG 4 ;
UPDATE ;
PAIR ;
PAIR ;
NIL operation } } }
{ IF_LEFT
{ DIG 3 ;
DROP ;
AMOUNT ;
PUSH mutez 0 ;
COMPARE ;
EQ ;
IF {} { AMOUNT ; FAILWITH } ;
DIG 2 ;
UNIT ;
SWAP ;
DIG 3 ;
DIG 2 ;
PAIR ;
EXEC ;
CDR ;
UNPAIR ;
UNPAIR ;
NONE nat ;
DIG 4 ;
UPDATE ;
PAIR ;
PAIR }
{ IF_LEFT
{ DROP ;
SWAP ;
DROP ;
SWAP ;
DROP ;
AMOUNT ;
PUSH mutez 0 ;
COMPARE ;
EQ ;
IF {} { AMOUNT ; FAILWITH } ;
PUSH nat 0 ;
DUP 2 ;
CAR ;
CAR ;
SENDER ;
GET ;
IF_NONE { PUSH int 46 ; FAILWITH } {} ;
COMPARE ;
EQ ;
IF {} { PUSH int 405 ; FAILWITH } ;
UNPAIR ;
UNPAIR ;
PUSH (option nat) (Some 1) ;
SENDER ;
UPDATE ;
PAIR ;
PAIR }
{ AMOUNT ;
PUSH mutez 0 ;
COMPARE ;
EQ ;
IF {} { AMOUNT ; FAILWITH } ;
DUP 2 ;
GET 5 ;
SENDER ;
COMPARE ;
EQ ;
IF {} { PUSH int 504 ; FAILWITH } ;
DUP ;
IF_CONS
{ SWAP ;
DROP ;
SWAP ;
DROP ;
DIG 2 ;
DROP ;
DIG 2 ;
DROP ;
DUP 2 ;
GET 6 ;
DUP 2 ;
CAR ;
CDR ;
COMPARE ;
EQ ;
IF {} { PUSH int 503 ; FAILWITH } ;
DUP 2 ;
GET 3 ;
CDR ;
DUP 2 ;
CAR ;
CAR ;
COMPARE ;
EQ ;
IF {} { PUSH int 503 ; FAILWITH } ;
SWAP ;
UNPAIR ;
UNPAIR ;
SWAP ;
CAR ;
DIG 3 ;
CDR ;
SWAP ;
PAIR ;
SWAP ;
PAIR ;
PAIR }
{ DROP ; SWAP ; DROP ; SWAP ; DROP } } } ;
NIL operation } ;
NIL operation ;
SWAP ;
ITER { CONS } ;
PAIR }