calculateMinimumAmountOut()
function allows value of 0
to be returned under certain conditions. This opens user up to high slippage and sandwich attacks.
When calculating the minimumAmountOut
from the calculateMinimumAmountOut()
function, the value is finally decided like this:
This shows that if Collateral value - Swap Value
is bigger than the required Collateral Value
then the value of 0
will be returned as the minimumAmountOut
. This is problematic because if a swap occurs with any token that has slippage e.g. ARB
, there will be zero slippage protection and as a result MEV Bots could sandwich the swap and profit at the expense of the user.
Users could lose portions or the majority value of funds used during swap.
Manual review.
Calculate the minimumAmountOut
that will result even if collateralValueMinusSwapValue >= requiredCollateralValue
.
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.