20,000 USDC
View results
Submission Details
Severity: medium

ERC20 tokens that do not follow the standard correctly can cause a DOS or unexpected behavior

Summary

ERC20 tokens that do not follow the standard correctly can cause a DOS or unexpected behavior.

Vulnerability Details

In Lender.sol dangerous ERC20 operations are used for collateralToken and loanToken (which are both configured by the user). Not all ERC20s follow the standard. Some do silent fails if not the operation is not checked (like USDT), some revert if approval is from non-zero to non-zero value and other have before and after transfer hooks.

Impact

The protocol can wrongly assume that a certain ERC20 operation was successful, leading to unexpected behavior.

Tools Used

Manual Review

Recommendations

use safeERC20 by OZ.

Support

FAQs

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