x
33
{ parameter (unit %default) ; storage (pair (string %base_symbol) (pair (address %oracle) (string %quote_symbol))) ; code { CDR ; NIL operation ; SENDER ; CONTRACT unit ; IF_NONE { PUSH int 246 ; FAILWITH } {} ; AMOUNT ; UNIT ; TRANSFER_TOKENS ; CONS ; PAIR } ; view "get_price" unit nat { CDR ; DUP ; GET 3 ; SWAP ; DUP ; DUG 2 ; GET 4 ; VIEW "get_price" nat ; IF_NONE { PUSH int 502 ; FAILWITH } {} ; PUSH nat 1000000 ; DIG 2 ; DUP ; GET 3 ; SWAP ; CAR ; VIEW "get_price" nat ; IF_NONE { PUSH int 502 ; FAILWITH } {} ; MUL ; EDIV ; IF_NONE { PUSH int 258 ; FAILWITH } { CAR } } }