Skip to content

Commit

Permalink
Merge branch 'main' into update-base-min-eth
Browse files Browse the repository at this point in the history
  • Loading branch information
mzywang authored Oct 18, 2024
2 parents d1d8fd6 + 5e9f4e6 commit 02c7192
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
12 changes: 12 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,17 @@
"address": "0x7145F8aeef1f6510E92164038E1B6F8cB2c42Cbb",
"startBlock": 10320368
}
},
"worldchain-mainnet": {
"Factory": {
"address": "0x7a5028BDa40e7B173C278C5342087826455ea25a",
"startBlock": 1603366
}
},
"sepolia": {
"Factory": {
"address": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
"startBlock": 3518270
}
}
}
46 changes: 46 additions & 0 deletions src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export enum ChainId {
OPTIMISM = 10,
ZKSYNC_ERA = 324,
ZORA_MAINNET = 7777777,
WORLDCHAIN_MAINNET = 480,
SEPOLIA = 11155111,
}

// subgraph does not support string enums, hence these constants
Expand All @@ -29,6 +31,8 @@ const MATIC_NETWORK_NAME = 'matic'
const OPTIMISM_NETWORK_NAME = 'optimism'
const ZKSYNC_ERA_NETWORK_NAME = 'zksync-era'
const ZORA_MAINNET_NETWORK_NAME = 'zora-mainnet'
const WORLDCHAIN_MAINNET_NETWORK_NAME = 'worldchain-mainnet'
const SEPOLIA_NETWORK_NAME = 'sepolia'

// Note: All token and pool addresses should be lowercased!
export class SubgraphConfig {
Expand Down Expand Up @@ -410,6 +414,48 @@ export function getSubgraphConfig(): SubgraphConfig {
poolsToSkip: [],
poolMappings: [],
}
} else if (selectedNetwork == WORLDCHAIN_MAINNET_NETWORK_NAME) {
return {
factoryAddress: '0x7a5028bda40e7b173c278c5342087826455ea25a',
stablecoinWrappedNativePoolAddress: '0x5f835420502a7702de50cd0e78d8aa3608b2137e', // WETH/USDC.e 0.05% pool
stablecoinIsToken0: false,
wrappedNativeAddress: '0x4200000000000000000000000000000000000006', // WETH
minimumNativeLocked: BigDecimal.fromString('1'),
stablecoinAddresses: [
'0x79a02482a880bce3f13e09da970dc34db4cd24d1', // USDC.e
],
whitelistTokens: [
'0x4200000000000000000000000000000000000006', // WETH
'0x79a02482a880bce3f13e09da970dc34db4cd24d1', // USDC.e
'0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3', // WBTC
'0x2cfc85d8e48f8eab294be644d9e25c3030863003', // WLD
'0x859dbe24b90c9f2f7742083d3cf59ca41f55be5d', // sDAI
],
tokenOverrides: [],
poolsToSkip: [],
poolMappings: [],
}
} else if (selectedNetwork == SEPOLIA_NETWORK_NAME) {
return {
factoryAddress: '0x0227628f3f023bb0b980b67d528571c95c6dac1c',
stablecoinWrappedNativePoolAddress: '0x6418eec70f50913ff0d756b48d32ce7c02b47c47', // USDC/WETH 1% pool
stablecoinIsToken0: true,
wrappedNativeAddress: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14', // WETH
minimumNativeLocked: BigDecimal.fromString('1'),
stablecoinAddresses: [
'0x1c7d4b196cb0c7b01d743fbc6116a902379c7238', // USDC
'0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0', // USDT
],
whitelistTokens: [
'0xfff9976782d46cc05630d1f6ebab18b2324d6b14', // WETH
'0x1c7d4b196cb0c7b01d743fbc6116a902379c7238', // USDC
'0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0', // USDT
'0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', // UNI,
],
tokenOverrides: [],
poolsToSkip: [],
poolMappings: [],
}
} else {
throw new Error('Unsupported Network')
}
Expand Down
8 changes: 4 additions & 4 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ features:
dataSources:
- kind: ethereum/contract
name: Factory
network: mainnet
network: sepolia
source:
address: '0x1F98431c8aD98523631AE4a59f267346ea31F984'
address: "0x0227628f3F023bb0B980b67D528571c95c6DaC1c"
abi: Factory
startBlock: 12369621
startBlock: 3518270
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -39,7 +39,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pool
network: mainnet
network: sepolia
source:
abi: Pool
mapping:
Expand Down

0 comments on commit 02c7192

Please sign in to comment.