20,000 USDC
View results
Submission Details
Severity: high
Valid

Swap without slippage protection

Summary

Vulnerability Details

In sellProfits() function, the amountOutMinimum is set to 0. This means that the swap will accept any amount of tokens back which can result in getting sandwiched by MEV bots.

Impact

An MEV bot can initiate a sandwich attack every time sellProfits() is executed. So, the fees collected by the protocol will always be lower than expected after the swap. In some cases (low liquidity tokens), the swap might return only a tiny fraction of WETH or almost up to nothing at all after the swap.

Tools Used

Manual Review.

Recommendations

Calculate and set the amountOutMinimum to the swap.
The amountOutMinimum can be obtained by executing exactInputSingle function from ISwapRouter

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.