Add rough draft of hashlock contract

This commit is contained in:
John David Pressman 2020-01-22 01:30:04 -08:00
parent c8ea510f18
commit 7756bfda93

View File

@ -0,0 +1,16 @@
type storage = {
hashed: bytes;
unused: bool;
}
type parameter = {
hashable: bytes;
message: unit -> operation list;
}
let main ((p,s): parameter * storage) : operation list * storage =
if ((Crypto.sha256 p.hashable) = s.hashed) && s.unused
then
let s: storage = {hashed = s.hashed; unused = false} in
((p.message ()), s)
else (([]: operation list), s)