Skip to content

Commit

Permalink
add sepolia support
Browse files Browse the repository at this point in the history
  • Loading branch information
matteenm committed Oct 16, 2024
1 parent 813cb4b commit d44aac9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
6 changes: 6 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@
"address": "0x7a5028BDa40e7B173C278C5342087826455ea25a",
"startBlock": 1603366
}
},
"sepolia": {
"Factory": {
"address": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
"startBlock": 3518270
}
}
}
23 changes: 23 additions & 0 deletions src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum ChainId {
ZKSYNC_ERA = 324,
ZORA_MAINNET = 7777777,
WORLDCHAIN_MAINNET = 480,
SEPOLIA = 11155111,
}

// subgraph does not support string enums, hence these constants
Expand All @@ -31,6 +32,7 @@ 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 @@ -433,6 +435,27 @@ export function getSubgraphConfig(): SubgraphConfig {
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 d44aac9

Please sign in to comment.