The Standard

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

Did not approve to 0 first

Summary

Some tokens do not implement the ERC20 standard properly but are still accepted by most code that accepts ERC20 tokens. For example, Tether (USDT)'s approve() function will revert if the current approval is not zero, to protect against front-running changes of approvals.

Vulnerability Details

In the executeERC20SwapAndFee() function in SmartVaultV3, we're approving the swapRouter to spend amountIn:

IERC20(_params.tokenIn).safeApprove(ISmartVaultManagerV3(manager).swapRouter2(), _params.amountIn);

However, if the tokenIn is a token like USDT that reverts if the current approval is not zero, and there is some approval left from previous use, then this will revert and in return, the swap function will not be able to be executed.

Impact

The swap function won't work.

Tools Used

Manual review

Recommendations

Approve to 0 first.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

informational/invalid

Support

FAQs

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