Skip to content

Commit

Permalink
fix inheritance order
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Nov 29, 2023
1 parent ad34755 commit aad107a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
2 changes: 2 additions & 0 deletions contracts/NonfungiblePositionManagerV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {PeripheryValidation} from "./base/PeripheryValidation.sol";
import {PeripheryPayments} from "./base/PeripheryPayments.sol";
import {PeripheryImmutableState} from "./base/PeripheryImmutableState.sol";
import {SelfPermit} from "./base/SelfPermit.sol";
import {LiquidityManagement} from "./base/LiquidityManagement.sol";
import {Multicall} from "./base/Multicall.sol";

contract NonfungiblePositionManagerV4 is
Expand All @@ -22,6 +23,7 @@ contract NonfungiblePositionManagerV4 is
PeripheryImmutableState,
PeripheryValidation,
PeripheryPayments,
LiquidityManagement,
SelfPermit,
Multicall
{
Expand Down
2 changes: 1 addition & 1 deletion contracts/base/LiquidityManagement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract contract LiquidityManagement is ILockCallback, ILiquidityManagement, Pe
}

function lockAcquired(bytes calldata rawData) external override returns (bytes memory) {
// TODO: handle mint/add liquidity here
// TODO: handle mint/add/decrease liquidity here
return abi.encode(0);
}
}
26 changes: 26 additions & 0 deletions contracts/interfaces/ILiquidityManagement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pragma solidity ^0.8.19;
import {ILockCallback} from "@uniswap/v4-core/contracts/interfaces/callback//ILockCallback.sol";
import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";

/// @title Liquidity management interface
/// @notice Wrapper around pool manager callbacks
interface ILiquidityManagement is ILockCallback {
struct MintParams {
PoolKey poolKey;
Expand All @@ -17,4 +19,28 @@ interface ILiquidityManagement is ILockCallback {
uint256 deadline;
bytes hookData;
}

struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}

struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}

struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
}
24 changes: 0 additions & 24 deletions contracts/interfaces/INonfungiblePositionManagerV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ interface INonfungiblePositionManagerV4 is
payable
returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);

struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}

/// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
/// @param params tokenId The ID of the token for which liquidity is being increased,
/// amount0Desired The desired amount of token0 to be spent,
Expand All @@ -119,14 +110,6 @@ interface INonfungiblePositionManagerV4 is
payable
returns (uint128 liquidity, uint256 amount0, uint256 amount1);

struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}

/// @notice Decreases the amount of liquidity in a position and accounts it to the position
/// @param params tokenId The ID of the token for which liquidity is being decreased,
/// amount The amount by which liquidity will be decreased,
Expand All @@ -140,13 +123,6 @@ interface INonfungiblePositionManagerV4 is
payable
returns (uint256 amount0, uint256 amount1);

struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}

/// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
/// @param params tokenId The ID of the NFT for which tokens are being collected,
/// recipient The account that should receive the tokens,
Expand Down

0 comments on commit aad107a

Please sign in to comment.