The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Protocol will not work correctly with tokens that do not revert on failed `transfer`

Summary

Some tokens do not revert on failure in transfer but instead return false (example is ZRX). While such tokens are technically compliant with the standard it is a common issue to forget to check the return value of the transfer calls. With the current code, if such a call fails but does not revert it will result in inaccurate calculations or funds stuck in the protocol.

if (balance > 0) IERC20(_token.addr).transfer(protocol, balance);
eurosToken.transfer(protocol, eurosToken.balanceOf(address(this)));
IERC20(_token.addr).transfer(msg.sender, _rewardAmount);

Tools Used

manual analysis

Recommendations

Use OpenZeppelin's SafeERC20 library and its safe methods like safeTransfer() for ERC20 transfers.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

unchecked-transfer

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.