Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (63 sloc) 2.42 KB
parameter (or (pair :get_value (unit %unit)
(contract %callback_contract (pair timestamp
nat)))
(or (pair %update_value (timestamp %value_timestamp)
(nat %value))
(address %update_admin)));
storage (pair (pair timestamp
nat)
address);
code { DUP;
CAR;
DIP { CDR };
IF_LEFT { DUP;
CAR;
DIP { CDR };
DIP { DIP { DUP };
SWAP };
PAIR;
CDR;
CAR;
DIP { AMOUNT };
TRANSFER_TOKENS;
NIL operation;
SWAP;
CONS;
PAIR }
{ IF_LEFT { DIP { DUP;
CAR;
DIP { CDR } };
DIP { DUP };
DUP;
DIP { SWAP };
CAR;
DIP { CAR };
COMPARE;
GT;
IF { }
{ PUSH string "not newer";
FAILWITH };
DIP { DROP;
DUP;
DIP { SENDER;
COMPARE;
EQ;
IF { }
{ PUSH string "only admin may update";
FAILWITH } } };
PAIR;
NIL operation;
PAIR }
{ DIP { DUP;
CAR;
DIP { CDR };
DIP { SENDER;
COMPARE;
EQ;
IF { }
{ PUSH string "only admin may update";
FAILWITH } } };
SWAP;
PAIR;
NIL operation;
PAIR } } };
You can’t perform that action at this time.