From 099fb6d468ab44ace75712cb5da916875ccb6354 Mon Sep 17 00:00:00 2001 From: cryptoDev222 Date: Wed, 18 Aug 2021 15:11:29 -0500 Subject: [PATCH] feat: refactor check-haskey --- .../mainnet/connectors/uniswapV3/events.sol | 15 +++--- .../mainnet/connectors/uniswapV3/main.sol | 46 +++++++++++-------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/contracts/mainnet/connectors/uniswapV3/events.sol b/contracts/mainnet/connectors/uniswapV3/events.sol index ca087c1a..829fadd2 100644 --- a/contracts/mainnet/connectors/uniswapV3/events.sol +++ b/contracts/mainnet/connectors/uniswapV3/events.sol @@ -6,8 +6,8 @@ contract Events { uint256 liquidity, uint256 amtA, uint256 amtB, - int24 lowerTick, - int24 upperTick + int24 tickLower, + int24 tickUpper ); event LogDeposit( @@ -24,12 +24,11 @@ contract Events { uint256 amountB ); - event Swap( - address indexed tokenIn, - address indexed tokenOut, - uint256 amtIn, - uint256 amtOut + event LogCollect( + uint256 tokenId, + uint256 amountA, + uint256 amountB ); - event LogBurn(uint256 tokenId); + event LogBurnPosition(uint256 tokenId); } diff --git a/contracts/mainnet/connectors/uniswapV3/main.sol b/contracts/mainnet/connectors/uniswapV3/main.sol index d3c9a765..af3db817 100644 --- a/contracts/mainnet/connectors/uniswapV3/main.sol +++ b/contracts/mainnet/connectors/uniswapV3/main.sol @@ -13,9 +13,10 @@ import {Events} from "./events.sol"; abstract contract UniswapResolver is Helpers, Events { /** * @dev Mint New Position - * @param params: parameter for mint. - * @param getIds: ID to retrieve amtA. - * @param setId: ID stores the amount of LP token. + * @notice Mint New NFT LP Position + * @param params parameter for mint + * @param getIds ID to retrieve amtA + * @param setId ID stores the amount of LP token */ function mint( MintParams memory params, @@ -51,12 +52,13 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Increase Liquidity - * @param tokenId: NFT LP Token ID. - * @param amountA: tokenA amounts. - * @param amountB: tokenB amounts. - * @param slippage: slippage. - * @param getIds: IDs to retrieve token amounts - * @param setId: stores the liquidity amount + * @notice Increase Liquidity of NFT Position + * @param tokenId NFT LP Token ID. + * @param amountA tokenA amounts. + * @param amountB tokenB amounts. + * @param slippage slippage. + * @param getIds IDs to retrieve token amounts + * @param setId stores the liquidity amount */ function deposit( uint256 tokenId, @@ -88,12 +90,13 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Decrease Liquidity - * @param tokenId: NFT LP Token ID. - * @param liquidity: LP Token amount. - * @param amountAMin: Min amount of tokenA. - * @param amountBMin: Min amount of tokenB. - * @param getId: ID to retrieve LP token amounts - * @param setIds: stores the amount of output tokens + * @notice Decrease Liquidity of NFT Position + * @param tokenId NFT LP Token ID. + * @param liquidity LP Token amount. + * @param amountAMin Min amount of tokenA. + * @param amountBMin Min amount of tokenB. + * @param getId ID to retrieve LP token amounts + * @param setIds stores the amount of output tokens */ function withdraw( uint256 tokenId, @@ -126,11 +129,12 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Collect function - * @param tokenId: NFT LP Token ID. - * @param amount0Max: Max amount of token0. - * @param amount1Max: Max amount of token1. - * @param getIds: IDs to retrieve amounts - * @param setIds: stores the amount of output tokens + * @notice Collect from NFT Position + * @param tokenId NFT LP Token ID. + * @param amount0Max Max amount of token0. + * @param amount1Max Max amount of token1. + * @param getIds IDs to retrieve amounts + * @param setIds stores the amount of output tokens */ function collect( uint256 tokenId, @@ -160,6 +164,8 @@ abstract contract UniswapResolver is Helpers, Events { /** * @dev Burn Function + * @notice Burn NFT LP Position + * @param tokenId NFT LP Token ID */ function burn(uint256 tokenId) external