Some tokens (like USDT) have non-standard ERC20 implementations, such requiring approvals to be set to zero before changing them.
The _approveCollateralTokenForAave function uses safeIncreaseAllowance, which may not work for these tokens. For example, if the current allowance is non-zero, safeIncreaseAllowance will revert for USDT. Thus, this function might fail for certain tokens, requiring the allowance to be reset to zero first. The correct approach would be to call safeApprove with zero first, then safeIncreaseAllowance. However, the current code uses safeIncreaseAllowance, which could revert for tokens like USDT.
Manual review
USDT requires allowance reset to 0 before using safeIncreaseAllowance
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.