ligo/test/contracts/min.tz

14 lines
748 B
Plaintext

parameter (pair int int);
return int;
storage unit;
code { CAR; # Ignore the storage
DUP; # Duplicate so we can get both the numbers passed as parameters
DUP; # Second dup so we can access the lesser number
CAR; DIP{CDR}; # Unpack the numbers on top of the stack
CMPLT; # Compare the two numbers, placing a boolean on top of the stack
IF {CAR} {CDR}; # Access the first number if the boolean was true
UNIT; # Push storage value
SWAP; # Correct order for calling convention pair
PAIR} # Pair the numbers satisfying the calling convention