Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add snapshot file #187

Merged
merged 8 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .forge-snapshots/mint with native token.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
293959
293882
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
161293
161216
1 change: 1 addition & 0 deletions .forge-snapshots/swap with hooks.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
67310
1 change: 1 addition & 0 deletions .forge-snapshots/swap with native.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
67335
114 changes: 114 additions & 0 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
HooksTest:testAfterDonateInvalidReturn() (gas: 441987)
HooksTest:testAfterInitializeInvalidReturn() (gas: 875882)
HooksTest:testAfterModifyPositionInvalidReturn() (gas: 323560)
HooksTest:testAfterSwapInvalidReturn() (gas: 159107)
HooksTest:testBeforeDonateInvalidReturn() (gas: 442007)
HooksTest:testBeforeInitializeInvalidReturn() (gas: 844189)
HooksTest:testBeforeModifyPositionInvalidReturn() (gas: 132850)
HooksTest:testBeforeSwapInvalidReturn() (gas: 133833)
HooksTest:testDonateSucceedsWithHook() (gas: 531091)
HooksTest:testGas() (gas: 38344)
HooksTest:testInitializeSucceedsWithHook() (gas: 6190895)
HooksTest:testInvalidIfNoFlags() (gas: 907)
HooksTest:testIsValidHookAddressAnyFlags() (gas: 1827)
HooksTest:testIsValidHookAddressZeroAddress() (gas: 382)
HooksTest:testIsValidIfDynamicFee() (gas: 622)
HooksTest:testModifyPositionSucceedsWithHook() (gas: 280024)
HooksTest:testSwapSucceedsWithHook() (gas: 108810)
HooksTest:testValidateHookAddressAfterDonate(uint152) (runs: 256, μ: 1846, ~: 1846)
HooksTest:testValidateHookAddressAfterInitialize(uint152) (runs: 256, μ: 1847, ~: 1847)
HooksTest:testValidateHookAddressAfterModify(uint152) (runs: 256, μ: 1827, ~: 1827)
HooksTest:testValidateHookAddressAfterSwap(uint152) (runs: 256, μ: 1847, ~: 1847)
HooksTest:testValidateHookAddressAllHooks(uint152) (runs: 256, μ: 1659, ~: 1659)
HooksTest:testValidateHookAddressBeforeAndAfterDonate(uint152) (runs: 256, μ: 1796, ~: 1796)
HooksTest:testValidateHookAddressBeforeAndAfterInitialize(uint152) (runs: 256, μ: 1820, ~: 1820)
HooksTest:testValidateHookAddressBeforeAndAfterModify(uint152) (runs: 256, μ: 1785, ~: 1785)
HooksTest:testValidateHookAddressBeforeAndAfterSwap(uint152) (runs: 256, μ: 1777, ~: 1777)
HooksTest:testValidateHookAddressBeforeDonate(uint152) (runs: 256, μ: 1804, ~: 1804)
HooksTest:testValidateHookAddressBeforeInitialize(uint152) (runs: 256, μ: 1829, ~: 1829)
HooksTest:testValidateHookAddressBeforeModify(uint152) (runs: 256, μ: 1855, ~: 1855)
HooksTest:testValidateHookAddressBeforeSwap(uint152) (runs: 256, μ: 1848, ~: 1848)
HooksTest:testValidateHookAddressFailsAllHooks(uint152,uint8) (runs: 256, μ: 4727, ~: 4676)
HooksTest:testValidateHookAddressFailsNoHooks(uint152,uint8) (runs: 256, μ: 4779, ~: 4719)
HooksTest:testValidateHookAddressNoHooks(uint152) (runs: 256, μ: 1837, ~: 1837)
OwnedTest:testConstructor(address) (runs: 256, μ: 159689, ~: 159767)
OwnedTest:testSetOwnerFromNonOwner(address,address) (runs: 256, μ: 160839, ~: 160925)
OwnedTest:testSetOwnerFromOwner(address,address) (runs: 256, μ: 162918, ~: 162996)
PoolManagerTest:testDonateFailsIfNoLiquidity(uint160) (runs: 256, μ: 104878, ~: 105037)
PoolManagerTest:testDonateFailsIfNotInitialized() (gas: 69323)
PoolManagerTest:testDonateFailsWithIncorrectSelectors() (gas: 1103240)
PoolManagerTest:testDonateSucceedsForNativeTokensWhenPoolHasLiquidity() (gas: 500356)
PoolManagerTest:testDonateSucceedsWhenPoolHasLiquidity() (gas: 558289)
PoolManagerTest:testDonateSucceedsWithCorrectSelectors() (gas: 981840)
PoolManagerTest:testExtsloadForPoolPrice() (gas: 76014)
PoolManagerTest:testExtsloadMultipleSlots() (gas: 7333225)
PoolManagerTest:testGasDonateOneToken() (gas: 512324)
PoolManagerTest:testGasMint() (gas: 319940)
PoolManagerTest:testGasMintWithHooks() (gas: 802768)
PoolManagerTest:testGasMintWithNative() (gas: 304946)
PoolManagerTest:testGasPoolManagerInitialize() (gas: 72812)
PoolManagerTest:testGasSwap() (gas: 196624)
PoolManagerTest:testGasSwapAgainstLiq() (gas: 668537)
PoolManagerTest:testGasSwapAgainstLiqWithNative() (gas: 709872)
PoolManagerTest:testGasSwapWithHooks() (gas: 641268)
PoolManagerTest:testGasSwapWithNative() (gas: 196676)
PoolManagerTest:testLockEmitsCorrectId() (gas: 47981)
PoolManagerTest:testMintFailsIfNotInitialized() (gas: 70529)
PoolManagerTest:testMintFailsWithIncorrectSelectors() (gas: 872989)
PoolManagerTest:testMintSucceedsForNativeTokensIfInitialized(uint160) (runs: 256, μ: 260264, ~: 274621)
PoolManagerTest:testMintSucceedsIfInitialized(uint160) (runs: 256, μ: 263719, ~: 261717)
PoolManagerTest:testMintSucceedsWithCorrectSelectors() (gas: 809654)
PoolManagerTest:testMintSucceedsWithHooksIfInitialized(uint160) (runs: 256, μ: 806679, ~: 808507)
PoolManagerTest:testNoOpLockIsOk() (gas: 87210)
PoolManagerTest:testPoolManagerFeeControllerSet() (gas: 35330)
PoolManagerTest:testPoolManagerFetchFeeWhenController(uint160) (runs: 256, μ: 108235, ~: 108394)
PoolManagerTest:testPoolManagerInitialize((address,address,uint24,int24,address),uint160) (runs: 256, μ: 17880, ~: 13442)
PoolManagerTest:testPoolManagerInitializeFailsIfTickSpaceNeg(uint160) (runs: 256, μ: 15323, ~: 15323)
PoolManagerTest:testPoolManagerInitializeFailsIfTickSpaceTooLarge(uint160) (runs: 256, μ: 16271, ~: 16271)
PoolManagerTest:testPoolManagerInitializeFailsIfTickSpaceZero(uint160) (runs: 256, μ: 15324, ~: 15324)
PoolManagerTest:testPoolManagerInitializeFailsWithIncorrectSelectors() (gas: 578101)
PoolManagerTest:testPoolManagerInitializeForNativeTokens(uint160) (runs: 256, μ: 57800, ~: 58111)
PoolManagerTest:testPoolManagerInitializeSucceedsWithCorrectSelectors() (gas: 578125)
PoolManagerTest:testPoolManagerInitializeSucceedsWithEmptyHooks(uint160) (runs: 256, μ: 543524, ~: 543687)
PoolManagerTest:testPoolManagerInitializeSucceedsWithHooks(uint160) (runs: 256, μ: 608215, ~: 608373)
PoolManagerTest:testPoolManagerInitializeSucceedsWithMaxTickSpacing(uint160) (runs: 256, μ: 49727, ~: 49893)
PoolManagerTest:testSwapFailsIfNotInitialized(uint160) (runs: 256, μ: 72844, ~: 72844)
PoolManagerTest:testSwapFailsWithIncorrectSelectors() (gas: 948595)
PoolManagerTest:testSwapMintERC1155IfOutputNotTaken() (gas: 535548)
PoolManagerTest:testSwapSucceedsIfInitialized() (gas: 107208)
PoolManagerTest:testSwapSucceedsWithCorrectSelectors() (gas: 845733)
PoolManagerTest:testSwapSucceedsWithHooksIfInitialized() (gas: 649679)
PoolManagerTest:testSwapSucceedsWithNativeTokensIfInitialized() (gas: 105500)
PoolManagerTest:testSwapUse1155AsInput() (gas: 713157)
PoolTest:testModifyPosition(uint160,(address,int24,int24,int128,int24)) (runs: 256, μ: 20321, ~: 6980)
PoolTest:testPoolInitialize(uint160,uint8) (runs: 256, μ: 12687, ~: 5591)
PoolTest:testSwap(uint160,(uint24,int24,bool,int256,uint160)) (runs: 256, μ: 776640, ~: 7290)
SafeCastTest:testToInt128(int256) (runs: 256, μ: 1352, ~: 511)
SafeCastTest:testToInt128(uint256) (runs: 256, μ: 1355, ~: 390)
SafeCastTest:testToInt256(uint256) (runs: 256, μ: 993, ~: 450)
SafeCastTest:testToUint160(uint256) (runs: 256, μ: 1231, ~: 454)
TestBalanceDelta:testAdd(int128,int128,int128,int128) (runs: 256, μ: 4750, ~: 4750)
TestBalanceDelta:testSub(int128,int128,int128,int128) (runs: 256, μ: 4724, ~: 4724)
TestBalanceDelta:testToBalanceDelta() (gas: 968)
TestBalanceDelta:testToBalanceDelta(int128,int128) (runs: 256, μ: 613, ~: 613)
TestBitMath:testLeastSignificantBit(uint256) (runs: 256, μ: 4268, ~: 3748)
TestBitMath:testLeastSignificantBitMaxUint256() (gas: 697)
TestBitMath:testLeastSignificantBitOne() (gas: 715)
TestBitMath:testLeastSignificantBitPowersOfTwo() (gas: 151449)
TestBitMath:testLeastSignificantBitTwo() (gas: 673)
TestBitMath:testLeastSignificantBitZero() (gas: 3086)
TestBitMath:testLsbGas() (gas: 115496)
TestBitMath:testMostSignificantBit(uint256) (runs: 256, μ: 15281, ~: 8087)
TestBitMath:testMostSignificantBitMaxUint256() (gas: 650)
TestBitMath:testMostSignificantBitOne() (gas: 538)
TestBitMath:testMostSignificantBitPowersOfTwo() (gas: 125789)
TestBitMath:testMostSignificantBitTwo() (gas: 523)
TestBitMath:testMostSignificantBitZero() (gas: 3087)
TestBitMath:testMsbGas() (gas: 115335)
TestDelegateCall:testCanCallIntoPrivateMethodWithModifier() (gas: 5426)
TestDelegateCall:testCannotDelegateCallPrivateMethodWithModifier() (gas: 8641)
TestDelegateCall:testDelegateCallNoModifier() (gas: 5734)
TestDelegateCall:testDelegateCallWithModifier() (gas: 8575)
TestDelegateCall:testGasOverhead() (gas: 13709)
TestDynamicFees:testSwapFailsWithTooLargeFee() (gas: 98959)
TestDynamicFees:testSwapWorks() (gas: 104227)
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ jobs:

- name: Compile
run: yarn prettier-check

- name: Run forge snapshots
run: forge snapshot --check --tolerance 5
6 changes: 3 additions & 3 deletions test/foundry-tests/PoolManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155
params = IPoolManager.SwapParams({zeroForOne: true, amountSpecified: 100, sqrtPriceLimitX96: SQRT_RATIO_1_4});
testSettings = PoolSwapTest.TestSettings({withdrawTokens: false, settleUsingTransfer: false});

snapStart("swap");
snapStart("simple swap");
swapTest.swap(key, params, testSettings);
snapEnd();
}
Expand All @@ -831,7 +831,7 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155
params = IPoolManager.SwapParams({zeroForOne: true, amountSpecified: 100, sqrtPriceLimitX96: SQRT_RATIO_1_4});
testSettings = PoolSwapTest.TestSettings({withdrawTokens: false, settleUsingTransfer: false});

snapStart("swap");
snapStart("swap with native");
swapTest.swap(key, params, testSettings);
snapEnd();
}
Expand Down Expand Up @@ -863,7 +863,7 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155
params = IPoolManager.SwapParams({zeroForOne: true, amountSpecified: 100, sqrtPriceLimitX96: SQRT_RATIO_1_4});
testSettings = PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true});

snapStart("swap");
snapStart("swap with hooks");
swapTest.swap(key, params, testSettings);
snapEnd();
}
Expand Down