The swapExactOutput function does not include a maxInputAmount parameter, which is critical for ensuring that users do not overpay during swaps. This omission can lead to users inadvertently providing more tokens than necessary, resulting in potential financial losses.
The swapExactOutput function is designed to swap an exact amount of output tokens, but without a maxInputAmount parameter, users cannot cap the maximum number of input tokens they are willing to provide. This lack of a safeguard can lead to users providing an excessive number of input tokens if market conditions change unfavorably during the transaction execution.
Deploy the TSWAP contract
Call the function with parameters that would result in a high input amount due to rapid market changes.
Observe that the user overpays without any safeguard against providing an excessive number of input tokens.
Financial Loss: Users may overpay for swaps, leading to unintended financial losses.
User Trust: The lack of a maximum input limit can erode user trust in the contract, as users may feel unprotected from adverse market movements.
Market Manipulation: Malicious actors could exploit this vulnerability by manipulating market conditions to cause users to overpay significantly during swaps.
Manual Review
Add maxInputAmount Parameter: Update the swapExactOutput function to include a maxInputAmount parameter, ensuring that users do not overpay for swaps.
Input Validation: Validate the input amount against the maxInputAmount to ensure it does not exceed the user-defined limit.
User Education: Inform users about the importance of setting a maxInputAmount to protect themselves from potential overpayment.
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.