Skip to content

Commit

Permalink
move stuff around
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Nov 29, 2023
1 parent aad107a commit 87e0b2f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
18 changes: 9 additions & 9 deletions contracts/NonfungiblePositionManagerV4.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,6 @@ contract NonfungiblePositionManagerV4 is
// will do something like return mintEntry(params)
}

modifier isAuthorizedForToken(uint256 tokenId) {
if (!_isApprovedOrOwner(msg.sender, tokenId)) revert NotApproved();
_;
}

function tokenURI(uint256 tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) {
// TODO: implement this
}

/// @inheritdoc INonfungiblePositionManagerV4
function increaseLiquidity(IncreaseLiquidityParams calldata params)
external
Expand Down Expand Up @@ -184,6 +175,15 @@ contract NonfungiblePositionManagerV4 is
_burn(tokenId);
}

modifier isAuthorizedForToken(uint256 tokenId) {
if (!_isApprovedOrOwner(msg.sender, tokenId)) revert NotApproved();
_;
}

function tokenURI(uint256 tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) {
// TODO: implement this
}

/// @inheritdoc IERC721
function getApproved(uint256 tokenId) public view override(ERC721, IERC721) returns (address) {
if (!_exists(tokenId)) revert NonexistentToken();
Expand Down
19 changes: 18 additions & 1 deletion contracts/base/LiquidityManagement.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;

import {PoolKey} from "@uniswap/v4-core/contracts/types/PoolKey.sol";
import {BalanceDelta} from "@uniswap/v4-core/contracts/types/BalanceDelta.sol";
import {ILockCallback} from "@uniswap/v4-core/contracts/interfaces/callback//ILockCallback.sol";
import {IPeripheryPayments} from "../interfaces/IPeripheryPayments.sol";
import {ILiquidityManagement} from "../interfaces/ILiquidityManagement.sol";
import {PeripheryImmutableState} from "./PeripheryImmutableState.sol";

abstract contract LiquidityManagement is ILockCallback, ILiquidityManagement, PeripheryImmutableState {
struct AddLiquidityParams {
PoolKey poolKey;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
bytes hookData;
}

function mintEntry(MintParams memory params)
internal
returns (uint256 tokenId, uint128 liquidity, BalanceDelta delta)
{
// poolManager.lock call here
// TODO: poolManager.lock call here
}

/// @notice Add liquidity to an initialized pool
function addLiquidity(AddLiquidityParams memory params) internal returns (uint128 liquidity, BalanceDelta delta) {
// TODO: copy over addLiquidity helper here
}

function lockAcquired(bytes calldata rawData) external override returns (bytes memory) {
Expand Down

0 comments on commit 87e0b2f

Please sign in to comment.