From 0b953e8ee316f7b0d5fd3a88007dd525788b25c4 Mon Sep 17 00:00:00 2001 From: Arthur Abeilice Date: Thu, 14 Sep 2023 17:11:48 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Add=20kroma=20network=20(#1142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding chain kroma * adding multicall address * Update chainId.ts * Update .changeset/adding_kroma.md * Fix lint --------- Co-authored-by: Ɓukasz Stankiewicz --- .changeset/adding_kroma.md | 11 +++++++++++ packages/core/src/constants/chainId.ts | 4 ++++ packages/core/src/hooks/useConfig.test.tsx | 2 +- packages/core/src/model/chain/kroma.ts | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .changeset/adding_kroma.md diff --git a/.changeset/adding_kroma.md b/.changeset/adding_kroma.md new file mode 100644 index 000000000..480c21d05 --- /dev/null +++ b/.changeset/adding_kroma.md @@ -0,0 +1,11 @@ +--- +"@usedapp/core": patch +--- + +Adding the network kroma mainnet: + +https://blockscout.kroma.network/ + +https://kroma.network/ + +it does not have verified contracts yet in the explorer, adding multicall address later. diff --git a/packages/core/src/constants/chainId.ts b/packages/core/src/constants/chainId.ts index 3f9c607c2..8f02f9838 100644 --- a/packages/core/src/constants/chainId.ts +++ b/packages/core/src/constants/chainId.ts @@ -67,6 +67,7 @@ import { LineaTestnet, MantleTestnet, KromaSepoliaTestnet, + KromaMainnet, } from '../model' // rough alphabet order (put network from the same chain together) @@ -138,6 +139,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [ LineaTestnet, MantleTestnet, KromaSepoliaTestnet, + KromaMainnet, ] export enum ChainId { @@ -208,4 +210,6 @@ export enum ChainId { LineaTestnet = 59140, ArbitrumNova = 42170, MantleTestnet = 5001, + Kroma = 255, + KromaSepolia = 2358, } diff --git a/packages/core/src/hooks/useConfig.test.tsx b/packages/core/src/hooks/useConfig.test.tsx index 21c64cd86..990338728 100644 --- a/packages/core/src/hooks/useConfig.test.tsx +++ b/packages/core/src/hooks/useConfig.test.tsx @@ -26,7 +26,7 @@ describe('useConfig', () => { const { result, waitForCurrent } = await renderDAppHook(() => useConfig(), { config: setup.config }) await waitForCurrent((val) => val !== undefined) expect(result.error).to.be.undefined - expect(result.current.networks?.length).to.eq(67) + expect(result.current.networks?.length).to.eq(68) expect(result.current.notifications?.checkInterval).to.eq(500) expect(result.current.notifications?.expirationPeriod).to.eq(5000) }) diff --git a/packages/core/src/model/chain/kroma.ts b/packages/core/src/model/chain/kroma.ts index 354da1209..2c66587ed 100644 --- a/packages/core/src/model/chain/kroma.ts +++ b/packages/core/src/model/chain/kroma.ts @@ -19,3 +19,22 @@ export const KromaSepoliaTestnet: Chain = { getExplorerAddressLink: getAddressLink(KromaSepoliaExplorerUrl), getExplorerTransactionLink: getTransactionLink(KromaSepoliaExplorerUrl), } + +const KromaExplorerUrl = 'https://blockscout.kroma.network/' + +export const KromaMainnet: Chain = { + chainId: 255, + chainName: 'Kroma', + isTestChain: false, + isLocalChain: false, + multicallAddress: '0xE3c886498ac54433F2B0E6842FAE421006067751', + rpcUrl: 'https://api.kroma.network/', + nativeCurrency: { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + }, + blockExplorerUrl: KromaExplorerUrl, + getExplorerAddressLink: getAddressLink(KromaExplorerUrl), + getExplorerTransactionLink: getTransactionLink(KromaExplorerUrl), +}