diff --git a/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap index 2e7b67d1..0ccfc1df 100644 --- a/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap @@ -1 +1 @@ -181729 \ No newline at end of file +180826 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap index 1a710776..a36c9ed3 100644 --- a/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap @@ -1 +1 @@ -185616 \ No newline at end of file +184747 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap index eb0299a4..033fcda0 100644 --- a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap @@ -1 +1 @@ -137576 \ No newline at end of file +137347 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap index 0014efcd..5f53ee3e 100644 --- a/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap @@ -1 +1 @@ -331570 \ No newline at end of file +331343 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap index ce686ff3..a3bf0533 100644 --- a/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap @@ -1 +1 @@ -193836 \ No newline at end of file +192943 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap b/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap index 3f17b924..f3b852e6 100644 --- a/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap +++ b/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap @@ -1 +1 @@ -138357 \ No newline at end of file +137069 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap b/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap index 26cdfb14..23353c28 100644 --- a/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap +++ b/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap @@ -1 +1 @@ -32551 \ No newline at end of file +32545 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap index f1eeb46d..e4d69908 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap @@ -1 +1 @@ -148415 \ No newline at end of file +146807 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap index 7ff28d2e..1f22feb4 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap @@ -1 +1 @@ -296310 \ No newline at end of file +294365 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap index 1867536a..db24ec88 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap @@ -1 +1 @@ -131567 \ No newline at end of file +130278 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap b/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap index ec0b0f29..40c017ca 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap @@ -1 +1 @@ -120501 \ No newline at end of file +119302 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap index 49cfef34..1ad97f12 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap @@ -1 +1 @@ -977635 \ No newline at end of file +976074 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap index b04d640c..6ae4974f 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap @@ -1 +1 @@ -339825 \ No newline at end of file +338264 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap index 29021d65..412f74f8 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap @@ -1 +1 @@ -343302 \ No newline at end of file +341845 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap index 799659b3..6022aba5 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap @@ -1 +1 @@ -146245 \ No newline at end of file +144788 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap index aa5edd83..e73f678d 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap @@ -1 +1 @@ -180669 \ No newline at end of file +179296 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap index f0fca90b..bbc1c1f3 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap @@ -1 +1 @@ -186652 \ No newline at end of file +185279 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap index a23b293e..e661e42c 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap @@ -1 +1 @@ -139032 \ No newline at end of file +137674 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap b/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap index ef8f19e5..aeed5b07 100644 --- a/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap +++ b/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap @@ -1 +1 @@ -309785 \ No newline at end of file +308324 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap index 0caff221..df323c2f 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap @@ -1 +1 @@ -363044 \ No newline at end of file +360221 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap index e5c94192..eeb66ea7 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap @@ -1 +1 @@ -178212 \ No newline at end of file +175389 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap index 753342e1..3386655c 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap @@ -1 +1 @@ -248228 \ No newline at end of file +245355 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap b/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap index 8b1ec079..eaa079f8 100644 --- a/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap +++ b/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap @@ -1 +1 @@ -170800 \ No newline at end of file +168436 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap b/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap index dbabe6d1..7a6f8061 100644 --- a/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap +++ b/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap @@ -1 +1 @@ -114636 \ No newline at end of file +112268 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap b/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap index fead7002..8b80b4b1 100644 --- a/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap @@ -1 +1 @@ -124318 \ No newline at end of file +121487 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap b/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap index dc060286..7c7d22b0 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap @@ -1 +1 @@ -141559 \ No newline at end of file +138797 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap b/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap index 4c1c109e..d1802b29 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap @@ -1 +1 @@ -175051 \ No newline at end of file +172284 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap b/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap index fbdc5c36..b63e89aa 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap @@ -1 +1 @@ -161437 \ No newline at end of file +158711 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_simple.snap b/.forge-snapshots/CLPoolManagerTest#swap_simple.snap index f6eaf017..06fe9e32 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_simple.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_simple.snap @@ -1 +1 @@ -79435 \ No newline at end of file +76674 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap b/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap index 766c9477..8eb9108b 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap @@ -1 +1 @@ -153726 \ No newline at end of file +150965 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap b/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap index 84dcdda3..16dc93fd 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap @@ -1 +1 @@ -96242 \ No newline at end of file +93566 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap b/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap index 7cd92e9f..998597c4 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap @@ -1 +1 @@ -79438 \ No newline at end of file +76677 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap b/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap index 7658a9f9..df3f7901 100644 --- a/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap +++ b/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap @@ -1 +1 @@ -29467 \ No newline at end of file +32328 \ No newline at end of file diff --git a/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap b/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap index 8f979894..6ed84f8e 100644 --- a/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap +++ b/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap @@ -1 +1 @@ -11374 \ No newline at end of file +11394 \ No newline at end of file diff --git a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap index 1fc188de..e157b5b5 100644 --- a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap +++ b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap @@ -1 +1 @@ -525 \ No newline at end of file +520 \ No newline at end of file diff --git a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap index 929530e8..70e36030 100644 --- a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap +++ b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap @@ -1 +1 @@ -653 \ No newline at end of file +648 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap index 4c97b937..9a6039e9 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap @@ -1 +1 @@ -2239 \ No newline at end of file +2234 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap index f8a37503..a71ad804 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap @@ -1 +1 @@ -3029 \ No newline at end of file +3019 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap index 47c57f60..48e42dfb 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap @@ -1 +1 @@ -1981 \ No newline at end of file +1976 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap index f8a37503..a71ad804 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap @@ -1 +1 @@ -3029 \ No newline at end of file +3019 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap index 9606a0dd..21aeb5a6 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap @@ -1 +1 @@ -2229 \ No newline at end of file +2224 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap index 80f7c30e..1a73c6cc 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap @@ -1 +1 @@ -3182 \ No newline at end of file +3177 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap index 7237be0c..42e20350 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap @@ -1 +1 @@ -1971 \ No newline at end of file +1966 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap index 80f7c30e..1a73c6cc 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap @@ -1 +1 @@ -3182 \ No newline at end of file +3177 \ No newline at end of file diff --git a/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap b/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap index 04170a36..5ec4258d 100644 --- a/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap +++ b/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap @@ -1 +1 @@ -1151 \ No newline at end of file +1159 \ No newline at end of file diff --git a/.forge-snapshots/TickTest#update.snap b/.forge-snapshots/TickTest#update.snap index 7b7e6841..201f1298 100644 --- a/.forge-snapshots/TickTest#update.snap +++ b/.forge-snapshots/TickTest#update.snap @@ -1 +1 @@ -134819 \ No newline at end of file +134827 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap b/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap index f08826dc..01cd6f4e 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap @@ -1 +1 @@ -81624 \ No newline at end of file +81446 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap b/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap index e188f56d..30c979e2 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap @@ -1 +1 @@ -121653 \ No newline at end of file +121465 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap b/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap index 451d1a86..70082924 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap @@ -1 +1 @@ -45212 \ No newline at end of file +45034 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap b/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap index 5c8eeda4..ecbcdd19 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap @@ -1 +1 @@ -45211 \ No newline at end of file +45033 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#testLock_NoOp.snap b/.forge-snapshots/VaultTest#testLock_NoOp.snap index dc6975ce..4aef5c16 100644 --- a/.forge-snapshots/VaultTest#testLock_NoOp.snap +++ b/.forge-snapshots/VaultTest#testLock_NoOp.snap @@ -1 +1 @@ -33260 \ No newline at end of file +33072 \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index c96a6059..019a911e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,14 +1,14 @@ [profile.default] src = 'src' out = 'foundry-out' -solc_version = '0.8.24' +solc_version = '0.8.26' optimizer_runs = 800 via_ir = false ffi = true fs_permissions = [ { access = "read-write", path = ".forge-snapshots/" }, { access = "read", path = "./foundry-out" }, - { access = "read", path = "./script/config"}, + { access = "read", path = "./script/config" }, ] evm_version = 'cancun' @@ -21,7 +21,7 @@ runs = 1000 runs = 10000 [profile.ci.invariant] -runs = 1000 # The number of calls to make in the invariant tests +runs = 1000 # The number of calls to make in the invariant tests call_override = false # Override calls fail_on_revert = false # Fail the test if the contract reverts diff --git a/src/libraries/LPFeeLibrary.sol b/src/libraries/LPFeeLibrary.sol index 6c3c1f8e..b34a5bb7 100644 --- a/src/libraries/LPFeeLibrary.sol +++ b/src/libraries/LPFeeLibrary.sol @@ -13,10 +13,9 @@ library LPFeeLibrary { error FeeTooLarge(); /// @dev the flag and mask - uint24 public constant FEE_MASK = 0x7FFFFF; uint24 public constant OVERRIDE_MASK = 0xBFFFFF; - // the top bit of the fee in a PoolKey is used to signal if a Pool's LP fee is dynamic + // a dynamic fee pool must have exactly same value for fee field uint24 public constant DYNAMIC_FEE_FLAG = 0x800000; // the second bit of the fee returned by beforeSwap is used to signal if the stored LP fee should be overridden in this swap @@ -29,7 +28,7 @@ library LPFeeLibrary { uint24 public constant TEN_PERCENT_FEE = 100_000; function isDynamicLPFee(uint24 self) internal pure returns (bool) { - return self & DYNAMIC_FEE_FLAG != 0; + return self == DYNAMIC_FEE_FLAG; } function validate(uint24 self, uint24 maxFee) internal pure { @@ -40,7 +39,7 @@ library LPFeeLibrary { function getInitialLPFee(uint24 self) internal pure returns (uint24 lpFee) { // the initial fee for a dynamic fee pool is 0 if (self.isDynamicLPFee()) return 0; - lpFee = self & FEE_MASK; + lpFee = self; } /// @notice returns true if the fee has the override flag set (top bit of the uint24) diff --git a/src/pool-bin/BinPoolManager.sol b/src/pool-bin/BinPoolManager.sol index 94b49cdb..48cbb411 100644 --- a/src/pool-bin/BinPoolManager.sol +++ b/src/pool-bin/BinPoolManager.sol @@ -196,7 +196,6 @@ contract BinPoolManager is IBinPoolManager, ProtocolFees, Extsload { msg.sender, key, swapForY, 0, amountOut ); } else { - // clear the top 4 bits since they may be flagged lpFee = key.fee.getInitialLPFee(); } lpFee.validate(LPFeeLibrary.TEN_PERCENT_FEE); diff --git a/src/types/PoolKey.sol b/src/types/PoolKey.sol index 818812a0..647576b3 100644 --- a/src/types/PoolKey.sol +++ b/src/types/PoolKey.sol @@ -15,7 +15,7 @@ struct PoolKey { IHooks hooks; /// @notice The pool manager of the pool IPoolManager poolManager; - /// @notice The pool lp fee, capped at 1_000_000. The upper 4 bits determine if the hook sets any fees. + /// @notice The pool lp fee, capped at 1_000_000. If the pool has a dynamic fee then it must be exactly equal to 0x800000 uint24 fee; /// @notice Hooks callback and pool specific parameters, i.e. tickSpacing for CL, binStep for bin bytes32 parameters; diff --git a/test/VaultToken.t.sol b/test/VaultToken.t.sol index 5590db12..38d69286 100644 --- a/test/VaultToken.t.sol +++ b/test/VaultToken.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.24; +pragma solidity ^0.8.24; import {Test} from "forge-std/Test.sol"; import {VaultToken} from "../src/VaultToken.sol"; diff --git a/test/libraries/LPFeeLibrary.t.sol b/test/libraries/LPFeeLibrary.t.sol index 04ec1f01..030368f8 100644 --- a/test/libraries/LPFeeLibrary.t.sol +++ b/test/libraries/LPFeeLibrary.t.sol @@ -22,12 +22,20 @@ contract LPFeeLibraryTest is Test { assertEq(LPFeeLibrary.isDynamicLPFee(0x100000), false); // 1111 1111 1111 1111 1111 1111 - assertEq(LPFeeLibrary.isDynamicLPFee(0xFFFFFF), true); + assertEq(LPFeeLibrary.isDynamicLPFee(0xFFFFFF), false); // 0111 1111 1111 1111 1111 1111 assertEq(LPFeeLibrary.isDynamicLPFee(0x7FFFFF), false); } + function testIsDynamicLPFeeFuzz(uint24 fee) public { + if (fee != 0x800000) { + assertEq(LPFeeLibrary.isDynamicLPFee(fee), false); + } else { + assertEq(LPFeeLibrary.isDynamicLPFee(fee), true); + } + } + function testGetInitialLPFee() public { // static assertEq(LPFeeLibrary.getInitialLPFee(0x000001), 0x000001); @@ -36,12 +44,16 @@ contract LPFeeLibraryTest is Test { assertEq(LPFeeLibrary.getInitialLPFee(0x001004), 0x001004); assertEq(LPFeeLibrary.getInitialLPFee(0x111020), 0x111020); assertEq(LPFeeLibrary.getInitialLPFee(0x511020), 0x511020); - + assertEq(LPFeeLibrary.getInitialLPFee(0xF00F05), 0xF00F05); + assertEq(LPFeeLibrary.getInitialLPFee(0x800310), 0x800310); + assertEq(LPFeeLibrary.getInitialLPFee(0x901020), 0x901020); + assertEq(LPFeeLibrary.getInitialLPFee(0x800001), 0x800001); + assertEq(LPFeeLibrary.getInitialLPFee(0x800010), 0x800010); + assertEq(LPFeeLibrary.getInitialLPFee(0x800100), 0x800100); + assertEq(LPFeeLibrary.getInitialLPFee(0x801000), 0x801000); + assertEq(LPFeeLibrary.getInitialLPFee(0x810000), 0x810000); // dynamic - assertEq(LPFeeLibrary.getInitialLPFee(0xF00F05), 0); - assertEq(LPFeeLibrary.getInitialLPFee(0x800310), 0); assertEq(LPFeeLibrary.getInitialLPFee(0x800000), 0); - assertEq(LPFeeLibrary.getInitialLPFee(0x901020), 0); } function testFuzzValidate(uint24 self, uint24 maxFee) public { diff --git a/test/pool-bin/BinHookReturnsFee.t.sol b/test/pool-bin/BinHookReturnsFee.t.sol index 55b1514d..27f0cfca 100644 --- a/test/pool-bin/BinHookReturnsFee.t.sol +++ b/test/pool-bin/BinHookReturnsFee.t.sol @@ -88,7 +88,7 @@ contract BinHookReturnsFeeTest is Test, BinTestHelper { currency1: currency1, hooks: dynamicReturnsFeesHook, poolManager: poolManager, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(dynamicReturnsFeesHook.getHooksRegistrationBitmap())).setBinStep(10) }); diff --git a/test/pool-bin/BinPoolManager.t.sol b/test/pool-bin/BinPoolManager.t.sol index 5a2935d5..852e8159 100644 --- a/test/pool-bin/BinPoolManager.t.sol +++ b/test/pool-bin/BinPoolManager.t.sol @@ -213,7 +213,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -224,6 +224,24 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { poolManager.updateDynamicLPFee(key, dynamicSwapFee); } + function testInitializeInvalidFee() public { + uint16 bitMap = 0x0040; // 0000 0000 0100 0000 (before swap call) + BinFeeManagerHook binFeeManagerHook = new BinFeeManagerHook(poolManager); + binFeeManagerHook.setHooksRegistrationBitmap(bitMap); + + key = PoolKey({ + currency0: currency0, + currency1: currency1, + hooks: IHooks(address(binFeeManagerHook)), + poolManager: IPoolManager(address(poolManager)), + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + 1, + parameters: bytes32(uint256(bitMap)).setBinStep(10) + }); + + vm.expectRevert(LPFeeLibrary.FeeTooLarge.selector); + poolManager.initialize(key, 10, new bytes(0)); + } + function testInitializeSwapFeeTooLarge() public { uint24 swapFee = LPFeeLibrary.TEN_PERCENT_FEE + 1; @@ -888,7 +906,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -925,7 +943,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); poolManager.initialize(key, activeId, new bytes(0)); diff --git a/test/pool-bin/libraries/BinPoolFee.t.sol b/test/pool-bin/libraries/BinPoolFee.t.sol index ccee087e..161ace40 100644 --- a/test/pool-bin/libraries/BinPoolFee.t.sol +++ b/test/pool-bin/libraries/BinPoolFee.t.sol @@ -138,7 +138,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(10_000), // 10_000 = 1% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -158,7 +158,7 @@ contract BinPoolFeeTest is BinTestHelper { hooks: IHooks(address(mockFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), /// @dev dynamic swap fee is 0 when pool is initialized, hence 0.3% will be ignored - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: BinPoolParametersHelper.setBinStep( bytes32(uint256(mockFeeManagerHook.getHooksRegistrationBitmap())), 10 ) @@ -291,7 +291,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + poolFee, + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // parameters: poolParam // binStep parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -332,7 +332,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(10_000), // 10_000 = 1% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); diff --git a/test/pool-cl/CLPoolManager.t.sol b/test/pool-cl/CLPoolManager.t.sol index 9bace1a6..60698b44 100644 --- a/test/pool-cl/CLPoolManager.t.sol +++ b/test/pool-cl/CLPoolManager.t.sol @@ -358,7 +358,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps } else if (!_validateHookPermissionsConflict(key)) { vm.expectRevert(abi.encodeWithSelector(Hooks.HookPermissionsValidationError.selector)); poolManager.initialize(key, sqrtPriceX96, ZERO_BYTES); - } else if (key.fee & LPFeeLibrary.FEE_MASK > LPFeeLibrary.ONE_HUNDRED_PERCENT_FEE) { + } else if (key.fee > LPFeeLibrary.ONE_HUNDRED_PERCENT_FEE) { vm.expectRevert(abi.encodeWithSelector(IProtocolFees.FeeTooLarge.selector)); poolManager.initialize(key, sqrtPriceX96, ZERO_BYTES); } else { @@ -661,7 +661,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: CLPoolParametersHelper.setTickSpacing( @@ -675,6 +675,23 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES); } + function test_initialize_failsDynamicFeeInvalid() public { + clFeeManagerHook.setHooksRegistrationBitmap(uint16(1 << HOOKS_AFTER_INITIALIZE_OFFSET)); + PoolKey memory key = PoolKey({ + currency0: currency0, + currency1: currency1, + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + 1, + hooks: IHooks(address(clFeeManagerHook)), + poolManager: poolManager, + parameters: CLPoolParametersHelper.setTickSpacing( + bytes32(uint256(clFeeManagerHook.getHooksRegistrationBitmap())), 10 + ) + }); + + vm.expectRevert(LPFeeLibrary.FeeTooLarge.selector); + poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES); + } + // ************** *************** // // ************** modifyPosition *************** // // ************** *************** // @@ -1743,7 +1760,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // 0.3% hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256((60 << 16) | clFeeManagerHook.getHooksRegistrationBitmap())) @@ -2724,7 +2741,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256(10) << 16) @@ -2760,7 +2777,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256((10 << 16) | clFeeManagerHook.getHooksRegistrationBitmap())) diff --git a/test/pool-cl/libraries/CLPool.t.sol b/test/pool-cl/libraries/CLPool.t.sol index 3bff44ed..3a7ba1d4 100644 --- a/test/pool-cl/libraries/CLPool.t.sol +++ b/test/pool-cl/libraries/CLPool.t.sol @@ -18,6 +18,7 @@ import {FixedPoint128} from "../../../src/pool-cl/libraries/FixedPoint128.sol"; import {ICLPoolManager} from "../../../src/pool-cl/interfaces/ICLPoolManager.sol"; import {LPFeeLibrary} from "../../../src/libraries/LPFeeLibrary.sol"; import {ProtocolFeeLibrary} from "../../../src/libraries/ProtocolFeeLibrary.sol"; +import {BalanceDelta, BalanceDeltaLibrary} from "../../../src/types/BalanceDelta.sol"; contract PoolTest is Test { using CLPool for CLPool.State; @@ -98,6 +99,28 @@ contract PoolTest is Test { CLPool.SwapParams memory swapParams, uint24 lpFee ) public { + // modifyLiquidityParams = CLPool.ModifyLiquidityParams({ + // owner: 0x250Eb93F2C350590E52cdb977b8BcF502a1Db7e7, + // tickLower: -402986, + // tickUpper: 50085, + // liquidityDelta: 33245614918536803008426086500145, + // tickSpacing: 1, + // salt: 0xfd9c91c4f1bbf3d855ba0a973b97c685c1dd51875a574392ef94ab56d7a72528 + // }); + // swapParams = CLPool.SwapParams({ + // tickSpacing: 8807, + // zeroForOne: true, + // amountSpecified: 20406714586857485490153777552586525, + // sqrtPriceLimitX96: 3669890892491818487, + // lpFeeOverride: 440 + // }); + // TODO: find a better way to cover following case: + // 1. when amountSpecified is large enough + // 2. and the effect price is either too large or too small (due to larger price slippage or inproper liquidity range) + // It will cause the amountUnspecified to be out of int128 range hence the tx reverts with SafeCastOverflow + // try to comment following three limitations and uncomment above case and rerun the test to verify + modifyLiquidityParams.tickLower = -100; + modifyLiquidityParams.tickUpper = 100; swapParams.amountSpecified = int256(bound(swapParams.amountSpecified, 0, type(int128).max)); testModifyPosition(sqrtPriceX96, modifyLiquidityParams, lpFee); @@ -149,7 +172,13 @@ contract PoolTest is Test { vm.expectRevert(CLPool.InvalidFeeForExactOut.selector); } - state.swap(swapParams); + (BalanceDelta delta,) = state.swap(swapParams); + + if (swapParams.amountSpecified == 0) { + // early return if amountSpecified is 0 + assertTrue(delta == BalanceDeltaLibrary.ZERO_DELTA); + return; + } if ( modifyLiquidityParams.liquidityDelta == 0