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

Fees.sol#L30-L40 : Lack of slippage protection for uniswap swapping.

Summary

Fees.sol has the sellProfits function which will take the contracts balance and tries to swap and get the amount and then transfer to the staking contract.

the issue here is, there is no protection from MEV bots and other price manipulation attack which will lead to loss of funds. This is because there is not protection from slippage issue.

Vulnerability Details

function sellProfits(address _profits) public {
require(_profits != WETH, "not allowed");
uint256 amount = IERC20(_profits).balanceOf(address(this));
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0, -------------->>> audit find . no min value is specified.
sqrtPriceLimitX96: 0
});
amount = swapRouter.exactInputSingle(params);
IERC20(WETH).transfer(staking, IERC20(WETH).balanceOf(address(this)));
}
}

Impact

Loss of funds due to MEV bots attack or price manipulation attacks.

Tools Used

Manual review.

Recommendations

Include the slippage value this would ensure that the loss would not go beyond this specified limit.

Support

FAQs

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