import { NetworkArbitrumOne, NetworkAvalanche, NetworkBase, NetworkBinanceSmartChain, NetworkEthereum, NetworkLinea, NetworkOptimism, NetworkPolygon, NetworkScroll, NetworkZksync, } from '@web3icons/react'; import { arbitrum as viemArbitrum, avalanche as viemAvalanche, base as viemBase, bsc as viemBsc, linea as viemLinea, mainnet as viemMainnet, optimism as viemOptimism, polygon as viemPolygon, polygonZkEvm as viemPolygonZkEvm, scroll as viemScroll, zksync as viemZkSync, } from 'viem/chains'; import type { TypedEvmNetworkConfig } from '@openzeppelin/adapter-evm-core'; export const ethereumMainnet: TypedEvmNetworkConfig = { id: 'ethereum-mainnet', exportConstName: 'ethereumMainnet', name: 'Ethereum', ecosystem: 'evm', network: 'ethereum', type: 'mainnet', isTestnet: false, chainId: 1, // Keyless, CORS-friendly public endpoint (verified: eth_chainId → 0x1, and a browser preflight // returns `access-control-allow-origin: *` with POST allowed). viem's default mainnet transport // is not a dependable browser default, so we pin an explicit one here. This same value is the // last-resort fallback for the ENS v2 L1 path (see `resolveMainnetRpcUrl` in profiles/shared.ts), // so browser mainnet resolution and cross-chain ENS both get a CORS-safe default. rpcUrl: 'https://ethereum-rpc.publicnode.com', explorerUrl: 'https://etherscan.io', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkEthereum, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemMainnet, accessControlIndexerUrl: 'https://ethereum.indexer.pasevin.com', }; export const arbitrumMainnet: TypedEvmNetworkConfig = { id: 'arbitrum-mainnet', exportConstName: 'arbitrumMainnet', name: 'Arbitrum One', ecosystem: 'evm', network: 'arbitrum', type: 'mainnet', isTestnet: false, chainId: 42161, rpcUrl: viemArbitrum.rpcUrls.default.http[0], explorerUrl: 'https://arbiscan.io', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkArbitrumOne, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemArbitrum, accessControlIndexerUrl: 'https://openzeppelin-arbitrum-mainnet.graphql.subquery.network', }; export const polygonMainnet: TypedEvmNetworkConfig = { id: 'polygon-mainnet', exportConstName: 'polygonMainnet', name: 'Polygon', ecosystem: 'evm', network: 'polygon', type: 'mainnet', isTestnet: false, chainId: 137, rpcUrl: viemPolygon.rpcUrls.default.http[0], explorerUrl: 'https://polygonscan.com', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkPolygon, nativeCurrency: { name: 'MATIC', symbol: 'MATIC', decimals: 18, }, viemChain: viemPolygon, accessControlIndexerUrl: 'https://openzeppelin-polygon-mainnet.graphql.subquery.network', }; export const polygonZkEvmMainnet: TypedEvmNetworkConfig = { id: 'polygon-zkevm-mainnet', exportConstName: 'polygonZkEvmMainnet', name: 'Polygon zkEVM', ecosystem: 'evm', network: 'polygon-zkevm', type: 'mainnet', isTestnet: false, chainId: 1101, rpcUrl: viemPolygonZkEvm.rpcUrls.default.http[0], explorerUrl: 'https://zkevm.polygonscan.com', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkPolygon, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemPolygonZkEvm, accessControlIndexerUrl: 'https://polygon-zkevm.indexer.pasevin.com', }; export const baseMainnet: TypedEvmNetworkConfig = { id: 'base-mainnet', exportConstName: 'baseMainnet', name: 'Base', ecosystem: 'evm', network: 'base', type: 'mainnet', isTestnet: false, chainId: 8453, rpcUrl: viemBase.rpcUrls.default.http[0], explorerUrl: 'https://basescan.org', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkBase, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemBase, accessControlIndexerUrl: 'https://openzeppelin-base-mainnet.graphql.subquery.network', }; export const bscMainnet: TypedEvmNetworkConfig = { id: 'bsc-mainnet', exportConstName: 'bscMainnet', name: 'BNB Smart Chain', ecosystem: 'evm', network: 'bsc', type: 'mainnet', isTestnet: false, chainId: 56, rpcUrl: viemBsc.rpcUrls.default.http[0], explorerUrl: 'https://bscscan.com', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkBinanceSmartChain, nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18, }, viemChain: viemBsc, accessControlIndexerUrl: 'https://bsc.indexer.pasevin.com', }; export const optimismMainnet: TypedEvmNetworkConfig = { id: 'optimism-mainnet', exportConstName: 'optimismMainnet', name: 'OP Mainnet', ecosystem: 'evm', network: 'optimism', type: 'mainnet', isTestnet: false, chainId: 10, rpcUrl: viemOptimism.rpcUrls.default.http[0], explorerUrl: 'https://optimistic.etherscan.io', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkOptimism, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemOptimism, accessControlIndexerUrl: 'https://openzeppelin-optimism-mainnet.graphql.subquery.network', }; export const avalancheMainnet: TypedEvmNetworkConfig = { id: 'avalanche-mainnet', exportConstName: 'avalancheMainnet', name: 'Avalanche C-Chain', ecosystem: 'evm', network: 'avalanche', type: 'mainnet', isTestnet: false, chainId: 43114, rpcUrl: viemAvalanche.rpcUrls.default.http[0], explorerUrl: 'https://snowscan.xyz', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkAvalanche, nativeCurrency: { name: 'Avalanche', symbol: 'AVAX', decimals: 18, }, viemChain: viemAvalanche, accessControlIndexerUrl: 'https://avalanche.indexer.pasevin.com', }; // TODO: test and setup the api and explorer config export const zkSyncEraMainnet: TypedEvmNetworkConfig = { id: 'zksync-era-mainnet', exportConstName: 'zkSyncEraMainnet', name: 'ZkSync Era', ecosystem: 'evm', network: 'zksync-era', type: 'mainnet', isTestnet: false, chainId: 324, rpcUrl: viemZkSync.rpcUrls.default.http[0], explorerUrl: 'https://explorer.zksync.io', apiUrl: 'https://block-explorer-api.mainnet.zksync.io/api', primaryExplorerApiIdentifier: 'zksync-era-mainnet', supportsEtherscanV2: false, iconComponent: NetworkZksync, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemZkSync, accessControlIndexerUrl: 'https://zksync-era.indexer.pasevin.com', }; export const scrollMainnet: TypedEvmNetworkConfig = { id: 'scroll-mainnet', exportConstName: 'scrollMainnet', name: 'Scroll', ecosystem: 'evm', network: 'scroll', type: 'mainnet', isTestnet: false, chainId: 534352, rpcUrl: viemScroll.rpcUrls.default.http[0], explorerUrl: 'https://scrollscan.com', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkScroll, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemScroll, accessControlIndexerUrl: 'https://scroll.indexer.pasevin.com', }; export const lineaMainnet: TypedEvmNetworkConfig = { id: 'linea-mainnet', exportConstName: 'lineaMainnet', name: 'Linea', ecosystem: 'evm', network: 'linea', type: 'mainnet', isTestnet: false, chainId: 59144, rpcUrl: viemLinea.rpcUrls.default.http[0], explorerUrl: 'https://lineascan.build', apiUrl: 'https://api.etherscan.io/v2/api', primaryExplorerApiIdentifier: 'etherscan-v2', supportsEtherscanV2: true, iconComponent: NetworkLinea, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, viemChain: viemLinea, accessControlIndexerUrl: 'https://linea.indexer.pasevin.com', }; // TODO: Add other EVM mainnet networks with their public RPCs and viemChain objects