Skip to content
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
12 changes: 12 additions & 0 deletions networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
"startBlock": 0
}
},
"unichain-mainnet": {
"Factory": {
"address": "0x1f98400000000000000000000000000000000003",
"startBlock": 0
}
},
"unichain-sepolia": {
"Factory": {
"address": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
"startBlock": 0
}
},
"zksync-era": {
"Factory": {
"address": "0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422",
Expand Down
42 changes: 42 additions & 0 deletions src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export enum ChainId {
ZORA_MAINNET = 7777777,
WORLDCHAIN_MAINNET = 480,
SEPOLIA = 11155111,
UNICHAIN = 130,
UNICHAIN_SEPOLIA = 1301,
}

// subgraph does not support string enums, hence these constants
Expand All @@ -33,6 +35,8 @@ 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_NETWORK_NAME = 'unichain-mainnet'
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 +460,44 @@ export function getSubgraphConfig(): SubgraphConfig {
poolsToSkip: [],
poolMappings: [],
}
} else if (selectedNetwork == UNICHAIN_NETWORK_NAME) {
return {
factoryAddress: '0x1f98400000000000000000000000000000000003',
stablecoinWrappedNativePoolAddress: '0x65081cb48d74a32e9ccfed75164b8c09972dbcf1', // USDC/WETH 0.05%
stablecoinIsToken0: true,
wrappedNativeAddress: '0x4200000000000000000000000000000000000006', // WETH
minimumNativeLocked: BigDecimal.fromString('1'),
stablecoinAddresses: [
'0x078d782b760474a361dda0af3839290b0ef57ad6', // USDC
'0x20cab320a855b39f724131c69424240519573f81', // DAI
],
whitelistTokens: [
'0x4200000000000000000000000000000000000006', // WETH
'0x078d782b760474a361dda0af3839290b0ef57ad6', // USDC
'0x20cab320a855b39f724131c69424240519573f81', // DAI
],
tokenOverrides: [],
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