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.
In the executeERC20SwapAndFee()
function in SmartVaultV3, we're approving the swapRouter to spend 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.
The swap function won't work.
Manual review
Approve to 0 first.
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.