Skip to content

Commit c42499d

Browse files
authored
add code hash snap (#417)
* code hash snap * move files, add descriptor * rename * add mock router snap * router
1 parent 26dd146 commit c42499d

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed

snapshots/PosMGasTest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
"PositionManager_permit_twice": "44975",
3939
"PositionManager_subscribe": "87968",
4040
"PositionManager_unsubscribe": "62697",
41+
"position manager initcode hash (without constructor params, as uint256)": "81827502601055975118808937107769364319765058198432540518516360048852193272922",
4142
"positionManager bytecode size": "23877"
4243
}

snapshots/PositionDescriptorTest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"position descriptor initcode hash (without constructor params, as uint256)": "88482580191959945449130293370700011665153263709859488839371600440410373093991",
23
"positionDescriptor bytecode size": "24110"
34
}

snapshots/V4RouterTest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
"V4Router_ExactOut3Hops_nativeOut": "224943",
2323
"V4Router_ExactOutputSingle": "133337",
2424
"V4Router_ExactOutputSingle_nativeIn_sweepETH": "126419",
25-
"V4Router_ExactOutputSingle_nativeOut": "119821"
25+
"V4Router_ExactOutputSingle_nativeOut": "119821",
26+
"router initcode hash (without constructor params, as uint256)": "27545762869727400677117557485685740862616789454191614676777323590122002226479"
2627
}

test/PositionDescriptor.t.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ contract PositionDescriptorTest is Test, PosmTestSetup {
4141
deployAndApprovePosm(manager);
4242
}
4343

44+
function test_position_descriptor_initcodeHash() public {
45+
vm.snapshotValue(
46+
"position descriptor initcode hash (without constructor params, as uint256)",
47+
uint256(keccak256(abi.encodePacked(vm.getCode("PositionDescriptor.sol:PositionDescriptor"))))
48+
);
49+
}
50+
4451
function test_bytecodeSize_positionDescriptor() public {
4552
vm.snapshotValue("positionDescriptor bytecode size", address(positionDescriptor).code.length);
4653
}

test/position-managers/PositionManager.gas.t.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ contract PosMGasTest is Test, PosmTestSetup {
7373
sub = new MockSubscriber(lpm);
7474
}
7575

76+
function test_posm_initcodeHash() public {
77+
vm.snapshotValue(
78+
"position manager initcode hash (without constructor params, as uint256)",
79+
uint256(keccak256(abi.encodePacked(vm.getCode("PositionManager.sol:PositionManager"))))
80+
);
81+
}
82+
7683
function test_bytecodeSize_positionManager() public {
7784
vm.snapshotValue("positionManager bytecode size", address(lpm).code.length);
7885
}

test/router/V4Router.gas.t.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ contract V4RouterTest is RoutingTestHelpers {
2222
vm.snapshotValue("V4Router_Bytecode", address(router).code.length);
2323
}
2424

25+
function test_router_initcodeHash() public {
26+
vm.snapshotValue(
27+
"router initcode hash (without constructor params, as uint256)",
28+
uint256(keccak256(abi.encodePacked(vm.getCode("MockV4Router.sol:MockV4Router"))))
29+
);
30+
}
31+
2532
/*//////////////////////////////////////////////////////////////
2633
ERC20 -> ERC20 EXACT INPUT
2734
//////////////////////////////////////////////////////////////*/

0 commit comments

Comments
 (0)