Closed bb111189 closed 2 years ago
This is an add operation. and underflow will not occur
procedure AddToPaymentTokenBalance(to: ByStr20, payment_token_address: ByStr20, amount: Uint128) maybe_bal <- payment_tokens[to][payment_token_address]; new_bal = let cur_bal = get_bal maybe_bal in (* if underflow occurs, it throws CALL_CONTRACT_FAILED *) builtin add cur_bal amount; payment_tokens[to][payment_token_address] := new_bal end
This is an add operation. and underflow will not occur