From 83b6df8252050d6a7318a9c51131d0764b3cfe42 Mon Sep 17 00:00:00 2001 From: mendesfabio Date: Wed, 3 Jul 2024 10:35:59 -0300 Subject: [PATCH 1/4] create aggregators router --- pkg/interfaces/contracts/vault/IAggRouter.sol | 62 ++++++++ pkg/vault/contracts/AggRouter.sol | 110 ++++++++++++++ pkg/vault/contracts/test/AggRouterMock.sol | 9 ++ pkg/vault/test/foundry/AggRouter.t.sol | 138 ++++++++++++++++++ .../test/foundry/utils/BaseVaultTest.sol | 5 + 5 files changed, 324 insertions(+) create mode 100644 pkg/interfaces/contracts/vault/IAggRouter.sol create mode 100644 pkg/vault/contracts/AggRouter.sol create mode 100644 pkg/vault/contracts/test/AggRouterMock.sol create mode 100644 pkg/vault/test/foundry/AggRouter.t.sol diff --git a/pkg/interfaces/contracts/vault/IAggRouter.sol b/pkg/interfaces/contracts/vault/IAggRouter.sol new file mode 100644 index 000000000..2e5ef7777 --- /dev/null +++ b/pkg/interfaces/contracts/vault/IAggRouter.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.24; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import { SwapKind } from "./VaultTypes.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +interface IAggRouter { + /*************************************************************************** + Swaps + ***************************************************************************/ + + /** + * @dev Data for the swap hook. + * @param sender Account initiating the swap operation + * @param kind Type of swap (exact in or exact out) + * @param pool Address of the liquidity pool + * @param tokenIn Token to be swapped from + * @param tokenOut Token to be swapped to + * @param amountGiven Amount given based on kind of the swap (e.g., tokenIn for exact in) + * @param limit Maximum or minimum amount based on the kind of swap (e.g., maxAmountIn for exact out) + * @param deadline Deadline for the swap + * @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH + * @param userData Additional (optional) data required for the swap + */ + struct SwapSingleTokenHookParams { + address sender; + SwapKind kind; + address pool; + IERC20 tokenIn; + IERC20 tokenOut; + uint256 amountGiven; + uint256 limit; + uint256 deadline; + bool wethIsEth; + bytes userData; + } + + /** + * @notice Executes a swap operation with the amount of tokens sent directly to the Vault + * @param pool Address of the liquidity pool + * @param tokenIn Token to be swapped from + * @param tokenOut Token to be swapped to + * @param minAmountOut Minimum amount of tokens to be received + * @param deadline Deadline for the swap + * @param userData Additional (optional) data required for the swap + * @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH + * @return amountOut Calculated amount of output tokens to be received in exchange for the given input tokens + */ + function swapSingleTokenDonated( + address pool, + IERC20 tokenIn, + IERC20 tokenOut, + uint256 exactAmountIn, + uint256 minAmountOut, + uint256 deadline, + bool wethIsEth, + bytes calldata userData + ) external payable returns (uint256 amountOut); +} diff --git a/pkg/vault/contracts/AggRouter.sol b/pkg/vault/contracts/AggRouter.sol new file mode 100644 index 000000000..49e3353fd --- /dev/null +++ b/pkg/vault/contracts/AggRouter.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.24; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { Address } from "@openzeppelin/contracts/utils/Address.sol"; +import { IPermit2 } from "permit2/src/interfaces/IPermit2.sol"; + +import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; + +import { IAggRouter } from "@balancer-labs/v3-interfaces/contracts/vault/IAggRouter.sol"; +import { IWETH } from "@balancer-labs/v3-interfaces/contracts/solidity-utils/misc/IWETH.sol"; +import "@balancer-labs/v3-interfaces/contracts/vault/VaultTypes.sol"; + +import { + ReentrancyGuardTransient +} from "@balancer-labs/v3-solidity-utils/contracts/openzeppelin/ReentrancyGuardTransient.sol"; + +import { RouterCommon } from "./RouterCommon.sol"; + +contract AggRouter is IAggRouter, RouterCommon, ReentrancyGuardTransient { + using SafeERC20 for IERC20; + using Address for address payable; + + constructor(IVault vault, IWETH weth, IPermit2 permit2) RouterCommon(vault, weth, permit2) { + // solhint-disable-previous-line no-empty-blocks + } + + /// @inheritdoc IAggRouter + function swapSingleTokenDonated( + address pool, + IERC20 tokenIn, + IERC20 tokenOut, + uint256 exactAmountIn, + uint256 minAmountOut, + uint256 deadline, + bool wethIsEth, + bytes calldata userData + ) external payable saveSender returns (uint256) { + return + abi.decode( + _vault.unlock( + abi.encodeWithSelector( + AggRouter.swapSingleTokenDonatedHook.selector, + SwapSingleTokenHookParams({ + sender: msg.sender, + kind: SwapKind.EXACT_IN, + pool: pool, + tokenIn: tokenIn, + tokenOut: tokenOut, + amountGiven: exactAmountIn, + limit: minAmountOut, + deadline: deadline, + wethIsEth: wethIsEth, + userData: userData + }) + ) + ), + (uint256) + ); + } + + + /** + * @notice Hook for swaps. + * @dev Can only be called by the Vault. Also handles native ETH. + * @param params Swap parameters (see IRouter for struct definition) + * @return Token amount calculated by the pool math (e.g., amountOut for a exact in swap) + */ + function swapSingleTokenDonatedHook( + SwapSingleTokenHookParams calldata params + ) external nonReentrant onlyVault returns (uint256) { + (uint256 amountCalculated, uint256 amountIn, uint256 amountOut) = _swapHook(params); + + IERC20 tokenIn = params.tokenIn; + + _vault.settle(tokenIn, amountIn); + _sendTokenOut(params.sender, params.tokenOut, amountOut, params.wethIsEth); + + if (tokenIn == _weth) { + // Return the rest of ETH to sender + _returnEth(params.sender); + } + + return amountCalculated; + } + + function _swapHook( + SwapSingleTokenHookParams calldata params + ) internal returns (uint256 amountCalculated, uint256 amountIn, uint256 amountOut) { + // The deadline is timestamp-based: it should not be relied upon for sub-minute accuracy. + // solhint-disable-next-line not-rely-on-time + if (block.timestamp > params.deadline) { + revert SwapDeadline(); + } + + (amountCalculated, amountIn, amountOut) = _vault.swap( + SwapParams({ + kind: params.kind, + pool: params.pool, + tokenIn: params.tokenIn, + tokenOut: params.tokenOut, + amountGivenRaw: params.amountGiven, + limitRaw: params.limit, + userData: params.userData + }) + ); + } +} diff --git a/pkg/vault/contracts/test/AggRouterMock.sol b/pkg/vault/contracts/test/AggRouterMock.sol new file mode 100644 index 000000000..a95b9bbd8 --- /dev/null +++ b/pkg/vault/contracts/test/AggRouterMock.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.24; + +import "../AggRouter.sol"; + +contract AggRouterMock is AggRouter { + constructor(IVault vault, IWETH weth, IPermit2 permit2) AggRouter(vault, weth, permit2) {} +} diff --git a/pkg/vault/test/foundry/AggRouter.t.sol b/pkg/vault/test/foundry/AggRouter.t.sol new file mode 100644 index 000000000..06604b0e0 --- /dev/null +++ b/pkg/vault/test/foundry/AggRouter.t.sol @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +pragma solidity ^0.8.24; + +import "forge-std/Test.sol"; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; +import { IVaultAdmin } from "@balancer-labs/v3-interfaces/contracts/vault/IVaultAdmin.sol"; +import { IVaultErrors } from "@balancer-labs/v3-interfaces/contracts/vault/IVaultErrors.sol"; +import { IERC20MultiToken } from "@balancer-labs/v3-interfaces/contracts/vault/IERC20MultiToken.sol"; +import { IAuthentication } from "@balancer-labs/v3-interfaces/contracts/solidity-utils/helpers/IAuthentication.sol"; +import { TokenConfig } from "@balancer-labs/v3-interfaces/contracts/vault/VaultTypes.sol"; + +import { ArrayHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/ArrayHelpers.sol"; +import { EVMCallModeHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/EVMCallModeHelpers.sol"; +import { InputHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/InputHelpers.sol"; + +import { PoolMock } from "../../contracts/test/PoolMock.sol"; +import { AggRouter } from "../../contracts/AggRouter.sol"; +import { RouterCommon } from "../../contracts/RouterCommon.sol"; + +import { BaseVaultTest } from "./utils/BaseVaultTest.sol"; + +contract AggRouterTest is BaseVaultTest { + using ArrayHelpers for *; + + uint256 internal usdcAmountIn = 1e3 * 1e6; + uint256 internal daiAmountIn = 1e3 * 1e18; + uint256 internal daiAmountOut = 1e2 * 1e18; + uint256 internal ethAmountIn = 1e3 ether; + uint256 internal initBpt = 10e18; + uint256 internal bptAmountOut = 1e18; + + PoolMock internal wethPool; + PoolMock internal wethPoolNoInit; + + // Track the indices for the local dai/weth pool. + uint256 internal daiIdxWethPool; + uint256 internal wethIdx; + + // Track the indices for the standard dai/usdc pool. + uint256 internal daiIdx; + uint256 internal usdcIdx; + + uint256[] internal wethDaiAmountsIn; + IERC20[] internal wethDaiTokens; + + function setUp() public virtual override { + BaseVaultTest.setUp(); + } + + function createPool() internal override returns (address) { + PoolMock newPool = new PoolMock(IVault(address(vault)), "ERC20 Pool", "ERC20POOL"); + vm.label(address(newPool), "pool"); + + factoryMock.registerTestPool( + address(newPool), + vault.buildTokenConfig([address(dai), address(usdc)].toMemoryArray().asIERC20()), + poolHooksContract, + lp + ); + (daiIdx, usdcIdx) = getSortedIndexes(address(dai), address(usdc)); + + wethPool = new PoolMock(IVault(address(vault)), "ERC20 weth Pool", "ERC20POOL"); + vm.label(address(wethPool), "wethPool"); + + factoryMock.registerTestPool( + address(wethPool), + vault.buildTokenConfig([address(dai), address(weth)].toMemoryArray().asIERC20()), + poolHooksContract, + lp + ); + + (daiIdxWethPool, wethIdx) = getSortedIndexes(address(dai), address(weth)); + + wethDaiTokens = InputHelpers.sortTokens([address(weth), address(dai)].toMemoryArray().asIERC20()); + + wethDaiAmountsIn = new uint256[](2); + wethDaiAmountsIn[wethIdx] = ethAmountIn; + wethDaiAmountsIn[daiIdxWethPool] = daiAmountIn; + + wethPoolNoInit = new PoolMock(IVault(address(vault)), "ERC20 weth Pool", "ERC20POOL"); + vm.label(address(wethPoolNoInit), "wethPoolNoInit"); + + factoryMock.registerTestPool( + address(wethPoolNoInit), + vault.buildTokenConfig([address(weth), address(dai)].toMemoryArray().asIERC20()), + poolHooksContract, + lp + ); + + return address(newPool); + } + + function initPool() internal override { + (IERC20[] memory tokens, , , ) = vault.getPoolTokenInfo(pool); + + vm.prank(lp); + router.initialize(address(pool), tokens, [poolInitAmount, poolInitAmount].toMemoryArray(), 0, false, ""); + + vm.prank(lp); + bool wethIsEth = true; + router.initialize{ value: ethAmountIn }( + address(wethPool), + wethDaiTokens, + wethDaiAmountsIn, + initBpt, + wethIsEth, + bytes("") + ); + } + + function testSwapDonated() public { + require(weth.balanceOf(alice) == defaultBalance, "Precondition: wrong WETH balance"); + + bool wethIsEth = false; + + vm.prank(alice); + weth.transfer(address(vault), ethAmountIn); + + vm.prank(alice); + uint256 outputTokenAmount = aggRouter.swapSingleTokenDonated( + address(wethPool), + weth, + dai, + ethAmountIn, + 0, + MAX_UINT256, + wethIsEth, + "" + ); + + assertEq(weth.balanceOf(alice), defaultBalance - ethAmountIn, "Wrong WETH balance"); + assertEq(dai.balanceOf(alice), defaultBalance + outputTokenAmount, "Wrong DAI balance"); + } +} diff --git a/pkg/vault/test/foundry/utils/BaseVaultTest.sol b/pkg/vault/test/foundry/utils/BaseVaultTest.sol index 488b1d9dd..264808a3e 100644 --- a/pkg/vault/test/foundry/utils/BaseVaultTest.sol +++ b/pkg/vault/test/foundry/utils/BaseVaultTest.sol @@ -26,6 +26,7 @@ import { Router } from "../../../contracts/Router.sol"; import { BatchRouter } from "../../../contracts/BatchRouter.sol"; import { VaultStorage } from "../../../contracts/VaultStorage.sol"; import { RouterMock } from "../../../contracts/test/RouterMock.sol"; +import { AggRouterMock } from "../../../contracts/test/AggRouterMock.sol"; import { BatchRouterMock } from "../../../contracts/test/BatchRouterMock.sol"; import { PoolMock } from "../../../contracts/test/PoolMock.sol"; import { PoolHooksMock } from "../../../contracts/test/PoolHooksMock.sol"; @@ -71,6 +72,8 @@ abstract contract BaseVaultTest is VaultStorage, BaseTest, Permit2Helpers { RouterMock internal router; // Batch router BatchRouterMock internal batchRouter; + // Agg router mock + AggRouterMock internal aggRouter; // Authorizer mock. BasicAuthorizerMock internal authorizer; // Pool for tests. @@ -122,6 +125,8 @@ abstract contract BaseVaultTest is VaultStorage, BaseTest, Permit2Helpers { vm.label(address(router), "router"); batchRouter = new BatchRouterMock(IVault(address(vault)), weth, permit2); vm.label(address(batchRouter), "batch router"); + aggRouter = new AggRouterMock(IVault(address(vault)), weth, permit2); + vm.label(address(aggRouter), "agg router"); poolHooksContract = createHook(); pool = createPool(); From b1a0327b805a0d3828667f70a8b691dfe3219ccd Mon Sep 17 00:00:00 2001 From: mendesfabio Date: Wed, 3 Jul 2024 10:41:41 -0300 Subject: [PATCH 2/4] run prettier --- pkg/vault/contracts/AggRouter.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/vault/contracts/AggRouter.sol b/pkg/vault/contracts/AggRouter.sol index 49e3353fd..c11ef6735 100644 --- a/pkg/vault/contracts/AggRouter.sol +++ b/pkg/vault/contracts/AggRouter.sol @@ -27,7 +27,7 @@ contract AggRouter is IAggRouter, RouterCommon, ReentrancyGuardTransient { // solhint-disable-previous-line no-empty-blocks } - /// @inheritdoc IAggRouter + /// @inheritdoc IAggRouter function swapSingleTokenDonated( address pool, IERC20 tokenIn, @@ -61,7 +61,6 @@ contract AggRouter is IAggRouter, RouterCommon, ReentrancyGuardTransient { ); } - /** * @notice Hook for swaps. * @dev Can only be called by the Vault. Also handles native ETH. @@ -74,7 +73,7 @@ contract AggRouter is IAggRouter, RouterCommon, ReentrancyGuardTransient { (uint256 amountCalculated, uint256 amountIn, uint256 amountOut) = _swapHook(params); IERC20 tokenIn = params.tokenIn; - + _vault.settle(tokenIn, amountIn); _sendTokenOut(params.sender, params.tokenOut, amountOut, params.wethIsEth); From a268a1959d4a36e7bc5a1dac119e0eae499969cc Mon Sep 17 00:00:00 2001 From: Jeff Bennett Date: Mon, 21 Oct 2024 11:54:52 -0400 Subject: [PATCH 3/4] fix: adjust to new code --- pkg/vault/contracts/AggRouter.sol | 52 ++++++++++++++----- pkg/vault/test/.contract-sizes/AggRouter | 2 + pkg/vault/test/ContractSizes.ts | 1 + pkg/vault/test/foundry/AggRouter.t.sol | 13 ++--- .../test/foundry/utils/BaseVaultTest.sol | 1 + 5 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 pkg/vault/test/.contract-sizes/AggRouter diff --git a/pkg/vault/contracts/AggRouter.sol b/pkg/vault/contracts/AggRouter.sol index 6d8382ab7..0fee45a18 100644 --- a/pkg/vault/contracts/AggRouter.sol +++ b/pkg/vault/contracts/AggRouter.sol @@ -41,26 +41,50 @@ contract AggRouter is IAggRouter, RouterCommon, ReentrancyGuardTransient { return abi.decode( _vault.unlock( - abi.encodeWithSelector( - AggRouter.swapSingleTokenDonatedHook.selector, - SwapSingleTokenHookParams({ - sender: msg.sender, - kind: SwapKind.EXACT_IN, - pool: pool, - tokenIn: tokenIn, - tokenOut: tokenOut, - amountGiven: exactAmountIn, - limit: minAmountOut, - deadline: deadline, - wethIsEth: wethIsEth, - userData: userData - }) + _swapSingleTokenArgs( + pool, + tokenIn, + tokenOut, + exactAmountIn, + minAmountOut, + deadline, + wethIsEth, + userData ) ), (uint256) ); } + // Addresses stack-too-deep. + function _swapSingleTokenArgs( + address pool, + IERC20 tokenIn, + IERC20 tokenOut, + uint256 exactAmountIn, + uint256 minAmountOut, + uint256 deadline, + bool wethIsEth, + bytes calldata userData + ) private view returns (bytes memory) { + return + abi.encodeWithSelector( + AggRouter.swapSingleTokenDonatedHook.selector, + SwapSingleTokenHookParams({ + sender: msg.sender, + kind: SwapKind.EXACT_IN, + pool: pool, + tokenIn: tokenIn, + tokenOut: tokenOut, + amountGiven: exactAmountIn, + limit: minAmountOut, + deadline: deadline, + wethIsEth: wethIsEth, + userData: userData + }) + ); + } + /** * @notice Hook for swaps. * @dev Can only be called by the Vault. Also handles native ETH. diff --git a/pkg/vault/test/.contract-sizes/AggRouter b/pkg/vault/test/.contract-sizes/AggRouter new file mode 100644 index 000000000..3db0969c0 --- /dev/null +++ b/pkg/vault/test/.contract-sizes/AggRouter @@ -0,0 +1,2 @@ +Bytecode 6.289 +InitCode 6.948 \ No newline at end of file diff --git a/pkg/vault/test/ContractSizes.ts b/pkg/vault/test/ContractSizes.ts index dab2eb1e8..485d6b280 100644 --- a/pkg/vault/test/ContractSizes.ts +++ b/pkg/vault/test/ContractSizes.ts @@ -11,6 +11,7 @@ describe('ContractSizes', function () { 'Router', 'BatchRouter', 'CompositeLiquidityRouter', + 'AggRouter', ]) { const artifact = getArtifact(`v3-vault/${contractName}`); diff --git a/pkg/vault/test/foundry/AggRouter.t.sol b/pkg/vault/test/foundry/AggRouter.t.sol index 06604b0e0..69deaf92a 100644 --- a/pkg/vault/test/foundry/AggRouter.t.sol +++ b/pkg/vault/test/foundry/AggRouter.t.sol @@ -6,24 +6,19 @@ import "forge-std/Test.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; -import { IVaultAdmin } from "@balancer-labs/v3-interfaces/contracts/vault/IVaultAdmin.sol"; -import { IVaultErrors } from "@balancer-labs/v3-interfaces/contracts/vault/IVaultErrors.sol"; -import { IERC20MultiToken } from "@balancer-labs/v3-interfaces/contracts/vault/IERC20MultiToken.sol"; -import { IAuthentication } from "@balancer-labs/v3-interfaces/contracts/solidity-utils/helpers/IAuthentication.sol"; import { TokenConfig } from "@balancer-labs/v3-interfaces/contracts/vault/VaultTypes.sol"; +import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; -import { ArrayHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/ArrayHelpers.sol"; -import { EVMCallModeHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/EVMCallModeHelpers.sol"; +import { CastingHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/CastingHelpers.sol"; import { InputHelpers } from "@balancer-labs/v3-solidity-utils/contracts/helpers/InputHelpers.sol"; +import { ArrayHelpers } from "@balancer-labs/v3-solidity-utils/contracts/test/ArrayHelpers.sol"; import { PoolMock } from "../../contracts/test/PoolMock.sol"; -import { AggRouter } from "../../contracts/AggRouter.sol"; -import { RouterCommon } from "../../contracts/RouterCommon.sol"; import { BaseVaultTest } from "./utils/BaseVaultTest.sol"; contract AggRouterTest is BaseVaultTest { + using CastingHelpers for address[]; using ArrayHelpers for *; uint256 internal usdcAmountIn = 1e3 * 1e6; diff --git a/pkg/vault/test/foundry/utils/BaseVaultTest.sol b/pkg/vault/test/foundry/utils/BaseVaultTest.sol index e8a5acf36..9cb8bf18a 100644 --- a/pkg/vault/test/foundry/utils/BaseVaultTest.sol +++ b/pkg/vault/test/foundry/utils/BaseVaultTest.sol @@ -25,6 +25,7 @@ import { BatchRouterMock } from "../../../contracts/test/BatchRouterMock.sol"; import { CompositeLiquidityRouterMock } from "../../../contracts/test/CompositeLiquidityRouterMock.sol"; import { PoolFactoryMock } from "../../../contracts/test/PoolFactoryMock.sol"; import { PoolHooksMock } from "../../../contracts/test/PoolHooksMock.sol"; +import { AggRouterMock } from "../../../contracts/test/AggRouterMock.sol"; import { RouterMock } from "../../../contracts/test/RouterMock.sol"; import { VaultStorage } from "../../../contracts/VaultStorage.sol"; import { PoolMock } from "../../../contracts/test/PoolMock.sol"; From 7527e8c724ee11c390cd2face77148f4dc1ae552 Mon Sep 17 00:00:00 2001 From: Jeff Bennett Date: Mon, 21 Oct 2024 11:55:05 -0400 Subject: [PATCH 4/4] chore: update gas --- .../[StablePool - Standard] add liquidity proportional | 2 +- ... Standard] add liquidity single token exact out - warm slots | 2 +- ...StablePool - Standard] add liquidity unbalanced - warm slots | 2 +- .../[StablePool - Standard] remove liquidity proportional | 2 +- ...tandard] remove liquidity single token exact in - warm slots | 2 +- ...andard] remove liquidity single token exact out - warm slots | 2 +- ... Standard] swap single token exact in with fees - cold slots | 2 +- ... Standard] swap single token exact in with fees - warm slots | 2 +- .../[StablePool - With rate] add liquidity proportional | 2 +- ...With rate] add liquidity single token exact out - warm slots | 2 +- ...tablePool - With rate] add liquidity unbalanced - warm slots | 2 +- .../[StablePool - With rate] remove liquidity proportional | 2 +- ...th rate] remove liquidity single token exact in - warm slots | 2 +- ...h rate] remove liquidity single token exact out - warm slots | 2 +- ...With rate] swap single token exact in with fees - cold slots | 2 +- ...With rate] swap single token exact in with fees - warm slots | 2 +- .../test/gas/.hardhat-snapshots/[StablePool] donation | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity proportional b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity proportional index 7c57d7f3c..184d05cb6 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity proportional +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity proportional @@ -1 +1 @@ -179.1k \ No newline at end of file +179.3k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity single token exact out - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity single token exact out - warm slots index ac5df1c57..a4f9f6885 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity single token exact out - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity single token exact out - warm slots @@ -1 +1 @@ -171.6k \ No newline at end of file +171.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity unbalanced - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity unbalanced - warm slots index 1ee00a46e..16386076a 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity unbalanced - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] add liquidity unbalanced - warm slots @@ -1 +1 @@ -214.4k \ No newline at end of file +214.5k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity proportional b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity proportional index abc6469ef..eba3d018d 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity proportional +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity proportional @@ -1 +1 @@ -167.2k \ No newline at end of file +167.3k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact in - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact in - warm slots index 0be376f1e..c7e7b4544 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact in - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -166.4k \ No newline at end of file +166.5k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact out - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact out - warm slots index 1ce178592..514112d22 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact out - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -176.7k \ No newline at end of file +176.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - cold slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - cold slots index 6f0be6378..afe0c0e3e 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - cold slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - cold slots @@ -1 +1 @@ -178.5k \ No newline at end of file +178.7k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - warm slots index 7c96d2959..e2c17ee8c 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - Standard] swap single token exact in with fees - warm slots @@ -1 +1 @@ -164.7k \ No newline at end of file +164.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity proportional b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity proportional index 0cc5625cd..0718ec32c 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity proportional +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity proportional @@ -1 +1 @@ -234.2k \ No newline at end of file +234.4k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity single token exact out - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity single token exact out - warm slots index 436654701..a599d5414 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity single token exact out - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity single token exact out - warm slots @@ -1 +1 @@ -193.0k \ No newline at end of file +193.2k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity unbalanced - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity unbalanced - warm slots index 69b363ada..43f1f83db 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity unbalanced - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] add liquidity unbalanced - warm slots @@ -1 +1 @@ -230.5k \ No newline at end of file +230.6k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity proportional b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity proportional index c4f48aed1..4ab06f336 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity proportional +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity proportional @@ -1 +1 @@ -222.1k \ No newline at end of file +222.3k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact in - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact in - warm slots index 0d3d71a36..a1a745b5f 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact in - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact in - warm slots @@ -1 +1 @@ -187.7k \ No newline at end of file +187.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact out - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact out - warm slots index f0d199187..082a78c63 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact out - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] remove liquidity single token exact out - warm slots @@ -1 +1 @@ -197.9k \ No newline at end of file +198.0k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - cold slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - cold slots index 1406284b4..9da2b9249 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - cold slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - cold slots @@ -1 +1 @@ -211.6k \ No newline at end of file +211.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - warm slots b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - warm slots index f155b0969..cc6877811 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - warm slots +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool - With rate] swap single token exact in with fees - warm slots @@ -1 +1 @@ -180.6k \ No newline at end of file +180.8k \ No newline at end of file diff --git a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool] donation b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool] donation index 686ef4b38..56189c51a 100644 --- a/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool] donation +++ b/pkg/pool-stable/test/gas/.hardhat-snapshots/[StablePool] donation @@ -1 +1 @@ -177.9k \ No newline at end of file +178.0k \ No newline at end of file