Closed code423n4 closed 2 years ago
0v3rf10w
Calls inside a loop might lead to a denial-of-service attack. If one of the tokens reverts, then it will continue repeatedly.
SherBuy.sweepTokens(IERC20[]) (contracts/SherBuy.sol#181-190) token.safeTransfer(msg.sender,token.balanceOf(address(this))) (contracts/SherBuy.sol#188)
https://eth.wiki/en/howto/smart-contract-safety#favor-pull-over-push-for-external-calls
owner can remove DoS token from function argument
Handle
0v3rf10w
Vulnerability details
Impact
Calls inside a loop might lead to a denial-of-service attack. If one of the tokens reverts, then it will continue repeatedly.
Proof of Concept
Recommended Mitigation Steps
https://eth.wiki/en/howto/smart-contract-safety#favor-pull-over-push-for-external-calls