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

add unichain sepolia support #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -76,5 +76,11 @@
"address": "0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
"startBlock": 3518270
}
},
"unichain-sepolia": {
"Factory": {
"address": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
"startBlock": 0
}
}
}
20 changes: 20 additions & 0 deletions src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export enum ChainId {
ZORA_MAINNET = 7777777,
WORLDCHAIN_MAINNET = 480,
SEPOLIA = 11155111,
UNICHAIN_SEPOLIA = 1301,
}

// subgraph does not support string enums, hence these constants
Expand All @@ -33,6 +34,7 @@ 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'
const UNICHAIN_SEPOLIA_NETWORK_NAME = 'unichain-sepolia'

// Note: All token and pool addresses should be lowercased!
export class SubgraphConfig {
Expand Down Expand Up @@ -456,6 +458,24 @@ export function getSubgraphConfig(): SubgraphConfig {
poolsToSkip: [],
poolMappings: [],
}
} else if (selectedNetwork == UNICHAIN_SEPOLIA_NETWORK_NAME) {
return {
factoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
stablecoinWrappedNativePoolAddress: '0xE87b0A6C6611119deCF5C4e9203E1c46F561BdAE', // USDC/WETH
stablecoinIsToken0: true,
wrappedNativeAddress: '0x4200000000000000000000000000000000000006', // WETH
minimumNativeLocked: BigDecimal.fromString('1'),
stablecoinAddresses: [
'0x31d0220469e10c4E71834a79b1f276d740d3768F', // USDC
],
whitelistTokens: [
'0x4200000000000000000000000000000000000006', // WETH
'0x31d0220469e10c4E71834a79b1f276d740d3768F', // USDC
],
tokenOverrides: [],
poolsToSkip: [],
poolMappings: [],
}
} else {
throw new Error('Unsupported Network')
}
Expand Down
Loading