First test work commit, don't touch

This commit is contained in:
Robert Virding
2018-12-22 01:23:40 +01:00
parent 3ceb8c38db
commit d4d02fd576
97 changed files with 10599 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
contract SpendContract =
function withdraw : (int) => int
contract SpendTest =
function spend(to, amount) =
let total = Contract.balance
Chain.spend(to, amount)
total - amount
function withdraw(amount) : int =
spend(Call.caller, amount)
function withdraw_from(account, amount) =
account.withdraw(amount)
withdraw(amount)
function spend_from(from, to, amount) =
from.withdraw(amount)
Chain.spend(to, amount)
Chain.balance(to)
function get_balance() = Contract.balance
function get_balance_of(a) = Chain.balance(a)