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

UNISWAP_FEE is hardcoded which will lead to significant losses compared to optimal routing

Summary

UNISWAP_FEE is hardcoded which will lead to significant losses compared to optimal routing

Vulnerability Details

In Fees.sol , UNISWAP_FEE is hardcoded, which reduce significantly the possibilities and will lead to non optimal routes.

the instance:

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,
sqrtPriceLimitX96: 0
});
amount = swapRouter.exactInputSingle(params);
IERC20(WETH).transfer(staking, IERC20(WETH).balanceOf(address(this)));
}
}

Impact

using the current implementation would create a significant loss of revenue.

Tools Used

manually

Recommendations

Basic mitigation would be to hardcode in advance the best Uniswap paths in a mapping.

Support

FAQs

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