add op sepolia dapp config

This commit is contained in:
Felicio Mununga 2024-02-16 12:50:13 +09:00
parent baaa3d0e12
commit a0a6a0639c
No known key found for this signature in database
GPG Key ID: C4736C7AEBA55BE5
2 changed files with 30 additions and 3 deletions

View File

@ -1,8 +1,26 @@
// import { v4 as uuidv4 } from 'uuid'
import { ChainId, OptimismGoerli, Optimism, Config as DAppConfig, Localhost, Hardhat } from '@usedapp/core'
import { Chain, ChainId, Optimism, OptimismGoerli, Config as DAppConfig, Localhost, Hardhat } from '@usedapp/core'
const version = '0.0.6'
export const OptimismSepolia: Chain = {
chainId: 11155420,
chainName: 'OptimismSepolia',
isTestChain: false,
isLocalChain: false,
multicallAddress: '0xcA11bde05977b3631167028862bE2a173976CA11',
rpcUrl: 'https://sepolia.optimism.io/',
nativeCurrency: {
name: 'Ether',
symbol: 'ETH',
decimals: 18,
},
blockExplorerUrl: 'https://sepolia-optimistic.etherscan.io/',
getExplorerAddressLink: (address: string) => `https://sepolia-optimistic.etherscan.io/address/${address}`,
getExplorerTransactionLink: (transactionHash: string) =>
`https://sepolia-optimistic.etherscan.io/tx/${transactionHash}`,
}
export interface Config {
wakuConfig: {
environment: 'test' | 'production'
@ -56,11 +74,12 @@ const configs: Record<typeof process.env.ENV, Config> = {
wakuFeatureTopic: `/communitiesCuration/preview/${version}/featured/proto/`,
},
daapConfig: {
readOnlyChainId: ChainId.OptimismGoerli,
readOnlyChainId: OptimismSepolia.chainId,
readOnlyUrls: {
[OptimismSepolia.chainId]: `https://optimism-sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
[ChainId.OptimismGoerli]: `https://optimism-goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
},
networks: [OptimismGoerli],
networks: [OptimismSepolia, OptimismGoerli],
notifications: {
checkInterval: 500,
expirationPeriod: 50000,

View File

@ -1,4 +1,5 @@
import { ChainId } from '@usedapp/core'
import { OptimismSepolia } from '../config'
// todo?: move to config.ts
export const contracts = {
@ -16,6 +17,13 @@ export const contracts = {
tokenContract: '0xcAD273fA2bb77875333439FDf4417D995159c3E1',
multicallContract: '0xcA11bde05977b3631167028862bE2a173976CA11',
},
[OptimismSepolia.chainId]: {
votingContract: '0x7Ff554af5b6624db2135E4364F416d1D397f43e6',
featuredVotingContract: '0x336DFD512164Fe8CFA809BdE94B13E76e42edD6B',
directoryContract: '0x6B94e21FAB8Af38E8d89dd4A0480C04e9a5c53Ab',
tokenContract: '0x0B5DAd18B8791ddb24252B433ec4f21f9e6e5Ed0',
multicallContract: '0xcA11bde05977b3631167028862bE2a173976CA11',
},
[ChainId.Hardhat]: {
votingContract: process.env.VOTING_CONTRACT ?? '0x0000000000000000000000000000000000000000',
directoryContract: process.env.DIRECTORY_CONTRACT ?? '0x0000000000000000000000000000000000000000',