20,000 USDC
View results
Submission Details
Severity: medium

Tight deadline in `sellProfits`

Summary

The deadline parameter in swap function is set to block.timestamp which is too tight.

Vulnerability Details

There should be more time for the deadline than just one second.

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

The swap function will revert due to the tight deadline.

Tools Used

Manual Review

Recommendations

Change the deadline to a few minutes at least.

Support

FAQs

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