Skip to content

Commit

Permalink
Emit absolute approval amounts with approval events
Browse files Browse the repository at this point in the history
  • Loading branch information
truls committed Jan 27, 2019
1 parent 41bb56b commit bbc935f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/token/ERC20/ExternalERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ contract ExternalERC20 is IERC20 {
_externalERC20Storage.allowed(from, originSender).sub(value)
);
_transfer(from, to, value);
emit Approval(from, originSender, value);
emit Approval(from, originSender, _externalERC20Storage.allowed(from, originSender));
}

/**
Expand Down Expand Up @@ -266,6 +266,6 @@ contract ExternalERC20 is IERC20 {
_externalERC20Storage.allowed(account, burner).sub(value)
);
_burn(account, value);
emit Approval(account, burner, value);
emit Approval(account, burner, _externalERC20Storage.allowed(account, burner));
}
}
2 changes: 1 addition & 1 deletion test/token/ERC20/behaviors/ERC20.public.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function shouldBehaveLikeERC20PublicAPI (owner, recipient, anotherAccount) {
expectEvent.inLogs(events, 'Approval', {
owner: owner,
spender: spender,
value: amount
value: 0
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/token/ERC20/behaviors/ERC20Burnable.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) {
expectEvent.inLogs(this.logs, 'Approval', {
owner: owner,
spender: burner,
value: amount
value: originalAllowance - amount
});
});
}
Expand Down

0 comments on commit bbc935f

Please sign in to comment.