From 3b2248a50cc516104e44f4d80524ed2d782cec4e Mon Sep 17 00:00:00 2001 From: cryptoDev222 Date: Mon, 9 Aug 2021 23:53:49 -0500 Subject: [PATCH] fix small issues --- contracts/mainnet/connectors/uniswapV3/helpers.sol | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contracts/mainnet/connectors/uniswapV3/helpers.sol b/contracts/mainnet/connectors/uniswapV3/helpers.sol index f48a2edd..5586b6c2 100644 --- a/contracts/mainnet/connectors/uniswapV3/helpers.sol +++ b/contracts/mainnet/connectors/uniswapV3/helpers.sol @@ -101,20 +101,22 @@ abstract contract Helpers is DSMath, Basic { _amount1 ); - approve(_token0, address(nftManager), _amount0); - approve(_token1, address(nftManager), _amount1); - - uint256 isEth = address(_token0) == wethAddr ? 0 : 1; + uint256 isEth = address(_token0) == wethAddr ? 0 : 2; + isEth = address(_token1) == wethAddr ? 1 : 2; + require(isEth != 2, "no-ETH"); convertEthToWeth(isEth == 0, _token0, _amount0); convertEthToWeth(isEth == 1, _token1, _amount1); + approve(_token0, address(nftManager), _amount0); + approve(_token1, address(nftManager), _amount1); + uint256 _minAmt0 = getMinAmount(_token0, _amount0, params.slippage); uint256 _minAmt1 = getMinAmount(_token1, _amount1, params.slippage); INonfungiblePositionManager.MintParams memory params = INonfungiblePositionManager.MintParams( - isEth == 0 ? ethAddr : address(_token0), - isEth == 1 ? ethAddr : address(_token1), + address(_token0), + address(_token1), params.fee, params.tickLower, params.tickUpper,