HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: high
Invalid

USDT can't be registered as collateralToken

Summary

The USDT contract doesn't implement the IERC20 interface correctly. In this case functions that are supposed to return a bool (like approve does) don't.

Vulnerability Details

When trying to register USDT token with registerCollateralToken() . This brakes, due to the following line:

_collateralTokenContract.approve(_aaveV3Pool, type(uint256).max);

When trying to call approve, it will revert as IERC20 expects a return bool value but the usdtcontract does not.
https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7#code

Impact

This issue will make impossible to register usdtas a token in the protocol as registerCollateralToken() with usdt address will always revert.

Tools Used

Manual analysis.

Recommendations

In order to mitigate this use safeIncreaseAllowance which supports both cases.

_collateralTokenContract.safeIncreaseAllowance(_aaveV3Pool, type(uint256).max);
Updates

Lead Judging Commences

bube Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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