Check the actual amounts transferred #206
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Warden finding
duplicate
Another warden found this issue
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
pauliax
Vulnerability details
Impact
Consider checking the actual amount transferred, e.g. in function addBounty as otherwise, you may have trouble with non-standard tokens, e.g. deflationary with a fee on transfer. The actual amount transferred is balanceOf the token before and after.
Recommended Mitigation Steps
uint256 before = IERC20(token).balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), amount);
uint256 after = IERC20(token).balanceOf(address(this));
amount = after - before;
The text was updated successfully, but these errors were encountered: