diff --git a/lib/debug-helpers.ts b/lib/debug-helpers.ts index a1111c7df..8b51e57d9 100644 --- a/lib/debug-helpers.ts +++ b/lib/debug-helpers.ts @@ -36,7 +36,7 @@ export const vaultV3Address = sepoliaNetworkConfig.contracts.balancer.vaultV3 as export const poolId = '0x68e3266c9c8bbd44ad9dca5afbfe629022aee9fe000200000000000000000512' as const // Balancer Weighted wjAura and WETH -export const sepoliaRouter = '0x1c58cc548a23956469c7C528Bb3a846c842dfaF9' +export const sepoliaRouter = '0xB12FcB422aAe6720f882E22C340964a7723f2387' /* Used to pretty print objects when debugging diff --git a/lib/modules/pool/actions/add-liquidity/handlers/UnbalancedAddLiquidity.handler.integration.spec.ts b/lib/modules/pool/actions/add-liquidity/handlers/UnbalancedAddLiquidity.handler.integration.spec.ts index 6a1920b7d..4cc1ad0b4 100644 --- a/lib/modules/pool/actions/add-liquidity/handlers/UnbalancedAddLiquidity.handler.integration.spec.ts +++ b/lib/modules/pool/actions/add-liquidity/handlers/UnbalancedAddLiquidity.handler.integration.spec.ts @@ -6,12 +6,13 @@ import { aWjAuraWethPoolElementMock } from '@/test/msw/builders/gqlPoolElement.b import { UnbalancedAddLiquidityHandler } from './UnbalancedAddLiquidity.handler' import { selectAddLiquidityHandler } from './selectAddLiquidityHandler' import { HumanTokenAmountWithAddress } from '@/lib/modules/tokens/token.types' +import { Pool } from '../../../PoolProvider' function selectUnbalancedHandler() { return selectAddLiquidityHandler(aWjAuraWethPoolElementMock()) as UnbalancedAddLiquidityHandler } -describe('When adding unbalanced liquidity for a weighted pool', () => { +describe('When adding unbalanced liquidity for a weighted V2 pool', () => { test('calculates price impact', async () => { const handler = selectUnbalancedHandler() @@ -72,3 +73,45 @@ describe('When adding unbalanced liquidity for a weighted pool', () => { expect(result.data).toBeDefined() }) }) + +// TODO: unskip this test when sepolia V3 pools are available in production api +describe.skip('When adding unbalanced liquidity for a V3 pool', async () => { + // Sepolia + const balAddress = '0xb19382073c7a0addbb56ac6af1808fa49e377b75' + // const poolId = '0xec1b5ca86c83c7a85392063399e7d2170d502e00' // Sepolia B-50BAL-50WETH + // const v3Pool = await getPoolMock(poolId, GqlChain.Sepolia) + const v3Pool = {} as unknown as Pool + + const handler = selectAddLiquidityHandler(v3Pool) as UnbalancedAddLiquidityHandler + + const humanAmountsIn: HumanTokenAmountWithAddress[] = [ + { humanAmount: '0.1', tokenAddress: balAddress }, + ] + + it('calculates price impact', async () => { + const priceImpact = await handler.getPriceImpact(humanAmountsIn) + expect(priceImpact).toBeGreaterThan(0.002) + }) + + it('queries bptOut', async () => { + const result = await handler.simulate(humanAmountsIn) + + expect(result.bptOut.amount).toBeGreaterThan(100000000000000n) + }) + + it('builds Tx Config', async () => { + // Store query response in handler instance + const queryOutput = await handler.simulate(humanAmountsIn) + + const result = await handler.buildCallData({ + humanAmountsIn, + account: defaultTestUserAccount, + slippagePercent: '0.2', + queryOutput, + }) + + const sepoliaRouter = '0xB12FcB422aAe6720f882E22C340964a7723f2387' + expect(result.to).toBe(sepoliaRouter) + expect(result.data).toBeDefined() + }) +}) diff --git a/lib/modules/pool/actions/remove-liquidity/handlers/ProportionalRemoveLiquidity.handler.integration.spec.ts b/lib/modules/pool/actions/remove-liquidity/handlers/ProportionalRemoveLiquidity.handler.integration.spec.ts index 825aaa06a..c17e8db89 100644 --- a/lib/modules/pool/actions/remove-liquidity/handlers/ProportionalRemoveLiquidity.handler.integration.spec.ts +++ b/lib/modules/pool/actions/remove-liquidity/handlers/ProportionalRemoveLiquidity.handler.integration.spec.ts @@ -1,5 +1,5 @@ import networkConfig from '@/lib/config/networks/mainnet' -import { balAddress, wETHAddress } from '@/lib/debug-helpers' +import { balAddress, sepoliaRouter, wETHAddress } from '@/lib/debug-helpers' import { aBalWethPoolElementMock, aPhantomStablePoolMock, @@ -11,6 +11,8 @@ import { selectRemoveLiquidityHandler } from './selectRemoveLiquidityHandler' import { ProportionalRemoveLiquidityHandler } from './ProportionalRemoveLiquidity.handler' import { emptyAddress } from '@/lib/modules/web3/contracts/wagmi-helpers' import { connectWithDefaultUser } from '@/test/utils/wagmi/wagmi-connections' +// import { GqlChain } from '@/lib/shared/services/api/generated/graphql' +// import { getPoolMock } from '../../../__mocks__/getPoolMock' const poolMock = aBalWethPoolElementMock() // 80BAL-20WETH @@ -30,7 +32,7 @@ const defaultBuildInput = { account: defaultTestUserAccount, slippagePercent: '0 await connectWithDefaultUser() -describe('When proportionally removing liquidity for a weighted pool', async () => { +describe('When proportionally removing liquidity for a weighted v2 pool', async () => { test('returns ZERO price impact', async () => { const handler = selectProportionalHandler(poolMock) @@ -67,7 +69,7 @@ describe('When proportionally removing liquidity for a weighted pool', async () }) }) -describe('When removing liquidity from a stable pool', () => { +describe('When removing liquidity from a V2 stable pool', () => { test('queries remove liquidity', async () => { const pool = aPhantomStablePoolMock() // wstETH-rETH-sfrxETH @@ -79,3 +81,54 @@ describe('When removing liquidity from a stable pool', () => { expect(result.account).toBe(defaultTestUserAccount) }) }) + +// TODO: unskip this test when sepolia V3 pools are available in production api +describe.skip('When proportionally removing liquidity for a weighted v3 pool', async () => { + // Sepolia + const balAddress = '0xb19382073c7a0addbb56ac6af1808fa49e377b75' + const wethAddress = '0x7b79995e5f793a07bc00c21412e50ecae098e7f9' + // const poolId = '0xec1b5ca86c83c7a85392063399e7d2170d502e00' // Sepolia B-50BAL-50WETH + // const v3Pool = await getPoolMock(poolId, GqlChain.Sepolia) + + const v3Pool = {} as unknown as Pool + + const defaultQueryInput: QueryRemoveLiquidityInput = { + humanBptIn: '0.01', + tokenOut: emptyAddress, // We don't use in this scenario it but it is required to simplify TS interfaces + } + + test('returns ZERO price impact', async () => { + const handler = selectProportionalHandler(v3Pool) + + const priceImpact = await handler.getPriceImpact() + + expect(priceImpact).toBe(0) + }) + test('queries amounts out', async () => { + const handler = selectProportionalHandler(v3Pool) + + const result = await handler.simulate(defaultQueryInput) + + const [wEthTokenAmountOut, balTokenAmountOut] = result.amountsOut + + expect(balTokenAmountOut.token.address).toBe(balAddress) + expect(balTokenAmountOut.amount).toBeGreaterThan(200000000000000n) + + expect(wEthTokenAmountOut.token.address).toBe(wethAddress) + expect(wEthTokenAmountOut.amount).toBeGreaterThan(100000000000000n) + }) + + test('builds Tx Config', async () => { + const handler = selectProportionalHandler(v3Pool) + + const queryOutput = await handler.simulate(defaultQueryInput) + + const result = await handler.buildCallData({ + ...defaultBuildInput, + queryOutput, + }) + + expect(result.to).toBe(sepoliaRouter) + expect(result.data).toBeDefined() + }) +}) diff --git a/lib/modules/pool/actions/remove-liquidity/handlers/SingleTokenRemoveLiquidity.handler.integration.spec.ts b/lib/modules/pool/actions/remove-liquidity/handlers/SingleTokenRemoveLiquidity.handler.integration.spec.ts index 9f3a10e63..5115f4987 100644 --- a/lib/modules/pool/actions/remove-liquidity/handlers/SingleTokenRemoveLiquidity.handler.integration.spec.ts +++ b/lib/modules/pool/actions/remove-liquidity/handlers/SingleTokenRemoveLiquidity.handler.integration.spec.ts @@ -1,13 +1,13 @@ import networkConfig from '@/lib/config/networks/mainnet' -import { balAddress, wETHAddress } from '@/lib/debug-helpers' +import { balAddress, sepoliaRouter, wETHAddress } from '@/lib/debug-helpers' import { aBalWethPoolElementMock } from '@/test/msw/builders/gqlPoolElement.builders' import { defaultTestUserAccount } from '@/test/anvil/anvil-setup' import { Pool } from '../../../PoolProvider' import { QueryRemoveLiquidityInput, RemoveLiquidityType } from '../remove-liquidity.types' import { SingleTokenRemoveLiquidityHandler } from './SingleTokenRemoveLiquidity.handler' import { selectRemoveLiquidityHandler } from './selectRemoveLiquidityHandler' - -const poolMock = aBalWethPoolElementMock() // 80BAL-20WETH +// import { getPoolMock } from '../../../__mocks__/getPoolMock' +// import { GqlChain } from '@/lib/shared/services/api/generated/graphql' function selectSingleTokenHandler(pool: Pool): SingleTokenRemoveLiquidityHandler { return selectRemoveLiquidityHandler( @@ -23,9 +23,11 @@ const defaultQueryInput: QueryRemoveLiquidityInput = { const defaultBuildInput = { account: defaultTestUserAccount, slippagePercent: '0.2' } -describe('When removing unbalanced liquidity for a weighted pool', () => { +describe('When removing unbalanced liquidity for a weighted V2 pool', () => { + const v2poolMock = aBalWethPoolElementMock() // 80BAL-20WETH + test('queries amounts out', async () => { - const handler = selectSingleTokenHandler(poolMock) + const handler = selectSingleTokenHandler(v2poolMock) const result = await handler.simulate(defaultQueryInput) @@ -39,7 +41,7 @@ describe('When removing unbalanced liquidity for a weighted pool', () => { }) test('builds Tx Config', async () => { - const handler = selectSingleTokenHandler(poolMock) + const handler = selectSingleTokenHandler(v2poolMock) const inputs: QueryRemoveLiquidityInput = { humanBptIn: '1', @@ -54,3 +56,43 @@ describe('When removing unbalanced liquidity for a weighted pool', () => { expect(result.data).toBeDefined() }) }) + +// TODO: unskip this test when sepolia V3 pools are available in production api +describe.skip('When removing unbalanced liquidity for a weighted V3 pool', async () => { + // Sepolia + const balAddress = '0xb19382073c7a0addbb56ac6af1808fa49e377b75' + const wethAddress = '0x7b79995e5f793a07bc00c21412e50ecae098e7f9' + // const poolId = '0xec1b5ca86c83c7a85392063399e7d2170d502e00' // Sepolia B-50BAL-50WETH + // const v3Pool = await getPoolMock(poolId, GqlChain.Sepolia) + const v3Pool = {} as unknown as Pool + + const defaultQueryInput: QueryRemoveLiquidityInput = { + humanBptIn: '0.001', + tokenOut: balAddress, + } + + test('queries amounts out', async () => { + const handler = selectSingleTokenHandler(v3Pool) + + const result = await handler.simulate(defaultQueryInput) + + const [wEthTokenAmountOut, balTokenAmountOut] = result.amountsOut + + expect(wEthTokenAmountOut.token.address).toBe(wethAddress) + expect(wEthTokenAmountOut.amount).toBe(0n) + + expect(balTokenAmountOut.token.address).toBe(balAddress) + expect(balTokenAmountOut.amount).toBeGreaterThan(50000000000000000n) + }) + + test('builds Tx Config', async () => { + const handler = selectSingleTokenHandler(v3Pool) + + const queryOutput = await handler.simulate(defaultQueryInput) + + const result = await handler.buildCallData({ ...defaultBuildInput, queryOutput }) + + expect(result.to).toBe(sepoliaRouter) + expect(result.data).toBeDefined() + }) +}) diff --git a/lib/modules/pool/pool.helpers.ts b/lib/modules/pool/pool.helpers.ts index 48dfbf0c4..d7fb9f7cb 100644 --- a/lib/modules/pool/pool.helpers.ts +++ b/lib/modules/pool/pool.helpers.ts @@ -22,7 +22,7 @@ import { PoolIssue } from './alerts/pool-issues/PoolIssue.type' import { getUserTotalBalanceInt } from './user-balance.helpers' import { dateToUnixTimestamp } from '@/lib/shared/utils/time' import { balancerV2VaultAbi } from '../web3/contracts/abi/generated' -import { balancerV3VaultAbi } from '../web3/contracts/abi/balancerV3Abi' +import { balancerV3VaultAbi } from '../web3/contracts/abi/balancerV3VaultAbi' /** * METHODS diff --git a/lib/modules/pool/queries/usePoolEnrichWithOnChainData.integration.spec.tsx b/lib/modules/pool/queries/usePoolEnrichWithOnChainData.integration.spec.tsx index 55d368364..9415a1338 100644 --- a/lib/modules/pool/queries/usePoolEnrichWithOnChainData.integration.spec.tsx +++ b/lib/modules/pool/queries/usePoolEnrichWithOnChainData.integration.spec.tsx @@ -11,9 +11,9 @@ function testPoolEnrichWithOnChainData(pool: Pool) { return result } -// TODO: un-skip when pool 0x7cf221fa36584f59a4f7fd7b946b8571c78e3692 is available in production api +// TODO: un-skip when pool 0xec1b5ca86c83c7a85392063399e7d2170d502e00 is available in production api test.skip('enriches V3 pool with on-chain data', async () => { - const poolId = '0x7cf221fa36584f59a4f7fd7b946b8571c78e3692' // V3 Balancer 50 BAL 50 WETH (sepolia experimental) + const poolId = '0xec1b5ca86c83c7a85392063399e7d2170d502e00' // V3 Balancer 50 BAL 50 WETH (sepolia) const pool = await getPoolMock(poolId, GqlChain.Sepolia, defaultTestUserAccount) // delete values to ensure that onchain data is used @@ -45,12 +45,10 @@ test('enriches V2 pool with on-chain data', async () => { expect(Number(result.current.pool.dynamicData.totalShares)).toBeGreaterThan(0) }) -// TODO: un-skip when pool 0x232a18645c4e33dd64e6925e03da0f0dd77ad003 is available in production api -test.skip('enriches V1 Cow AMM pool with on-chain data', async () => { - // const poolId = '0x232a18645c4e33dd64e6925e03da0f0dd77ad003' // V1 test Cow AMM pool - const sepoliaPoolId = '0xd1bdc51decb61ee0c98e47fe17217c58be525180' // V1 test Cow AMM pool +test('enriches V1 Cow AMM pool with on-chain data', async () => { + const cowPoolId = '0xf706c50513446d709f08d3e5126cd74fb6bfda19' - const pool = await getPoolMock(sepoliaPoolId, GqlChain.Sepolia) + const pool = await getPoolMock(cowPoolId, GqlChain.Mainnet) // delete values to ensure that onchain data is used pool.dynamicData.totalLiquidity = '0' diff --git a/lib/modules/pool/queries/usePoolEnrichWithOnChainData.tsx b/lib/modules/pool/queries/usePoolEnrichWithOnChainData.tsx index 3756c1539..2cc4dcb89 100644 --- a/lib/modules/pool/queries/usePoolEnrichWithOnChainData.tsx +++ b/lib/modules/pool/queries/usePoolEnrichWithOnChainData.tsx @@ -2,7 +2,7 @@ import { cloneDeep } from 'lodash' import { Address, formatUnits } from 'viem' import { useReadContracts } from 'wagmi' import { useTokens } from '../../tokens/TokensProvider' -import { balancerV3VaultAbi } from '../../web3/contracts/abi/balancerV3Abi' +import { balancerV3ExtensionVaultAbi } from '../../web3/contracts/abi/balancerV3ExtensionVaultAbi' import { weightedPoolV3Abi } from '../../web3/contracts/abi/weightedPoolV3Abi' import { Pool } from '../PoolProvider' import { BPT_DECIMALS } from '../pool.constants' @@ -53,7 +53,7 @@ function useV3PoolOnchainData(pool: Pool) { contracts: [ { chainId, - abi: balancerV3VaultAbi, + abi: balancerV3ExtensionVaultAbi, address: vaultAddress, functionName: 'getPoolTokenInfo', args: [pool.address as Address], diff --git a/lib/modules/web3/contracts/abi/balancerV3Abi.ts b/lib/modules/web3/contracts/abi/balancerV3Abi.ts deleted file mode 100644 index 9aeb07c2b..000000000 --- a/lib/modules/web3/contracts/abi/balancerV3Abi.ts +++ /dev/null @@ -1,994 +0,0 @@ -// TODO: replace with wagmi generated abi once vault v3 is deployed in all networks -export const balancerV3VaultAbi = [ - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - components: [ - { - internalType: 'enum SwapKind', - name: 'kind', - type: 'uint8', - }, - { - internalType: 'uint256', - name: 'amountGivenScaled18', - type: 'uint256', - }, - { - internalType: 'uint256[]', - name: 'balancesScaled18', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'indexIn', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'indexOut', - type: 'uint256', - }, - { - internalType: 'address', - name: 'router', - type: 'address', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - internalType: 'struct IBasePool.PoolSwapParams', - name: 'swapParams', - type: 'tuple', - }, - ], - name: 'computeDynamicSwapFee', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - ], - name: 'getAggregateProtocolSwapFeeAmount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - ], - name: 'getAggregateProtocolYieldFeeAmount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getBptRate', - outputs: [ - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getHooksConfig', - outputs: [ - { - components: [ - { - internalType: 'bool', - name: 'shouldCallBeforeInitialize', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallAfterInitialize', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallComputeDynamicSwapFee', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallBeforeSwap', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallAfterSwap', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallBeforeAddLiquidity', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallAfterAddLiquidity', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallBeforeRemoveLiquidity', - type: 'bool', - }, - { - internalType: 'bool', - name: 'shouldCallAfterRemoveLiquidity', - type: 'bool', - }, - { - internalType: 'address', - name: 'hooksContract', - type: 'address', - }, - ], - internalType: 'struct HooksConfig', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getNonzeroDeltaCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolConfig', - outputs: [ - { - components: [ - { - internalType: 'uint24', - name: 'staticSwapFeePercentageUnscaled', - type: 'uint24', - }, - { - internalType: 'uint24', - name: 'aggregateProtocolSwapFeePercentageUnscaled', - type: 'uint24', - }, - { - internalType: 'uint24', - name: 'aggregateProtocolYieldFeePercentageUnscaled', - type: 'uint24', - }, - { - internalType: 'uint24', - name: 'tokenDecimalDiffs', - type: 'uint24', - }, - { - internalType: 'uint32', - name: 'pauseWindowEndTime', - type: 'uint32', - }, - { - internalType: 'bool', - name: 'isPoolRegistered', - type: 'bool', - }, - { - internalType: 'bool', - name: 'isPoolInitialized', - type: 'bool', - }, - { - internalType: 'bool', - name: 'isPoolPaused', - type: 'bool', - }, - { - internalType: 'bool', - name: 'isPoolInRecoveryMode', - type: 'bool', - }, - { - internalType: 'bool', - name: 'disableUnbalancedLiquidity', - type: 'bool', - }, - { - internalType: 'bool', - name: 'enableAddLiquidityCustom', - type: 'bool', - }, - { - internalType: 'bool', - name: 'enableRemoveLiquidityCustom', - type: 'bool', - }, - ], - internalType: 'struct PoolConfig', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolPausedState', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolRoleAccounts', - outputs: [ - { - components: [ - { - internalType: 'address', - name: 'pauseManager', - type: 'address', - }, - { - internalType: 'address', - name: 'swapFeeManager', - type: 'address', - }, - { - internalType: 'address', - name: 'poolCreator', - type: 'address', - }, - ], - internalType: 'struct PoolRoleAccounts', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolTokenInfo', - outputs: [ - { - components: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - { - internalType: 'enum TokenType', - name: 'tokenType', - type: 'uint8', - }, - { - internalType: 'contract IRateProvider', - name: 'rateProvider', - type: 'address', - }, - { - internalType: 'bool', - name: 'paysYieldFees', - type: 'bool', - }, - ], - internalType: 'struct TokenConfig[]', - name: 'tokenConfig', - type: 'tuple[]', - }, - { - internalType: 'uint256[]', - name: 'balancesRaw', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: 'scalingFactors', - type: 'uint256[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getPoolTokens', - outputs: [ - { - internalType: 'contract IERC20[]', - name: '', - type: 'address[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - ], - name: 'getReservesOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'getStaticSwapFeePercentage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - ], - name: 'getTokenDelta', - outputs: [ - { - internalType: 'int256', - name: '', - type: 'int256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getVaultAdmin', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'contract IERC20[]', - name: 'tokens', - type: 'address[]', - }, - { - internalType: 'uint256[]', - name: 'exactAmountsIn', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'minBptAmountOut', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - name: 'initialize', - outputs: [ - { - internalType: 'uint256', - name: 'bptAmountOut', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'isPoolInRecoveryMode', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'isPoolInitialized', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'isPoolPaused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - ], - name: 'isPoolRegistered', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isQueryDisabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'isUnlocked', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'quote', - outputs: [ - { - internalType: 'bytes', - name: 'result', - type: 'bytes', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'quoteAndRevert', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - components: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - { - internalType: 'enum TokenType', - name: 'tokenType', - type: 'uint8', - }, - { - internalType: 'contract IRateProvider', - name: 'rateProvider', - type: 'address', - }, - { - internalType: 'bool', - name: 'paysYieldFees', - type: 'bool', - }, - ], - internalType: 'struct TokenConfig[]', - name: 'tokenConfig', - type: 'tuple[]', - }, - { - internalType: 'uint256', - name: 'swapFeePercentage', - type: 'uint256', - }, - { - internalType: 'uint32', - name: 'pauseWindowEndTime', - type: 'uint32', - }, - { - components: [ - { - internalType: 'address', - name: 'pauseManager', - type: 'address', - }, - { - internalType: 'address', - name: 'swapFeeManager', - type: 'address', - }, - { - internalType: 'address', - name: 'poolCreator', - type: 'address', - }, - ], - internalType: 'struct PoolRoleAccounts', - name: 'roleAccounts', - type: 'tuple', - }, - { - internalType: 'address', - name: 'poolHooksContract', - type: 'address', - }, - { - components: [ - { - internalType: 'bool', - name: 'disableUnbalancedLiquidity', - type: 'bool', - }, - { - internalType: 'bool', - name: 'enableAddLiquidityCustom', - type: 'bool', - }, - { - internalType: 'bool', - name: 'enableRemoveLiquidityCustom', - type: 'bool', - }, - ], - internalType: 'struct LiquidityManagement', - name: 'liquidityManagement', - type: 'tuple', - }, - ], - name: 'registerPool', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'uint256', - name: 'exactBptAmountIn', - type: 'uint256', - }, - ], - name: 'removeLiquidityRecovery', - outputs: [ - { - internalType: 'uint256[]', - name: 'amountsOut', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'vault', - outputs: [ - { - internalType: 'contract IVault', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const diff --git a/lib/modules/web3/contracts/abi/balancerV3ExtensionVaultAbi.ts b/lib/modules/web3/contracts/abi/balancerV3ExtensionVaultAbi.ts new file mode 100644 index 000000000..cf0a3bc50 --- /dev/null +++ b/lib/modules/web3/contracts/abi/balancerV3ExtensionVaultAbi.ts @@ -0,0 +1,1781 @@ +// TODO: replace with wagmi generated abi once vault extension v3 is deployed in all networks +export const balancerV3ExtensionVaultAbi = [ + { + inputs: [ + { + internalType: 'contract IVault', + name: 'mainVault', + type: 'address', + }, + { + internalType: 'contract IVaultAdmin', + name: 'vaultAdmin', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [{ internalType: 'address', name: 'target', type: 'address' }], + name: 'AddressEmptyCode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], + name: 'AddressInsufficientBalance', + type: 'error', + }, + { inputs: [], name: 'AfterAddLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'AfterInitializeHookFailed', type: 'error' }, + { inputs: [], name: 'AfterRemoveLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'AfterSwapHookFailed', type: 'error' }, + { inputs: [], name: 'AmountGivenZero', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'AmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'AmountOutBelowMin', + type: 'error', + }, + { inputs: [], name: 'BalanceNotSettled', type: 'error' }, + { inputs: [], name: 'BalanceOverflow', type: 'error' }, + { inputs: [], name: 'BeforeAddLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeInitializeHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeRemoveLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeSwapHookFailed', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'BptAmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'BptAmountOutBelowMin', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'BufferAlreadyInitialized', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'BufferNotInitialized', + type: 'error', + }, + { inputs: [], name: 'BufferSharesInvalidOwner', type: 'error' }, + { inputs: [], name: 'BufferSharesInvalidReceiver', type: 'error' }, + { + inputs: [{ internalType: 'uint256', name: 'totalSupply', type: 'uint256' }], + name: 'BufferTotalSupplyTooLow', + type: 'error', + }, + { inputs: [], name: 'CannotReceiveEth', type: 'error' }, + { inputs: [], name: 'CannotSwapSameToken', type: 'error' }, + { inputs: [], name: 'CodecOverflow', type: 'error' }, + { inputs: [], name: 'DoesNotSupportAddLiquidityCustom', type: 'error' }, + { inputs: [], name: 'DoesNotSupportDonation', type: 'error' }, + { inputs: [], name: 'DoesNotSupportRemoveLiquidityCustom', type: 'error' }, + { inputs: [], name: 'DoesNotSupportUnbalancedLiquidity', type: 'error' }, + { inputs: [], name: 'DynamicSwapFeeHookFailed', type: 'error' }, + { + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'allowance', type: 'uint256' }, + { internalType: 'uint256', name: 'needed', type: 'uint256' }, + ], + name: 'ERC20InsufficientAllowance', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'sender', type: 'address' }, + { internalType: 'uint256', name: 'balance', type: 'uint256' }, + { internalType: 'uint256', name: 'needed', type: 'uint256' }, + ], + name: 'ERC20InsufficientBalance', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'approver', type: 'address' }], + name: 'ERC20InvalidApprover', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'receiver', type: 'address' }], + name: 'ERC20InvalidReceiver', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], + name: 'ERC20InvalidSender', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'spender', type: 'address' }], + name: 'ERC20InvalidSpender', + type: 'error', + }, + { inputs: [], name: 'ErrorSelectorNotFound', type: 'error' }, + { inputs: [], name: 'FailedInnerCall', type: 'error' }, + { inputs: [], name: 'FeePrecisionTooHigh', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'HookAdjustedAmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'HookAdjustedAmountOutBelowMin', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'uint256', name: 'limit', type: 'uint256' }, + ], + name: 'HookAdjustedSwapLimit', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'poolHooksContract', + type: 'address', + }, + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'poolFactory', type: 'address' }, + ], + name: 'HookRegistrationFailed', + type: 'error', + }, + { inputs: [], name: 'InputLengthMismatch', type: 'error' }, + { inputs: [], name: 'InvalidAddLiquidityKind', type: 'error' }, + { inputs: [], name: 'InvalidRemoveLiquidityKind', type: 'error' }, + { inputs: [], name: 'InvalidToken', type: 'error' }, + { inputs: [], name: 'InvalidTokenConfiguration', type: 'error' }, + { inputs: [], name: 'InvalidTokenType', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'InvalidUnderlyingToken', + type: 'error', + }, + { inputs: [], name: 'MaxTokens', type: 'error' }, + { inputs: [], name: 'MinTokens', type: 'error' }, + { inputs: [], name: 'NotEnoughBufferShares', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'expectedUnderlyingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualUnderlyingAmount', + type: 'uint256', + }, + ], + name: 'NotEnoughUnderlying', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'expectedWrappedAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualWrappedAmount', + type: 'uint256', + }, + ], + name: 'NotEnoughWrapped', + type: 'error', + }, + { inputs: [], name: 'NotStaticCall', type: 'error' }, + { inputs: [], name: 'NotVaultDelegateCall', type: 'error' }, + { inputs: [], name: 'OutOfBounds', type: 'error' }, + { inputs: [], name: 'PauseBufferPeriodDurationTooLarge', type: 'error' }, + { inputs: [], name: 'PercentageAboveMax', type: 'error' }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolAlreadyInitialized', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolAlreadyRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolInRecoveryMode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotInRecoveryMode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotInitialized', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotPaused', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolPauseWindowExpired', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolPaused', + type: 'error', + }, + { + inputs: [{ internalType: 'uint256', name: 'totalSupply', type: 'uint256' }], + name: 'PoolTotalSupplyTooLow', + type: 'error', + }, + { inputs: [], name: 'ProtocolFeesExceedTotalCollected', type: 'error' }, + { inputs: [], name: 'QueriesDisabled', type: 'error' }, + { inputs: [], name: 'QuoteResultSpoofed', type: 'error' }, + { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' }, + { + inputs: [{ internalType: 'bytes', name: 'result', type: 'bytes' }], + name: 'Result', + type: 'error', + }, + { inputs: [], name: 'RouterNotTrusted', type: 'error' }, + { + inputs: [{ internalType: 'uint256', name: 'value', type: 'uint256' }], + name: 'SafeCastOverflowedUintToInt', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], + name: 'SenderIsNotVault', + type: 'error', + }, + { inputs: [], name: 'SwapFeePercentageTooHigh', type: 'error' }, + { inputs: [], name: 'SwapFeePercentageTooLow', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'uint256', name: 'limit', type: 'uint256' }, + ], + name: 'SwapLimit', + type: 'error', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'TokenAlreadyRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'TokenNotRegistered', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'expectedToken', type: 'address' }, + { internalType: 'address', name: 'actualToken', type: 'address' }, + ], + name: 'TokensMismatch', + type: 'error', + }, + { inputs: [], name: 'TokensNotSorted', type: 'error' }, + { inputs: [], name: 'TradeAmountTooSmall', type: 'error' }, + { inputs: [], name: 'VaultBuffersArePaused', type: 'error' }, + { inputs: [], name: 'VaultIsNotUnlocked', type: 'error' }, + { inputs: [], name: 'VaultNotPaused', type: 'error' }, + { inputs: [], name: 'VaultPauseWindowDurationTooLarge', type: 'error' }, + { inputs: [], name: 'VaultPauseWindowExpired', type: 'error' }, + { inputs: [], name: 'VaultPaused', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'WrapAmountTooSmall', + type: 'error', + }, + { inputs: [], name: 'WrongProtocolFeeControllerDeployment', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'address', + name: 'underlyingToken', + type: 'address', + }, + ], + name: 'WrongUnderlyingToken', + type: 'error', + }, + { inputs: [], name: 'WrongVaultAdminDeployment', type: 'error' }, + { inputs: [], name: 'WrongVaultExtensionDeployment', type: 'error' }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IAuthorizer', + name: 'newAuthorizer', + type: 'address', + }, + ], + name: 'AuthorizerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnedShares', + type: 'uint256', + }, + ], + name: 'BufferSharesBurned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'issuedShares', + type: 'uint256', + }, + ], + name: 'BufferSharesMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWrapped', + type: 'uint256', + }, + ], + name: 'LiquidityAddedToBuffer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWrapped', + type: 'uint256', + }, + ], + name: 'LiquidityRemovedFromBuffer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'liquidityProvider', + type: 'address', + }, + { + indexed: false, + internalType: 'int256[]', + name: 'deltas', + type: 'int256[]', + }, + ], + name: 'PoolBalanceChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + ], + name: 'PoolInitialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'PoolPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'recoveryMode', + type: 'bool', + }, + ], + name: 'PoolRecoveryModeStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'factory', + type: 'address', + }, + { + components: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'enum TokenType', + name: 'tokenType', + type: 'uint8', + }, + { + internalType: 'contract IRateProvider', + name: 'rateProvider', + type: 'address', + }, + { + internalType: 'bool', + name: 'paysYieldFees', + type: 'bool', + }, + ], + indexed: false, + internalType: 'struct TokenConfig[]', + name: 'tokenConfig', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint32', + name: 'pauseWindowEndTime', + type: 'uint32', + }, + { + components: [ + { + internalType: 'address', + name: 'pauseManager', + type: 'address', + }, + { + internalType: 'address', + name: 'swapFeeManager', + type: 'address', + }, + { + internalType: 'address', + name: 'poolCreator', + type: 'address', + }, + ], + indexed: false, + internalType: 'struct PoolRoleAccounts', + name: 'roleAccounts', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bool', + name: 'enableHookAdjustedAmounts', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallComputeDynamicSwapFee', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'address', + name: 'hooksContract', + type: 'address', + }, + ], + indexed: false, + internalType: 'struct HooksConfig', + name: 'hooksConfig', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bool', + name: 'disableUnbalancedLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableAddLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableRemoveLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableDonation', + type: 'bool', + }, + ], + indexed: false, + internalType: 'struct LiquidityManagement', + name: 'liquidityManagement', + type: 'tuple', + }, + ], + name: 'PoolRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IProtocolFeeController', + name: 'newProtocolFeeController', + type: 'address', + }, + ], + name: 'ProtocolFeeControllerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeeAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'swapFeeToken', + type: 'address', + }, + ], + name: 'Swap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + ], + name: 'SwapFeePercentageChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'underlyingToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnedShares', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'withdrawnUnderlying', + type: 'uint256', + }, + ], + name: 'Unwrap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'VaultBuffersPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'VaultPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'VaultQueriesDisabled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'underlyingToken', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'depositedUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + ], + name: 'Wrap', + type: 'event', + }, + { stateMutability: 'payable', type: 'fallback' }, + { + inputs: [ + { internalType: 'address', name: 'token', type: 'address' }, + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + ], + name: 'allowance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'token', type: 'address' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { + components: [ + { + internalType: 'enum SwapKind', + name: 'kind', + type: 'uint8', + }, + { + internalType: 'uint256', + name: 'amountGivenScaled18', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'balancesScaled18', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'indexIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'indexOut', + type: 'uint256', + }, + { + internalType: 'address', + name: 'router', + type: 'address', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct PoolSwapParams', + name: 'swapParams', + type: 'tuple', + }, + ], + name: 'computeDynamicSwapFeePercentage', + outputs: [ + { + internalType: 'uint256', + name: 'dynamicSwapFeePercentage', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'contract IERC20', name: 'token', type: 'address' }, + ], + name: 'getAggregateSwapFeeAmount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'contract IERC20', name: 'token', type: 'address' }, + ], + name: 'getAggregateYieldFeeAmount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getBptRate', + outputs: [{ internalType: 'uint256', name: 'rate', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getCurrentLiveBalances', + outputs: [ + { + internalType: 'uint256[]', + name: 'balancesLiveScaled18', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getHooksConfig', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'enableHookAdjustedAmounts', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallComputeDynamicSwapFee', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'address', + name: 'hooksContract', + type: 'address', + }, + ], + internalType: 'struct HooksConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNonzeroDeltaCount', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolConfig', + outputs: [ + { + components: [ + { + components: [ + { + internalType: 'bool', + name: 'disableUnbalancedLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableAddLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableRemoveLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableDonation', + type: 'bool', + }, + ], + internalType: 'struct LiquidityManagement', + name: 'liquidityManagement', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'staticSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'aggregateSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'aggregateYieldFeePercentage', + type: 'uint256', + }, + { + internalType: 'uint40', + name: 'tokenDecimalDiffs', + type: 'uint40', + }, + { + internalType: 'uint32', + name: 'pauseWindowEndTime', + type: 'uint32', + }, + { + internalType: 'bool', + name: 'isPoolRegistered', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isPoolInitialized', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isPoolPaused', + type: 'bool', + }, + { + internalType: 'bool', + name: 'isPoolInRecoveryMode', + type: 'bool', + }, + ], + internalType: 'struct PoolConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolData', + outputs: [ + { + components: [ + { + internalType: 'PoolConfigBits', + name: 'poolConfigBits', + type: 'bytes32', + }, + { + internalType: 'contract IERC20[]', + name: 'tokens', + type: 'address[]', + }, + { + components: [ + { + internalType: 'enum TokenType', + name: 'tokenType', + type: 'uint8', + }, + { + internalType: 'contract IRateProvider', + name: 'rateProvider', + type: 'address', + }, + { + internalType: 'bool', + name: 'paysYieldFees', + type: 'bool', + }, + ], + internalType: 'struct TokenInfo[]', + name: 'tokenInfo', + type: 'tuple[]', + }, + { + internalType: 'uint256[]', + name: 'balancesRaw', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'balancesLiveScaled18', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'tokenRates', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'decimalScalingFactors', + type: 'uint256[]', + }, + ], + internalType: 'struct PoolData', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolPausedState', + outputs: [ + { internalType: 'bool', name: '', type: 'bool' }, + { internalType: 'uint32', name: '', type: 'uint32' }, + { internalType: 'uint32', name: '', type: 'uint32' }, + { internalType: 'address', name: '', type: 'address' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolRoleAccounts', + outputs: [ + { + components: [ + { + internalType: 'address', + name: 'pauseManager', + type: 'address', + }, + { + internalType: 'address', + name: 'swapFeeManager', + type: 'address', + }, + { + internalType: 'address', + name: 'poolCreator', + type: 'address', + }, + ], + internalType: 'struct PoolRoleAccounts', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolTokenInfo', + outputs: [ + { + internalType: 'contract IERC20[]', + name: 'tokens', + type: 'address[]', + }, + { + components: [ + { + internalType: 'enum TokenType', + name: 'tokenType', + type: 'uint8', + }, + { + internalType: 'contract IRateProvider', + name: 'rateProvider', + type: 'address', + }, + { + internalType: 'bool', + name: 'paysYieldFees', + type: 'bool', + }, + ], + internalType: 'struct TokenInfo[]', + name: 'tokenInfo', + type: 'tuple[]', + }, + { + internalType: 'uint256[]', + name: 'balancesRaw', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'lastBalancesLiveScaled18', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolTokenRates', + outputs: [ + { + internalType: 'uint256[]', + name: 'decimalScalingFactors', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'tokenRates', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getPoolTokens', + outputs: [ + { + internalType: 'contract IERC20[]', + name: 'tokens', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getProtocolFeeController', + outputs: [ + { + internalType: 'contract IProtocolFeeController', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'getReservesOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'getStaticSwapFeePercentage', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'getTokenDelta', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVaultAdmin', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { + internalType: 'contract IERC20[]', + name: 'tokens', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'exactAmountsIn', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minBptAmountOut', + type: 'uint256', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + name: 'initialize', + outputs: [{ internalType: 'uint256', name: 'bptAmountOut', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'isPoolInRecoveryMode', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'isPoolInitialized', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'isPoolPaused', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'isPoolRegistered', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isQueryDisabled', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isUnlocked', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'data', type: 'bytes' }], + name: 'quote', + outputs: [{ internalType: 'bytes', name: 'result', type: 'bytes' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'data', type: 'bytes' }], + name: 'quoteAndRevert', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'reentrancyGuardEntered', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { + components: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'enum TokenType', + name: 'tokenType', + type: 'uint8', + }, + { + internalType: 'contract IRateProvider', + name: 'rateProvider', + type: 'address', + }, + { + internalType: 'bool', + name: 'paysYieldFees', + type: 'bool', + }, + ], + internalType: 'struct TokenConfig[]', + name: 'tokenConfig', + type: 'tuple[]', + }, + { + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + internalType: 'uint32', + name: 'pauseWindowEndTime', + type: 'uint32', + }, + { internalType: 'bool', name: 'protocolFeeExempt', type: 'bool' }, + { + components: [ + { + internalType: 'address', + name: 'pauseManager', + type: 'address', + }, + { + internalType: 'address', + name: 'swapFeeManager', + type: 'address', + }, + { + internalType: 'address', + name: 'poolCreator', + type: 'address', + }, + ], + internalType: 'struct PoolRoleAccounts', + name: 'roleAccounts', + type: 'tuple', + }, + { + internalType: 'address', + name: 'poolHooksContract', + type: 'address', + }, + { + components: [ + { + internalType: 'bool', + name: 'disableUnbalancedLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableAddLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableRemoveLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableDonation', + type: 'bool', + }, + ], + internalType: 'struct LiquidityManagement', + name: 'liquidityManagement', + type: 'tuple', + }, + ], + name: 'registerPool', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'from', type: 'address' }, + { + internalType: 'uint256', + name: 'exactBptAmountIn', + type: 'uint256', + }, + ], + name: 'removeLiquidityRecovery', + outputs: [ + { + internalType: 'uint256[]', + name: 'amountsOutRaw', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'token', type: 'address' }], + name: 'totalSupply', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'vault', + outputs: [{ internalType: 'contract IVault', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { stateMutability: 'payable', type: 'receive' }, +] as const diff --git a/lib/modules/web3/contracts/abi/balancerV3VaultAbi.ts b/lib/modules/web3/contracts/abi/balancerV3VaultAbi.ts new file mode 100644 index 000000000..108637bf9 --- /dev/null +++ b/lib/modules/web3/contracts/abi/balancerV3VaultAbi.ts @@ -0,0 +1,1293 @@ +// TODO: replace with wagmi generated abi once vault v3 is deployed in all networks +export const balancerV3VaultAbi = [ + { + inputs: [ + { + internalType: 'contract IVaultExtension', + name: 'vaultExtension', + type: 'address', + }, + { + internalType: 'contract IAuthorizer', + name: 'authorizer', + type: 'address', + }, + { + internalType: 'contract IProtocolFeeController', + name: 'protocolFeeController', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [{ internalType: 'address', name: 'target', type: 'address' }], + name: 'AddressEmptyCode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], + name: 'AddressInsufficientBalance', + type: 'error', + }, + { inputs: [], name: 'AfterAddLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'AfterInitializeHookFailed', type: 'error' }, + { inputs: [], name: 'AfterRemoveLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'AfterSwapHookFailed', type: 'error' }, + { inputs: [], name: 'AllZeroInputs', type: 'error' }, + { inputs: [], name: 'AmountGivenZero', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'AmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'AmountOutBelowMin', + type: 'error', + }, + { inputs: [], name: 'BalanceNotSettled', type: 'error' }, + { inputs: [], name: 'BalanceOverflow', type: 'error' }, + { inputs: [], name: 'BeforeAddLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeInitializeHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeRemoveLiquidityHookFailed', type: 'error' }, + { inputs: [], name: 'BeforeSwapHookFailed', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'BptAmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'BptAmountOutBelowMin', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'BufferAlreadyInitialized', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'BufferNotInitialized', + type: 'error', + }, + { inputs: [], name: 'BufferSharesInvalidOwner', type: 'error' }, + { inputs: [], name: 'BufferSharesInvalidReceiver', type: 'error' }, + { + inputs: [{ internalType: 'uint256', name: 'totalSupply', type: 'uint256' }], + name: 'BufferTotalSupplyTooLow', + type: 'error', + }, + { inputs: [], name: 'CannotReceiveEth', type: 'error' }, + { inputs: [], name: 'CannotSwapSameToken', type: 'error' }, + { inputs: [], name: 'DoesNotSupportAddLiquidityCustom', type: 'error' }, + { inputs: [], name: 'DoesNotSupportDonation', type: 'error' }, + { inputs: [], name: 'DoesNotSupportRemoveLiquidityCustom', type: 'error' }, + { inputs: [], name: 'DoesNotSupportUnbalancedLiquidity', type: 'error' }, + { inputs: [], name: 'DynamicSwapFeeHookFailed', type: 'error' }, + { + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'allowance', type: 'uint256' }, + { internalType: 'uint256', name: 'needed', type: 'uint256' }, + ], + name: 'ERC20InsufficientAllowance', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'sender', type: 'address' }, + { internalType: 'uint256', name: 'balance', type: 'uint256' }, + { internalType: 'uint256', name: 'needed', type: 'uint256' }, + ], + name: 'ERC20InsufficientBalance', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'approver', type: 'address' }], + name: 'ERC20InvalidApprover', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'receiver', type: 'address' }], + name: 'ERC20InvalidReceiver', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], + name: 'ERC20InvalidSender', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'spender', type: 'address' }], + name: 'ERC20InvalidSpender', + type: 'error', + }, + { inputs: [], name: 'FailedInnerCall', type: 'error' }, + { inputs: [], name: 'FeePrecisionTooHigh', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'maxAmountIn', type: 'uint256' }, + ], + name: 'HookAdjustedAmountInAboveMax', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + { internalType: 'uint256', name: 'minAmountOut', type: 'uint256' }, + ], + name: 'HookAdjustedAmountOutBelowMin', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'uint256', name: 'limit', type: 'uint256' }, + ], + name: 'HookAdjustedSwapLimit', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'poolHooksContract', + type: 'address', + }, + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'poolFactory', type: 'address' }, + ], + name: 'HookRegistrationFailed', + type: 'error', + }, + { inputs: [], name: 'InputLengthMismatch', type: 'error' }, + { inputs: [], name: 'InvalidAddLiquidityKind', type: 'error' }, + { inputs: [], name: 'InvalidRemoveLiquidityKind', type: 'error' }, + { inputs: [], name: 'InvalidToken', type: 'error' }, + { inputs: [], name: 'InvalidTokenConfiguration', type: 'error' }, + { inputs: [], name: 'InvalidTokenType', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'InvalidUnderlyingToken', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'invariantRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxInvariantRatio', + type: 'uint256', + }, + ], + name: 'InvariantRatioAboveMax', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'invariantRatio', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'minInvariantRatio', + type: 'uint256', + }, + ], + name: 'InvariantRatioBelowMin', + type: 'error', + }, + { inputs: [], name: 'MaxTokens', type: 'error' }, + { inputs: [], name: 'MinTokens', type: 'error' }, + { inputs: [], name: 'MultipleNonZeroInputs', type: 'error' }, + { inputs: [], name: 'NotEnoughBufferShares', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'expectedUnderlyingAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualUnderlyingAmount', + type: 'uint256', + }, + ], + name: 'NotEnoughUnderlying', + type: 'error', + }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'expectedWrappedAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'actualWrappedAmount', + type: 'uint256', + }, + ], + name: 'NotEnoughWrapped', + type: 'error', + }, + { inputs: [], name: 'NotStaticCall', type: 'error' }, + { inputs: [], name: 'NotVaultDelegateCall', type: 'error' }, + { inputs: [], name: 'PauseBufferPeriodDurationTooLarge', type: 'error' }, + { inputs: [], name: 'PercentageAboveMax', type: 'error' }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolAlreadyInitialized', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolAlreadyRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolInRecoveryMode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotInRecoveryMode', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotInitialized', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotPaused', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolNotRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolPauseWindowExpired', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'pool', type: 'address' }], + name: 'PoolPaused', + type: 'error', + }, + { + inputs: [{ internalType: 'uint256', name: 'totalSupply', type: 'uint256' }], + name: 'PoolTotalSupplyTooLow', + type: 'error', + }, + { inputs: [], name: 'ProtocolFeesExceedTotalCollected', type: 'error' }, + { inputs: [], name: 'QueriesDisabled', type: 'error' }, + { inputs: [], name: 'QuoteResultSpoofed', type: 'error' }, + { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' }, + { inputs: [], name: 'RouterNotTrusted', type: 'error' }, + { + inputs: [{ internalType: 'uint256', name: 'value', type: 'uint256' }], + name: 'SafeCastOverflowedUintToInt', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'token', type: 'address' }], + name: 'SafeERC20FailedOperation', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'sender', type: 'address' }], + name: 'SenderIsNotVault', + type: 'error', + }, + { inputs: [], name: 'SwapFeePercentageTooHigh', type: 'error' }, + { inputs: [], name: 'SwapFeePercentageTooLow', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'uint256', name: 'limit', type: 'uint256' }, + ], + name: 'SwapLimit', + type: 'error', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'TokenAlreadyRegistered', + type: 'error', + }, + { + inputs: [{ internalType: 'contract IERC20', name: 'token', type: 'address' }], + name: 'TokenNotRegistered', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'expectedToken', type: 'address' }, + { internalType: 'address', name: 'actualToken', type: 'address' }, + ], + name: 'TokensMismatch', + type: 'error', + }, + { inputs: [], name: 'TradeAmountTooSmall', type: 'error' }, + { inputs: [], name: 'VaultBuffersArePaused', type: 'error' }, + { inputs: [], name: 'VaultIsNotUnlocked', type: 'error' }, + { inputs: [], name: 'VaultNotPaused', type: 'error' }, + { inputs: [], name: 'VaultPauseWindowDurationTooLarge', type: 'error' }, + { inputs: [], name: 'VaultPauseWindowExpired', type: 'error' }, + { inputs: [], name: 'VaultPaused', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + ], + name: 'WrapAmountTooSmall', + type: 'error', + }, + { inputs: [], name: 'WrongProtocolFeeControllerDeployment', type: 'error' }, + { + inputs: [ + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'address', + name: 'underlyingToken', + type: 'address', + }, + ], + name: 'WrongUnderlyingToken', + type: 'error', + }, + { inputs: [], name: 'WrongVaultAdminDeployment', type: 'error' }, + { inputs: [], name: 'WrongVaultExtensionDeployment', type: 'error' }, + { inputs: [], name: 'ZeroDivision', type: 'error' }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IAuthorizer', + name: 'newAuthorizer', + type: 'address', + }, + ], + name: 'AuthorizerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnedShares', + type: 'uint256', + }, + ], + name: 'BufferSharesBurned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'issuedShares', + type: 'uint256', + }, + ], + name: 'BufferSharesMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWrapped', + type: 'uint256', + }, + ], + name: 'LiquidityAddedToBuffer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountWrapped', + type: 'uint256', + }, + ], + name: 'LiquidityRemovedFromBuffer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'liquidityProvider', + type: 'address', + }, + { + indexed: false, + internalType: 'int256[]', + name: 'deltas', + type: 'int256[]', + }, + ], + name: 'PoolBalanceChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + ], + name: 'PoolInitialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'PoolPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'recoveryMode', + type: 'bool', + }, + ], + name: 'PoolRecoveryModeStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'factory', + type: 'address', + }, + { + components: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'enum TokenType', + name: 'tokenType', + type: 'uint8', + }, + { + internalType: 'contract IRateProvider', + name: 'rateProvider', + type: 'address', + }, + { + internalType: 'bool', + name: 'paysYieldFees', + type: 'bool', + }, + ], + indexed: false, + internalType: 'struct TokenConfig[]', + name: 'tokenConfig', + type: 'tuple[]', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint32', + name: 'pauseWindowEndTime', + type: 'uint32', + }, + { + components: [ + { + internalType: 'address', + name: 'pauseManager', + type: 'address', + }, + { + internalType: 'address', + name: 'swapFeeManager', + type: 'address', + }, + { + internalType: 'address', + name: 'poolCreator', + type: 'address', + }, + ], + indexed: false, + internalType: 'struct PoolRoleAccounts', + name: 'roleAccounts', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bool', + name: 'enableHookAdjustedAmounts', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterInitialize', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallComputeDynamicSwapFee', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterSwap', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterAddLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallBeforeRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'shouldCallAfterRemoveLiquidity', + type: 'bool', + }, + { + internalType: 'address', + name: 'hooksContract', + type: 'address', + }, + ], + indexed: false, + internalType: 'struct HooksConfig', + name: 'hooksConfig', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bool', + name: 'disableUnbalancedLiquidity', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableAddLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableRemoveLiquidityCustom', + type: 'bool', + }, + { + internalType: 'bool', + name: 'enableDonation', + type: 'bool', + }, + ], + indexed: false, + internalType: 'struct LiquidityManagement', + name: 'liquidityManagement', + type: 'tuple', + }, + ], + name: 'PoolRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IProtocolFeeController', + name: 'newProtocolFeeController', + type: 'address', + }, + ], + name: 'ProtocolFeeControllerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountOut', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeeAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'swapFeeToken', + type: 'address', + }, + ], + name: 'Swap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + ], + name: 'SwapFeePercentageChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pool', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC20', + name: 'underlyingToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'burnedShares', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'withdrawnUnderlying', + type: 'uint256', + }, + ], + name: 'Unwrap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'VaultBuffersPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'VaultPausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'VaultQueriesDisabled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IERC20', + name: 'underlyingToken', + type: 'address', + }, + { + indexed: true, + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'depositedUnderlying', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + ], + name: 'Wrap', + type: 'event', + }, + { stateMutability: 'payable', type: 'fallback' }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { + internalType: 'uint256[]', + name: 'maxAmountsIn', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'minBptAmountOut', + type: 'uint256', + }, + { + internalType: 'enum AddLiquidityKind', + name: 'kind', + type: 'uint8', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct AddLiquidityParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'addLiquidity', + outputs: [ + { internalType: 'uint256[]', name: 'amountsIn', type: 'uint256[]' }, + { internalType: 'uint256', name: 'bptAmountOut', type: 'uint256' }, + { internalType: 'bytes', name: 'returnData', type: 'bytes' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'enum SwapKind', + name: 'kind', + type: 'uint8', + }, + { + internalType: 'enum WrappingDirection', + name: 'direction', + type: 'uint8', + }, + { + internalType: 'contract IERC4626', + name: 'wrappedToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountGivenRaw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'limitRaw', + type: 'uint256', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct BufferWrapOrUnwrapParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'erc4626BufferWrapOrUnwrap', + outputs: [ + { + internalType: 'uint256', + name: 'amountCalculatedRaw', + type: 'uint256', + }, + { internalType: 'uint256', name: 'amountInRaw', type: 'uint256' }, + { internalType: 'uint256', name: 'amountOutRaw', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getAuthorizer', + outputs: [{ internalType: 'contract IAuthorizer', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'contract IERC20', name: 'token', type: 'address' }, + ], + name: 'getPoolTokenCountAndIndexOfToken', + outputs: [ + { internalType: 'uint256', name: '', type: 'uint256' }, + { internalType: 'uint256', name: '', type: 'uint256' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVaultExtension', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'reentrancyGuardEntered', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'pool', type: 'address' }, + { internalType: 'address', name: 'from', type: 'address' }, + { + internalType: 'uint256', + name: 'maxBptAmountIn', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'minAmountsOut', + type: 'uint256[]', + }, + { + internalType: 'enum RemoveLiquidityKind', + name: 'kind', + type: 'uint8', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct RemoveLiquidityParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'removeLiquidity', + outputs: [ + { internalType: 'uint256', name: 'bptAmountIn', type: 'uint256' }, + { + internalType: 'uint256[]', + name: 'amountsOut', + type: 'uint256[]', + }, + { internalType: 'bytes', name: 'returnData', type: 'bytes' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'contract IERC20', name: 'token', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'sendTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'contract IERC20', name: 'token', type: 'address' }, + { internalType: 'uint256', name: 'amountHint', type: 'uint256' }, + ], + name: 'settle', + outputs: [{ internalType: 'uint256', name: 'credit', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'enum SwapKind', + name: 'kind', + type: 'uint8', + }, + { internalType: 'address', name: 'pool', type: 'address' }, + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amountGivenRaw', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'limitRaw', + type: 'uint256', + }, + { internalType: 'bytes', name: 'userData', type: 'bytes' }, + ], + internalType: 'struct VaultSwapParams', + name: 'vaultSwapParams', + type: 'tuple', + }, + ], + name: 'swap', + outputs: [ + { + internalType: 'uint256', + name: 'amountCalculated', + type: 'uint256', + }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bytes', name: 'data', type: 'bytes' }], + name: 'unlock', + outputs: [{ internalType: 'bytes', name: 'result', type: 'bytes' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { stateMutability: 'payable', type: 'receive' }, +] as const diff --git a/lib/modules/web3/contracts/useMulticall.integration.spec.ts b/lib/modules/web3/contracts/useMulticall.integration.spec.ts index afb0e8aa0..9130587d9 100644 --- a/lib/modules/web3/contracts/useMulticall.integration.spec.ts +++ b/lib/modules/web3/contracts/useMulticall.integration.spec.ts @@ -35,7 +35,7 @@ describe('Performs multicall in multiple chains', () => { expect(result.current.results[mainnet.id].data).toMatchInlineSnapshot(` { "ethBalance": { - "result": 0n, + "result": 1n, "status": "success", }, } diff --git a/package.json b/package.json index ab8cc475c..88eaa8dc3 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "dependencies": { "@apollo/client": "^3.11.8", - "@balancer/sdk": "^0.25.0", + "@balancer/sdk": "^0.26.0", "@chakra-ui/anatomy": "^2.2.2", "@chakra-ui/hooks": "^2.2.1", "@chakra-ui/icons": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e830e0fb..3f032dfd2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^3.11.8 version: 3.11.8(@types/react@18.2.34)(graphql-ws@5.14.1(graphql@16.8.1))(graphql@16.8.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@balancer/sdk': - specifier: ^0.25.0 - version: 0.25.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) + specifier: ^0.26.0 + version: 0.26.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) '@chakra-ui/anatomy': specifier: ^2.2.2 version: 2.2.2 @@ -49,7 +49,7 @@ importers: version: 1.2.1(@chakra-ui/react@2.8.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(framer-motion@10.16.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0) '@rainbow-me/rainbowkit': specifier: ^2.1.6 - version: 2.1.6(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.29.0)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) + version: 2.1.6(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)) '@sentry/nextjs': specifier: ^8.13.0 version: 8.13.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@1.25.1(@opentelemetry/api@1.9.0))(@opentelemetry/instrumentation@0.52.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.25.1(@opentelemetry/api@1.9.0))(@opentelemetry/semantic-conventions@1.25.1)(next@14.2.0(@babel/core@7.23.5)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(webpack@5.91.0(esbuild@0.19.8)(webpack-cli@5.1.4)) @@ -73,7 +73,7 @@ importers: version: 9.1.2 chakra-react-select: specifier: ^4.7.6 - version: 4.7.6(@chakra-ui/form-control@2.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/icon@3.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/layout@2.3.1(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/media-query@3.3.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/menu@2.2.1(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(framer-motion@10.16.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/spinner@2.1.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 4.7.6(tpxrkqumplwq6zwmz6cptryacu) date-fns: specifier: ^2.30.0 version: 2.30.0 @@ -169,7 +169,7 @@ importers: version: 2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) wagmi: specifier: ^2.12.11 - version: 2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.29.0)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) + version: 2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) devDependencies: '@apollo/experimental-nextjs-app-support': specifier: ^0.11.3 @@ -1311,8 +1311,8 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} - '@balancer/sdk@0.25.0': - resolution: {integrity: sha512-y0tzJ/4LaFZeMnE9CqcVdq3StDvzjBAnsyKOK1plQYDHsxD/U2O07z2CK2T45YgxbXLqMPLKrKzqZcuyi8Pi9Q==} + '@balancer/sdk@0.26.0': + resolution: {integrity: sha512-FgYUiCCL1vL1r7qI6rQFZLc+3o0uvBAUYNo2sYtyFLfEQEJLI6WRlx0KfdNR361rcW9Ra4emDw8wEHY5GJ+I6w==} engines: {node: '>=18.x'} '@bcoe/v8-coverage@0.2.3': @@ -3683,9 +3683,6 @@ packages: '@swc/helpers@0.5.5': resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==} - '@tanstack/query-core@5.29.0': - resolution: {integrity: sha512-WgPTRs58hm9CMzEr5jpISe8HXa3qKQ8CxewdYZeVnA54JrPY9B1CZiwsCoLpLkf0dGRZq+LcX5OiJb0bEsOFww==} - '@tanstack/query-core@5.56.2': resolution: {integrity: sha512-gor0RI3/R5rVV3gXfddh1MM+hgl0Z4G7tj6Xxpq6p2I03NGPaJ8dITY9Gz05zYYb/EJq9vPas/T4wn9EaDPd4Q==} @@ -9620,7 +9617,7 @@ snapshots: '@babel/core': 7.23.5 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.0 - debug: 4.3.4 + debug: 4.3.7 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -10670,7 +10667,7 @@ snapshots: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - '@balancer/sdk@0.25.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)': + '@balancer/sdk@0.26.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)': dependencies: decimal.js-light: 2.5.1 lodash.clonedeep: 4.5.0 @@ -12654,7 +12651,7 @@ snapshots: dependencies: '@ethereumjs/tx': 4.2.0 '@types/debug': 4.1.10 - debug: 4.3.4 + debug: 4.3.7 semver: 7.5.4 superstruct: 1.0.3 transitivePeerDependencies: @@ -13102,7 +13099,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@rainbow-me/rainbowkit@2.1.6(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.29.0)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))': + '@rainbow-me/rainbowkit@2.1.6(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(babel-plugin-macros@3.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))': dependencies: '@tanstack/react-query': 5.56.2(react@18.2.0) '@vanilla-extract/css': 1.15.5(babel-plugin-macros@3.1.0) @@ -13115,7 +13112,7 @@ snapshots: react-remove-scroll: 2.6.0(@types/react@18.2.34)(react@18.2.0) ua-parser-js: 1.0.37 viem: 2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) - wagmi: 2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.29.0)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) + wagmi: 2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) transitivePeerDependencies: - '@types/react' - babel-plugin-macros @@ -13843,9 +13840,6 @@ snapshots: '@swc/counter': 0.1.3 tslib: 2.6.2 - '@tanstack/query-core@5.29.0': - optional: true - '@tanstack/query-core@5.56.2': {} '@tanstack/query-devtools@5.55.1': {} @@ -14373,13 +14367,13 @@ snapshots: - bufferutil - utf-8-validate - '@wagmi/connectors@5.1.10(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@types/react@18.2.34)(@wagmi/core@2.13.5(@tanstack/query-core@5.29.0)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)': + '@wagmi/connectors@5.1.10(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@types/react@18.2.34)(@wagmi/core@2.13.5(@tanstack/query-core@5.56.2)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)': dependencies: '@coinbase/wallet-sdk': 4.0.4 '@metamask/sdk': 0.28.2(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(utf-8-validate@5.0.10) '@safe-global/safe-apps-provider': 0.18.3(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) '@safe-global/safe-apps-sdk': 9.1.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) - '@wagmi/core': 2.13.5(@tanstack/query-core@5.29.0)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)) + '@wagmi/core': 2.13.5(@tanstack/query-core@5.56.2)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)) '@walletconnect/ethereum-provider': 2.16.1(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@types/react@18.2.34)(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10) '@walletconnect/modal': 2.6.2(@types/react@18.2.34)(react@18.2.0) cbw-sdk: '@coinbase/wallet-sdk@3.9.3' @@ -14418,14 +14412,14 @@ snapshots: - webpack-dev-server - zod - '@wagmi/core@2.13.5(@tanstack/query-core@5.29.0)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))': + '@wagmi/core@2.13.5(@tanstack/query-core@5.56.2)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))': dependencies: eventemitter3: 5.0.1 mipd: 0.0.7(typescript@5.4.5) viem: 2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) zustand: 4.4.1(@types/react@18.2.34)(react@18.2.0) optionalDependencies: - '@tanstack/query-core': 5.29.0 + '@tanstack/query-core': 5.56.2 typescript: 5.4.5 transitivePeerDependencies: - '@types/react' @@ -15384,8 +15378,8 @@ snapshots: loupe: 3.1.1 pathval: 2.0.0 - ? chakra-react-select@4.7.6(@chakra-ui/form-control@2.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/icon@3.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/layout@2.3.1(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/media-query@3.3.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/menu@2.2.1(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(framer-motion@10.16.4(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/spinner@2.1.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0))(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - : dependencies: + chakra-react-select@4.7.6(tpxrkqumplwq6zwmz6cptryacu): + dependencies: '@chakra-ui/form-control': 2.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0) '@chakra-ui/icon': 3.2.0(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0) '@chakra-ui/layout': 2.3.1(@chakra-ui/system@2.6.2(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.2.34)(react@18.2.0))(@types/react@18.2.34)(react@18.2.0))(react@18.2.0))(react@18.2.0) @@ -20231,11 +20225,11 @@ snapshots: vlq@1.0.1: {} - wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.29.0)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4): + wagmi@2.12.11(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.34)(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4): dependencies: '@tanstack/react-query': 5.56.2(react@18.2.0) - '@wagmi/connectors': 5.1.10(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@types/react@18.2.34)(@wagmi/core@2.13.5(@tanstack/query-core@5.29.0)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) - '@wagmi/core': 2.13.5(@tanstack/query-core@5.29.0)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)) + '@wagmi/connectors': 5.1.10(@react-native-async-storage/async-storage@1.23.1(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10)))(@types/react@18.2.34)(@wagmi/core@2.13.5(@tanstack/query-core@5.56.2)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.8)(esbuild@0.19.8)(react-dom@18.2.0(react@18.2.0))(react-native@0.73.7(@babel/core@7.23.5)(@babel/preset-env@7.24.4(@babel/core@7.23.5))(bufferutil@4.0.8)(react@18.2.0)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@3.29.4)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) + '@wagmi/core': 2.13.5(@tanstack/query-core@5.56.2)(@types/react@18.2.34)(react@18.2.0)(typescript@5.4.5)(viem@2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)) react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) viem: 2.21.6(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) diff --git a/test/anvil/anvil-setup.ts b/test/anvil/anvil-setup.ts index 3b2030965..7113a1918 100644 --- a/test/anvil/anvil-setup.ts +++ b/test/anvil/anvil-setup.ts @@ -50,9 +50,8 @@ export const ANVIL_NETWORKS: Record = { port: ANVIL_PORTS.Ethereum, // From time to time this block gets outdated having this kind of error in integration tests: // ContractFunctionExecutionError: The contract function "queryJoin" returned no data ("0x"). - // forkBlockNumber: 19769489n, - // forkBlockNumber: 20061849n, - forkBlockNumber: 20474895n, + // forkBlockNumber: 20474895n, + forkBlockNumber: 20777062n, }, Polygon: { networkName: 'Polygon', @@ -66,7 +65,7 @@ export const ANVIL_NETWORKS: Record = { fallBackRpc: 'https://gateway.tenderly.co/public/sepolia', port: ANVIL_PORTS.Sepolia, // For now we will use the last block until v3 deployments are final - // forkBlockNumber: , + // forkBlockNumber: 6679621n, }, }