scilla_version 0 contract SendZil () field test_field : Uint256 = Uint256 0 field bool : Bool = True field empty_bool : Option Bool = None {Bool} field some_int : Option Int32 = let ten = Int32 10 in Some {Int32} ten field pair: Pair String Uint32 = let s1 = "Hello" in let num = Uint32 2 in Pair {String Uint32} s1 num field list : List Int32 = let nil = Nil {Int32} in let one = Int32 1 in Cons {Int32} one nil transition acceptZil () accept; v <- _balance; ev = {_eventname: "currentBalance"; value: v}; event ev end transition updateTestField (val : Uint256) test_field := val end transition dontAcceptZil () v <- _balance; ev = {_eventname: "currentBalance"; value: v}; event ev end (* See ZIL-5165 *) transition fundUserWithTag( user : ByStr20, amount : Uint128) msg = { _tag : "AddFunds"; _recipient : user ; _amount : amount }; no_msg = Nil {Message}; msgs = Cons {Message} msg no_msg; send msgs end transition fundUser (user : ByStr20, amount : Uint128) msg = { _tag : "" ; _recipient : user ; _amount : amount }; no_msg = Nil {Message}; msgs = Cons {Message} msg no_msg; send msgs end transition fundContract (contract_address : ByStr20, amount : Uint128) msg = { _tag : "acceptZil" ; _recipient : contract_address ; _amount : amount }; no_msg = Nil {Message}; msgs = Cons {Message} msg no_msg; send msgs end transition callOtherContract (contract_address : ByStr20, tag : String, value : Uint256) msg = { _tag : tag ; _recipient : contract_address ; _amount : Uint128 0 ; val: value}; no_msg = Nil {Message}; msgs = Cons {Message} msg no_msg; send msgs end