Skip to content

Commit

Permalink
BAT Token implementation fix (#89)
Browse files Browse the repository at this point in the history
Fix BAT try_create_tokens overwriting current balance
  • Loading branch information
4ever2 authored Apr 15, 2021
1 parent 280da2a commit fb5ab02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion execution/examples/BAT.v
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Definition try_create_tokens sender (sender_payload : Amount) current_slot state
do _ <- returnIf (state.(tokenCreationCap) <? checkedSupply) ;
let new_token_state : EIP20Token.State := {|
EIP20Token.total_supply := checkedSupply;
EIP20Token.balances := FMap.add sender tokens (balances state);
EIP20Token.balances := FMap.partial_alter (fun balance => Some (with_default 0 balance + tokens)) sender (balances state);
EIP20Token.allowances := allowances state;
|} in
Some (state<|token_state := new_token_state|>).
Expand Down

0 comments on commit fb5ab02

Please sign in to comment.