Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zora support #239

Merged
merged 6 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,11 @@
"address": "0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422",
"startBlock": 12637075
}
},
"zora-mainnet": {
"Factory": {
"address": "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb",
"startBlock": 10320368
}
}
}
20 changes: 20 additions & 0 deletions src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum ChainId {
MATIC = 137,
OPTIMISM = 10,
ZKSYNC_ERA = 324,
ZORA_MAINNET = 7777777,
}

// subgraph does not support string enums, hence these constants
Expand All @@ -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_MAINNET_NETWORK_NAME = 'zora-mainnet'

// Note: All token and pool addresses should be lowercased!
export class SubgraphConfig {
Expand Down Expand Up @@ -390,6 +392,24 @@ export function getSubgraphConfig(): SubgraphConfig {
poolsToSkip: [],
poolMappings: [],
}
} else if (selectedNetwork == ZORA_MAINNET_NETWORK_NAME) {
return {
factoryAddress: '0x7145f8aeef1f6510e92164038e1b6f8cb2c42cbb',
stablecoinWrappedNativePoolAddress: '0xbc59f8f3b275aa56a90d13bae7cce5e6e11a3b17', // WETH/USDzC 3% pool
stablecoinIsToken0: false,
wrappedNativeAddress: '0x4200000000000000000000000000000000000006', // WETH
minimumNativeLocked: BigDecimal.fromString('1'),
stablecoinAddresses: [
'0xcccccccc7021b32ebb4e8c08314bd62f7c653ec4', // USDzC
],
whitelistTokens: [
'0x4200000000000000000000000000000000000006', // WETH
'0xcccccccc7021b32ebb4e8c08314bd62f7c653ec4', // USDzC
],
tokenOverrides: [],
poolsToSkip: [],
poolMappings: [],
}
} else {
throw new Error('Unsupported Network')
}
Expand Down
Loading