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

Uniswap V3 may not support _profits token

Summary

In Fees.sol the sellProfits function will not work if Uniswap V3 does not support the _profits token.

Vulnerability Details

The sellProfits function swaps acquired fees from Lender.sol for WETH. In the case that Uniswap V3 does not support swapping from _profits to WETH, the protocol would not be able to retrieve the accumulated fees for the _profits token.

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

Funds would be stuck in the Fees.sol contract and would not be able to be retrieved.

Tools Used

Manual review

Recommendations

Lender.sol should only use tokens, that can be swapped for WETH on Uniswap V3.

Support

FAQs

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