The Standard

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

Use safeTransfer for ERC20 Tokens

Summary

The code currently relies on standard ERC20 transfer() and transferFrom() functions, which may pose issues with certain tokens like Tether (USDT) that deviate from the ERC20 standard. To enhance compatibility and prevent reverted calls, it is recommended to replace these functions with OpenZeppelin's SafeERC20's safeTransfer() and safeTransferFrom().

Vulnerability Details

LiquidationPool.sol

File: contracts/LiquidationPool.sol
175: IERC20(_token.addr).transfer(msg.sender, _rewardAmount);

LiquidationPoolManager.sol

File: contracts/LiquidationPoolManager.sol
54: if (balance > 0) IERC20(_token.addr).transfer(protocol, balance);

Impact

The current implementation may encounter issues, especially with tokens like Tether (USDT), where the lack of boolean return values in the transfer() and transferFrom() functions can lead to reverted calls.

Tools Used

Manual review

Recommendations

Replace the usage of standard ERC20 transfer() and transferFrom() functions with OpenZeppelin's SafeERC20's safeTransfer() and safeTransferFrom() to ensure compatibility with tokens that do not fully adhere to the ERC20 standard.

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.