The Standard

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

Missing checks for successful transfer can lead to silent failures and wrong accounting

Summary

Missing checks for successful transfer on EIP-20 compliant tokens can lead to silent failures and wrong accounting

Vulnerability Details

Openzeppelin's IERC20 interface is compliant to EIP-20 specification. Which means the transfer function of this interface returns a bool which can be used to check whether the transfer failed or not.
In this case, ignoring the return value leads to considering the transfer successful and silent failure if the transfer fails.

File: contracts/LiquidationPoolManager.sol
40: eurosToken.transfer(protocol, eurosToken.balanceOf(address(this)));
54: if (balance > 0) IERC20(_token.addr).transfer(protocol, balance);
File: contracts/LiquidationPool.sol
175: IERC20(_token.addr).transfer(msg.sender, _rewardAmount);

Impact

Failure to check whether a transfer was successful or not will cause silent failures of transfers and affect token accounting.

Tools Used

Manual review

Recommendations

Add a require() statement that checks the return value of ERC20 token transfers.

However, using require() to check transfer return values could lead to issues with tokens non-compliant EIP-20 specification, which do not return a boolean value.
Therefore, I highly advise to use safeTransfer() from Openzeppelin's SafeERC20.

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.