The sellPoolTokens
function in the TSwapPool
contract uses the swapExactOutput
function instead of the swapExactInput
function.
The sellPoolTokens
function is intended to allow users to sell a specified amount of pool tokens and receive the corresponding amount of WETH in return. However, the function calls swapExactOutput
instead of swapExactInput
. This results in the calculation of the required input amount (pool tokens) based on the desired output amount (WETH), which can lead to an incorrect amount of pool tokens being deducted from the user.
Add this test in the TSwapPool.t.sol
When users attempt to sell a specific amount of pool tokens, the amount deducted from their balance is not what they expected. This discrepancy can lead to users selling more tokens than intended, undermining trust in the protocol's functionality.
Manual review
Replace the swapExactOutput
function with swapExactInput
function.
Add additional param minOutputAmount
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.