x
674
1123
{ parameter (or (or (unit %default) (pair %setup_func (nat %idx) (bytes %func_bytes))) (or %use (or (or (or (or (list %add_managers (pair (address %manager) (bool %add))) (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 (pair %ban (nat %pair_id) (pair %ban_params (key_hash %baker) (nat %ban_period))) (pair %claim (nat %pair_id) (address %receiver) (option %referral_code nat)))) (or (or (pair %claim_interface_fee (or %token (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (address %receiver) (option %referral_code nat)) (pair %claim_interface_tez_fee (nat %pair_id) (address %receiver) (option %referral_code nat))) (or (unit %close) (unit %confirm_admin)))) (or (or (or (pair %divest_liquidity (nat %pair_id) (nat %min_token_a_out) (nat %min_token_b_out) (nat %shares) (address %liquidity_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (pair %flash_swap_callback (nat %pair_id) (nat %prev_tez_balance) (nat %amount_in))) (or (pair %invest_liquidity (nat %pair_id) (nat %token_a_in) (nat %token_b_in) (nat %shares) (address %shares_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (pair %launch_callback (pair %vote_params (address %voter) (key_hash %candidate) (bool %execute_voting) (nat %votes)) (address %bucket)))) (or (or (pair %launch_exchange (pair %pair (or %token_a (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (or %token_b (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez))) (nat %token_a_in) (nat %token_b_in) (address %shares_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (list %permit (pair key signature (bytes %permit_hash)))) (or (address %set_admin) (address %set_auction))))) (or (or (or (or (nat %set_baker_rate) (nat %set_collecting_period)) (or (pair %set_expiry (address %issuer) (nat %expiry) (option %permit_hash bytes)) (pair %set_fees (nat %interface_fee) (nat %swap_fee) (nat %auction_fee) (nat %withdraw_fee_reward)))) (or (or (address %set_flash_swaps_proxy) (pair %swap (option %lambda (lambda unit (list operation))) (list %swaps (pair (or %direction (unit %a_to_b) (unit %b_to_a)) (nat %pair_id))) (timestamp %deadline) (address %receiver) (address %referrer) (nat %amount_in) (nat %min_amount_out) (option %referral_code nat))) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (nat %token_id) (nat %amount))))) (list %update_operators (or (pair %add_operator (address %owner) (address %operator) (nat %token_id)) (pair %remove_operator (address %owner) (address %operator) (nat %token_id))))))) (or (or (pair %update_token_metadata (nat %token_id) (map %token_info string bytes)) (pair %vote (nat %pair_id) (key_hash %candidate) (option %referral_code nat))) (or (pair %withdraw_auction_fee (option %pair_id nat) (or %token (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (option %referral_code nat)) (pair %withdraw_profit (contract %receiver unit) (nat %pair_id) (option %referral_code nat))))))) ; storage (pair (pair %storage (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes))) (big_map %ledger (pair address nat) nat) (big_map %accounts (pair address nat) (set address)) (big_map %tokens nat (pair (or %token_a (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (or %token_b (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)))) (big_map %token_to_id bytes nat) (big_map %pairs nat (pair (nat %token_a_pool) (nat %token_b_pool) (nat %token_a_price_cml) (nat %token_b_price_cml) (nat %total_supply) (timestamp %last_block_timestamp) (option %bucket address))) (big_map %permits address (pair (map %permits bytes (pair (timestamp %created_at) (option %expiry nat))) (option %expiry nat))) (big_map %interface_fee (pair (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) address) nat) (big_map %interface_tez_fee (pair nat address) nat) (big_map %auction_fee (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) nat) (big_map %auction_tez_fee nat nat) (set %managers address) (pair %fees (nat %interface_fee) (nat %swap_fee) (nat %auction_fee) (nat %withdraw_fee_reward)) (address %admin) (option %pending_admin address) (address %baker_registry) (address %flash_swaps_proxy) (address %auction) (nat %permits_counter) (nat %default_expiry) (bool %entered) (nat %tokens_count) (nat %collecting_period) (nat %baker_rate_f)) (big_map %dex_core_lambdas nat bytes) (big_map %metadata string bytes)) ; code { UNPAIR ; IF_LEFT { IF_LEFT { DROP } { PUSH string "400" ; DUP 3 ; CAR ; GET 27 ; SENDER ; COMPARE ; EQ ; IF { DROP } { FAILWITH } ; PUSH string "102" ; PUSH nat 27 ; DUP 3 ; CAR ; COMPARE ; LE ; IF { DROP } { FAILWITH } ; DUP 2 ; GET 3 ; DUP 2 ; CAR ; GET ; IF_NONE { UNIT ; DUP 3 ; DIG 3 ; GET 3 ; DUP 4 ; CDR ; DIG 4 ; CAR ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 3 } { DROP 2 ; PUSH string "101" ; FAILWITH } ; SWAP ; DROP } ; NIL operation } { DUP 2 ; GET 3 ; DUP 2 ; IF_LEFT { IF_LEFT { IF_LEFT { IF_LEFT { IF_LEFT { DROP ; PUSH nat 13 } { DROP ; PUSH nat 22 } } { IF_LEFT { DROP ; PUSH nat 17 } { DROP ; PUSH nat 26 } } } { IF_LEFT { IF_LEFT { DROP ; PUSH nat 5 } { DROP ; PUSH nat 6 } } { IF_LEFT { DROP ; PUSH nat 25 } { DROP ; PUSH nat 10 } } } } { IF_LEFT { IF_LEFT { IF_LEFT { DROP ; PUSH nat 2 } { DROP ; PUSH nat 24 } } { IF_LEFT { DROP ; PUSH nat 1 } { DROP ; PUSH nat 23 } } } { IF_LEFT { IF_LEFT { DROP ; PUSH nat 0 } { DROP ; PUSH nat 18 } } { IF_LEFT { DROP ; PUSH nat 9 } { DROP ; PUSH nat 12 } } } } } { IF_LEFT { IF_LEFT { IF_LEFT { IF_LEFT { DROP ; PUSH nat 27 } { DROP ; PUSH nat 15 } } { IF_LEFT { DROP ; PUSH nat 19 } { DROP ; PUSH nat 14 } } } { IF_LEFT { IF_LEFT { DROP ; PUSH nat 11 } { DROP ; PUSH nat 3 } } { IF_LEFT { DROP ; PUSH nat 20 } { DROP ; PUSH nat 21 } } } } { IF_LEFT { IF_LEFT { DROP ; PUSH nat 16 } { DROP ; PUSH nat 8 } } { IF_LEFT { DROP ; PUSH nat 7 } { DROP ; PUSH nat 4 } } } } ; GET ; IF_NONE { PUSH string "100" ; FAILWITH } {} ; UNPACK (lambda (pair (or (or (or (or (or (list %add_managers (pair (address %manager) (bool %add))) (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 (pair %ban (nat %pair_id) (pair %ban_params (key_hash %baker) (nat %ban_period))) (pair %claim (nat %pair_id) (address %receiver) (option %referral_code nat)))) (or (or (pair %claim_interface_fee (or %token (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (address %receiver) (option %referral_code nat)) (pair %claim_interface_tez_fee (nat %pair_id) (address %receiver) (option %referral_code nat))) (or (unit %close) (unit %confirm_admin)))) (or (or (or (pair %divest_liquidity (nat %pair_id) (nat %min_token_a_out) (nat %min_token_b_out) (nat %shares) (address %liquidity_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (pair %flash_swap_callback (nat %pair_id) (nat %prev_tez_balance) (nat %amount_in))) (or (pair %invest_liquidity (nat %pair_id) (nat %token_a_in) (nat %token_b_in) (nat %shares) (address %shares_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (pair %launch_callback (pair %vote_params (address %voter) (key_hash %candidate) (bool %execute_voting) (nat %votes)) (address %bucket)))) (or (or (pair %launch_exchange (pair %pair (or %token_a (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (or %token_b (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez))) (nat %token_a_in) (nat %token_b_in) (address %shares_receiver) (key_hash %candidate) (timestamp %deadline) (option %referral_code nat)) (list %permit (pair key signature (bytes %permit_hash)))) (or (address %set_admin) (address %set_auction))))) (or (or (or (or (nat %set_baker_rate) (nat %set_collecting_period)) (or (pair %set_expiry (address %issuer) (nat %expiry) (option %permit_hash bytes)) (pair %set_fees (nat %interface_fee) (nat %swap_fee) (nat %auction_fee) (nat %withdraw_fee_reward)))) (or (or (address %set_flash_swaps_proxy) (pair %swap (option %lambda (lambda unit (list operation))) (list %swaps (pair (or %direction (unit %a_to_b) (unit %b_to_a)) (nat %pair_id))) (timestamp %deadline) (address %receiver) (address %referrer) (nat %amount_in) (nat %min_amount_out) (option %referral_code nat))) (or (list %transfer (pair (address %from_) (list %txs (pair (address %to_) (nat %token_id) (nat %amount))))) (list %update_operators (or (pair %add_operator (address %owner) (address %operator) (nat %token_id)) (pair %remove_operator (address %owner) (address %operator) (nat %token_id))))))) (or (or (pair %update_token_metadata (nat %token_id) (map %token_info string bytes)) (pair %vote (nat %pair_id) (key_hash %candidate) (option %referral_code nat))) (or (pair %withdraw_auction_fee (option %pair_id nat) (or %token (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (option %referral_code nat)) (pair %withdraw_profit (contract %receiver unit) (nat %pair_id) (option %referral_code nat)))))) (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes))) (big_map %ledger (pair address nat) nat) (big_map %accounts (pair address nat) (set address)) (big_map %tokens nat (pair (or %token_a (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (or %token_b (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)))) (big_map %token_to_id bytes nat) (big_map %pairs nat (pair (nat %token_a_pool) (nat %token_b_pool) (nat %token_a_price_cml) (nat %token_b_price_cml) (nat %total_supply) (timestamp %last_block_timestamp) (option %bucket address))) (big_map %permits address (pair (map %permits bytes (pair (timestamp %created_at) (option %expiry nat))) (option %expiry nat))) (big_map %interface_fee (pair (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) address) nat) (big_map %interface_tez_fee (pair nat address) nat) (big_map %auction_fee (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) nat) (big_map %auction_tez_fee nat nat) (set %managers address) (pair %fees (nat %interface_fee) (nat %swap_fee) (nat %auction_fee) (nat %withdraw_fee_reward)) (address %admin) (option %pending_admin address) (address %baker_registry) (address %flash_swaps_proxy) (address %auction) (nat %permits_counter) (nat %default_expiry) (bool %entered) (nat %tokens_count) (nat %collecting_period) (nat %baker_rate_f)) (pair (list operation) (big_map %token_metadata nat (pair (nat %token_id) (map %token_info string bytes))) (big_map %ledger (pair address nat) nat) (big_map %accounts (pair address nat) (set address)) (big_map %tokens nat (pair (or %token_a (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) (or %token_b (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)))) (big_map %token_to_id bytes nat) (big_map %pairs nat (pair (nat %token_a_pool) (nat %token_b_pool) (nat %token_a_price_cml) (nat %token_b_price_cml) (nat %total_supply) (timestamp %last_block_timestamp) (option %bucket address))) (big_map %permits address (pair (map %permits bytes (pair (timestamp %created_at) (option %expiry nat))) (option %expiry nat))) (big_map %interface_fee (pair (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) address) nat) (big_map %interface_tez_fee (pair nat address) nat) (big_map %auction_fee (or (or (address %fa12) (pair %fa2 (address %token) (nat %id))) (unit %tez)) nat) (big_map %auction_tez_fee nat nat) (set %managers address) (pair %fees (nat %interface_fee) (nat %swap_fee) (nat %auction_fee) (nat %withdraw_fee_reward)) (address %admin) (option %pending_admin address) (address %baker_registry) (address %flash_swaps_proxy) (address %auction) (nat %permits_counter) (nat %default_expiry) (bool %entered) (nat %tokens_count) (nat %collecting_period) (nat %baker_rate_f))) ; IF_NONE { DROP ; PUSH string "103" ; FAILWITH } { DUP 3 ; CAR ; DIG 2 ; PAIR ; EXEC } ; SWAP ; DUP 2 ; CDR ; UPDATE 1 ; SWAP ; CAR } ; PAIR } ; view "get_baker_rate" unit nat { CDR ; CAR ; GET 46 } ; view "get_collecting_period" unit nat { CDR ; CAR ; GET 45 } ; view "get_cumulative_prices" (list nat) (list (pair (nat %request) (pair %cumulative_prices (timestamp %last_block_timestamp) (nat %token_a_price_cml) (nat %token_b_price_cml)))) { PUSH nat 1000000000000000000 ; LAMBDA (pair nat nat) nat { UNPAIR ; EDIV ; IF_NONE { PUSH string "408" ; FAILWITH } { PUSH nat 0 ; DUP 2 ; CDR ; COMPARE ; GT ; IF { PUSH nat 1 ; SWAP ; CAR ; ADD } { CAR } } } ; DIG 2 ; UNPAIR ; NIL (pair nat (pair timestamp nat nat)) ; SWAP ; ITER { SWAP ; DUP 3 ; CAR ; GET 11 ; DUP 3 ; GET ; IF_NONE { PUSH string "108" ; FAILWITH } {} ; DUP 6 ; DUP 2 ; GET 7 ; PAIR ; DUP 6 ; SWAP ; EXEC ; DUP 7 ; DUP 3 ; GET 5 ; PAIR ; DUP 7 ; SWAP ; EXEC ; DIG 2 ; GET 11 ; PAIR 3 ; DIG 2 ; PAIR ; CONS } ; SWAP ; DIG 2 ; DIG 3 ; DROP 3 } ; view "get_toks_per_share" (list (pair (nat %pair_id) (nat %shares_amt))) (list (pair (pair %request (nat %pair_id) (nat %shares_amt)) (pair %tokens_per_share (nat %token_a_amt) (nat %token_b_amt)))) { UNPAIR ; NIL (pair (pair nat nat) (pair nat nat)) ; SWAP ; ITER { SWAP ; DUP 3 ; CAR ; GET 11 ; DUP 3 ; CAR ; GET ; IF_NONE { PUSH string "108" ; FAILWITH } {} ; PUSH string "109" ; PUSH nat 0 ; DUP 3 ; GET 3 ; DUP 4 ; CAR ; MUL ; COMPARE ; NEQ ; IF { DROP } { FAILWITH } ; DUP ; GET 9 ; DUP 2 ; GET 3 ; DUP 5 ; CDR ; MUL ; EDIV ; IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; CAR ; DUP 2 ; GET 9 ; DIG 2 ; CAR ; DUP 5 ; CDR ; MUL ; EDIV ; IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; CAR ; PAIR ; DIG 2 ; PAIR ; CONS } ; SWAP ; DROP } ; view "get_swap_min_res" (pair (list %swaps (pair (or %direction (unit %a_to_b) (unit %b_to_a)) (nat %pair_id))) (nat %amount_in)) nat { PUSH string "108" ; PUSH string "113" ; PUSH address "tz1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZNkiRg" ; PUSH nat 1000000000000000000 ; LAMBDA (pair nat nat) nat { UNPAIR ; EDIV ; IF_NONE { PUSH string "408" ; FAILWITH } { PUSH nat 0 ; DUP 2 ; CDR ; COMPARE ; GT ; IF { PUSH nat 1 ; SWAP ; CAR ; ADD } { CAR } } } ; DIG 5 ; UNPAIR ; DUP ; CAR ; IF_CONS { SWAP ; DROP ; SOME } { NONE (pair (or unit unit) nat) } ; IF_NONE { PUSH string "117" ; FAILWITH } {} ; DUP 3 ; CAR ; GET 7 ; DUP 2 ; CDR ; GET ; IF_NONE { DUP 8 ; FAILWITH } {} ; PUSH nat 0 ; DUP 4 ; CDR ; NONE address ; DUP 10 ; DIG 10 ; DIG 6 ; CAR ; IF_LEFT { DROP ; DIG 5 ; CAR } { DROP ; DIG 5 ; CDR } ; NIL (pair address address nat) ; DIG 8 ; CAR ; PAIR 8 ; SWAP ; CAR ; ITER { SWAP ; DUP ; CAR ; GET 11 ; DUP 3 ; CDR ; GET ; IF_NONE { DUP 6 ; FAILWITH } {} ; PUSH string "109" ; PUSH nat 0 ; DUP 3 ; GET 3 ; DUP 4 ; CAR ; MUL ; COMPARE ; NEQ ; IF { DROP } { FAILWITH } ; PUSH string "118" ; PUSH nat 0 ; DUP 4 ; GET 13 ; COMPARE ; NEQ ; IF { DROP } { FAILWITH } ; DUP 2 ; CAR ; GET 7 ; DUP 4 ; CDR ; GET ; IF_NONE { DUP 7 ; FAILWITH } {} ; DUP ; CAR ; DUP 3 ; CAR ; PAIR ; SWAP ; CDR ; DUP 3 ; GET 3 ; PAIR ; DUP 5 ; CAR ; IF_LEFT { DROP ; SWAP } { DROP } ; SWAP ; PAIR ; PUSH string "119" ; DUP 4 ; GET 5 ; DUP 3 ; CDR ; CDR ; COMPARE ; EQ ; IF { DROP } { FAILWITH } ; DUP 3 ; CAR ; GET 25 ; DUP ; GET 5 ; DUP 2 ; GET 3 ; DUP 3 ; CAR ; ADD ; ADD ; DUP 8 ; SUB ; ISNAT ; IF_NONE { PUSH string "406" ; FAILWITH } {} ; DUP 5 ; GET 13 ; MUL ; DUP 3 ; CAR ; CAR ; DUP 2 ; MUL ; DUP 2 ; DUP 10 ; DUP 6 ; CDR ; CAR ; MUL ; ADD ; SWAP ; EDIV ; IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; CAR ; DUP 3 ; CAR ; DUP 7 ; GET 13 ; MUL ; DUP 10 ; DIG 4 ; GET 3 ; DUP 8 ; GET 13 ; MUL ; DIG 4 ; ADD ; EDIV ; IF_NONE { PUSH string "DIV by 0" ; FAILWITH } {} ; CAR ; DUP 2 ; DUP 10 ; DUP 3 ; MUL ; DUP 11 ; DUP 9 ; GET 13 ; MUL ; SUB ; SUB ; ISNAT ; IF_NONE { PUSH string "406" ; FAILWITH } {} ; DUP 7 ; DUP 9 ; CDR ; DUP 9 ; CAR ; DUP 10 ; GET 9 ; DIG 10 ; GET 5 ; UNIT ; RIGHT (or address (pair address nat)) ; DUP 2 ; COMPARE ; EQ ; IF { DROP ; DUP 2 ; DUP 3 ; GET 17 ; DIG 8 ; DIG 4 ; GET 17 ; DUP 5 ; DUP 7 ; PAIR ; GET ; IF_NONE { PUSH nat 0 } {} ; ADD ; DIG 3 ; DUP 5 ; PAIR ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 17 ; DUP ; DUP 2 ; GET 21 ; DIG 5 ; DIG 3 ; GET 21 ; DUP 5 ; GET ; IF_NONE { PUSH nat 0 } {} ; ADD ; DIG 3 ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 21 } { DIG 3 ; DROP ; DUP 3 ; DUP 4 ; GET 15 ; DIG 8 ; DIG 5 ; GET 15 ; DUP 6 ; DUP 6 ; PAIR ; GET ; IF_NONE { PUSH nat 0 } {} ; ADD ; DIG 4 ; DUP 5 ; PAIR ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 15 ; DUP ; DUP 2 ; GET 19 ; DIG 5 ; DIG 3 ; GET 19 ; DUP 5 ; GET ; IF_NONE { PUSH nat 0 } {} ; ADD ; DIG 3 ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 19 } ; UPDATE 1 ; PUSH nat 0 ; DUP 2 ; GET 14 ; COMPARE ; GT ; UNIT ; RIGHT (or address (pair address nat)) ; DUP 3 ; GET 5 ; COMPARE ; EQ ; AND ; IF { DUP ; GET 13 ; DUP 6 ; GET 12 ; IF_NONE { DUP 10 ; FAILWITH } {} ; DUP 3 ; GET 11 ; IF_NONE { DUP 11 ; FAILWITH } {} ; PAIR 3 ; UNIT ; DUP 3 ; DIG 3 ; GET 3 ; DIG 3 ; CONS ; UPDATE 3 } { UNIT ; SWAP } ; SWAP ; DROP ; DUP 4 ; DUP 5 ; CAR ; DUP 5 ; DUP 7 ; CAR ; CAR ; SUB ; ISNAT ; IF_NONE { PUSH string "406" ; FAILWITH } {} ; UPDATE 1 ; UPDATE 1 ; DUP ; DUP 2 ; CDR ; DIG 4 ; DIG 3 ; CDR ; CAR ; ADD ; UPDATE 1 ; UPDATE 2 ; SWAP ; UNIT ; RIGHT (or address (pair address nat)) ; DIG 4 ; CAR ; CDR ; COMPARE ; EQ ; IF { DUP 4 ; GET 12 } { NONE address } ; UPDATE 11 ; DIG 2 ; UPDATE 13 ; DUP 2 ; CAR ; CDR ; UPDATE 5 ; DUP 2 ; CAR ; CAR ; DIG 2 ; CDR ; CAR ; DUP 5 ; CAR ; IF_LEFT { DROP ; DUP 4 ; SWAP ; UPDATE 1 ; SWAP ; UPDATE 3 } { DROP ; DUP 4 ; DIG 2 ; UPDATE 1 ; SWAP ; UPDATE 3 } ; DUP 2 ; DUP 3 ; CAR ; DIG 3 ; CAR ; GET 11 ; DUP 5 ; GET 11 ; NOW ; SUB ; ISNAT ; IF_NONE { PUSH string "406" ; FAILWITH } {} ; PUSH nat 0 ; DUP 7 ; GET 3 ; COMPARE ; GT ; PUSH nat 0 ; DUP 8 ; CAR ; COMPARE ; GT ; PUSH nat 0 ; DUP 4 ; COMPARE ; GT ; AND ; AND ; IF { DUP 6 ; DUP 2 ; DUP 8 ; CAR ; DUP 12 ; DUP 10 ; GET 3 ; MUL ; PAIR ; DUP 11 ; SWAP ; EXEC ; MUL ; DIG 7 ; GET 5 ; ADD ; UPDATE 5 ; DUP ; DIG 2 ; DUP 3 ; GET 3 ; DUP 11 ; DUP 5 ; CAR ; MUL ; PAIR ; DUP 10 ; SWAP ; EXEC ; MUL ; DIG 2 ; GET 7 ; ADD ; UPDATE 7 ; UNIT ; SWAP } { DROP ; UNIT ; DIG 5 } ; SWAP ; DROP ; DUP 5 ; CAR ; UPDATE 1 ; DIG 4 ; GET 3 ; UPDATE 3 ; NOW ; UPDATE 11 ; DIG 4 ; CDR ; SWAP ; SOME ; SWAP ; UPDATE ; UPDATE 11 ; UPDATE 1 ; DUP ; PUSH nat 1 ; DIG 2 ; GET 14 ; ADD ; UPDATE 14 } ; SWAP ; DIG 2 ; DIG 3 ; DIG 4 ; DROP 4 ; GET 13 } ; view "get_total_supply" (list nat) (list (pair (nat %request) (nat %total_supply))) { UNPAIR ; NIL (pair nat nat) ; SWAP ; ITER { SWAP ; DUP 3 ; CAR ; GET 11 ; DUP 3 ; GET ; IF_NONE { PUSH string "108" ; FAILWITH } {} ; GET 9 ; DIG 2 ; PAIR ; CONS } ; SWAP ; DROP } ; view "get_reserves" (list nat) (list (pair (nat %request) (pair %reserves (nat %token_a_pool) (nat %token_b_pool)))) { UNPAIR ; NIL (pair nat (pair nat nat)) ; SWAP ; ITER { SWAP ; DUP 3 ; CAR ; GET 11 ; DUP 3 ; GET ; IF_NONE { PUSH string "108" ; FAILWITH } {} ; SWAP ; DUP 2 ; GET 3 ; DIG 2 ; CAR ; PAIR ; DIG 2 ; PAIR ; CONS } ; SWAP ; DROP } ; view "check_is_banned_baker" (pair (nat %pair_id) (key_hash %baker)) bool { UNPAIR ; SWAP ; CAR ; GET 11 ; DUP 2 ; CAR ; GET ; IF_NONE { PUSH string "108" ; FAILWITH } {} ; GET 12 ; IF_NONE { PUSH string "113" ; FAILWITH } {} ; PUSH string "125" ; SWAP ; DIG 2 ; CDR ; VIEW "is_banned_baker" bool ; IF_NONE { FAILWITH } { SWAP ; DROP } } }