
Unbound untyped fields before binding typed ones Fix failing tests Make complex_types contract non-compatible with aevm Reduce code duplication Undo changes to test.aes Remove special handling of __constructor__ field Resolve field constraint by arity of contract function Update CHANGELOG Update CHANGELOG.md Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com> Split bind_field function Add a comment about rebinding
24 lines
558 B
Plaintext
24 lines
558 B
Plaintext
|
|
contract SpendTest =
|
|
|
|
stateful entrypoint spend(to, amount) =
|
|
let total = Contract.balance
|
|
Chain.spend(to, amount)
|
|
total - amount
|
|
|
|
stateful entrypoint withdraw(amount) : int =
|
|
spend(Call.caller, amount)
|
|
|
|
stateful entrypoint withdraw_from(account, amount) =
|
|
account.withdraw(amount)
|
|
withdraw(amount)
|
|
|
|
stateful entrypoint spend_from(from, to, amount) =
|
|
from.withdraw(amount)
|
|
Chain.spend(to, amount)
|
|
Chain.balance(to)
|
|
|
|
entrypoint get_balance() = Contract.balance
|
|
entrypoint get_balance_of(a) = Chain.balance(a)
|
|
|