Fees#sellProfits
executes a swap using Uniswap V3 but fails to implement proper slippage control, leaving funds highly vulnerable to theft through MEV sandwich attacks.
When executing a swap using Uniswap, amountOutMinimum
and sqrtPriceLimitX96
are used to define the slippage tolerance of the transaction (see here for more info). amountOutMinimum
defines an amount of received tokens that, if fewer are received, the transaction reverts. sqrtPriceLimitX96
determines the price at which to not swap any more tokens.
In Fees#sellProfits
, a swap is made using Uniswap V3's SwapRouter
, where both amountOutMinimum
and sqrtPriceLimitX96
are set to 0
. This means that the contract allows up to 100% slippage. In other words, the amount that the contract is able to lose from a sandwich attack is uncapped.
Each time sellProfits
is called, a considerable amount of user funds are prone to be stolen by MEV bots.
Manual review
Implement non-zero slippage parameters when interacting with Uniswap:
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.