From 25118528554ba3ec9bbdbf5b3bb09a563c394502 Mon Sep 17 00:00:00 2001 From: mendesfabio Date: Thu, 24 Oct 2024 10:07:11 -0300 Subject: [PATCH] update to deployment 10 --- README.md | 12 +- networks.json | 12 +- pnpm-lock.yaml | 13 + scripts/generate-manifests.js | 2 +- subgraphs/v3-pools/src/mappings/weighted.ts | 2 +- subgraphs/v3-pools/template.yaml | 8 +- .../v3-vault/abis/ProtocolFeeController.json | 314 +--- subgraphs/v3-vault/abis/Vault.json | 931 +++--------- subgraphs/v3-vault/abis/VaultExtension.json | 1278 +++-------------- subgraphs/v3-vault/schema.graphql | 9 + subgraphs/v3-vault/src/mappings/vault.ts | 59 +- subgraphs/v3-vault/template.yaml | 8 +- 12 files changed, 570 insertions(+), 2078 deletions(-) diff --git a/README.md b/README.md index c5fd542..a221873 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ This repository contains the subgraph implementations for Balancer v3, including ## Preliminary Deployments -| Subgraph | Version | Endpoint | -| -------- | ------- | ---------------------------------------------------------------------------------------- | -| Vault | 8th | https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-8th/version/latest | -| Pools | 8th | https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-8th/version/latest | -| Vault | 7th | https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-7th/version/latest | -| Pools | 7th | https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-7th/version/latest | +| Subgraph | Version | Endpoint | +| -------- | ------- | ----------------------------------------------------------------------------------------- | +| Vault | 10 | https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-10th/version/latest | +| Pools | 10 | https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-10th/version/latest | +| Vault | 9th | https://api.studio.thegraph.com/query/31386/balancer-v3-sepolia-9th/version/latest | +| Pools | 9th | https://api.studio.thegraph.com/query/31386/balancer-pools-v3-sepolia-9th/version/latest | ## Prerequisites diff --git a/networks.json b/networks.json index 59a6506..34b4bb2 100644 --- a/networks.json +++ b/networks.json @@ -1,16 +1,16 @@ { "sepolia": { "Vault": { - "address": "0x0EF1c156a7986F394d90eD1bEeA6483Cc435F542", - "startBlock": 6638943 + "address": "0x68aD967ae8393B722EC69dB1018Ec28AF9A34493", + "startBlock": 6924029 }, "WeightedPoolFactory": { - "address": "0x7c5E586ed4EC1793a6076FC0Dcad03Ca2442f7F8", - "startBlock": 6638995 + "address": "0x4F12F60148F98aD920b99e844807F0e245f2AE58", + "startBlock": 6924094 }, "StablePoolFactory": { - "address": "0x2a55364B7948a460f9DEfFFc4440cB838A10dc26", - "startBlock": 6639020 + "address": "0xD895059a81711e4955823ED2C0755F204A86E5DA", + "startBlock": 6924116 } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7a2829..a0eba1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,19 @@ importers: specifier: 0.5.0 version: 0.5.0 + subgraphs/v2-pools: + dependencies: + '@graphprotocol/graph-cli': + specifier: 0.66.0 + version: 0.66.0(@types/node@22.5.0)(node-fetch@3.3.2)(typescript@5.5.4) + '@graphprotocol/graph-ts': + specifier: 0.32.0 + version: 0.32.0 + devDependencies: + matchstick-as: + specifier: 0.5.0 + version: 0.5.0 + subgraphs/v2-vault: dependencies: '@graphprotocol/graph-cli': diff --git a/scripts/generate-manifests.js b/scripts/generate-manifests.js index edcfe9f..5ab57bf 100644 --- a/scripts/generate-manifests.js +++ b/scripts/generate-manifests.js @@ -15,7 +15,7 @@ function replacePlaceholders(template, network, networkData) { return result; } -['pools', 'vault'].forEach(subgraph => { +['v3-pools', 'v3-vault'].forEach(subgraph => { const templatePath = path.join('subgraphs', subgraph, 'template.yaml'); if (!fs.existsSync(templatePath)) { diff --git a/subgraphs/v3-pools/src/mappings/weighted.ts b/subgraphs/v3-pools/src/mappings/weighted.ts index c84f22f..ab71e6c 100644 --- a/subgraphs/v3-pools/src/mappings/weighted.ts +++ b/subgraphs/v3-pools/src/mappings/weighted.ts @@ -26,6 +26,6 @@ export function handleWeightedPoolCreated(event: PoolCreated): void { PoolType.Weighted, 1, handleWeightedPoolParams, - "stableParams" + "weightedParams" ); } diff --git a/subgraphs/v3-pools/template.yaml b/subgraphs/v3-pools/template.yaml index f05d402..d717f6a 100644 --- a/subgraphs/v3-pools/template.yaml +++ b/subgraphs/v3-pools/template.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: WeightedPoolFactory - network: { { network } } + network: {{ network }} source: abi: BasePoolFactory address: "{{ WeightedPoolFactory.address }}" - startBlock: { { WeightedPoolFactory.startBlock } } + startBlock: {{ WeightedPoolFactory.startBlock }} mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -27,11 +27,11 @@ dataSources: file: ./src/mappings/weighted.ts - kind: ethereum name: StablePoolFactory - network: { { network } } + network: {{ network }} source: abi: BasePoolFactory address: "{{ StablePoolFactory.address }}" - startBlock: { { StablePoolFactory.startBlock } } + startBlock: {{ StablePoolFactory.startBlock }} mapping: kind: ethereum/events apiVersion: 0.0.7 diff --git a/subgraphs/v3-vault/abis/ProtocolFeeController.json b/subgraphs/v3-vault/abis/ProtocolFeeController.json index 0b26a4b..ef24dab 100644 --- a/subgraphs/v3-vault/abis/ProtocolFeeController.json +++ b/subgraphs/v3-vault/abis/ProtocolFeeController.json @@ -1,142 +1,74 @@ [ { "inputs": [ - { - "internalType": "contract IVault", - "name": "vault_", - "type": "address" - } + { "internalType": "contract IVault", "name": "vault_", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } + { "internalType": "address", "name": "target", "type": "address" } ], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "address", "name": "account", "type": "address" } ], "name": "AddressInsufficientBalance", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "caller", "type": "address" }, + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "CallerIsNotPoolCreator", "type": "error" }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [], - "name": "FeePrecisionTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "PoolCreatorFeePercentageTooHigh", - "type": "error" - }, + { "inputs": [], "name": "FailedInnerCall", "type": "error" }, + { "inputs": [], "name": "FeePrecisionTooHigh", "type": "error" }, + { "inputs": [], "name": "PoolCreatorFeePercentageTooHigh", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolCreatorNotRegistered", "type": "error" }, - { - "inputs": [], - "name": "ProtocolSwapFeePercentageTooHigh", - "type": "error" - }, + { "inputs": [], "name": "ProtocolSwapFeePercentageTooHigh", "type": "error" }, { "inputs": [], "name": "ProtocolYieldFeePercentageTooHigh", "type": "error" }, - { - "inputs": [], - "name": "ReentrancyGuardReentrantCall", - "type": "error" - }, + { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "inputs": [ - { - "internalType": "uint8", - "name": "bits", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } + { "internalType": "uint8", "name": "bits", "type": "uint8" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "SafeCastOverflowedUintDowncast", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "token", "type": "address" } ], "name": "SafeERC20FailedOperation", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } + { "internalType": "address", "name": "sender", "type": "address" } ], "name": "SenderIsNotVault", "type": "error" }, - { - "inputs": [], - "name": "SenderNotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroDivision", - "type": "error" - }, + { "inputs": [], "name": "SenderNotAllowed", "type": "error" }, + { "inputs": [], "name": "ZeroDivision", "type": "error" }, { "anonymous": false, "inputs": [ @@ -353,11 +285,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "collectAggregateFees", "outputs": [], @@ -366,11 +294,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "collectAggregateFeesHook", "outputs": [], @@ -391,32 +315,16 @@ } ], "name": "computeAggregateFeePercentage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "pure", "type": "function" }, { "inputs": [ - { - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - } + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } ], "name": "getActionId", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, @@ -424,11 +332,7 @@ "inputs": [], "name": "getAuthorizer", "outputs": [ - { - "internalType": "contract IAuthorizer", - "name": "", - "type": "address" - } + { "internalType": "contract IAuthorizer", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" @@ -436,111 +340,59 @@ { "inputs": [], "name": "getGlobalProtocolSwapFeePercentage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getGlobalProtocolYieldFeePercentage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolCreatorFeeAmounts", "outputs": [ - { - "internalType": "uint256[]", - "name": "feeAmounts", - "type": "uint256[]" - } + { "internalType": "uint256[]", "name": "feeAmounts", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolProtocolSwapFeeInfo", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolProtocolYieldFeeInfo", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getProtocolFeeAmounts", "outputs": [ - { - "internalType": "uint256[]", - "name": "feeAmounts", - "type": "uint256[]" - } + { "internalType": "uint256[]", "name": "feeAmounts", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" @@ -549,32 +401,16 @@ "inputs": [], "name": "getVault", "outputs": [ - { - "internalType": "contract IVault", - "name": "", - "type": "address" - } + { "internalType": "contract IVault", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "poolCreator", - "type": "address" - }, - { - "internalType": "bool", - "name": "protocolFeeExempt", - "type": "bool" - } + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "poolCreator", "type": "address" }, + { "internalType": "bool", "name": "protocolFeeExempt", "type": "bool" } ], "name": "registerPool", "outputs": [ @@ -620,11 +456,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "poolCreatorSwapFeePercentage", @@ -638,11 +470,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "poolCreatorYieldFeePercentage", @@ -656,11 +484,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "newProtocolSwapFeePercentage", @@ -674,11 +498,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "newProtocolYieldFeePercentage", @@ -692,11 +512,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "updateProtocolSwapFeePercentage", "outputs": [], @@ -705,11 +521,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "updateProtocolYieldFeePercentage", "outputs": [], @@ -720,22 +532,14 @@ "inputs": [], "name": "vault", "outputs": [ - { - "internalType": "contract IVault", - "name": "", - "type": "address" - } + { "internalType": "contract IVault", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "withdrawPoolCreatorFees", "outputs": [], @@ -744,16 +548,8 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "withdrawPoolCreatorFees", "outputs": [], @@ -762,16 +558,8 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "withdrawProtocolFees", "outputs": [], diff --git a/subgraphs/v3-vault/abis/Vault.json b/subgraphs/v3-vault/abis/Vault.json index 45e7042..4a0a5ba 100644 --- a/subgraphs/v3-vault/abis/Vault.json +++ b/subgraphs/v3-vault/abis/Vault.json @@ -22,56 +22,24 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } + { "internalType": "address", "name": "target", "type": "address" } ], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "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": [], "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": [ { @@ -79,16 +47,8 @@ "name": "tokenIn", "type": "address" }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAmountIn", - "type": "uint256" - } + { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { "internalType": "uint256", "name": "maxAmountIn", "type": "uint256" } ], "name": "AmountInAboveMax", "type": "error" @@ -100,78 +60,30 @@ "name": "tokenOut", "type": "address" }, - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - } + { "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": [], "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" - } + { "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" - } + { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, + { "internalType": "uint256", "name": "minAmountOut", "type": "uint256" } ], "name": "BptAmountOutBelowMin", "type": "error" @@ -198,47 +110,19 @@ "name": "BufferNotInitialized", "type": "error" }, - { - "inputs": [], - "name": "BufferSharesInvalidOwner", - "type": "error" - }, - { - "inputs": [], - "name": "BufferSharesInvalidReceiver", - "type": "error" - }, + { "inputs": [], "name": "BufferSharesInvalidOwner", "type": "error" }, + { "inputs": [], "name": "BufferSharesInvalidReceiver", "type": "error" }, { "inputs": [ - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - } + { "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": "CannotReceiveEth", "type": "error" }, + { "inputs": [], "name": "CannotSwapSameToken", "type": "error" }, + { "inputs": [], "name": "DoesNotSupportAddLiquidityCustom", "type": "error" }, + { "inputs": [], "name": "DoesNotSupportDonation", "type": "error" }, { "inputs": [], "name": "DoesNotSupportRemoveLiquidityCustom", @@ -249,107 +133,55 @@ "name": "DoesNotSupportUnbalancedLiquidity", "type": "error" }, - { - "inputs": [], - "name": "DynamicSwapFeeHookFailed", - "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" - } + { "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" - } + { "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" - } + { "internalType": "address", "name": "approver", "type": "address" } ], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } + { "internalType": "address", "name": "receiver", "type": "address" } ], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } + { "internalType": "address", "name": "sender", "type": "address" } ], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - } + { "internalType": "address", "name": "spender", "type": "address" } ], "name": "ERC20InvalidSpender", "type": "error" }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [], - "name": "FeePrecisionTooHigh", - "type": "error" - }, + { "inputs": [], "name": "FailedInnerCall", "type": "error" }, + { "inputs": [], "name": "FeePrecisionTooHigh", "type": "error" }, { "inputs": [ { @@ -357,16 +189,8 @@ "name": "tokenIn", "type": "address" }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAmountIn", - "type": "uint256" - } + { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { "internalType": "uint256", "name": "maxAmountIn", "type": "uint256" } ], "name": "HookAdjustedAmountInAboveMax", "type": "error" @@ -378,32 +202,16 @@ "name": "tokenOut", "type": "address" }, - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - } + { "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" - } + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "HookAdjustedSwapLimit", "type": "error" @@ -415,50 +223,19 @@ "name": "poolHooksContract", "type": "address" }, - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "poolFactory", - "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": [], "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": "InvalidTokenDecimals", "type": "error" }, + { "inputs": [], "name": "InvalidTokenType", "type": "error" }, { "inputs": [ { @@ -502,26 +279,10 @@ "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": [], "name": "MaxTokens", "type": "error" }, + { "inputs": [], "name": "MinTokens", "type": "error" }, + { "inputs": [], "name": "MultipleNonZeroInputs", "type": "error" }, + { "inputs": [], "name": "NotEnoughBufferShares", "type": "error" }, { "inputs": [ { @@ -564,309 +325,155 @@ "name": "NotEnoughWrapped", "type": "error" }, - { - "inputs": [], - "name": "NotStaticCall", - "type": "error" - }, - { - "inputs": [], - "name": "NotVaultDelegateCall", - "type": "error" - }, + { "inputs": [], "name": "NotStaticCall", "type": "error" }, + { "inputs": [], "name": "NotVaultDelegateCall", "type": "error" }, { "inputs": [], "name": "PauseBufferPeriodDurationTooLarge", "type": "error" }, - { - "inputs": [], - "name": "PercentageAboveMax", - "type": "error" - }, + { "inputs": [], "name": "PercentageAboveMax", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "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": "int256", - "name": "value", - "type": "int256" - } - ], - "name": "SafeCastOverflowedIntToUint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "SafeCastOverflowedUintToInt", + "name": "PoolAlreadyRegistered", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "SafeERC20FailedOperation", + "name": "PoolInRecoveryMode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "SenderIsNotVault", + "name": "PoolNotInRecoveryMode", "type": "error" }, { - "inputs": [], - "name": "SwapFeePercentageTooHigh", + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } + ], + "name": "PoolNotInitialized", "type": "error" }, { - "inputs": [], - "name": "SwapFeePercentageTooLow", + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } + ], + "name": "PoolNotPaused", "type": "error" }, { "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "limit", - "type": "uint256" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "SwapLimit", + "name": "PoolNotRegistered", "type": "error" }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "TokenAlreadyRegistered", + "name": "PoolPauseWindowExpired", "type": "error" }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "TokenNotRegistered", + "name": "PoolPaused", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedToken", - "type": "address" - }, - { - "internalType": "address", - "name": "actualToken", - "type": "address" - } + { "internalType": "uint256", "name": "totalSupply", "type": "uint256" } ], - "name": "TokensMismatch", + "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": [], - "name": "TradeAmountTooSmall", + "inputs": [{ "internalType": "int256", "name": "value", "type": "int256" }], + "name": "SafeCastOverflowedIntToUint", "type": "error" }, { - "inputs": [], - "name": "VaultBuffersArePaused", + "inputs": [ + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "SafeCastOverflowedUintToInt", "type": "error" }, { - "inputs": [], - "name": "VaultIsNotUnlocked", + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" } + ], + "name": "SafeERC20FailedOperation", "type": "error" }, { - "inputs": [], - "name": "VaultNotPaused", + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "SenderIsNotVault", "type": "error" }, + { "inputs": [], "name": "SwapFeePercentageTooHigh", "type": "error" }, + { "inputs": [], "name": "SwapFeePercentageTooLow", "type": "error" }, { - "inputs": [], - "name": "VaultPauseWindowDurationTooLarge", + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "limit", "type": "uint256" } + ], + "name": "SwapLimit", "type": "error" }, { - "inputs": [], - "name": "VaultPauseWindowExpired", + "inputs": [ + { "internalType": "contract IERC20", "name": "token", "type": "address" } + ], + "name": "TokenAlreadyRegistered", "type": "error" }, { - "inputs": [], - "name": "VaultPaused", + "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": [ { @@ -899,21 +506,9 @@ "name": "WrongUnderlyingToken", "type": "error" }, - { - "inputs": [], - "name": "WrongVaultAdminDeployment", - "type": "error" - }, - { - "inputs": [], - "name": "WrongVaultExtensionDeployment", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroDivision", - "type": "error" - }, + { "inputs": [], "name": "WrongVaultAdminDeployment", "type": "error" }, + { "inputs": [], "name": "WrongVaultExtensionDeployment", "type": "error" }, + { "inputs": [], "name": "ZeroDivision", "type": "error" }, { "anonymous": false, "inputs": [ @@ -1216,11 +811,7 @@ "name": "rateProvider", "type": "address" }, - { - "internalType": "bool", - "name": "paysYieldFees", - "type": "bool" - } + { "internalType": "bool", "name": "paysYieldFees", "type": "bool" } ], "indexed": false, "internalType": "struct TokenConfig[]", @@ -1342,11 +933,7 @@ "name": "enableRemoveLiquidityCustom", "type": "bool" }, - { - "internalType": "bool", - "name": "enableDonation", - "type": "bool" - } + { "internalType": "bool", "name": "enableDonation", "type": "bool" } ], "indexed": false, "internalType": "struct LiquidityManagement", @@ -1563,24 +1150,13 @@ "name": "Wrap", "type": "event" }, - { - "stateMutability": "payable", - "type": "fallback" - }, + { "stateMutability": "payable", "type": "fallback" }, { "inputs": [ { "components": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256[]", "name": "maxAmountsIn", @@ -1596,11 +1172,7 @@ "name": "kind", "type": "uint8" }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } + { "internalType": "bytes", "name": "userData", "type": "bytes" } ], "internalType": "struct AddLiquidityParams", "name": "params", @@ -1609,21 +1181,9 @@ ], "name": "addLiquidity", "outputs": [ - { - "internalType": "uint256[]", - "name": "amountsIn", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "bptAmountOut", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } + { "internalType": "uint256[]", "name": "amountsIn", "type": "uint256[]" }, + { "internalType": "uint256", "name": "bptAmountOut", "type": "uint256" }, + { "internalType": "bytes", "name": "returnData", "type": "bytes" } ], "stateMutability": "nonpayable", "type": "function" @@ -1632,11 +1192,7 @@ "inputs": [ { "components": [ - { - "internalType": "enum SwapKind", - "name": "kind", - "type": "uint8" - }, + { "internalType": "enum SwapKind", "name": "kind", "type": "uint8" }, { "internalType": "enum WrappingDirection", "name": "direction", @@ -1652,11 +1208,7 @@ "name": "amountGivenRaw", "type": "uint256" }, - { - "internalType": "uint256", - "name": "limitRaw", - "type": "uint256" - } + { "internalType": "uint256", "name": "limitRaw", "type": "uint256" } ], "internalType": "struct BufferWrapOrUnwrapParams", "name": "params", @@ -1670,16 +1222,8 @@ "name": "amountCalculatedRaw", "type": "uint256" }, - { - "internalType": "uint256", - "name": "amountInRaw", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountOutRaw", - "type": "uint256" - } + { "internalType": "uint256", "name": "amountInRaw", "type": "uint256" }, + { "internalType": "uint256", "name": "amountOutRaw", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" @@ -1688,40 +1232,20 @@ "inputs": [], "name": "getAuthorizer", "outputs": [ - { - "internalType": "contract IAuthorizer", - "name": "", - "type": "address" - } + { "internalType": "contract IAuthorizer", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "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" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" @@ -1729,26 +1253,14 @@ { "inputs": [], "name": "getVaultExtension", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "reentrancyGuardEntered", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, @@ -1756,16 +1268,8 @@ "inputs": [ { "components": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "uint256", "name": "maxBptAmountIn", @@ -1781,11 +1285,7 @@ "name": "kind", "type": "uint8" }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } + { "internalType": "bytes", "name": "userData", "type": "bytes" } ], "internalType": "struct RemoveLiquidityParams", "name": "params", @@ -1794,42 +1294,22 @@ ], "name": "removeLiquidity", "outputs": [ - { - "internalType": "uint256", - "name": "bptAmountIn", - "type": "uint256" - }, + { "internalType": "uint256", "name": "bptAmountIn", "type": "uint256" }, { "internalType": "uint256[]", "name": "amountsOut", "type": "uint256[]" }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } + { "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" - } + { "internalType": "contract IERC20", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "sendTo", "outputs": [], @@ -1838,24 +1318,12 @@ }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amountHint", - "type": "uint256" - } + { "internalType": "contract IERC20", "name": "token", "type": "address" }, + { "internalType": "uint256", "name": "amountHint", "type": "uint256" } ], "name": "settle", "outputs": [ - { - "internalType": "uint256", - "name": "credit", - "type": "uint256" - } + { "internalType": "uint256", "name": "credit", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" @@ -1864,16 +1332,8 @@ "inputs": [ { "components": [ - { - "internalType": "enum SwapKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "enum SwapKind", "name": "kind", "type": "uint8" }, + { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "contract IERC20", "name": "tokenIn", @@ -1889,16 +1349,8 @@ "name": "amountGivenRaw", "type": "uint256" }, - { - "internalType": "uint256", - "name": "limitRaw", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } + { "internalType": "uint256", "name": "limitRaw", "type": "uint256" }, + { "internalType": "bytes", "name": "userData", "type": "bytes" } ], "internalType": "struct VaultSwapParams", "name": "vaultSwapParams", @@ -1912,41 +1364,18 @@ "name": "amountCalculated", "type": "uint256" }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountOut", - "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" - } - ], + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "unlock", - "outputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - } - ], + "outputs": [{ "internalType": "bytes", "name": "result", "type": "bytes" }], "stateMutability": "nonpayable", "type": "function" }, - { - "stateMutability": "payable", - "type": "receive" - } + { "stateMutability": "payable", "type": "receive" } ] diff --git a/subgraphs/v3-vault/abis/VaultExtension.json b/subgraphs/v3-vault/abis/VaultExtension.json index e06965c..3e6f60d 100644 --- a/subgraphs/v3-vault/abis/VaultExtension.json +++ b/subgraphs/v3-vault/abis/VaultExtension.json @@ -17,51 +17,23 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } + { "internalType": "address", "name": "target", "type": "address" } ], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "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": [], "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": [ { @@ -69,16 +41,8 @@ "name": "tokenIn", "type": "address" }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAmountIn", - "type": "uint256" - } + { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { "internalType": "uint256", "name": "maxAmountIn", "type": "uint256" } ], "name": "AmountInAboveMax", "type": "error" @@ -90,78 +54,30 @@ "name": "tokenOut", "type": "address" }, - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - } + { "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": [], "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" - } + { "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" - } + { "internalType": "uint256", "name": "amountOut", "type": "uint256" }, + { "internalType": "uint256", "name": "minAmountOut", "type": "uint256" } ], "name": "BptAmountOutBelowMin", "type": "error" @@ -188,52 +104,20 @@ "name": "BufferNotInitialized", "type": "error" }, - { - "inputs": [], - "name": "BufferSharesInvalidOwner", - "type": "error" - }, - { - "inputs": [], - "name": "BufferSharesInvalidReceiver", - "type": "error" - }, + { "inputs": [], "name": "BufferSharesInvalidOwner", "type": "error" }, + { "inputs": [], "name": "BufferSharesInvalidReceiver", "type": "error" }, { "inputs": [ - { - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - } + { "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": "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", @@ -244,112 +128,56 @@ "name": "DoesNotSupportUnbalancedLiquidity", "type": "error" }, - { - "inputs": [], - "name": "DynamicSwapFeeHookFailed", - "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" - } + { "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" - } + { "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" - } + { "internalType": "address", "name": "approver", "type": "address" } ], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } + { "internalType": "address", "name": "receiver", "type": "address" } ], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } + { "internalType": "address", "name": "sender", "type": "address" } ], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - } + { "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": [], "name": "ErrorSelectorNotFound", "type": "error" }, + { "inputs": [], "name": "FailedInnerCall", "type": "error" }, + { "inputs": [], "name": "FeePrecisionTooHigh", "type": "error" }, { "inputs": [ { @@ -357,16 +185,8 @@ "name": "tokenIn", "type": "address" }, - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxAmountIn", - "type": "uint256" - } + { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, + { "internalType": "uint256", "name": "maxAmountIn", "type": "uint256" } ], "name": "HookAdjustedAmountInAboveMax", "type": "error" @@ -378,32 +198,16 @@ "name": "tokenOut", "type": "address" }, - { - "internalType": "uint256", - "name": "amountOut", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountOut", - "type": "uint256" - } + { "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" - } + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "limit", "type": "uint256" } ], "name": "HookAdjustedSwapLimit", "type": "error" @@ -415,50 +219,19 @@ "name": "poolHooksContract", "type": "address" }, - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "poolFactory", - "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": [], "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": "InvalidTokenDecimals", "type": "error" }, + { "inputs": [], "name": "InvalidTokenType", "type": "error" }, { "inputs": [ { @@ -470,21 +243,9 @@ "name": "InvalidUnderlyingToken", "type": "error" }, - { - "inputs": [], - "name": "MaxTokens", - "type": "error" - }, - { - "inputs": [], - "name": "MinTokens", - "type": "error" - }, - { - "inputs": [], - "name": "NotEnoughBufferShares", - "type": "error" - }, + { "inputs": [], "name": "MaxTokens", "type": "error" }, + { "inputs": [], "name": "MinTokens", "type": "error" }, + { "inputs": [], "name": "NotEnoughBufferShares", "type": "error" }, { "inputs": [ { @@ -527,308 +288,150 @@ "name": "NotEnoughWrapped", "type": "error" }, - { - "inputs": [], - "name": "NotStaticCall", - "type": "error" - }, - { - "inputs": [], - "name": "NotVaultDelegateCall", - "type": "error" - }, - { - "inputs": [], - "name": "OutOfBounds", - "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": [], "name": "PercentageAboveMax", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolAlreadyInitialized", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolAlreadyRegistered", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolInRecoveryMode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolNotInRecoveryMode", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolNotInitialized", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "PoolNotPaused", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "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" - } + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "TokensMismatch", + "name": "PoolPauseWindowExpired", "type": "error" }, { - "inputs": [], - "name": "TokensNotSorted", + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } + ], + "name": "PoolPaused", "type": "error" }, { - "inputs": [], - "name": "TradeAmountTooSmall", + "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": "VaultBuffersArePaused", + "inputs": [{ "internalType": "bytes", "name": "result", "type": "bytes" }], + "name": "Result", "type": "error" }, + { "inputs": [], "name": "RouterNotTrusted", "type": "error" }, { - "inputs": [], - "name": "VaultIsNotUnlocked", + "inputs": [ + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "SafeCastOverflowedUintToInt", "type": "error" }, { - "inputs": [], - "name": "VaultNotPaused", + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "SenderIsNotVault", "type": "error" }, + { "inputs": [], "name": "SwapFeePercentageTooHigh", "type": "error" }, + { "inputs": [], "name": "SwapFeePercentageTooLow", "type": "error" }, { - "inputs": [], - "name": "VaultPauseWindowDurationTooLarge", + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "limit", "type": "uint256" } + ], + "name": "SwapLimit", "type": "error" }, { - "inputs": [], - "name": "VaultPauseWindowExpired", + "inputs": [ + { "internalType": "contract IERC20", "name": "token", "type": "address" } + ], + "name": "TokenAlreadyRegistered", "type": "error" }, { - "inputs": [], - "name": "VaultPaused", + "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": [ { @@ -861,16 +464,8 @@ "name": "WrongUnderlyingToken", "type": "error" }, - { - "inputs": [], - "name": "WrongVaultAdminDeployment", - "type": "error" - }, - { - "inputs": [], - "name": "WrongVaultExtensionDeployment", - "type": "error" - }, + { "inputs": [], "name": "WrongVaultAdminDeployment", "type": "error" }, + { "inputs": [], "name": "WrongVaultExtensionDeployment", "type": "error" }, { "anonymous": false, "inputs": [ @@ -1173,11 +768,7 @@ "name": "rateProvider", "type": "address" }, - { - "internalType": "bool", - "name": "paysYieldFees", - "type": "bool" - } + { "internalType": "bool", "name": "paysYieldFees", "type": "bool" } ], "indexed": false, "internalType": "struct TokenConfig[]", @@ -1299,11 +890,7 @@ "name": "enableRemoveLiquidityCustom", "type": "bool" }, - { - "internalType": "bool", - "name": "enableDonation", - "type": "bool" - } + { "internalType": "bool", "name": "enableDonation", "type": "bool" } ], "indexed": false, "internalType": "struct LiquidityManagement", @@ -1520,106 +1107,45 @@ "name": "Wrap", "type": "event" }, - { - "stateMutability": "payable", - "type": "fallback" - }, + { "stateMutability": "payable", "type": "fallback" }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } + { "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" - } - ], + "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" - } + { "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" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "account", "type": "address" } ], "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "components": [ - { - "internalType": "enum SwapKind", - "name": "kind", - "type": "uint8" - }, + { "internalType": "enum SwapKind", "name": "kind", "type": "uint8" }, { "internalType": "uint256", "name": "amountGivenScaled18", @@ -1630,26 +1156,10 @@ "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": "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", @@ -1669,78 +1179,47 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], - "name": "getAggregateSwapFeeAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + "name": "getAddLiquidityCalledFlag", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "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" - } + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "contract IERC20", "name": "token", "type": "address" } ], "name": "getAggregateYieldFeeAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getBptRate", "outputs": [ - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } + { "internalType": "uint256", "name": "rate", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getCurrentLiveBalances", "outputs": [ @@ -1755,11 +1234,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getHooksConfig", "outputs": [ @@ -1832,23 +1307,13 @@ { "inputs": [], "name": "getNonzeroDeltaCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolConfig", "outputs": [ @@ -1916,11 +1381,7 @@ "name": "isPoolInitialized", "type": "bool" }, - { - "internalType": "bool", - "name": "isPoolPaused", - "type": "bool" - }, + { "internalType": "bool", "name": "isPoolPaused", "type": "bool" }, { "internalType": "bool", "name": "isPoolInRecoveryMode", @@ -1937,11 +1398,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolData", "outputs": [ @@ -2010,45 +1467,21 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "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" - } + { "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" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolRoleAccounts", "outputs": [ @@ -2076,15 +1509,11 @@ } ], "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolTokenInfo", "outputs": [ @@ -2105,11 +1534,7 @@ "name": "rateProvider", "type": "address" }, - { - "internalType": "bool", - "name": "paysYieldFees", - "type": "bool" - } + { "internalType": "bool", "name": "paysYieldFees", "type": "bool" } ], "internalType": "struct TokenInfo[]", "name": "tokenInfo", @@ -2131,11 +1556,7 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolTokenRates", "outputs": [ @@ -2144,22 +1565,14 @@ "name": "decimalScalingFactors", "type": "uint256[]" }, - { - "internalType": "uint256[]", - "name": "tokenRates", - "type": "uint256[]" - } + { "internalType": "uint256[]", "name": "tokenRates", "type": "uint256[]" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getPoolTokens", "outputs": [ @@ -2187,86 +1600,42 @@ }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "internalType": "contract IERC20", "name": "token", "type": "address" } ], "name": "getReservesOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "getStaticSwapFeePercentage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } + { "internalType": "contract IERC20", "name": "token", "type": "address" } ], "name": "getTokenDelta", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], + "outputs": [{ "internalType": "int256", "name": "", "type": "int256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getVaultAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "contract IERC20[]", "name": "tokens", @@ -2282,19 +1651,11 @@ "name": "minBptAmountOut", "type": "uint256" }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } + { "internalType": "bytes", "name": "userData", "type": "bytes" } ], "name": "initialize", "outputs": [ - { - "internalType": "uint256", - "name": "bptAmountOut", - "type": "uint256" - } + { "internalType": "uint256", "name": "bptAmountOut", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" @@ -2308,145 +1669,69 @@ } ], "name": "isERC4626BufferInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "isPoolInRecoveryMode", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "isPoolInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "isPoolPaused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - } + { "internalType": "address", "name": "pool", "type": "address" } ], "name": "isPoolRegistered", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isQueryDisabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isUnlocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "quote", - "outputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - } - ], + "outputs": [{ "internalType": "bytes", "name": "result", "type": "bytes" }], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "quoteAndRevert", "outputs": [], "stateMutability": "nonpayable", @@ -2455,23 +1740,13 @@ { "inputs": [], "name": "reentrancyGuardEntered", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, { "components": [ { @@ -2489,11 +1764,7 @@ "name": "rateProvider", "type": "address" }, - { - "internalType": "bool", - "name": "paysYieldFees", - "type": "bool" - } + { "internalType": "bool", "name": "paysYieldFees", "type": "bool" } ], "internalType": "struct TokenConfig[]", "name": "tokenConfig", @@ -2509,11 +1780,7 @@ "name": "pauseWindowEndTime", "type": "uint32" }, - { - "internalType": "bool", - "name": "protocolFeeExempt", - "type": "bool" - }, + { "internalType": "bool", "name": "protocolFeeExempt", "type": "bool" }, { "components": [ { @@ -2558,11 +1825,7 @@ "name": "enableRemoveLiquidityCustom", "type": "bool" }, - { - "internalType": "bool", - "name": "enableDonation", - "type": "bool" - } + { "internalType": "bool", "name": "enableDonation", "type": "bool" } ], "internalType": "struct LiquidityManagement", "name": "liquidityManagement", @@ -2576,16 +1839,8 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "pool", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, + { "internalType": "address", "name": "pool", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "uint256", "name": "exactBptAmountIn", @@ -2605,83 +1860,33 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } + { "internalType": "address", "name": "token", "type": "address" } ], "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "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" - } + { "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" - } - ], + "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" - } + { "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" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, @@ -2689,17 +1894,10 @@ "inputs": [], "name": "vault", "outputs": [ - { - "internalType": "contract IVault", - "name": "", - "type": "address" - } + { "internalType": "contract IVault", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, - { - "stateMutability": "payable", - "type": "receive" - } + { "stateMutability": "payable", "type": "receive" } ] diff --git a/subgraphs/v3-vault/schema.graphql b/subgraphs/v3-vault/schema.graphql index e2f40a6..0cfd2b3 100644 --- a/subgraphs/v3-vault/schema.graphql +++ b/subgraphs/v3-vault/schema.graphql @@ -51,6 +51,15 @@ type Pool @entity { "Indicates whether the Pool has been initialized" isInitialized: Boolean! + "Protocol swap fee percentage" + protocolSwapFee: BigDecimal! + "Protocol yield fee percentage" + protocolYieldFee: BigDecimal! + "Pool creator swap fee percentage" + poolCreatorSwapFee: BigDecimal! + "Pool creator yield fee percentage" + poolCreatorYieldFee: BigDecimal! + "Total number of swaps performed in this Pool" swapsCount: BigInt! "Number of unique holders of this Pool's tokens" diff --git a/subgraphs/v3-vault/src/mappings/vault.ts b/subgraphs/v3-vault/src/mappings/vault.ts index d706f9b..05e2d69 100644 --- a/subgraphs/v3-vault/src/mappings/vault.ts +++ b/subgraphs/v3-vault/src/mappings/vault.ts @@ -7,6 +7,8 @@ import { PoolBalanceChanged, PoolRegistered, Swap as SwapEvent, + Unwrap, + Wrap, } from "../types/Vault/Vault"; import { Buffer, @@ -53,6 +55,10 @@ export function handlePoolRegistered(event: PoolRegistered): void { pool.isInitialized = false; pool.swapsCount = ZERO_BI; pool.holdersCount = ZERO_BI; + pool.protocolSwapFee = ZERO_BD; + pool.protocolYieldFee = ZERO_BD; + pool.poolCreatorSwapFee = ZERO_BD; + pool.poolCreatorYieldFee = ZERO_BD; let poolContract = ERC20.bind(poolAddress); let symbolCall = poolContract.try_symbol(); @@ -406,7 +412,11 @@ export function handleBufferSharesMinted(event: BufferSharesMinted): void { createUser(event.params.to); let buffer = getBuffer(event.params.wrappedToken); - let issuedShares = scaleDown(event.params.issuedShares, 18); + let wrappedToken = getToken(changetype
(buffer.wrappedToken)); + let issuedShares = scaleDown( + event.params.issuedShares, + wrappedToken.decimals + ); buffer.totalShares = buffer.totalShares.plus(issuedShares); buffer.save(); @@ -428,7 +438,11 @@ export function handleBufferSharesBurned(event: BufferSharesBurned): void { createUser(event.params.from); let buffer = getBuffer(event.params.wrappedToken); - let burnedShares = scaleDown(event.params.burnedShares, 18); + let wrappedToken = getToken(changetype
(buffer.wrappedToken)); + let burnedShares = scaleDown( + event.params.burnedShares, + wrappedToken.decimals + ); buffer.totalShares = buffer.totalShares.minus(burnedShares); buffer.save(); @@ -445,3 +459,44 @@ export function handleBufferSharesBurned(event: BufferSharesBurned): void { bufferShare.balance = bufferShare.balance.minus(burnedShares); bufferShare.save(); } + +export function handleUnwrap(event: Unwrap): void { + let buffer = getBuffer(event.params.wrappedToken); + + let wrappedToken = getToken(changetype
(buffer.wrappedToken)); + let underlyingToken = getToken(changetype
(buffer.underlyingToken)); + + let burnedShares = scaleDown( + event.params.burnedShares, + wrappedToken.decimals + ); + let withdrawnUnderlying = scaleDown( + event.params.withdrawnUnderlying, + underlyingToken.decimals + ); + + buffer.underlyingBalance = + buffer.underlyingBalance.minus(withdrawnUnderlying); + buffer.wrappedBalance = buffer.wrappedBalance.plus(burnedShares); + buffer.save(); +} + +export function handleWrap(event: Wrap): void { + let buffer = getBuffer(event.params.wrappedToken); + + let wrappedToken = getToken(changetype
(buffer.wrappedToken)); + let underlyingToken = getToken(changetype
(buffer.underlyingToken)); + + let mintedShares = scaleDown( + event.params.mintedShares, + wrappedToken.decimals + ); + let depositedUnderlying = scaleDown( + event.params.depositedUnderlying, + underlyingToken.decimals + ); + + buffer.underlyingBalance = buffer.underlyingBalance.plus(depositedUnderlying); + buffer.wrappedBalance = buffer.wrappedBalance.minus(mintedShares); + buffer.save(); +} diff --git a/subgraphs/v3-vault/template.yaml b/subgraphs/v3-vault/template.yaml index ad9febe..e51b0c2 100644 --- a/subgraphs/v3-vault/template.yaml +++ b/subgraphs/v3-vault/template.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: Vault - network: { { network } } + network: {{ network }} source: abi: Vault address: "{{ Vault.address }}" - startBlock: { { Vault.startBlock } } + startBlock: {{ Vault.startBlock }} mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -36,13 +36,13 @@ dataSources: handler: handleSwap - event: LiquidityAddedToBuffer(indexed address,uint256,uint256) handler: handleLiquidityAddedToBuffer - - event: LiquidityAddedToBuffer(indexed address,uint256,uint256) + - event: LiquidityRemovedFromBuffer(indexed address,uint256,uint256) handler: handleLiquidityRemovedFromBuffer file: ./src/mappings/vault.ts templates: - kind: ethereum/contract name: BPT - network: { { network } } + network: {{ network }} source: abi: BPT mapping: