mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-17 16:58:21 +03:00
Update examples
This commit is contained in:
parent
a0b00ac78c
commit
9cb5ac1d91
@ -47,12 +47,12 @@ program token.aleo {
|
||||
// Decrements `account[sender]` by `amount`.
|
||||
// If `account[sender]` does not exist, it will be created.
|
||||
// If `account[sender] - amount` underflows, `transfer_public` is reverted.
|
||||
let current_amount = Mapping::get_or(account, sender, 0u64);
|
||||
let current_amount: u64 = Mapping::get_or(account, sender, 0u64);
|
||||
Mapping::set(account, sender, current_amount - amount);
|
||||
// Increments `account[receiver]` by `amount`.
|
||||
// If `account[receiver]` does not exist, it will be created.
|
||||
// If `account[receiver] + amount` overflows, `transfer_public` is reverted.
|
||||
let current_amount = Mapping::get_or(account, receiver, 0u64);
|
||||
let current_amount: u64 = Mapping::get_or(account, receiver, 0u64);
|
||||
Mapping::set(account, receiver, current_amount + amount);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user