The sellProfits
function accepts any slippage
The sellProfits
function have the amountOutMinimum
and sqrtPriceLimitX96
in 0, also can be called by anyone, this gives the possibility of a MEV attack or sandwich attack
From Uniswap Docs:
amountOutMinimum
: we are setting to zero, but this is a significant risk in production. For a real deployment, this value should be calculated using our SDK or an onchain price oracle - this helps protect against getting an unusually bad price for a trade due to a front running sandwich or another type of price manipulation
sqrtPriceLimitX96
: We set this to zero - which makes this parameter inactive. In production, this value can be used to set the limit for the price the swap will push the pool to, which can help protect against price impact or for setting up logic in a variety of price-relevant mechanisms.
Another issue is the pool fee is always 3000(0.3%), which means that the pool tier is always the same, it may be the case that the liquidity of the pool of 3000(0.3%) is changed to the other, for example 100(0.01%) or 500(0.05%), giving a greater possibility of MEV attacks since it has low liquidity and also giving worse rates to token swaps
Loose the profits received by the Fees contract
Add the fee
, amountOutMinimum
and sqrtPriceLimitX96
parameters to the sellProfits
function and calculate these off-chain
Also protect this function with as example onlyOwner
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.