Selling profits earned can be lost due to incorrect swap params passed to Swap Router.
The parameters are set have no slippage protection, so any MEV bot could see this transaction, aggressively sandwich attack it.
In the swapping params, the minimum output amount(amountOutMinimum) is configured as 0. This basically means, in exchange for swapping for ERC20 token, the caller is agreeing to receive no tokens at all if such circumstances prevail.
This is not a production setup and should be restricted.
Also, the price Limit(sqrtPriceLimitX96) is also configured as 0 is defined the price limit for the swap to go through. Incase the price falls below the specified price, the swap does not happen.
This is not a production setup.
ERC20 tokens will be lost in the swapping which is not the intention of the protocol.
Manual Review
Add these two param as parameter of the function, so that caller has the ability to measure and take the risk of loosing the profits generated.
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.