Skip to content

Commit

Permalink
change name for UR
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis committed Dec 10, 2024
1 parent ab76d3b commit 21fdc89
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/PositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {ERC721Permit_v4} from "./base/ERC721Permit_v4.sol";
import {ReentrancyLock} from "./base/ReentrancyLock.sol";
import {IPositionManager} from "./interfaces/IPositionManager.sol";
import {Multicall_v4} from "./base/Multicall_v4.sol";
import {PoolInitializer} from "./base/PoolInitializer.sol";
import {PoolInitializer_v4} from "./base/PoolInitializer_v4.sol";
import {DeltaResolver} from "./base/DeltaResolver.sol";
import {BaseActionsRouter} from "./base/BaseActionsRouter.sol";
import {Actions} from "./libraries/Actions.sol";
Expand Down Expand Up @@ -100,7 +100,7 @@ import {IWETH9} from "./interfaces/external/IWETH9.sol";
contract PositionManager is
IPositionManager,
ERC721Permit_v4,
PoolInitializer,
PoolInitializer_v4,
Multicall_v4,
DeltaResolver,
ReentrancyLock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pragma solidity ^0.8.0;

import {ImmutableState} from "./ImmutableState.sol";
import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
import {IPoolInitializer} from "../interfaces/IPoolInitializer.sol";
import {IPoolInitializer_v4} from "../interfaces/IPoolInitializer_v4.sol";

/// @title Pool Initializer
/// @notice Initializes a Uniswap v4 Pool
/// @dev Enables create pool + mint liquidity in a single transaction with multicall
abstract contract PoolInitializer is ImmutableState, IPoolInitializer {
/// @inheritdoc IPoolInitializer
abstract contract PoolInitializer_v4 is ImmutableState, IPoolInitializer_v4 {
/// @inheritdoc IPoolInitializer_v4
function initializePool(PoolKey calldata key, uint160 sqrtPriceX96) external payable returns (int24) {
try poolManager.initialize(key, sqrtPriceX96) returns (int24 tick) {
return tick;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";

interface IPoolInitializer {
interface IPoolInitializer_v4 {
/// @notice Initialize a Uniswap v4 Pool
/// @dev If the pool is already initialized, this function will not revert and just return type(int24).max
/// @param key The PoolKey of the pool to initialize
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IPositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IImmutableState} from "./IImmutableState.sol";
import {IERC721Permit_v4} from "./IERC721Permit_v4.sol";
import {IEIP712_v4} from "./IEIP712_v4.sol";
import {IMulticall_v4} from "./IMulticall_v4.sol";
import {IPoolInitializer} from "./IPoolInitializer.sol";
import {IPoolInitializer_v4} from "./IPoolInitializer_v4.sol";
import {IUnorderedNonce} from "./IUnorderedNonce.sol";
import {IPermit2Forwarder} from "./IPermit2Forwarder.sol";

Expand All @@ -21,7 +21,7 @@ interface IPositionManager is
IERC721Permit_v4,
IEIP712_v4,
IMulticall_v4,
IPoolInitializer,
IPoolInitializer_v4,
IUnorderedNonce,
IPermit2Forwarder
{
Expand Down
4 changes: 2 additions & 2 deletions test/position-managers/PositionManager.gas.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol";

import {IERC20} from "forge-std/interfaces/IERC20.sol";

import {IPositionManager, IPoolInitializer} from "../../src/interfaces/IPositionManager.sol";
import {IPositionManager, IPoolInitializer_v4} from "../../src/interfaces/IPositionManager.sol";
import {Actions} from "../../src/libraries/Actions.sol";
import {PositionConfig} from "../shared/PositionConfig.sol";
import {IMulticall_v4} from "../../src/interfaces/IMulticall_v4.sol";
Expand Down Expand Up @@ -395,7 +395,7 @@ contract PosMGasTest is Test, PosmTestSetup {

// Use multicall to initialize a pool and mint liquidity
bytes[] memory calls = new bytes[](2);
calls[0] = abi.encodeWithSelector(IPoolInitializer.initializePool.selector, key, SQRT_PRICE_1_1);
calls[0] = abi.encodeWithSelector(IPoolInitializer_v4.initializePool.selector, key, SQRT_PRICE_1_1);

config = PositionConfig({
poolKey: key,
Expand Down
8 changes: 4 additions & 4 deletions test/position-managers/PositionManager.multicall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol";
import {IERC20} from "forge-std/interfaces/IERC20.sol";
import {IERC721} from "forge-std/interfaces/IERC721.sol";

import {IPositionManager, IPoolInitializer} from "../../src/interfaces/IPositionManager.sol";
import {IPositionManager, IPoolInitializer_v4} from "../../src/interfaces/IPositionManager.sol";
import {Actions} from "../../src/libraries/Actions.sol";
import {PositionConfig} from "../shared/PositionConfig.sol";
import {IMulticall_v4} from "../../src/interfaces/IMulticall_v4.sol";
Expand Down Expand Up @@ -97,7 +97,7 @@ contract PositionManagerMulticallTest is Test, Permit2SignatureHelpers, PosmTest

// Use multicall to initialize a pool and mint liquidity
bytes[] memory calls = new bytes[](2);
calls[0] = abi.encodeWithSelector(IPoolInitializer.initializePool.selector, key, SQRT_PRICE_1_1);
calls[0] = abi.encodeWithSelector(IPoolInitializer_v4.initializePool.selector, key, SQRT_PRICE_1_1);

config = PositionConfig({
poolKey: key,
Expand Down Expand Up @@ -138,7 +138,7 @@ contract PositionManagerMulticallTest is Test, Permit2SignatureHelpers, PosmTest

// Use multicall to initialize the pool again.
bytes[] memory calls = new bytes[](2);
calls[0] = abi.encodeWithSelector(IPoolInitializer.initializePool.selector, key, SQRT_PRICE_1_1);
calls[0] = abi.encodeWithSelector(IPoolInitializer_v4.initializePool.selector, key, SQRT_PRICE_1_1);

config = PositionConfig({
poolKey: key,
Expand Down Expand Up @@ -184,7 +184,7 @@ contract PositionManagerMulticallTest is Test, Permit2SignatureHelpers, PosmTest

// Use multicall to initialize a pool and mint liquidity
bytes[] memory calls = new bytes[](2);
calls[0] = abi.encodeWithSelector(IPoolInitializer.initializePool.selector, key, SQRT_PRICE_1_1);
calls[0] = abi.encodeWithSelector(IPoolInitializer_v4.initializePool.selector, key, SQRT_PRICE_1_1);

config = PositionConfig({
poolKey: key,
Expand Down

0 comments on commit 21fdc89

Please sign in to comment.