diff --git a/lib/v4-periphery b/lib/v4-periphery index 151b2829..3819809f 160000 --- a/lib/v4-periphery +++ b/lib/v4-periphery @@ -1 +1 @@ -Subproject commit 151b28293733b9cd8a310babc15408fe1ba55c35 +Subproject commit 3819809f8c3aa6224ece98e83abe5fbfd15a0788 diff --git a/test/integration-tests/V3ToV4Migration.test.ts b/test/integration-tests/V3ToV4Migration.test.ts index 62941214..79e08e7e 100644 --- a/test/integration-tests/V3ToV4Migration.test.ts +++ b/test/integration-tests/V3ToV4Migration.test.ts @@ -969,7 +969,7 @@ describe('V3 to V4 Migration Tests:', () => { describe('V4 Commands', () => { beforeEach(async () => { // initialize new pool on v4 - await v4PositionManager.connect(bob).initializePool(USDC_WETH.poolKey, USDC_WETH.price, '0x') + await v4PositionManager.connect(bob).initializePool(USDC_WETH.poolKey, USDC_WETH.price) }) it('mint v4 succeeds', async () => { @@ -1658,11 +1658,10 @@ describe('V3 to V4 Migration Tests:', () => { tickSpacing: 10, hooks: '0x0000000000000000000000000000000000000000', }, - '79228162514264337593543950336', - '0x' + '79228162514264337593543950336' ) - await v4PositionManager.connect(bob).initializePool(ETH_USDC.poolKey, ETH_USDC.price, '0x') + await v4PositionManager.connect(bob).initializePool(ETH_USDC.poolKey, ETH_USDC.price) }) it('migrate with minting succeeds', async () => { // Bob max-approves the v3PM to access his USDC and WETH diff --git a/test/integration-tests/gas-tests/V3ToV4Migration.gas.test.ts b/test/integration-tests/gas-tests/V3ToV4Migration.gas.test.ts index 6d83e8a7..7c4ddbd7 100644 --- a/test/integration-tests/gas-tests/V3ToV4Migration.gas.test.ts +++ b/test/integration-tests/gas-tests/V3ToV4Migration.gas.test.ts @@ -260,8 +260,8 @@ describe('V3 to V4 Migration Gas Tests', () => { describe('V4 Commands', () => { beforeEach(async () => { // initialize new pool on v4 - await v4PositionManager.connect(bob).initializePool(USDC_WETH.poolKey, USDC_WETH.price, '0x') - await v4PositionManager.connect(bob).initializePool(ETH_USDC.poolKey, ETH_USDC.price, '0x') + await v4PositionManager.connect(bob).initializePool(USDC_WETH.poolKey, USDC_WETH.price) + await v4PositionManager.connect(bob).initializePool(ETH_USDC.poolKey, ETH_USDC.price) }) describe('mint', () => { diff --git a/test/integration-tests/gas-tests/__snapshots__/V3ToV4Migration.gas.test.ts.snap b/test/integration-tests/gas-tests/__snapshots__/V3ToV4Migration.gas.test.ts.snap index 00d7c729..d2090132 100644 --- a/test/integration-tests/gas-tests/__snapshots__/V3ToV4Migration.gas.test.ts.snap +++ b/test/integration-tests/gas-tests/__snapshots__/V3ToV4Migration.gas.test.ts.snap @@ -31,34 +31,34 @@ Object { exports[`V3 to V4 Migration Gas Tests V4 Commands increase gas: increase 1`] = ` Object { "calldataByteLength": 2084, - "gasUsed": 228044, + "gasUsed": 228073, } `; exports[`V3 to V4 Migration Gas Tests V4 Commands increase gas: migrate and increase 1`] = ` Object { "calldataByteLength": 2980, - "gasUsed": 452893, + "gasUsed": 452916, } `; exports[`V3 to V4 Migration Gas Tests V4 Commands mint gas: migrate and mint 1`] = ` Object { "calldataByteLength": 2500, - "gasUsed": 591127, + "gasUsed": 591168, } `; exports[`V3 to V4 Migration Gas Tests V4 Commands mint gas: migrate weth position into eth position with forwarding 1`] = ` Object { "calldataByteLength": 2788, - "gasUsed": 595274, + "gasUsed": 595307, } `; exports[`V3 to V4 Migration Gas Tests V4 Commands mint gas: mint 1`] = ` Object { "calldataByteLength": 1604, - "gasUsed": 437555, + "gasUsed": 437596, } `; diff --git a/test/integration-tests/shared/constants.ts b/test/integration-tests/shared/constants.ts index 7a35eb2f..294fafd2 100644 --- a/test/integration-tests/shared/constants.ts +++ b/test/integration-tests/shared/constants.ts @@ -25,3 +25,4 @@ export const V3_FACTORY_MAINNET = '0x1F98431c8aD98523631AE4a59f267346ea31F984' export const V3_INIT_CODE_HASH_MAINNET = '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54' export const V2_INIT_CODE_HASH_MAINNET = '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' export const V3_NFT_POSITION_MANAGER_MAINNET = '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' +export const V4_POSITION_DESCRIPTOR_ADDRESS = '0x0000000000000000000000000000000000000000' // TODO, deploy this in-line and use the proper address in posm's constructor diff --git a/test/integration-tests/shared/deployUniversalRouter.ts b/test/integration-tests/shared/deployUniversalRouter.ts index 5f067e79..e127edec 100644 --- a/test/integration-tests/shared/deployUniversalRouter.ts +++ b/test/integration-tests/shared/deployUniversalRouter.ts @@ -8,6 +8,7 @@ import { V3_INIT_CODE_HASH_MAINNET, PERMIT2_ADDRESS, V3_NFT_POSITION_MANAGER_MAINNET, + V4_POSITION_DESCRIPTOR_ADDRESS, } from './constants' import { deployV4PoolManager, deployV4PositionManager } from './v4Helpers' @@ -22,7 +23,8 @@ export async function deployRouter(v4PoolManager?: string, mockReentrantWETH?: s poolInitCodeHash: V3_INIT_CODE_HASH_MAINNET, v4PoolManager: poolManager, v3NFTPositionManager: V3_NFT_POSITION_MANAGER_MAINNET, - v4PositionManager: (await deployV4PositionManager(poolManager, PERMIT2_ADDRESS)).address, + v4PositionManager: (await deployV4PositionManager(poolManager, PERMIT2_ADDRESS, V4_POSITION_DESCRIPTOR_ADDRESS)) + .address, } const routerFactory = await ethers.getContractFactory('UniversalRouter') diff --git a/test/integration-tests/shared/v4Helpers.ts b/test/integration-tests/shared/v4Helpers.ts index 6c8e790b..5b25c6a5 100644 --- a/test/integration-tests/shared/v4Helpers.ts +++ b/test/integration-tests/shared/v4Helpers.ts @@ -58,12 +58,17 @@ export const ETH_USDC = { tickUpper: ETH_USDC_TICK_UPPER, } -export async function deployV4PositionManager(v4PoolManager: string, permit2: string): Promise { +export async function deployV4PositionManager( + v4PoolManager: string, + permit2: string, + v4PositionDescriptor: string +): Promise { const positionManagerFactory = await ethers.getContractFactory('PositionManager') const positionManager = (await positionManagerFactory.deploy( v4PoolManager, permit2, - 50000 + 50000, + v4PositionDescriptor )) as unknown as PositionManager return positionManager } @@ -75,7 +80,7 @@ export async function deployV4PoolManager(): Promise { } export async function initializeV4Pool(poolManager: PoolManager, poolKey: any, sqrtPrice: BigNumber) { - await poolManager.initialize(poolKey, sqrtPrice.toString(), '0x') + await poolManager.initialize(poolKey, sqrtPrice.toString()) } export async function addLiquidityToV4Pool(