Closed sherlock-admin3 closed 5 months ago
bareli
medium
Some ERC20 tokens revert on zero value transfers:
https://github.com/d-xo/weird-erc20#revert-on-zero-value-transfers
function sweepToken(IERC20 token) external onlyOwner { uint256 amount = token.balanceOf(address(this)); token.safeTransfer(recipient, amount); emit SweepToken(address(token), amount); }
function sweepToken(IERC20 token, uint256 amount) external onlyOwner { token.safeTransfer(recipient, amount); emit SweepToken(address(token), amount); }
ERC20 token can revert.sweep will be revert.
https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/utilities/Sweepable.sol#L24
Manual Review
check the amount is greater than 0.
bareli
medium
zero amount transfer can fail.
Summary
Some ERC20 tokens revert on zero value transfers:
https://github.com/d-xo/weird-erc20#revert-on-zero-value-transfers
Vulnerability Detail
function sweepToken(IERC20 token) external onlyOwner { uint256 amount = token.balanceOf(address(this)); token.safeTransfer(recipient, amount); emit SweepToken(address(token), amount); }
Impact
ERC20 token can revert.sweep will be revert.
Code Snippet
https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/utilities/Sweepable.sol#L24
Tool used
Manual Review
Recommendation
check the amount is greater than 0.