Skip to content

Instantly share code, notes, and snippets.

@saibakatar
Created October 18, 2018 07:04
Show Gist options
  • Save saibakatar/436c75df6da75c694245e70a23d4785b to your computer and use it in GitHub Desktop.
Save saibakatar/436c75df6da75c694245e70a23d4785b to your computer and use it in GitHub Desktop.
Hash declaration in Scilla
contract Hash()
field a: Option ByStr32 = None {ByStr32} (*declaring variable a with no value*)
field b: ByStr32 = 0x123456789012345678901234567890123456789012345678901234567890abff
(*declaring variable b with some fixed value*)
transition update_value()
(*updating variable a*)
c = 0xabff567890123456789012345678901234567890123456789012345678901234; (*declaring variable c with fixed value in the transition*)
tmp= Some {ByStr32} c;
a:= tmp;
(*updating variable b*)
d= 0xffff567890123456789012345678901234567890123456789012345678901234;
b:= d
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment