Revision 222330dc62b50df603a7efba2c15f1da9ddc84dc authored by Killian Delarue on 19 September 2023, 08:59:38 UTC, committed by Killian Delarue on 19 September 2023, 08:59:38 UTC
Approved-by: Arvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
Approved-by: Raphaƫl Proust <code@bnwr.net>

See merge request https://gitlab.com/tezos/tezos/-/merge_requests/10153
2 parent s 47caadb + bde8479
Raw File
auction.tz
parameter key_hash;
storage (pair timestamp (pair mutez key_hash));
code { DUP; CDAR; DUP; NOW; CMPGT; IF {FAIL} {}; SWAP; # Check if auction has ended
       DUP; CAR; DIP{CDDR}; AMOUNT; PAIR; SWAP; DIP{SWAP; PAIR}; # Setup replacement storage
       DUP; CAR; AMOUNT; CMPLE; IF {FAIL} {};  # Check to make sure that the new amount is greater
       DUP; CAR;                               # Get amount of refund
       DIP{CDR; IMPLICIT_ACCOUNT}; UNIT; TRANSFER_TOKENS; # Make refund
       NIL operation; SWAP; CONS; PAIR} # Calling convention
back to top