Converted struct into params

This commit is contained in:
Thrilok Kumar 2021-08-21 01:40:38 +05:30
parent ee738fda70
commit 9d0727b6fa
2 changed files with 25 additions and 4 deletions

View File

@ -104,7 +104,7 @@ abstract contract Helpers is DSMath, Basic {
(tokenId, liquidity, amountA, amountB) = nftManager.mint(params); (tokenId, liquidity, amountA, amountB) = nftManager.mint(params);
} }
function getAddress(uint256 _tokenId) function getNftTokenPairAddresses(uint256 _tokenId)
internal internal
view view
returns (address token0, address token1) returns (address token0, address token1)
@ -164,7 +164,7 @@ abstract contract Helpers is DSMath, Basic {
uint256 amtB uint256 amtB
) )
{ {
(address token0, address token1) = getAddress(tokenId); (address token0, address token1) = getNftTokenPairAddresses(tokenId);
(liquidity, amtA, amtB) = _addLiquidity( (liquidity, amtA, amtB) = _addLiquidity(
tokenId, tokenId,

View File

@ -14,12 +14,19 @@ abstract contract UniswapResolver is Helpers, Events {
/** /**
* @dev Mint New Position * @dev Mint New Position
* @notice Mint New NFT LP Position * @notice Mint New NFT LP Position
* @param params parameter for mint * @param tokenA parameter for mint
* @param getIds ID to retrieve amtA * @param getIds ID to retrieve amtA
* @param setId ID stores the amount of LP token * @param setId ID stores the amount of LP token
*/ */
function mint( 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[] calldata getIds,
uint256 setId uint256 setId
) )
@ -27,6 +34,20 @@ abstract contract UniswapResolver is Helpers, Events {
payable payable
returns (string memory _eventName, bytes memory _eventParam) 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.amtA = getUint(getIds[0], params.amtA);
params.amtB = getUint(getIds[1], params.amtB); params.amtB = getUint(getIds[1], params.amtB);