UniswapV3: NonfungiblePositionManager

This contract allows users to create a standard UniswapV3 position, which is wrapped into a NFT.

The NonfungiblePositionManager is the owner of the NFT and all privileges are on behalf of this contract. It exposes logic that allows the tokenID holder to access these privileges.

1. mint Function

The mint function is the gateway for creating new liquidity positions within UniswapV3, which are then encapsulated within an NFT. This NFT symbolizes ownership and rights over the liquidity position. Once a position is created, the PositionManager holds the ownership, managing all associated rights.

2. increaseLiquidity Function

This function allows NFT holders to add more liquidity to their existing positions. A unique feature of increaseLiquidity is its flexibility; it permits users to add to positions even if they are not the token holders, even without any permissions.

3. decreaseLiquidity Function

Users can reduce their stake in a liquidity pool using the decreaseLiquidity function. Importantly, it takes into account the accrued fees, ensuring that liquidity providers are compensated for the transaction fees their liquidity has generated. The liquidity which is removed is then converted to tokenA/B and can be collected via the “collect” function.

4. collect Function

The collect function enables liquidity providers to withdraw accrued fees and any residual tokens from their positions.

5. burn Function

The burn function allows users to eliminate the NFT representing their liquidity position, provided there is no remaining liquidity associated with it.

It is important to mention that there is a griefing vector for this function: Due to the fact that the liquidity must be zero, a user can simply add a small amount on behalf of this position, which effectively makes the burn call revert.