diff --git a/pkg/interfaces/contracts/test/IVaultMainMock.sol b/pkg/interfaces/contracts/test/IVaultMainMock.sol index b43e7c15a..710a234f3 100644 --- a/pkg/interfaces/contracts/test/IVaultMainMock.sol +++ b/pkg/interfaces/contracts/test/IVaultMainMock.sol @@ -50,7 +50,7 @@ interface IVaultMainMock { function manualSetStaticSwapFeePercentage(address pool, uint256 value) external; - function manualSetPoolTokenBalances(address, IERC20[] memory, uint256[] memory, uint256[] memory) external; + function manualSetPoolTokensAndBalances(address, IERC20[] memory, uint256[] memory, uint256[] memory) external; function manualSetPoolConfigBits(address pool, PoolConfigBits config) external; diff --git a/pkg/interfaces/contracts/vault/IVaultErrors.sol b/pkg/interfaces/contracts/vault/IVaultErrors.sol index 7c113432a..ea6e77446 100644 --- a/pkg/interfaces/contracts/vault/IVaultErrors.sol +++ b/pkg/interfaces/contracts/vault/IVaultErrors.sol @@ -121,8 +121,8 @@ interface IVaultErrors { /// @dev The user attempted to swap a token for itself. error CannotSwapSameToken(); - /// @dev The user attempted to swap a token not in the pool. - error TokenNotRegistered(); + /// @dev The user attempted to operate with a token that is not in the pool. + error TokenNotRegistered(IERC20 token); /// @dev An amount in or out has exceeded the limit specified in the swap request. error SwapLimit(uint256 amount, uint256 limit); diff --git a/pkg/pool-utils/test/foundry/PoolInfo.t.sol b/pkg/pool-utils/test/foundry/PoolInfo.t.sol index baa973e3d..7795874c4 100644 --- a/pkg/pool-utils/test/foundry/PoolInfo.t.sol +++ b/pkg/pool-utils/test/foundry/PoolInfo.t.sol @@ -53,7 +53,12 @@ contract PoolInfoTest is BaseTest { function testGetTokenInfo() public { uint256[] memory expectedRawBalances = [uint256(1), uint256(2)].toMemoryArray(); uint256[] memory expectedLastLiveBalances = [uint256(3), uint256(4)].toMemoryArray(); - vault.manualSetPoolTokenBalances(address(poolInfo), poolTokens, expectedRawBalances, expectedLastLiveBalances); + vault.manualSetPoolTokensAndBalances( + address(poolInfo), + poolTokens, + expectedRawBalances, + expectedLastLiveBalances + ); TokenInfo[] memory expectedTokenInfo = new TokenInfo[](2); expectedTokenInfo[0] = TokenInfo({ @@ -125,7 +130,12 @@ contract PoolInfoTest is BaseTest { function testGetCurrentLiveBalances() public { uint256[] memory expectedRawBalances = [uint256(12), uint256(34)].toMemoryArray(); uint256[] memory expectedLastLiveBalances = [uint256(56), uint256(478)].toMemoryArray(); - vault.manualSetPoolTokenBalances(address(poolInfo), poolTokens, expectedRawBalances, expectedLastLiveBalances); + vault.manualSetPoolTokensAndBalances( + address(poolInfo), + poolTokens, + expectedRawBalances, + expectedLastLiveBalances + ); PoolConfig memory config; config.isPoolRegistered = true; diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 2b431ba6a..5095e039e 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -207.1k \ No newline at end of file +205.9k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity using swapExactOur - warm slots index 009d1b2e1..6fe76d3bd 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -185.8k \ No newline at end of file +184.6k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots index 79cdeaa6c..dc73a17ed 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -200.5k \ No newline at end of file +199.3k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots index d65bbca98..1f45f59e0 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -231.9k \ No newline at end of file +230.7k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - cold slots index db6bec21b..3b4e72d6e 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -190.7k \ No newline at end of file +186.8k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - warm slots index f42106a41..a5111e503 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -173.6k \ No newline at end of file +169.7k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity proportional b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity proportional index 9bd60a6da..438d6c8b8 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity proportional +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity proportional @@ -1 +1 @@ -180.1k \ No newline at end of file +180.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity single token exact out - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity single token exact out - warm slots index 9f03a77e5..78e0744ff 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity single token exact out - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity single token exact out - warm slots @@ -1 +1 @@ -180.9k \ No newline at end of file +179.4k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity unbalanced - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity unbalanced - warm slots index d132426ef..85f89ffc8 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity unbalanced - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity unbalanced - warm slots @@ -1 +1 @@ -212.4k \ No newline at end of file +212.2k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity proportional b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity proportional index be52068b9..d6cadab53 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity proportional +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity proportional @@ -1 +1 @@ -169.4k \ No newline at end of file +169.2k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact in - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact in - warm slots index 4d012e3cd..4f9c232e4 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact in - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -170.5k \ No newline at end of file +169.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact out - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact out - warm slots index 31943869d..078957aab 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact out - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -192.4k \ No newline at end of file +191.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - cold slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - cold slots index fd76c368e..ac5df1c57 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - cold slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - cold slots @@ -1 +1 @@ -175.4k \ No newline at end of file +171.6k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - warm slots index 18191ce12..e95e917e5 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] swap single token exact in with fees - warm slots @@ -1 +1 @@ -158.3k \ No newline at end of file +154.4k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 764400b2c..b9d256747 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -229.0k \ No newline at end of file +227.8k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity using swapExactOur - warm slots index c4fc76106..5c91eb8ae 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -207.6k \ No newline at end of file +206.4k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots index 0cb6255ca..004790117 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -222.0k \ No newline at end of file +220.8k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots index 9a49b6988..c3d355b94 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -253.4k \ No newline at end of file +252.2k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - cold slots index 1a065660b..0e7ae198a 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -224.1k \ No newline at end of file +220.2k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - warm slots index 50abda12d..1a7f8291a 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -189.9k \ No newline at end of file +186.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity proportional b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity proportional index ed2cc0e26..3451a2402 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity proportional +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity proportional @@ -1 +1 @@ -235.6k \ No newline at end of file +235.5k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity single token exact out - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity single token exact out - warm slots index 46f8e42d3..49ad196e0 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity single token exact out - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity single token exact out - warm slots @@ -1 +1 @@ -200.2k \ No newline at end of file +198.7k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity unbalanced - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity unbalanced - warm slots index 33b4787d7..764400b2c 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity unbalanced - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity unbalanced - warm slots @@ -1 +1 @@ -229.2k \ No newline at end of file +229.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity proportional b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity proportional index e9f713213..208c12b0c 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity proportional +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity proportional @@ -1 +1 @@ -224.6k \ No newline at end of file +224.4k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact in - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact in - warm slots index f6b5c2133..ed7bfb6da 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact in - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -189.6k \ No newline at end of file +188.1k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact out - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact out - warm slots index 56ac56a80..0b1517abd 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact out - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -211.5k \ No newline at end of file +210.0k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - cold slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - cold slots index 8a85979a0..adf0102cd 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - cold slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - cold slots @@ -1 +1 @@ -208.8k \ No newline at end of file +204.9k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - warm slots b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - warm slots index 973e2eec4..f5e4f3723 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - warm slots +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] swap single token exact in with fees - warm slots @@ -1 +1 @@ -174.6k \ No newline at end of file +170.7k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] donation b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] donation index 68b670a11..e4ac6fa96 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] donation +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] donation @@ -1 +1 @@ -178.8k \ No newline at end of file +178.6k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize with ETH b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize with ETH index 6b0797cc8..1eccb3494 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize with ETH +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize with ETH @@ -1 +1 @@ -348.0k \ No newline at end of file +348.2k \ No newline at end of file diff --git a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize without ETH b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize without ETH index 8e808fb0d..c7b5aac9d 100644 --- a/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize without ETH +++ b/pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize without ETH @@ -1 +1 @@ -335.5k \ No newline at end of file +335.7k \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactIn.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactIn.snap index 4cf072b75..d72ee8e6f 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactIn.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactIn.snap @@ -1 +1 @@ -726401 \ No newline at end of file +722310 \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactOut.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactOut.snap index 00cc662a7..0ad40bd54 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactOut.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolEmptyBufferSwapExactOut.snap @@ -1 +1 @@ -753328 \ No newline at end of file +749260 \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactIn.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactIn.snap index e2694de03..18060339c 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactIn.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactIn.snap @@ -1 +1 @@ -289429 \ No newline at end of file +285338 \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactOut.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactOut.snap index 624ce03e3..3643814e7 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactOut.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapExactOut.snap @@ -1 +1 @@ -312273 \ No newline at end of file +308205 \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactIn.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactIn.snap index e54c178b7..6c646fa03 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactIn.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactIn.snap @@ -1 +1 @@ -670006 \ No newline at end of file +665915 \ No newline at end of file diff --git a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactOut.snap b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactOut.snap index 624f8bf37..11cd5c978 100644 --- a/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactOut.snap +++ b/pkg/vault/.forge-snapshots/forkBoostedPoolSwapTooLarge-ExactOut.snap @@ -1 +1 @@ -696939 \ No newline at end of file +692871 \ No newline at end of file diff --git a/pkg/vault/contracts/Vault.sol b/pkg/vault/contracts/Vault.sol index 6bd1976ad..608a3c5ca 100644 --- a/pkg/vault/contracts/Vault.sol +++ b/pkg/vault/contracts/Vault.sol @@ -40,7 +40,6 @@ import { PoolDataLib } from "./lib/PoolDataLib.sol"; import { VaultCommon } from "./VaultCommon.sol"; contract Vault is IVaultMain, VaultCommon, Proxy { - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using PackedTokenBalance for bytes32; using InputHelpers for uint256; using FixedPoint for *; @@ -269,29 +268,9 @@ contract Vault is IVaultMain, VaultCommon, Proxy { function _loadSwapState( SwapParams memory params, PoolData memory poolData - ) private view returns (SwapState memory state) { - // Use the storage map only for translating token addresses to indices. Raw balances can be read from poolData. - EnumerableMap.IERC20ToBytes32Map storage poolBalances = _poolTokenBalances[params.pool]; - - // EnumerableMap stores indices *plus one* to use the zero index as a sentinel value for non-existence. - uint256 indexIn = poolBalances.unchecked_indexOf(params.tokenIn); - uint256 indexOut = poolBalances.unchecked_indexOf(params.tokenOut); - - // If either are zero, revert because the token wasn't registered to this pool. - if (indexIn == 0 || indexOut == 0) { - // We require the pool to be initialized, which means it's also registered. - // This can only happen if the tokens are not registered. - revert TokenNotRegistered(); - } - - // Convert to regular 0-based indices now, since we've established the tokens are valid. - unchecked { - indexIn -= 1; - indexOut -= 1; - } - - state.indexIn = indexIn; - state.indexOut = indexOut; + ) private pure returns (SwapState memory state) { + state.indexIn = _findTokenIndex(poolData.tokens, params.tokenIn); + state.indexOut = _findTokenIndex(poolData.tokens, params.tokenOut); // If the amountGiven is entering the pool math (ExactIn), round down, since a lower apparent amountIn leads // to a lower calculated amountOut, favoring the pool. @@ -464,20 +443,14 @@ contract Vault is IVaultMain, VaultCommon, Proxy { ); // 6) Store pool balances, raw and live (only index in and out) - EnumerableMap.IERC20ToBytes32Map storage poolBalances = _poolTokenBalances[params.pool]; - poolBalances.unchecked_setAt( - state.indexIn, - PackedTokenBalance.toPackedBalance( - poolData.balancesRaw[state.indexIn], - poolData.balancesLiveScaled18[state.indexIn] - ) + mapping(uint256 => bytes32) storage poolBalances = _poolTokenBalances[params.pool]; + poolBalances[state.indexIn] = PackedTokenBalance.toPackedBalance( + poolData.balancesRaw[state.indexIn], + poolData.balancesLiveScaled18[state.indexIn] ); - poolBalances.unchecked_setAt( - state.indexOut, - PackedTokenBalance.toPackedBalance( - poolData.balancesRaw[state.indexOut], - poolData.balancesLiveScaled18[state.indexOut] - ) + poolBalances[state.indexOut] = PackedTokenBalance.toPackedBalance( + poolData.balancesRaw[state.indexOut], + poolData.balancesLiveScaled18[state.indexOut] ); // 7) Off-chain events @@ -1491,17 +1464,11 @@ contract Vault is IVaultMain, VaultCommon, Proxy { address pool, IERC20 token ) external view withRegisteredPool(pool) returns (uint256, uint256) { - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 tokenCount = poolTokenBalances.length(); - // unchecked indexOf returns index + 1, or 0 if token is not present. - uint256 index = poolTokenBalances.unchecked_indexOf(token); - if (index == 0) { - revert TokenNotRegistered(); - } + IERC20[] memory poolTokens = _poolTokens[pool]; - unchecked { - return (tokenCount, index - 1); - } + uint256 index = _findTokenIndex(poolTokens, token); + + return (poolTokens.length, index); } /******************************************************************************* diff --git a/pkg/vault/contracts/VaultCommon.sol b/pkg/vault/contracts/VaultCommon.sol index bb5ad865e..a2a1db0b2 100644 --- a/pkg/vault/contracts/VaultCommon.sol +++ b/pkg/vault/contracts/VaultCommon.sol @@ -33,7 +33,6 @@ import { PoolDataLib } from "./lib/PoolDataLib.sol"; * that require storage to work and will be required in both the main Vault and its extension. */ abstract contract VaultCommon is IVaultEvents, IVaultErrors, VaultStorage, ReentrancyGuardTransient, ERC20MultiToken { - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using PackedTokenBalance for bytes32; using PoolConfigLib for PoolConfigBits; using ScalingHelpers for *; @@ -256,20 +255,25 @@ abstract contract VaultCommon is IVaultEvents, IVaultErrors, VaultStorage, Reent * and poolData.liveBalances in the same storage slot. */ function _writePoolBalancesToStorage(address pool, PoolData memory poolData) internal { - EnumerableMap.IERC20ToBytes32Map storage poolBalances = _poolTokenBalances[pool]; + mapping(uint256 => bytes32) storage poolBalances = _poolTokenBalances[pool]; for (uint256 i = 0; i < poolData.balancesRaw.length; ++i) { - // Since we assume all newBalances are properly ordered, we can simply use `unchecked_setAt` - // to avoid one less storage read per token. - poolBalances.unchecked_setAt( - i, - PackedTokenBalance.toPackedBalance(poolData.balancesRaw[i], poolData.balancesLiveScaled18[i]) + // Since we assume all newBalances are properly ordered + poolBalances[i] = PackedTokenBalance.toPackedBalance( + poolData.balancesRaw[i], + poolData.balancesLiveScaled18[i] ); } } function _loadPoolData(address pool, Rounding roundingDirection) internal view returns (PoolData memory poolData) { - poolData.load(_poolTokenBalances[pool], _poolConfigBits[pool], _poolTokenInfo[pool], roundingDirection); + poolData.load( + _poolTokenBalances[pool], + _poolConfigBits[pool], + _poolTokenInfo[pool], + _poolTokens[pool], + roundingDirection + ); } /** @@ -283,7 +287,13 @@ abstract contract VaultCommon is IVaultEvents, IVaultErrors, VaultStorage, Reent Rounding roundingDirection ) internal nonReentrant returns (PoolData memory poolData) { // Initialize poolData with base information for subsequent calculations. - poolData.load(_poolTokenBalances[pool], _poolConfigBits[pool], _poolTokenInfo[pool], roundingDirection); + poolData.load( + _poolTokenBalances[pool], + _poolConfigBits[pool], + _poolTokenInfo[pool], + _poolTokens[pool], + roundingDirection + ); PoolDataLib.syncPoolBalancesAndFees(poolData, _poolTokenBalances[pool], _aggregateFeeAmounts[pool]); } @@ -334,6 +344,17 @@ abstract contract VaultCommon is IVaultEvents, IVaultErrors, VaultStorage, Reent emit SwapFeePercentageChanged(pool, swapFeePercentage); } + /// @dev Find the index of a token in a token array. Returns -1 if not found. + function _findTokenIndex(IERC20[] memory tokens, IERC20 token) internal pure returns (uint256) { + for (uint256 i = 0; i < tokens.length; i++) { + if (tokens[i] == token) { + return i; + } + } + + revert TokenNotRegistered(token); + } + /******************************************************************************* Recovery Mode *******************************************************************************/ diff --git a/pkg/vault/contracts/VaultExtension.sol b/pkg/vault/contracts/VaultExtension.sol index 804f7fc42..77021f9c6 100644 --- a/pkg/vault/contracts/VaultExtension.sol +++ b/pkg/vault/contracts/VaultExtension.sol @@ -57,7 +57,6 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { using Address for *; using ArrayHelpers for uint256[]; using FixedPoint for uint256; - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using EnumerableSet for EnumerableSet.AddressSet; using PackedTokenBalance for bytes32; using PoolConfigLib for PoolConfigBits; @@ -188,9 +187,6 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { revert MaxTokens(); } - // Retrieve or create the pool's token balances mapping. - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint8[] memory tokenDecimalDiffs = new uint8[](numTokens); IERC20 previousToken; @@ -198,21 +194,17 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { TokenConfig memory tokenData = params.tokenConfig[i]; IERC20 token = tokenData.token; - // Enforce token sorting. (`previousToken` will be the zero address on the first iteration.) - if (token < previousToken) { - revert InputHelpers.TokensNotSorted(); - } - previousToken = token; - // Ensure that the token address is valid if (address(token) == address(0) || address(token) == pool) { revert InvalidToken(); } - // Register the token with an initial balance of zero. - // Ensure the token isn't already registered for the pool. - // Note: EnumerableMaps require an explicit initial value when creating a key-value pair. - if (poolTokenBalances.set(token, bytes32(0)) == false) { + // Enforce token sorting. (`previousToken` will be the zero address on the first iteration.) + if (token < previousToken) { + revert InputHelpers.TokensNotSorted(); + } + + if (token == previousToken) { revert TokenAlreadyRegistered(token); } @@ -237,6 +229,10 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { } tokenDecimalDiffs[i] = uint8(18) - IERC20Metadata(address(token)).decimals(); + + // Store token and seed the next iteration. + _poolTokens[pool].push(token); + previousToken = token; } // Store the role account addresses (for getters). @@ -420,7 +416,7 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { uint256[] memory exactAmountsInScaled18, uint256 minBptAmountOut ) internal nonReentrant returns (uint256 bptAmountOut) { - EnumerableMap.IERC20ToBytes32Map storage poolBalances = _poolTokenBalances[pool]; + mapping(uint256 => bytes32) storage poolBalances = _poolTokenBalances[pool]; for (uint256 i = 0; i < poolData.tokens.length; ++i) { IERC20 actualToken = poolData.tokens[i]; @@ -434,10 +430,7 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { _takeDebt(actualToken, exactAmountsIn[i]); // Store the new Pool balances (and initial last live balances). - poolBalances.unchecked_setAt( - i, - PackedTokenBalance.toPackedBalance(exactAmountsIn[i], exactAmountsInScaled18[i]) - ); + poolBalances[i] = PackedTokenBalance.toPackedBalance(exactAmountsIn[i], exactAmountsInScaled18[i]); } emit PoolBalanceChanged(pool, to, exactAmountsIn.unsafeCastToInt256(true)); @@ -518,18 +511,7 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { function getPoolTokens( address pool ) external view onlyVaultDelegateCall withRegisteredPool(pool) returns (IERC20[] memory tokens) { - // Retrieve the mapping of tokens and their balances for the specified pool. - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); - // Initialize arrays to store tokens based on the number of tokens in the pool. - tokens = new IERC20[](numTokens); - - for (uint256 i = 0; i < numTokens; ++i) { - // Because the iteration is bounded by `tokens.length`, which matches the EnumerableMap's length, - // we can safely use `unchecked_at`. This ensures that `i` is a valid token index and minimizes - // storage reads. - tokens[i] = poolTokenBalances.unchecked_keyAt(i); - } + return _poolTokens[pool]; } /// @inheritdoc IVaultExtension @@ -543,19 +525,15 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { returns (uint256[] memory decimalScalingFactors, uint256[] memory tokenRates) { // Retrieve the mapping of tokens and their balances for the specified pool. - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); PoolConfigBits poolConfig = _poolConfigBits[pool]; + IERC20[] memory tokens = _poolTokens[pool]; + uint256 numTokens = tokens.length; decimalScalingFactors = PoolConfigLib.getDecimalScalingFactors(poolConfig, numTokens); tokenRates = new uint256[](numTokens); for (uint256 i = 0; i < numTokens; ++i) { - // Because the iteration is bounded by `tokens.length`, which matches the EnumerableMap's length, - // we can safely use `unchecked_at`. This ensures that `i` is a valid token index and minimizes - // storage reads. - IERC20 token = poolTokenBalances.unchecked_keyAt(i); - TokenInfo memory tokenInfo = _poolTokenInfo[pool][token]; + TokenInfo memory tokenInfo = _poolTokenInfo[pool][tokens[i]]; tokenRates[i] = PoolDataLib.getTokenRate(tokenInfo); } } @@ -583,19 +561,15 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { ) { // Retrieve the mapping of tokens and their balances for the specified pool. - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); - tokens = new IERC20[](numTokens); + mapping(uint256 => bytes32) storage poolTokenBalances = _poolTokenBalances[pool]; + tokens = _poolTokens[pool]; + uint256 numTokens = tokens.length; tokenInfo = new TokenInfo[](numTokens); balancesRaw = new uint256[](numTokens); lastLiveBalances = new uint256[](numTokens); for (uint256 i = 0; i < numTokens; ++i) { - bytes32 packedBalance; - // Because the iteration is bounded by `tokens.length`, which matches the EnumerableMap's length, - // we can safely use `unchecked_at`. This ensures that `i` is a valid token index and minimizes - // storage reads. - (tokens[i], packedBalance) = poolTokenBalances.unchecked_at(i); + bytes32 packedBalance = poolTokenBalances[i]; tokenInfo[i] = _poolTokenInfo[pool][tokens[i]]; balancesRaw[i] = packedBalance.getBalanceRaw(); lastLiveBalances[i] = packedBalance.getBalanceDerived(); @@ -768,20 +742,17 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { returns (uint256[] memory amountsOutRaw) { // Retrieve the mapping of tokens and their balances for the specified pool. - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); + mapping(uint256 => bytes32) storage poolTokenBalances = _poolTokenBalances[pool]; // Initialize arrays to store tokens and balances based on the number of tokens in the pool. - IERC20[] memory tokens = new IERC20[](numTokens); + IERC20[] memory tokens = _poolTokens[pool]; + uint256 numTokens = tokens.length; + uint256[] memory balancesRaw = new uint256[](numTokens); bytes32 packedBalances; for (uint256 i = 0; i < numTokens; ++i) { - // Because the iteration is bounded by `tokens.length`, which matches the EnumerableMap's length, - // we can safely use `unchecked_at`. This ensures that `i` is a valid token index and minimizes - // storage reads. - (tokens[i], packedBalances) = poolTokenBalances.unchecked_at(i); - balancesRaw[i] = packedBalances.getBalanceRaw(); + balancesRaw[i] = poolTokenBalances[i].getBalanceRaw(); } amountsOutRaw = BasePoolMath.computeProportionalAmountsOut(balancesRaw, _totalSupply(pool), exactBptAmountIn); @@ -798,11 +769,11 @@ contract VaultExtension is IVaultExtension, VaultCommon, Proxy { // Store the new pool balances - raw only, since we don't have rates in Recovery Mode. // In Recovery Mode, raw and last live balances will get out of sync. This is corrected when the pool is taken // out of Recovery Mode. - EnumerableMap.IERC20ToBytes32Map storage poolBalances = _poolTokenBalances[pool]; + mapping(uint256 => bytes32) storage poolBalances = _poolTokenBalances[pool]; for (uint256 i = 0; i < numTokens; ++i) { - packedBalances = poolBalances.unchecked_valueAt(i); - poolBalances.unchecked_setAt(i, packedBalances.setBalanceRaw(balancesRaw[i])); + packedBalances = poolBalances[i]; + poolBalances[i] = packedBalances.setBalanceRaw(balancesRaw[i]); } _spendAllowance(address(pool), from, msg.sender, exactBptAmountIn); diff --git a/pkg/vault/contracts/VaultStorage.sol b/pkg/vault/contracts/VaultStorage.sol index 4c23856ba..03d1778bb 100644 --- a/pkg/vault/contracts/VaultStorage.sol +++ b/pkg/vault/contracts/VaultStorage.sol @@ -75,7 +75,8 @@ contract VaultStorage { // Pool -> (token -> PackedTokenBalance): structure containing the current raw and "last live" scaled balances. // Last live balances are used for yield fee computation, and since these have rates applied, they are stored // as scaled 18-decimal FP values. Each value takes up half the storage slot (i.e., 128 bits). - mapping(address => EnumerableMap.IERC20ToBytes32Map) internal _poolTokenBalances; + mapping(address => mapping(uint256 => bytes32)) internal _poolTokenBalances; + mapping(address => IERC20[]) internal _poolTokens; // Pool -> (token -> TokenInfo): The token configuration of each Pool's tokens. mapping(address => mapping(IERC20 => TokenInfo)) internal _poolTokenInfo; diff --git a/pkg/vault/contracts/lib/PoolDataLib.sol b/pkg/vault/contracts/lib/PoolDataLib.sol index 3595c98a5..1bfd923e5 100644 --- a/pkg/vault/contracts/lib/PoolDataLib.sol +++ b/pkg/vault/contracts/lib/PoolDataLib.sol @@ -15,7 +15,6 @@ import { PackedTokenBalance } from "@balancer-labs/v3-solidity-utils/contracts/h import { PoolConfigBits, PoolConfigLib } from "./PoolConfigLib.sol"; library PoolDataLib { - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using PackedTokenBalance for bytes32; using FixedPoint for *; using ScalingHelpers for *; @@ -23,15 +22,16 @@ library PoolDataLib { function load( PoolData memory poolData, - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances, + mapping(uint => bytes32) storage poolTokenBalances, PoolConfigBits poolConfigBits, mapping(IERC20 => TokenInfo) storage poolTokenInfo, + IERC20[] storage tokens, Rounding roundingDirection ) internal view { - uint256 numTokens = poolTokenBalances.length(); + uint256 numTokens = tokens.length; poolData.poolConfigBits = poolConfigBits; - poolData.tokens = new IERC20[](numTokens); + poolData.tokens = tokens; poolData.tokenInfo = new TokenInfo[](numTokens); poolData.balancesRaw = new uint256[](numTokens); poolData.balancesLiveScaled18 = new uint256[](numTokens); @@ -43,10 +43,9 @@ library PoolDataLib { poolData.poolConfigBits.isPoolInRecoveryMode() == false; for (uint256 i = 0; i < numTokens; ++i) { - (IERC20 token, bytes32 packedBalance) = poolTokenBalances.unchecked_at(i); - TokenInfo memory tokenInfo = poolTokenInfo[token]; + TokenInfo memory tokenInfo = poolTokenInfo[poolData.tokens[i]]; + bytes32 packedBalance = poolTokenBalances[i]; - poolData.tokens[i] = token; poolData.tokenInfo[i] = tokenInfo; poolData.tokenRates[i] = getTokenRate(tokenInfo); updateRawAndLiveBalance(poolData, i, packedBalance.getBalanceRaw(), roundingDirection); @@ -86,14 +85,14 @@ library PoolDataLib { function syncPoolBalancesAndFees( PoolData memory poolData, - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances, + mapping(uint256 => bytes32) storage poolTokenBalances, mapping(IERC20 => bytes32) storage poolAggregateProtocolFeeAmounts ) internal { uint256 numTokens = poolData.balancesRaw.length; for (uint256 i = 0; i < numTokens; ++i) { IERC20 token = poolData.tokens[i]; - bytes32 packedBalances = poolTokenBalances.unchecked_valueAt(i); + bytes32 packedBalances = poolTokenBalances[i]; uint256 storedBalanceRaw = packedBalances.getBalanceRaw(); // poolData has balances updated with yield fees now. @@ -107,9 +106,9 @@ library PoolDataLib { ); } - poolTokenBalances.unchecked_setAt( - i, - PackedTokenBalance.toPackedBalance(poolData.balancesRaw[i], poolData.balancesLiveScaled18[i]) + poolTokenBalances[i] = PackedTokenBalance.toPackedBalance( + poolData.balancesRaw[i], + poolData.balancesLiveScaled18[i] ); } } @@ -123,7 +122,7 @@ library PoolDataLib { */ function reloadBalancesAndRates( PoolData memory poolData, - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances, + mapping(uint256 => bytes32) storage poolTokenBalances, Rounding roundingDirection ) internal view { uint256 numTokens = poolData.tokens.length; @@ -135,7 +134,7 @@ library PoolDataLib { for (uint256 i = 0; i < numTokens; ++i) { poolData.tokenRates[i] = getTokenRate(poolData.tokenInfo[i]); - (, packedBalance) = poolTokenBalances.unchecked_at(i); + packedBalance = poolTokenBalances[i]; // Note the order dependency. This requires up-to-date tokenRate for the token at index `i` in `poolData` updateRawAndLiveBalance(poolData, i, packedBalance.getBalanceRaw(), roundingDirection); diff --git a/pkg/vault/contracts/test/PoolHooksMock.sol b/pkg/vault/contracts/test/PoolHooksMock.sol index 18672fc3b..209249750 100644 --- a/pkg/vault/contracts/test/PoolHooksMock.sol +++ b/pkg/vault/contracts/test/PoolHooksMock.sol @@ -496,6 +496,6 @@ contract PoolHooksMock is BaseHooks { function _setBalancesInVault() private { IERC20[] memory poolTokens = _vault.getPoolTokens(_pool); // We don't care about last live balances here, so we just use the same raw balances - IVaultMock(address(_vault)).manualSetPoolTokenBalances(_pool, poolTokens, _newBalancesRaw, _newBalancesRaw); + IVaultMock(address(_vault)).manualSetPoolTokensAndBalances(_pool, poolTokens, _newBalancesRaw, _newBalancesRaw); } } diff --git a/pkg/vault/contracts/test/VaultMock.sol b/pkg/vault/contracts/test/VaultMock.sol index fdb58c969..b1321f5ad 100644 --- a/pkg/vault/contracts/test/VaultMock.sol +++ b/pkg/vault/contracts/test/VaultMock.sol @@ -42,7 +42,6 @@ struct SwapInternalStateLocals { } contract VaultMock is IVaultMainMock, Vault { - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using ScalingHelpers for uint256; using PackedTokenBalance for bytes32; using PoolConfigLib for *; @@ -236,19 +235,21 @@ contract VaultMock is IVaultMainMock, Vault { } } - function manualSetPoolTokenBalances( + function manualSetPoolTokensAndBalances( address pool, IERC20[] memory tokens, uint256[] memory tokenBalanceRaw, uint256[] memory tokenBalanceLiveScaled18 ) public { - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; + require(tokens.length == tokenBalanceRaw.length, "VaultMock: TOKENS_LENGTH_MISMATCH"); + require(tokens.length == tokenBalanceLiveScaled18.length, "VaultMock: TOKENS_LENGTH_MISMATCH"); + + mapping(uint256 => bytes32) storage poolTokenBalances = _poolTokenBalances[pool]; for (uint256 i = 0; i < tokens.length; ++i) { - poolTokenBalances.set( - tokens[i], - PackedTokenBalance.toPackedBalance(tokenBalanceRaw[i], tokenBalanceLiveScaled18[i]) - ); + poolTokenBalances[i] = PackedTokenBalance.toPackedBalance(tokenBalanceRaw[i], tokenBalanceLiveScaled18[i]); } + + _poolTokens[pool] = tokens; } function mockIsUnlocked() public view onlyWhenUnlocked {} @@ -367,28 +368,24 @@ contract VaultMock is IVaultMainMock, Vault { } function getRawBalances(address pool) external view returns (uint256[] memory balancesRaw) { - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; + mapping(uint256 => bytes32) storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); + uint256 numTokens = _poolTokens[pool].length; balancesRaw = new uint256[](numTokens); - bytes32 packedBalances; for (uint256 i = 0; i < numTokens; ++i) { - (, packedBalances) = poolTokenBalances.unchecked_at(i); - balancesRaw[i] = packedBalances.getBalanceRaw(); + balancesRaw[i] = poolTokenBalances[i].getBalanceRaw(); } } function getLastLiveBalances(address pool) external view returns (uint256[] memory lastLiveBalances) { - EnumerableMap.IERC20ToBytes32Map storage poolTokenBalances = _poolTokenBalances[pool]; + mapping(uint256 => bytes32) storage poolTokenBalances = _poolTokenBalances[pool]; - uint256 numTokens = poolTokenBalances.length(); + uint256 numTokens = _poolTokens[pool].length; lastLiveBalances = new uint256[](numTokens); - bytes32 packedBalances; for (uint256 i = 0; i < numTokens; ++i) { - (, packedBalances) = poolTokenBalances.unchecked_at(i); - lastLiveBalances[i] = packedBalances.getBalanceDerived(); + lastLiveBalances[i] = poolTokenBalances[i].getBalanceDerived(); } } diff --git a/pkg/vault/test/.contract-sizes/Vault b/pkg/vault/test/.contract-sizes/Vault index 74570f3cc..cd9552a5a 100644 --- a/pkg/vault/test/.contract-sizes/Vault +++ b/pkg/vault/test/.contract-sizes/Vault @@ -1,2 +1,2 @@ -Bytecode 24.005* -InitCode 25.287 \ No newline at end of file +Bytecode 24.037* +InitCode 25.319 \ No newline at end of file diff --git a/pkg/vault/test/.contract-sizes/VaultAdmin b/pkg/vault/test/.contract-sizes/VaultAdmin index 11d03d482..e5a802257 100644 --- a/pkg/vault/test/.contract-sizes/VaultAdmin +++ b/pkg/vault/test/.contract-sizes/VaultAdmin @@ -1,2 +1,2 @@ -Bytecode 11.811 -InitCode 12.848 \ No newline at end of file +Bytecode 11.835 +InitCode 12.872 \ No newline at end of file diff --git a/pkg/vault/test/.contract-sizes/VaultExtension b/pkg/vault/test/.contract-sizes/VaultExtension index 39828d4e1..ee60e8f1b 100644 --- a/pkg/vault/test/.contract-sizes/VaultExtension +++ b/pkg/vault/test/.contract-sizes/VaultExtension @@ -1,2 +1,2 @@ -Bytecode 20.488 -InitCode 21.677 \ No newline at end of file +Bytecode 20.473 +InitCode 21.661 \ No newline at end of file diff --git a/pkg/vault/test/foundry/Router.t.sol b/pkg/vault/test/foundry/Router.t.sol index 122b233aa..37808fd42 100644 --- a/pkg/vault/test/foundry/Router.t.sol +++ b/pkg/vault/test/foundry/Router.t.sol @@ -472,7 +472,7 @@ contract RouterTest is BaseVaultTest { assertEq(amountsGiven[usdcIdx], 4321); assertEq(tokenIndex, usdcIdx); - vm.expectRevert(IVaultErrors.TokenNotRegistered.selector); + vm.expectRevert(abi.encodeWithSelector(IVaultErrors.TokenNotRegistered.selector, weth)); router.getSingleInputArrayAndTokenIndex(pool, weth, daiAmountIn); } diff --git a/pkg/vault/test/foundry/unit/VaultCommonBasicFunctions.t.sol b/pkg/vault/test/foundry/unit/VaultCommonBasicFunctions.t.sol index c7b8e37b8..a558d9c21 100644 --- a/pkg/vault/test/foundry/unit/VaultCommonBasicFunctions.t.sol +++ b/pkg/vault/test/foundry/unit/VaultCommonBasicFunctions.t.sol @@ -75,7 +75,7 @@ contract VaultCommonBasicFunctionsTest is BaseVaultTest { originalLastLiveBalances[1] = 456; originalLastLiveBalances[2] = 789; - vault.manualSetPoolTokenBalances(pool, tokens, originalBalancesRaw, originalLastLiveBalances); + vault.manualSetPoolTokensAndBalances(pool, tokens, originalBalancesRaw, originalLastLiveBalances); ( IERC20[] memory newTokens, @@ -136,7 +136,7 @@ contract VaultCommonBasicFunctionsTest is BaseVaultTest { rawBalances[0] = 1000; rawBalances[1] = 2000; rawBalances[2] = 3000; - vault.manualSetPoolTokenBalances(pool, tokens, rawBalances, rawBalances); + vault.manualSetPoolTokensAndBalances(pool, tokens, rawBalances, rawBalances); PoolConfigBits originalPoolConfig; uint8[] memory tokenDecimalDiffs = new uint8[](3); @@ -203,7 +203,7 @@ contract VaultCommonBasicFunctionsTest is BaseVaultTest { originalLastLiveBalances[0] = balance2; originalLastLiveBalances[1] = balance3; originalLastLiveBalances[2] = balance1; - vault.manualSetPoolTokenBalances(pool, tokens, originalBalancesRaw, originalLastLiveBalances); + vault.manualSetPoolTokensAndBalances(pool, tokens, originalBalancesRaw, originalLastLiveBalances); ( IERC20[] memory newTokens, diff --git a/pkg/vault/test/foundry/unit/VaultUnit.t.sol b/pkg/vault/test/foundry/unit/VaultUnit.t.sol index e40934f2a..d4e65c307 100644 --- a/pkg/vault/test/foundry/unit/VaultUnit.t.sol +++ b/pkg/vault/test/foundry/unit/VaultUnit.t.sol @@ -144,7 +144,7 @@ contract VaultUnitTest is BaseTest { poolData.tokens[1] = usdc; // Live balances will be updated, so we just set them equal to the raw ones. - vault.manualSetPoolTokenBalances(pool, defaultTokens, tokenBalances, tokenBalances); + vault.manualSetPoolTokensAndBalances(pool, defaultTokens, tokenBalances, tokenBalances); vm.mockCall(rateProvider, abi.encodeWithSelector(IRateProvider.getRate.selector), abi.encode(secondTokenRate)); poolData = vault.manualUpdatePoolDataLiveBalancesAndRates(pool, poolData, Rounding.ROUND_UP); diff --git a/pkg/vault/test/foundry/unit/VaultUnitLiquidity.t.sol b/pkg/vault/test/foundry/unit/VaultUnitLiquidity.t.sol index 792836115..f1fa80ccd 100644 --- a/pkg/vault/test/foundry/unit/VaultUnitLiquidity.t.sol +++ b/pkg/vault/test/foundry/unit/VaultUnitLiquidity.t.sol @@ -29,7 +29,6 @@ contract VaultUnitLiquidityTest is BaseTest { using ArrayHelpers for *; using ScalingHelpers for *; using FixedPoint for *; - using EnumerableMap for EnumerableMap.IERC20ToBytes32Map; using PoolConfigLib for PoolConfigBits; // #region Test structs @@ -68,7 +67,7 @@ contract VaultUnitLiquidityTest is BaseTest { uint256[] memory initialBalances = new uint256[](tokens.length); // We don't care about last live balances, so we set them equal to the raw ones. - vault.manualSetPoolTokenBalances(pool, tokens, initialBalances, initialBalances); + vault.manualSetPoolTokensAndBalances(pool, tokens, initialBalances, initialBalances); vault.manualSetPoolRegistered(pool, true); diff --git a/pkg/vault/test/foundry/unit/VaultUnitSwap.t.sol b/pkg/vault/test/foundry/unit/VaultUnitSwap.t.sol index 1b7ea0b59..d17cee8a9 100644 --- a/pkg/vault/test/foundry/unit/VaultUnitSwap.t.sol +++ b/pkg/vault/test/foundry/unit/VaultUnitSwap.t.sol @@ -51,7 +51,7 @@ contract VaultUnitSwapTest is BaseTest { swapTokens = [dai, usdc]; // We don't care about last live balances, so we set them equal to the raw ones. - vault.manualSetPoolTokenBalances(pool, swapTokens, initialBalances, initialBalances); + vault.manualSetPoolTokensAndBalances(pool, swapTokens, initialBalances, initialBalances); vault.manualSetAggregateSwapFeeAmount(pool, swapTokens[0], 0); vault.manualSetAggregateSwapFeeAmount(pool, swapTokens[1], 0); diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 078957aab..ebdc6e927 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -191.0k \ No newline at end of file +189.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity using swapExactOur - warm slots index 17f953d26..b184a5b1e 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -185.6k \ No newline at end of file +184.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots index eaa18b945..90e84e685 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -200.4k \ No newline at end of file +199.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots index 5a736b111..a92489d41 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -216.1k \ No newline at end of file +214.9k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - cold slots index db6bec21b..3b4e72d6e 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -190.7k \ No newline at end of file +186.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - warm slots index f42106a41..a5111e503 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -173.6k \ No newline at end of file +169.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity proportional index 04b210b53..438d6c8b8 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity proportional @@ -1 +1 @@ -180.2k \ No newline at end of file +180.0k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity single token exact out - warm slots index 748a49473..32a6c77e7 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity single token exact out - warm slots @@ -1 +1 @@ -180.7k \ No newline at end of file +179.2k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity unbalanced - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity unbalanced - warm slots index 4d7248631..d45abbc2b 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity unbalanced - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] add liquidity unbalanced - warm slots @@ -1 +1 @@ -196.2k \ No newline at end of file +196.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity proportional index be52068b9..d6cadab53 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity proportional @@ -1 +1 @@ -169.4k \ No newline at end of file +169.2k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact in - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact in - warm slots index 7221e1a20..c1c6029be 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact in - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -170.3k \ No newline at end of file +168.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact out - warm slots index ec94fa11b..755281f6c 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -176.5k \ No newline at end of file +175.0k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - cold slots index fd76c368e..6a4e21edd 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - cold slots @@ -1 +1 @@ -175.4k \ No newline at end of file +171.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - warm slots index 18191ce12..e95e917e5 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - Standard] swap single token exact in with fees - warm slots @@ -1 +1 @@ -158.3k \ No newline at end of file +154.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 36de741e1..56ac56a80 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -212.7k \ No newline at end of file +211.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity using swapExactOur - warm slots index 8cd71bef4..2e043eda1 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -207.4k \ No newline at end of file +206.2k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots index adec91666..d2d61defe 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -221.9k \ No newline at end of file +220.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots index 896921bb7..2c67f8f51 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -237.6k \ No newline at end of file +236.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - cold slots index 1a065660b..dc7b07f9d 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -224.1k \ No newline at end of file +220.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - warm slots index 50abda12d..288025e1d 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -189.9k \ No newline at end of file +185.9k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity proportional index 5aab01dd5..3451a2402 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity proportional @@ -1 +1 @@ -235.7k \ No newline at end of file +235.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity single token exact out - warm slots index cfd508fbf..002ebdba4 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity single token exact out - warm slots @@ -1 +1 @@ -199.9k \ No newline at end of file +198.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity unbalanced - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity unbalanced - warm slots index 36de741e1..c55b98f4a 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity unbalanced - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] add liquidity unbalanced - warm slots @@ -1 +1 @@ -212.7k \ No newline at end of file +212.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity proportional index e9f713213..2500f7ec6 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity proportional @@ -1 +1 @@ -224.6k \ No newline at end of file +224.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact in - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact in - warm slots index bfb6c3c2f..a1a745b5f 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact in - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -189.3k \ No newline at end of file +187.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact out - warm slots index fc06e6049..3639dbfe8 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -195.5k \ No newline at end of file +194.0k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - cold slots index 8a85979a0..adf0102cd 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - cold slots @@ -1 +1 @@ -208.8k \ No newline at end of file +204.9k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - warm slots index 973e2eec4..f5e4f3723 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock - With rate] swap single token exact in with fees - warm slots @@ -1 +1 @@ -174.6k \ No newline at end of file +170.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 541fa1f84..c72e0221f 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -209.6k \ No newline at end of file +208.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity using swapExactOur - warm slots index 820617156..7ff227a9b 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -204.3k \ No newline at end of file +202.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots index 8afd666e7..7f090af37 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -219.0k \ No newline at end of file +217.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots index 0e393975a..0282ceb48 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -234.7k \ No newline at end of file +233.2k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - cold slots index 11db40be5..8b4740447 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -182.6k \ No newline at end of file +178.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - warm slots index 11db40be5..8b4740447 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -182.6k \ No newline at end of file +178.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity proportional index 92f2ba216..2c5955baf 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity proportional @@ -1 +1 @@ -198.8k \ No newline at end of file +198.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity single token exact out - warm slots index dc73a17ed..30601cb65 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity single token exact out - warm slots @@ -1 +1 @@ -199.3k \ No newline at end of file +197.6k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity unbalanced - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity unbalanced - warm slots index a92489d41..1ee00a46e 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity unbalanced - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] add liquidity unbalanced - warm slots @@ -1 +1 @@ -214.9k \ No newline at end of file +214.4k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity proportional index c8db04547..047859320 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity proportional @@ -1 +1 @@ -188.0k \ No newline at end of file +187.6k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact in - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact in - warm slots index b98a8d017..da2903a1f 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact in - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -188.9k \ No newline at end of file +187.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact out - warm slots index 15a428766..0bf151b37 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -195.1k \ No newline at end of file +193.3k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - cold slots index eba3d018d..5ff7a9013 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - cold slots @@ -1 +1 @@ -167.3k \ No newline at end of file +163.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - warm slots index eba3d018d..5ff7a9013 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - Standard] swap single token exact in with fees - warm slots @@ -1 +1 @@ -167.3k \ No newline at end of file +163.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots index 595a5e235..69c5b62e1 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots @@ -1 +1 @@ -233.3k \ No newline at end of file +231.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity using swapExactOur - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity using swapExactOur - warm slots index aeacc716a..aa059b0ef 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity using swapExactOur - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] add liquidity using swapExactOur - warm slots @@ -1 +1 @@ -228.0k \ No newline at end of file +226.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots index 4608f9871..8de26ea9c 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots @@ -1 +1 @@ -242.4k \ No newline at end of file +241.0k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots index 73cf44a66..cc9eea734 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots @@ -1 +1 @@ -258.2k \ No newline at end of file +256.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - cold slots index b0c83f644..3451a2402 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - cold slots @@ -1 +1 @@ -239.8k \ No newline at end of file +235.5k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - warm slots index 5928b3ed5..2047abbb9 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate - BatchRouter] swap exact in with one token and fees - warm slots @@ -1 +1 @@ -205.6k \ No newline at end of file +201.3k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity proportional index f8e69ab37..8c0ff5edc 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity proportional @@ -1 +1 @@ -256.3k \ No newline at end of file +255.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity single token exact out - warm slots index 3c0a54e75..48bdca23d 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity single token exact out - warm slots @@ -1 +1 @@ -220.5k \ No newline at end of file +218.8k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity unbalanced - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity unbalanced - warm slots index 595a5e235..bc994c706 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity unbalanced - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] add liquidity unbalanced - warm slots @@ -1 +1 @@ -233.3k \ No newline at end of file +232.9k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity proportional b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity proportional index 799eb3e65..5e97e74e1 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity proportional +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity proportional @@ -1 +1 @@ -245.2k \ No newline at end of file +244.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact in - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact in - warm slots index 2e853f7ae..c72e0221f 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact in - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -209.9k \ No newline at end of file +208.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact out - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact out - warm slots index 5a736b111..2303cb6aa 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact out - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -216.1k \ No newline at end of file +214.3k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - cold slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - cold slots index 2500f7ec6..cc4a97392 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - cold slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - cold slots @@ -1 +1 @@ -224.5k \ No newline at end of file +220.3k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - warm slots b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - warm slots index 831ad61f6..61d910b6a 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - warm slots +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks - With rate] swap single token exact in with fees - warm slots @@ -1 +1 @@ -190.3k \ No newline at end of file +186.1k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] donation b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] donation index 3038d780f..6637ded16 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] donation +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] donation @@ -1 +1 @@ -199.4k \ No newline at end of file +199.0k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize with ETH b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize with ETH index b02e0f42b..3b4f1d72f 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize with ETH +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize with ETH @@ -1 +1 @@ -356.4k \ No newline at end of file +356.2k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize without ETH b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize without ETH index 213a2d7d6..7fc876f38 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize without ETH +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMockWithHooks] initialize without ETH @@ -1 +1 @@ -343.8k \ No newline at end of file +343.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] donation b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] donation index 34e80eef2..afe0c0e3e 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] donation +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] donation @@ -1 +1 @@ -178.9k \ No newline at end of file +178.7k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize with ETH b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize with ETH index 45e9ce397..3f495065a 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize with ETH +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize with ETH @@ -1 +1 @@ -342.8k \ No newline at end of file +342.9k \ No newline at end of file diff --git a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize without ETH b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize without ETH index 3016798d7..65c719a49 100644 --- a/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize without ETH +++ b/pkg/vault/test/gas/.hardhat-snapshots/[PoolMock] initialize without ETH @@ -1 +1 @@ -330.2k \ No newline at end of file +330.4k \ No newline at end of file