In contracts/SmartVaultV3::swap()
method, we execute the swap with a minimumAmountOut that is in reality greater than the actual minimumAmountOut taking into account the real value of the amountIn.
In contracts/SmartVaultV3::swap()
method, we determin the value of the minimumAmountOut
variable based on the actual value the vault owner wants to swap( let's call that value _amount). This effectively assumes that, amountIn
in during the swap equals _amount
. But then when constructing the swap params we indicate that, the amountIn
is less than the amount the user wished to swap by a delta of swapFee
. This goes against the assumption a few sentences back and thus, the minimumAmountOut used during the swap is actually greater than what it is really supposed to be and may cause the swap to fail in situations it should not have. For example, when the swap result in the amount out to be less than minimumAmountOut
but still is greater than the minimumAmountOut for an amountIn that is amountIn = _amount - swapFee
Swaps may fail due to the minimumAmountOut value not being met during the swap even though minimumAmountOut might be an incorrect value for the value provided in amountIn
Manual review
calculate the minimumAmountOut based on the actual value that is used on amountIn during the swap.
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.