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

Missing slippage checks

Summary

Missing slippage checks

Vulnerability Details

The following functions lack slippage protection and they are exposed to front-running, which will lead to the user losing their funds as they get sandwiched.

https://docs.uniswap.org/contracts/v3/guides/swaps/single-swaps#swap-input-parameters amountOutMinimum: we are setting to zero, but this is a significant risk in production.

Impact

ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0,//@audit
sqrtPriceLimitX96: 0
});
amount = swapRouter.exactInputSingle(params);

Tools Used

vscode

Recommendations

It is recommended that amountOutMinimum be 99% of amout

Support

FAQs

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