From c43107dde00ea32e25825b5fa14b2d342f391540 Mon Sep 17 00:00:00 2001 From: matteen Date: Tue, 2 Jul 2024 19:00:13 -0400 Subject: [PATCH 1/4] zksync support --- networks.json | 6 ++++++ src/utils/chains.ts | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/networks.json b/networks.json index 68d113ad..b0238833 100644 --- a/networks.json +++ b/networks.json @@ -52,5 +52,11 @@ "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984", "startBlock": 0 } + }, + "zksync-era": { + "Factory": { + "address": "0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422", + "startBlock": 12637075 + } } } diff --git a/src/utils/chains.ts b/src/utils/chains.ts index 205f2655..f27f9dbc 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -13,6 +13,7 @@ export enum ChainId { MAINNET = 1, MATIC = 137, OPTIMISM = 10, + ZKSYNC_ERA = 324, } // subgraph does not support string enums, hence these constants @@ -25,6 +26,7 @@ const CELO_NETWORK_NAME = 'celo' const MAINNET_NETWORK_NAME = 'mainnet' const MATIC_NETWORK_NAME = 'matic' const OPTIMISM_NETWORK_NAME = 'optimism' +const ZKSYNC_ERA_NETWORK_NAME = 'zksync-era' // Note: All token and pool addresses should be lowercased! export class SubgraphConfig { @@ -358,6 +360,29 @@ export function getSubgraphConfig(): SubgraphConfig { ], poolMappings: OPTIMISM_POOL_MAPPINGS, } + } else if (selectedNetwork == ZKSYNC_ERA_NETWORK_NAME) { + return { + factoryAddress: '0x8fda5a7a8dca67bbcdd10f02fa0649a937215422', + stablecoinWrappedNativePoolAddress: '0x3e3dd517fec2e70eddba2a626422a4ba286e8c38', // USDC.e/WETH 0.05% pool + stablecoinIsToken0: true, + wrappedNativeAddress: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', // WETH + minimumNativeLocked: BigDecimal.fromString('1'), + stablecoinAddresses: [ + '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4', // USDC.e + '0xa07028b453a1f6ac277e93f3a0ea73b4be5c7d63', // USDT + '0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4' // USDC + ], + whitelistTokens: [ + '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', // WETH + '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4', // USDC.e + '0xa07028b453a1f6ac277e93f3a0ea73b4be5c7d63', // USDT + '0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4', // USDC + '0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e', // ZK + ], + tokenOverrides: [], + poolsToSkip: [], + poolMappings: [], + } } else { throw new Error('Unsupported Network') } From ca9d6809c100b6a47e8ddf7636963dc1c758f155 Mon Sep 17 00:00:00 2001 From: matteen Date: Wed, 3 Jul 2024 12:27:26 -0400 Subject: [PATCH 2/4] add zora support --- networks.json | 6 ++++++ src/utils/chains.ts | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/networks.json b/networks.json index b0238833..d49be409 100644 --- a/networks.json +++ b/networks.json @@ -58,5 +58,11 @@ "address": "0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422", "startBlock": 12637075 } + }, + "zora": { + "Factory": { + "address": "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb", + "startBlock": 10320368 + } } } diff --git a/src/utils/chains.ts b/src/utils/chains.ts index f27f9dbc..6ae8dd0c 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -14,6 +14,7 @@ export enum ChainId { MATIC = 137, OPTIMISM = 10, ZKSYNC_ERA = 324, + ZORA = 7777777 } // subgraph does not support string enums, hence these constants @@ -27,6 +28,7 @@ const MAINNET_NETWORK_NAME = 'mainnet' const MATIC_NETWORK_NAME = 'matic' const OPTIMISM_NETWORK_NAME = 'optimism' const ZKSYNC_ERA_NETWORK_NAME = 'zksync-era' +const ZORA_NETWORK_NAME = 'zora' // Note: All token and pool addresses should be lowercased! export class SubgraphConfig { @@ -383,6 +385,24 @@ export function getSubgraphConfig(): SubgraphConfig { poolsToSkip: [], poolMappings: [], } + } else if (selectedNetwork == ZORA_NETWORK_NAME) { + return { + factoryAddress: '0x7145f8aeef1f6510e92164038e1b6f8cb2c42cbb', + stablecoinWrappedNativePoolAddress: '0xbc59f8f3b275aa56a90d13bae7cce5e6e11a3b17', // WETH/USDC 3% pool + stablecoinIsToken0: false, + wrappedNativeAddress: '0x4200000000000000000000000000000000000006', // WETH + minimumNativeLocked: BigDecimal.fromString('1'), + stablecoinAddresses: [ + '0xcccccccc7021b32ebb4e8c08314bd62f7c653ec4' // USDC + ], + whitelistTokens: [ + '0x4200000000000000000000000000000000000006', // WETH + '0xcccccccc7021b32ebb4e8c08314bd62f7c653ec4', // USDC + ], + tokenOverrides: [], + poolsToSkip: [], + poolMappings: [], + } } else { throw new Error('Unsupported Network') } From 05a7f3acbac80e4bd916a406340eb0f4994d93a6 Mon Sep 17 00:00:00 2001 From: matteen Date: Fri, 4 Oct 2024 11:36:01 -0400 Subject: [PATCH 3/4] updates --- networks.json | 2 +- src/utils/chains.ts | 6 +++--- subgraph.yaml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/networks.json b/networks.json index d49be409..1a9d863d 100644 --- a/networks.json +++ b/networks.json @@ -59,7 +59,7 @@ "startBlock": 12637075 } }, - "zora": { + "zora-mainnet": { "Factory": { "address": "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb", "startBlock": 10320368 diff --git a/src/utils/chains.ts b/src/utils/chains.ts index 096d3b39..a0a86154 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -14,7 +14,7 @@ export enum ChainId { MATIC = 137, OPTIMISM = 10, ZKSYNC_ERA = 324, - ZORA = 7777777, + ZORA_MAINNET = 7777777, } // subgraph does not support string enums, hence these constants @@ -28,7 +28,7 @@ const MAINNET_NETWORK_NAME = 'mainnet' const MATIC_NETWORK_NAME = 'matic' const OPTIMISM_NETWORK_NAME = 'optimism' const ZKSYNC_ERA_NETWORK_NAME = 'zksync-era' -const ZORA_NETWORK_NAME = 'zora' +const ZORA_MAINNET_NETWORK_NAME = 'zora-mainnet' // Note: All token and pool addresses should be lowercased! export class SubgraphConfig { @@ -392,7 +392,7 @@ export function getSubgraphConfig(): SubgraphConfig { poolsToSkip: [], poolMappings: [], } - } else if (selectedNetwork == ZORA_NETWORK_NAME) { + } else if (selectedNetwork == ZORA_MAINNET_NETWORK_NAME) { return { factoryAddress: '0x7145f8aeef1f6510e92164038e1b6f8cb2c42cbb', stablecoinWrappedNativePoolAddress: '0xbc59f8f3b275aa56a90d13bae7cce5e6e11a3b17', // WETH/USDzC 3% pool diff --git a/subgraph.yaml b/subgraph.yaml index 395f99b4..6427135f 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -9,11 +9,11 @@ features: dataSources: - kind: ethereum/contract name: Factory - network: mainnet + network: zora-mainnet source: - address: '0x1F98431c8aD98523631AE4a59f267346ea31F984' + address: "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb" abi: Factory - startBlock: 12369621 + startBlock: 10320368 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -39,7 +39,7 @@ dataSources: templates: - kind: ethereum/contract name: Pool - network: mainnet + network: zora-mainnet source: abi: Pool mapping: From 0ce41ef6142b3551848f0b2193786ec18c8d07be Mon Sep 17 00:00:00 2001 From: matteen Date: Fri, 4 Oct 2024 11:38:09 -0400 Subject: [PATCH 4/4] dont update yaml file --- subgraph.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subgraph.yaml b/subgraph.yaml index 6427135f..395f99b4 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -9,11 +9,11 @@ features: dataSources: - kind: ethereum/contract name: Factory - network: zora-mainnet + network: mainnet source: - address: "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb" + address: '0x1F98431c8aD98523631AE4a59f267346ea31F984' abi: Factory - startBlock: 10320368 + startBlock: 12369621 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -39,7 +39,7 @@ dataSources: templates: - kind: ethereum/contract name: Pool - network: zora-mainnet + network: mainnet source: abi: Pool mapping: