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

Not having a minimum output amount is dangerous

Summary

Allowing to receive 0 in as trade amount can lead to front runs / sandwich attacks and the user losing huge amounts

Vulnerability Details

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

Impact

Max slippage, MEV, losing assets in sandwich attacks

Tools Used

Manual

Recommendations

Set a non hardcoded minimum amount so users can set their own amounts

Support

FAQs

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

Give us feedback!