From 9d0727b6fae00dff9616fbdf70fbe691f2de91b7 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Sat, 21 Aug 2021 01:40:38 +0530 Subject: [PATCH] Converted struct into params --- .../mainnet/connectors/uniswapV3/helpers.sol | 4 +-- .../mainnet/connectors/uniswapV3/main.sol | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/contracts/mainnet/connectors/uniswapV3/helpers.sol b/contracts/mainnet/connectors/uniswapV3/helpers.sol index cb403e85..8585f84f 100644 --- a/contracts/mainnet/connectors/uniswapV3/helpers.sol +++ b/contracts/mainnet/connectors/uniswapV3/helpers.sol @@ -104,7 +104,7 @@ abstract contract Helpers is DSMath, Basic { (tokenId, liquidity, amountA, amountB) = nftManager.mint(params); } - function getAddress(uint256 _tokenId) + function getNftTokenPairAddresses(uint256 _tokenId) internal view returns (address token0, address token1) @@ -164,7 +164,7 @@ abstract contract Helpers is DSMath, Basic { uint256 amtB ) { - (address token0, address token1) = getAddress(tokenId); + (address token0, address token1) = getNftTokenPairAddresses(tokenId); (liquidity, amtA, amtB) = _addLiquidity( tokenId, diff --git a/contracts/mainnet/connectors/uniswapV3/main.sol b/contracts/mainnet/connectors/uniswapV3/main.sol index 68770652..e5bb6ca1 100644 --- a/contracts/mainnet/connectors/uniswapV3/main.sol +++ b/contracts/mainnet/connectors/uniswapV3/main.sol @@ -14,12 +14,19 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Mint New Position * @notice Mint New NFT LP Position - * @param params parameter for mint + * @param tokenA parameter for mint * @param getIds ID to retrieve amtA * @param setId ID stores the amount of LP token */ function mint( - MintParams memory params, + address tokenA, + address tokenB, + uint24 fee, + int24 tickLower, + int24 tickUpper, + uint256 amtA, + uint256 amtB, + uint256 slippage, uint256[] calldata getIds, uint256 setId ) @@ -27,6 +34,20 @@ abstract contract UniswapResolver is Helpers, Events { payable returns (string memory _eventName, bytes memory _eventParam) { + + MintParams memory params; + { + params = MintParams( + tokenA, + tokenB, + fee, + tickLower, + tickUpper, + amtA, + amtB, + slippage + ); + } params.amtA = getUint(getIds[0], params.amtA); params.amtB = getUint(getIds[1], params.amtB);