The sellPoolTokens function currently calls the swapExactOutput function, which is incorrect because it passes the poolTokenAmount as the parameter. Since poolTokenAmount specifies the amount of input tokens (pool tokens) the user wants to sell, the function should instead call swapExactInput. This mismatch leads to an incorrect calculation of the token amount received by the user, resulting in users getting incorrect token amounts.
Users will receive an incorrect amount of tokens due to the miscalculation, severely disrupting protocol functionality.
Manual Review
Consider implementing swapExactInput
in place of swapExactOutput
. This change requires modifying the sellPoolTokens
function to include a new parameter, such as minWethToReceive
, which will be passed to swapExactInput
.
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.