spend test
This commit is contained in:
parent
0e73d7011d
commit
7ba49c549d
14
test/contracts/hagia/spend.aes
Normal file
14
test/contracts/hagia/spend.aes
Normal file
@ -0,0 +1,14 @@
|
||||
include "List.aes"
|
||||
|
||||
contract C =
|
||||
|
||||
payable stateful entrypoint split(targets : list(address)) =
|
||||
let value_per_person = Call.value / List.length(targets)
|
||||
spend_to_all(value_per_person, targets)
|
||||
|
||||
stateful function
|
||||
spend_to_all : (int, list(address)) => unit
|
||||
spend_to_all(_, []) = ()
|
||||
spend_to_all(value, addr::rest) =
|
||||
Chain.spend(addr, value)
|
||||
spend_to_all(value, rest)
|
Loading…
x
Reference in New Issue
Block a user