mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
31 lines
636 B
Plaintext
31 lines
636 B
Plaintext
/*
|
|
namespace: Compile
|
|
expectation: Fail
|
|
*/
|
|
|
|
mapping balances: address => u128;
|
|
|
|
function read(public addr: address) -> public u128 {
|
|
return balances[addr];
|
|
}
|
|
|
|
function write(public addr: address, public amount: u128) {
|
|
balances[addr] = amount;
|
|
}
|
|
|
|
function read_in_finalize(public addr: address) {
|
|
finalize(addr);
|
|
}
|
|
|
|
finalize read_in_finalize(public addr: address) -> public u128 {
|
|
return balances[addr];
|
|
}
|
|
|
|
function write_in_finalize(public addr: address, public amount: u128) {
|
|
async finalize(addr, amount);
|
|
}
|
|
|
|
finalize write_in_finalize(public: addr: address, public amount: u128) {
|
|
balances[addr] = amount;
|
|
}
|