The function calculateMinimumAmountOut()
only calculates the minimum amount of received tokens to ensure the collateral value does not fall below the minimum required, exposing users to a sandwich attack where the user may receive just enough tokens to meet the minimum requirement.
The swap()
function should include an additional parameter, _amountOutMinimum
, and an additional step to compare this parameter with the minimumAmountOut
variable.
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.