ligo/test/contracts/max_in_list.tz
2017-07-24 20:29:12 +02:00

11 lines
298 B
Plaintext

parameter (list int32);
storage unit;
return (option int32);
code {CADR; DIP{NONE int32};
LAMBDA
(pair int32 (option int32))
(option int32)
{DUP; DUP; CAR; SWAP; CDR;
IF_NONE {DIP{DROP}; SOME} {CMPGT; IF {CDR} {CAR; SOME}}};
REDUCE; UNIT; SWAP; PAIR};