In the sellProfits function, use amount_in and amount_out instead of amount.
- uint256 amount = IERC20(_profits).balanceOf(address(this));
+ uint256 amount_in = IERC20(_profits).balanceOf(address(this));
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
@@ -34,12 +34,12 @@ contract Fees {
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
- amountIn: amount,
+ amountIn: amount_in,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});
- amount = swapRouter.exactInputSingle(params);
+ uint256 amount_out = swapRouter.exactInputSingle(params);