Swapping received fee tokens (_profits) for WETH is susceptible to inefficient swaps due to using a hardcoded swap fee of 0.3% (3000, in line 34) in the sellProfits function of the Fees contract.
Usually, there are multiple Uniswap V3 pools available for a given token pair with different swap fees.
For instance, the optimal route to swap USDC for WETH is using the 0.05% (500) swap fee pool, which has significantly more liquidity than the 0.3% (3000) swap fee pool and thus less slippage.
Additionally, if the desired pool is not available, the swap will fail, or an attacker could exploit this by creating an imbalanced pool with the desired swap fee and stealing the tokens.
The Fees contract uses inefficient swaps, which leads to higher slippage (receiving less WETH) or failing swaps.
Manual Review
Consider defining the optimal Uniswap V3 swap paths (i.e., tokenIn and fee) for a given _profits token in advance by storing them in a mapping.
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.