Skip to content

Commit

Permalink
Add support for Berachain Artio, Blast Sepolia and RARI Chain
Browse files Browse the repository at this point in the history
  • Loading branch information
rkalis committed Feb 29, 2024
1 parent 31dafec commit eaf9f5a
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cypress/e2e/chains.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const TEST_ADDRESSES = {
[ChainId.PolygonMainnet]: '0xe126b3E5d052f1F575828f61fEBA4f4f2603652a',
[ChainId.PolygonzkEVM]: '0x16959Ac6E43f509F9d16De76B3B6f60D908BF816',
[ChainId.PulseChain]: '0x9c128fFa923B251Fa40F58906034b2DeaE6C3146',
[1380012617]: '0xE247B36665d3E1a5B17f0E5F795096ca0015e9d9',
[ChainId.RedlightChainMainnet]: '0xfE294d4CfA1F3b57b902d60c17B583DED8C519bb',
[ChainId.RolluxMainnet]: '0x75CCD3a10D9325aE2BF7f59d23A892061952fAF3',
[ChainId.RootstockMainnet]: '0xe126b3E5d052f1F575828f61fEBA4f4f2603652a',
Expand All @@ -103,6 +104,8 @@ const TEST_ADDRESSES = {
[ChainId.ArbitrumSepolia]: '0xDd3287043493E0a08d2B348397554096728B459c',
[ChainId.AvalancheFujiTestnet]: '0x4D915A2f0a2c94b159b69D36bc26338E0ef8E3F6',
[ChainId.BaseGoerliTestnet]: '0xDEA7DBE814dc0B13C57ed78ff2b3B3cc8Efab4be',
[ChainId.BerachainArtio]: '0x1F8C24902fbe49c235aD89F93d0C06CD699B0dfE',
[ChainId.BlastSepoliaTestnet]: '0x01208040F4DB383c9f73C023d3c00a5F15bE5bCa',
[ChainId.BNBSmartChainTestnet]: '0x40FE4911704f14f409ebEE40475377720C732803',
[ChainId.CeloAlfajoresTestnet]: '0x486FCa950d82e45e8e6863Fac4d22e0Db1359618',
[ChainId.CoinExSmartChainTestnet]: '0x5B82588003Ac9db7510702171b94f4acAF87Ca72',
Expand Down
23 changes: 22 additions & 1 deletion lib/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ export const PROVIDER_SUPPORTED_CHAINS = [
export const BLOCKSCOUT_SUPPORTED_CHAINS = [
ChainId.Astar,
ChainId.AuroraMainnet,
ChainId.BerachainArtio,
ChainId.BitgertMainnet,
ChainId.BitrockMainnet,
ChainId.BlastSepoliaTestnet,
ChainId.CallistoMainnet,
ChainId.CronosMainnet,
ChainId.CronosTestnet,
Expand Down Expand Up @@ -85,6 +87,7 @@ export const BLOCKSCOUT_SUPPORTED_CHAINS = [
ChainId.PegoNetwork,
ChainId['PGN(PublicGoodsNetwork)'],
ChainId.PulseChainTestnetv4,
1380012617, // RARI Chain
ChainId.RedlightChainMainnet,
ChainId.RolluxMainnet,
ChainId.RootstockMainnet,
Expand Down Expand Up @@ -216,6 +219,7 @@ export const CHAIN_SELECT_MAINNETS = [
ChainId.Shiden,
ChainId.LightlinkPhoenixMainnet,
ChainId.Palm,
1380012617, // RARI Chain
ChainId.BitrockMainnet,
ChainId.Zora,
ChainId.ExosamaNetwork,
Expand Down Expand Up @@ -244,6 +248,7 @@ export const CHAIN_SELECT_TESTNETS = [
ChainId.TaikoJolnirL2,
ChainId.TaikoKatlaL2,
ChainId.FrameTestnet,
ChainId.BlastSepoliaTestnet,
ChainId.AvalancheFujiTestnet,
ChainId.CronosTestnet,
ChainId.PulseChainTestnetv4,
Expand All @@ -257,6 +262,7 @@ export const CHAIN_SELECT_TESTNETS = [
ChainId.HorizenGobiTestnet,
ChainId.ShimmerEVMTestnet,
ChainId.ZetaChainAthens3Testnet,
ChainId.BerachainArtio,
];

export const ORDERED_CHAINS = [...CHAIN_SELECT_MAINNETS, ...CHAIN_SELECT_TESTNETS];
Expand Down Expand Up @@ -306,6 +312,7 @@ export const getChainName = (chainId: number): string => {
[ChainId.BitrockMainnet]: 'Bitrock',
[ChainId.BitTorrentChainMainnet]: 'BTT Chain',
[ChainId.BitTorrentChainTestnet]: 'BTTC Testnet',
[ChainId.BlastSepoliaTestnet]: 'Blast Sepolia',
[ChainId.BNBSmartChainMainnet]: 'BNB Chain',
[ChainId.BNBSmartChainTestnet]: 'BNB Chain Testnet',
[ChainId.BobaNetwork]: 'Boba',
Expand Down Expand Up @@ -372,6 +379,7 @@ export const getChainName = (chainId: number): string => {
[ChainId.PolygonzkEVMTestnet]: 'Polygon zkEVM Testnet',
[ChainId.PulseChain]: 'PulseChain',
[ChainId.PulseChainTestnetv4]: 'PulseChain Testnet',
[1380012617]: 'RARI Chain',
[ChainId.RedlightChainMainnet]: 'Redlight',
[ChainId.RolluxMainnet]: 'Rollux',
[ChainId.RootstockMainnet]: 'Rootstock',
Expand Down Expand Up @@ -400,6 +408,7 @@ export const getChainName = (chainId: number): string => {
[ChainId.ZkSyncSepoliaTestnet]: 'zkSync Sepolia',
[12345678901]: 'Taiko', // TODO: This is a placeholder so we can add a description for Taiko
[12345678902]: 'Frame', // TODO: This is a placeholder so we can add a description for Frame
[12345678903]: 'Berachain', // TODO: This is a placeholder so we can add a description for Berachain
};

const name = overrides[chainId] ?? getChain(chainId)?.name ?? `Chain ID ${chainId}`;
Expand Down Expand Up @@ -447,6 +456,7 @@ export const getChainExplorerUrl = (chainId: number): string | undefined => {
[ChainId.PolygonzkEVMTestnet]: 'https://testnet-zkevm.polygonscan.com',
[ChainId.PulseChain]: 'https://scan.pulsechain.com',
[ChainId.PulseChainTestnetv4]: 'https://scan.v4.testnet.pulsechain.com',
[1380012617]: 'https://mainnet.explorer.rarichain.org',
[ChainId.Scroll]: 'https://scrollscan.com',
[ChainId.SmartBitcoinCash]: 'https://www.smartscan.cash',
[ChainId.Wanchain]: 'https://www.wanscan.org',
Expand All @@ -468,7 +478,7 @@ export const getChainFreeRpcUrl = (chainId: number): string | undefined => {
};

const [rpcUrl] = getChain(chainId)?.rpc ?? [];
return overrides[chainId] ?? rpcUrl;
return overrides[chainId] ?? rpcUrl ?? getChainRpcUrl(chainId);
};

export const getChainRpcUrl = (chainId: number): string | undefined => {
Expand Down Expand Up @@ -502,6 +512,7 @@ export const getChainRpcUrl = (chainId: number): string | undefined => {
[ChainId.PolygonzkEVM]: `https://polygonzkevm-mainnet.g.alchemy.com/v2/${alchemyKey}`,
[ChainId.PolygonzkEVMTestnet]: `https://polygonzkevm-testnet.g.alchemy.com/v2/${alchemyKey}`,
[ChainId.Sepolia]: `https://sepolia.infura.io/v3/${infuraKey}`,
[1380012617]: 'https://mainnet.rpc.rarichain.org/http',
[ChainId.Shiden]: 'https://shiden.public.blastapi.io',
[ChainId.XDCNetwork]: 'https://erpc.xdcrpc.com',
[ChainId.ZetaChainAthens3Testnet]: 'https://zetachain-athens-evm.blockpi.network/v1/rpc/public',
Expand Down Expand Up @@ -549,10 +560,12 @@ export const getChainLogo = (chainId: number): string => {
[ChainId.AvalancheFujiTestnet]: '/assets/images/vendor/chains/avalanche.svg',
[ChainId.Base]: '/assets/images/vendor/chains/base.svg',
[ChainId.BaseGoerliTestnet]: '/assets/images/vendor/chains/base.svg',
[ChainId.BerachainArtio]: '/assets/images/vendor/chains/berachain.jpg',
[ChainId.BitgertMainnet]: '/assets/images/vendor/chains/bitgert.svg',
[ChainId.BitrockMainnet]: '/assets/images/vendor/chains/bitrock.svg',
[ChainId.BitTorrentChainMainnet]: '/assets/images/vendor/chains/bttc.svg',
[ChainId.BitTorrentChainTestnet]: '/assets/images/vendor/chains/bttc.svg',
[ChainId.BlastSepoliaTestnet]: '/assets/images/vendor/chains/blast.jpg',
[ChainId.BNBSmartChainMainnet]: '/assets/images/vendor/chains/bsc.svg',
[ChainId.BNBSmartChainTestnet]: '/assets/images/vendor/chains/bsc.svg',
[ChainId.BobaNetwork]: '/assets/images/vendor/chains/boba.jpg',
Expand Down Expand Up @@ -633,6 +646,7 @@ export const getChainLogo = (chainId: number): string => {
[ChainId.PolygonzkEVMTestnet]: '/assets/images/vendor/chains/polygon.svg',
[ChainId.PulseChain]: '/assets/images/vendor/chains/pulsechain.png',
[ChainId.PulseChainTestnetv4]: '/assets/images/vendor/chains/pulsechain.png',
[1380012617]: '/assets/images/vendor/chains/rari.svg',
[ChainId.RedlightChainMainnet]: '/assets/images/vendor/chains/redlight.png',
[ChainId.RolluxMainnet]: '/assets/images/vendor/chains/rollux.svg',
[ChainId.RootstockMainnet]: '/assets/images/vendor/chains/rootstock.jpg',
Expand Down Expand Up @@ -675,6 +689,7 @@ export const getChainInfoUrl = (chainId: number): string | undefined => {
[ChainId['SongbirdCanary-Network']]: 'https://flare.network/songbird/',
[ChainId.Wanchain]: 'https://www.wanchain.org/',
[ChainId.XDCNetwork]: 'https://xdc.org/',
[1380012617]: 'https://rarichain.org/',
};

const mainnetChainId = getCorrespondingMainnetChainId(chainId);
Expand Down Expand Up @@ -771,10 +786,12 @@ export const getChainApiUrl = (chainId: number): string | undefined => {
[ChainId.AvalancheFujiTestnet]: 'https://api-testnet.snowtrace.io/api',
[ChainId.Base]: 'https://api.basescan.org/api',
[ChainId.BaseGoerliTestnet]: 'https://api-goerli.basescan.org/api',
[ChainId.BerachainArtio]: 'https://api.routescan.io/v2/network/testnet/evm/80085/etherscan/api',
[ChainId.BitgertMainnet]: 'https://brisescan.com/api',
[ChainId.BitrockMainnet]: 'https://explorer.bit-rock.io/api',
[ChainId.BitTorrentChainMainnet]: 'https://api.bttcscan.com/api',
[ChainId.BitTorrentChainTestnet]: 'https://api-testnet.bttcscan.com/api',
[ChainId.BlastSepoliaTestnet]: 'https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan/api',
[ChainId.BNBSmartChainMainnet]: 'https://api.bscscan.com/api',
[ChainId.BNBSmartChainTestnet]: 'https://api-testnet.bscscan.com/api',
[ChainId.CallistoMainnet]: 'https://explorer.callisto.network/api',
Expand Down Expand Up @@ -833,6 +850,7 @@ export const getChainApiUrl = (chainId: number): string | undefined => {
[ChainId.PolygonzkEVMTestnet]: 'https://api-testnet-zkevm.polygonscan.com/api',
[ChainId.PulseChain]: 'https://scan.pulsechain.com/api',
[ChainId.PulseChainTestnetv4]: 'https://scan.v4.testnet.pulsechain.com/api',
[1380012617]: 'https://mainnet.explorer.rarichain.org/api',
[ChainId.RedlightChainMainnet]: 'https://redlightscan.finance/api',
[ChainId.RolluxMainnet]: 'https://explorer.rollux.com/api',
[ChainId.RootstockMainnet]: 'https://blockscout.com/rsk/mainnet/api',
Expand Down Expand Up @@ -902,6 +920,8 @@ export const getCorrespondingMainnetChainId = (chainId: number): number | undefi
[ChainId.ArbitrumSepolia]: ChainId.ArbitrumOne,
[ChainId.AvalancheFujiTestnet]: ChainId['AvalancheC-Chain'],
[ChainId.BaseGoerliTestnet]: ChainId.Base,
[ChainId.BerachainArtio]: 12345678903, // TODO: This is a placeholder so we can add a description for Berachain
[ChainId.BlastSepoliaTestnet]: ChainId.Blast,
[ChainId.BNBSmartChainTestnet]: ChainId.BNBSmartChainMainnet,
[ChainId.CeloAlfajoresTestnet]: ChainId.CeloMainnet,
[ChainId.CoinExSmartChainTestnet]: ChainId.CoinExSmartChainMainnet,
Expand Down Expand Up @@ -959,6 +979,7 @@ export const getChainDeployedContracts = (chainId: number): any | undefined => {
[ChainId.BaseGoerliTestnet]: { ...MULTICALL },
[ChainId.BitgertMainnet]: { ...MULTICALL },
[ChainId.BitTorrentChainMainnet]: { ...MULTICALL },
[ChainId.BlastSepoliaTestnet]: { ...MULTICALL },
[ChainId.BNBSmartChainMainnet]: { ...MULTICALL },
[ChainId.BNBSmartChainTestnet]: { ...MULTICALL },
[ChainId.BobaNetwork]: { ...MULTICALL },
Expand Down
3 changes: 3 additions & 0 deletions locales/en/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"aurora": "Aurora is an EVM compatible blockchain created by the team behind the NEAR blockchain. It uses a consensus mechanism based on Delegated Proof of Stake. Aurora is built as an EVM sidechain for the NEAR ecosystem and features a trustless bridge to bridge to move assets between NEAR, Ethereum and Aurora.",
"avalanche": "Avalanche is a blockchain using the Avalanche consensus mechanism, combining features of both classical and Nakamoto consensus mechanisms to achieve high throughput and fast finality. The core of the Avalanche network consists of three different chains: the Exchange Chain (X-Chain), the Contract Chain (C-Chain) and the Platform Chain (P-Chain). These chains play different parts in the system, where the C-Chain offers support for EVM-compatible smart contracts.",
"base": "Base is a Layer 2 scaling solution for Ethereum developed by Coinbase. It is built on Optimism's Open Source OP Stack, so just like Optimism it uses optimistic rollup technology. It was launched in the summer of 2023 during what they dubbed to be \"onchain summer\". It has already gained a lot of usage, and since they are backed by one of the largest cryptocurrency companies, it is likely to continue to grow.",
"berachain": "Berachain is a Layer 1 blockchain that uses a new consensus mechanism called Proof of Liquidity, a mechanism that builds on top of Proof of Stake. This consensus mechanism aims to improve on Proof of Stake by creating more DEX liquidity in the process of validating transactions, as opposed to regular Proof of Stake, which takes liquidity out of the network.",
"bitgert": "Bitgert Chain is a Layer 1 blockchain created by the Bitgert exchange. It uses a consensus mechanism based on Proof of Authority. This consensus mechanism allows for fast and cheap transactions, but compromises on decentralization. Bitgert also provides other services related to the blockchain, such as a P2P exchange and payment gateway.",
"bitrock": "Bitrock is a sidechain of Ethereum that uses a Proof of Authority consensus mechanism. It was built to offer high throughput and low fees and it achieves that by using the more centralized Proof of Authority consensus mechanism. Bitrock also plans to build a multichain DEX, allowing users to swap tokens between different networks.",
"blast": "Blast is a Layer 2 scaling solution for Ethereum created by the team behind NFT marketplace Blur. Blast has natively built yield into the protocol by automatically staking all ETH and stablecoins that users deposit into the L2 and redistributing the staking rewards - while allowing users to freely transact with these assets on Blast.",
"bnb-chain": "BNB Chain is a popular smart contract blockchain that was created by Binance in 2020. It was one of the earliest alt-L1 blockchains created to offer lower transaction fees and faster transaction times than Ethereum. It achieves this by using a Proof of Staked Authority (PoSA) consensus mechanism, a more centralized version of Proof of Stake (PoS).",
"boba": "Boba is a Layer 2 scaling solution built on top of multiple different EVM blockchains, including Ethereum, BNB Chain and Avalanche, aiming to become a universal scaling platform for all blockchains. To achieve this they use the popular Optimistic Rollup technology, which allows them to offer very low fees while maintaining strong security guarantees.",
"btt-chain": "BitTorrent Chain (BTTC), is a blockchain focused on cross-chain interoperability between Ethereum, Tron and other EVM chains. It uses a consensus mechanism based on Proof of Stake, where validators stake BTT to validate transactions. The validators also periodically submit checkpoints to the Ethereum, BNB Chain and Tron blockchains.",
Expand Down Expand Up @@ -64,6 +66,7 @@
"polygon": "Polygon PoS is an Ethereum sidechain that is secured by a set of validators that are elected by the Polygon community. It is one of the most popular smart contract blockchains, especially in the NFT space. Besides the Polygon PoS network, Polygon is also working on a set of other L2 solutions, such as Polygon zkEVM.",
"polygon-zkevm": "Polygon zkEVM is a new and innovative L2 scaling solution and one of the first zkEVM implementations. zkEVM technology offers higher throughputs at lower costs than many other L2 solutions, while maintaining strong security guarantees compared to other L2 solutions like Optimistic Rollups.",
"pulsechain": "PulseChain is a Layer 1 blockchain built as a full fork of the Ethereum blockchain. This means that it shares the same transaction history up until the launch of the forked network. PulseChain was created out of the HEX community and was created to provide lower fees than Ethereum.",
"rari-chain": "RARI Chain is a Layer 3 blockchain that builds on top of the Arbitrum Nova Layer 2 scaling solution. With its low cost transactions and embedded royalties on the protocol level, RARI Chain aims to empower creators to build and monetize their work.",
"redlight": "Redlight is a Layer 1 blockchain using a Proof of Authority consensus mechanism. By using a mostly centralized Proof of Authority consensus mechanism it is ableto provide a high throughput of transactions without any minimum gas fees under normal operations.",
"rollux": "Rollux is a Layer 2 scaling solution for Syscoin. It uses optimistic rollups to scale Syscoin by executing transactions on Rollux and posting batches of transaction data to Syscoin. By being a Layer 2 solution for Syscoin, Rollux is also able to inherit some of the security properties of Syscoin, such as the merged mining with Bitcoin.",
"rootstock": "Rootstock is a Bitcoin sidechain that aims to bring EVM functionality to the Bitcoin ecosystem. Its network is secured through a process called merged mining, which allows Bitcoin miners to simultaneously use their hashrate for Bitcoin and Rootstock transactions. The bridge between Bitcoin and Rootstock is secured by 9 high-profile organisations through a process they call Powpeg.",
Expand Down
Loading

0 comments on commit eaf9f5a

Please sign in to comment.