Add salt to hashlock contract
This commit is contained in:
parent
7756bfda93
commit
d878387424
@ -9,6 +9,9 @@ type parameter = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let main ((p,s): parameter * storage) : operation list * storage =
|
let main ((p,s): parameter * storage) : operation list * storage =
|
||||||
|
(* We have to use a hash salted with the solvers address, otherwise a baker
|
||||||
|
could steal *)
|
||||||
|
let salted: bytes = Bytes.concat p.hashable (Bytes.pack sender) in
|
||||||
if ((Crypto.sha256 p.hashable) = s.hashed) && s.unused
|
if ((Crypto.sha256 p.hashable) = s.hashed) && s.unused
|
||||||
then
|
then
|
||||||
let s: storage = {hashed = s.hashed; unused = false} in
|
let s: storage = {hashed = s.hashed; unused = false} in
|
||||||
|
Loading…
Reference in New Issue
Block a user