The safeApprove(0) method is not included in SmartVaultV3's executeERC20SwapAndFee() when a swap is executed. This prevents the smart contract owner from swapping the same token more than once because executeERC20SwapAndFee() uses safeApprove() with a non-zero value. therefore the transaction will always revert.
The SmartVaultV3#executeERC20SwapAndFee() function, called internally by SmartVaultV3#swap, uses OpenZeppelin's safeApprove() method. This method approves ISmartVaultManagerV3(manager).swapRouter2() to perform a swap of tokenIn with amountIn.
However, safeApprove() is never reset to 0 after the first swap.
This means the allowance for ISmartVaultManagerV3(manager).swapRouter2() for tokenIn with amountIn is not set to 0, which is necessary for calling the swap function again(safeApprove()), especially for the same tokenIn.
OpenZeppelin SafeERC20 Contract - safeApprove Function
Consider adding another swap function in the smartVault.js test suite after the first swap, which will successfully pass the test.
The smart vault owner will never be able to swap the same token more than once, making the swap() function completely useless in the smart vault.
Manual
Always use safeApprove(..., 0) when changing the allowance, or opt for 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.