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

Missing slippage checks

Summary

Users can be frontrun and receive a worse price than expected when they initially submitted the transaction.

Vulnerability Details

The current implementation lacks essential safeguards, such as a minimum return amount or a deadline for the trade transaction to be validated. This absence of protective measures leaves the trade susceptible to front-running. It also opens up the possibility of sandwich attacks. Consequently, these vulnerabilities could result in the loss of user funds.

ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
//@audit- wtffffffff zero slippage is really bad
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});

Impact

No slippage checks can lead to users being front run and lead to loss of users funds.

Tools Used

This issue was identified through a manual review of the code.

Recommendations

Add some sort of protection for the user such that they receive their desired amounts. Add a minimum return amount for all swap and liquidity provisions/removals to all Router functions.

Support

FAQs

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

Give us feedback!