Update examples

This commit is contained in:
Pranav Gaddamadugu 2023-04-05 17:30:39 -07:00
parent a0b00ac78c
commit 9cb5ac1d91

View File

@ -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);
}