From 9778afac32de640734d9ea12120272a4cbcde18b Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Thu, 12 Dec 2024 12:32:08 -0500 Subject: [PATCH 1/5] code hash snap --- snapshots/PositionManagerTest.json | 3 +++ test/position-managers/PositionManager.t.sol | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 snapshots/PositionManagerTest.json diff --git a/snapshots/PositionManagerTest.json b/snapshots/PositionManagerTest.json new file mode 100644 index 00000000..18fcc100 --- /dev/null +++ b/snapshots/PositionManagerTest.json @@ -0,0 +1,3 @@ +{ + "position manager initcode hash (without constructor params, as uint256)": "81827502601055975118808937107769364319765058198432540518516360048852193272922" +} \ No newline at end of file diff --git a/test/position-managers/PositionManager.t.sol b/test/position-managers/PositionManager.t.sol index a0dc970d..89066316 100644 --- a/test/position-managers/PositionManager.t.sol +++ b/test/position-managers/PositionManager.t.sol @@ -61,6 +61,13 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers { approvePosmFor(alice); } + function test_posm_initcodeHash() public { + vm.snapshotValue( + "position manager initcode hash (without constructor params, as uint256)", + uint256(keccak256(abi.encodePacked(vm.getCode("PositionManager.sol:PositionManager")))) + ); + } + function test_modifyLiquidities_reverts_deadlinePassed() public { PositionConfig memory config = PositionConfig({poolKey: key, tickLower: 0, tickUpper: 60}); bytes memory calls = getMintEncoded(config, 1e18, ActionConstants.MSG_SENDER, ""); From ca05423b834ddc853aa3024140f6181c613f56d9 Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Tue, 17 Dec 2024 14:09:15 -0500 Subject: [PATCH 2/5] move files, add descriptor --- snapshots/PosMGasTest.json | 1 + snapshots/PositionDescriptorTest.json | 1 + snapshots/PositionManagerTest.json | 3 --- test/PositionDescriptor.t.sol | 7 +++++++ test/position-managers/PositionManager.gas.t.sol | 7 +++++++ test/position-managers/PositionManager.t.sol | 7 ------- 6 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 snapshots/PositionManagerTest.json diff --git a/snapshots/PosMGasTest.json b/snapshots/PosMGasTest.json index 195b2104..fab212ff 100644 --- a/snapshots/PosMGasTest.json +++ b/snapshots/PosMGasTest.json @@ -38,5 +38,6 @@ "PositionManager_permit_twice": "44975", "PositionManager_subscribe": "87968", "PositionManager_unsubscribe": "62697", + "position manager initcode hash (without constructor params, as uint256)": "81827502601055975118808937107769364319765058198432540518516360048852193272922", "positionManager bytecode size": "23877" } \ No newline at end of file diff --git a/snapshots/PositionDescriptorTest.json b/snapshots/PositionDescriptorTest.json index 5be19f6a..df2ff3df 100644 --- a/snapshots/PositionDescriptorTest.json +++ b/snapshots/PositionDescriptorTest.json @@ -1,3 +1,4 @@ { + "position descriptor initcode hash (without constructor params, as uint256)": "88482580191959945449130293370700011665153263709859488839371600440410373093991", "positionDescriptor bytecode size": "24110" } \ No newline at end of file diff --git a/snapshots/PositionManagerTest.json b/snapshots/PositionManagerTest.json deleted file mode 100644 index 18fcc100..00000000 --- a/snapshots/PositionManagerTest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "position manager initcode hash (without constructor params, as uint256)": "81827502601055975118808937107769364319765058198432540518516360048852193272922" -} \ No newline at end of file diff --git a/test/PositionDescriptor.t.sol b/test/PositionDescriptor.t.sol index 57b1a641..7b924784 100644 --- a/test/PositionDescriptor.t.sol +++ b/test/PositionDescriptor.t.sol @@ -41,6 +41,13 @@ contract PositionDescriptorTest is Test, PosmTestSetup { deployAndApprovePosm(manager); } + function test_posm_initcodeHash() public { + vm.snapshotValue( + "position descriptor initcode hash (without constructor params, as uint256)", + uint256(keccak256(abi.encodePacked(vm.getCode("PositionDescriptor.sol:PositionDescriptor")))) + ); + } + function test_bytecodeSize_positionDescriptor() public { vm.snapshotValue("positionDescriptor bytecode size", address(positionDescriptor).code.length); } diff --git a/test/position-managers/PositionManager.gas.t.sol b/test/position-managers/PositionManager.gas.t.sol index c43d6805..3b0e8dd7 100644 --- a/test/position-managers/PositionManager.gas.t.sol +++ b/test/position-managers/PositionManager.gas.t.sol @@ -73,6 +73,13 @@ contract PosMGasTest is Test, PosmTestSetup { sub = new MockSubscriber(lpm); } + function test_posm_initcodeHash() public { + vm.snapshotValue( + "position manager initcode hash (without constructor params, as uint256)", + uint256(keccak256(abi.encodePacked(vm.getCode("PositionManager.sol:PositionManager")))) + ); + } + function test_bytecodeSize_positionManager() public { vm.snapshotValue("positionManager bytecode size", address(lpm).code.length); } diff --git a/test/position-managers/PositionManager.t.sol b/test/position-managers/PositionManager.t.sol index 89066316..a0dc970d 100644 --- a/test/position-managers/PositionManager.t.sol +++ b/test/position-managers/PositionManager.t.sol @@ -61,13 +61,6 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers { approvePosmFor(alice); } - function test_posm_initcodeHash() public { - vm.snapshotValue( - "position manager initcode hash (without constructor params, as uint256)", - uint256(keccak256(abi.encodePacked(vm.getCode("PositionManager.sol:PositionManager")))) - ); - } - function test_modifyLiquidities_reverts_deadlinePassed() public { PositionConfig memory config = PositionConfig({poolKey: key, tickLower: 0, tickUpper: 60}); bytes memory calls = getMintEncoded(config, 1e18, ActionConstants.MSG_SENDER, ""); From d275f15c38d4df6e0f0070f66b9ce590fa979ee4 Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Tue, 17 Dec 2024 15:34:40 -0500 Subject: [PATCH 3/5] rename --- test/PositionDescriptor.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/PositionDescriptor.t.sol b/test/PositionDescriptor.t.sol index 7b924784..824cc79d 100644 --- a/test/PositionDescriptor.t.sol +++ b/test/PositionDescriptor.t.sol @@ -41,7 +41,7 @@ contract PositionDescriptorTest is Test, PosmTestSetup { deployAndApprovePosm(manager); } - function test_posm_initcodeHash() public { + function test_position_descriptor_initcodeHash() public { vm.snapshotValue( "position descriptor initcode hash (without constructor params, as uint256)", uint256(keccak256(abi.encodePacked(vm.getCode("PositionDescriptor.sol:PositionDescriptor")))) From 27028c2ac9e246e597107a832f90c38bb2d1b1e6 Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Wed, 18 Dec 2024 15:58:23 -0500 Subject: [PATCH 4/5] add mock router snap --- snapshots/V4RouterTest.json | 3 ++- test/router/V4Router.gas.t.sol | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/snapshots/V4RouterTest.json b/snapshots/V4RouterTest.json index ff5612e8..c7965855 100644 --- a/snapshots/V4RouterTest.json +++ b/snapshots/V4RouterTest.json @@ -22,5 +22,6 @@ "V4Router_ExactOut3Hops_nativeOut": "224943", "V4Router_ExactOutputSingle": "133337", "V4Router_ExactOutputSingle_nativeIn_sweepETH": "126419", - "V4Router_ExactOutputSingle_nativeOut": "119821" + "V4Router_ExactOutputSingle_nativeOut": "119821", + "position manager initcode hash (without constructor params, as uint256)": "27545762869727400677117557485685740862616789454191614676777323590122002226479" } \ No newline at end of file diff --git a/test/router/V4Router.gas.t.sol b/test/router/V4Router.gas.t.sol index 3be32029..d3e4c1e5 100644 --- a/test/router/V4Router.gas.t.sol +++ b/test/router/V4Router.gas.t.sol @@ -22,6 +22,13 @@ contract V4RouterTest is RoutingTestHelpers { vm.snapshotValue("V4Router_Bytecode", address(router).code.length); } + function test_router_initcodeHash() public { + vm.snapshotValue( + "position manager initcode hash (without constructor params, as uint256)", + uint256(keccak256(abi.encodePacked(vm.getCode("MockV4Router.sol:MockV4Router")))) + ); + } + /*////////////////////////////////////////////////////////////// ERC20 -> ERC20 EXACT INPUT //////////////////////////////////////////////////////////////*/ From 3a09cc89ae22653015d09d2c71917758bce3d5bd Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Wed, 18 Dec 2024 16:21:55 -0500 Subject: [PATCH 5/5] router --- snapshots/V4RouterTest.json | 2 +- test/router/V4Router.gas.t.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snapshots/V4RouterTest.json b/snapshots/V4RouterTest.json index c7965855..952f619d 100644 --- a/snapshots/V4RouterTest.json +++ b/snapshots/V4RouterTest.json @@ -23,5 +23,5 @@ "V4Router_ExactOutputSingle": "133337", "V4Router_ExactOutputSingle_nativeIn_sweepETH": "126419", "V4Router_ExactOutputSingle_nativeOut": "119821", - "position manager initcode hash (without constructor params, as uint256)": "27545762869727400677117557485685740862616789454191614676777323590122002226479" + "router initcode hash (without constructor params, as uint256)": "27545762869727400677117557485685740862616789454191614676777323590122002226479" } \ No newline at end of file diff --git a/test/router/V4Router.gas.t.sol b/test/router/V4Router.gas.t.sol index d3e4c1e5..a1ad2120 100644 --- a/test/router/V4Router.gas.t.sol +++ b/test/router/V4Router.gas.t.sol @@ -24,7 +24,7 @@ contract V4RouterTest is RoutingTestHelpers { function test_router_initcodeHash() public { vm.snapshotValue( - "position manager initcode hash (without constructor params, as uint256)", + "router initcode hash (without constructor params, as uint256)", uint256(keccak256(abi.encodePacked(vm.getCode("MockV4Router.sol:MockV4Router")))) ); }