ligo/test/contracts/max_in_list.tz

11 lines
296 B
Plaintext
Raw Normal View History

2017-07-24 17:06:56 +04:00
parameter (list int32);
storage unit;
return (option int32);
code {CAR; DIP{NONE int32};
2017-07-24 17:06:56 +04:00
LAMBDA
(pair int32 (option int32))
(option int32)
{DUP; DUP; CAR; SWAP; CDR;
2017-07-24 17:06:56 +04:00
IF_NONE {DIP{DROP}; SOME} {CMPGT; IF {CDR} {CAR; SOME}}};
REDUCE; UNIT; SWAP; PAIR};