mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
27 lines
593 B
Plaintext
27 lines
593 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(public addr: address) -> public u128 {
|
|
return balances[addr];
|
|
}
|
|
|
|
function write_in_finalize(public addr: address, public amount: u128) {
|
|
finalize(addr, amount);
|
|
} finalize(public: addr: address, public amount: u128) {
|
|
balances[addr] = amount;
|
|
}
|