ligo/src/bin_client/test/contracts/int_publisher.tz

18 lines
787 B
Plaintext
Raw Normal View History

# (signed hash of the string, string)
parameter (option (pair signature int));
storage (pair key int);
code {DUP; DUP; CAR;
IF_NONE {PUSH tez "1.00"; # Fee pattern from July 26
AMOUNT; CMPLE; IF {FAIL} {};
# Provide the data
CDR; DIP {CDDR}}
{DUP; DIP{SWAP}; SWAP; CDAR; # Move key to the top
DIP {DUP; CAR; DIP {CDR; H}; PAIR}; # Arrange the new piece of data
CHECK_SIGNATURE; # Check to ensure the data is authentic
# Update data
IF {CDR; SWAP; DIP{DUP}; CDAR; PAIR}
# Revert the update. This could be replaced with FAIL
{DROP; DUP; CDR; DIP{CDDR}}};
# Cleanup
DIP{DROP}; NIL operation; PAIR}