Skip to content

Commit

Permalink
🐳 Add kroma network (#1142)
Browse files Browse the repository at this point in the history
* Adding chain kroma

* adding multicall address

* Update chainId.ts

* Update .changeset/adding_kroma.md

* Fix lint

---------

Co-authored-by: Łukasz Stankiewicz <[email protected]>
  • Loading branch information
afa7789 and nezouse committed Sep 14, 2023
1 parent 179f853 commit 0b953e8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .changeset/adding_kroma.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions packages/core/src/constants/chainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
LineaTestnet,
MantleTestnet,
KromaSepoliaTestnet,
KromaMainnet,
} from '../model'

// rough alphabet order (put network from the same chain together)
Expand Down Expand Up @@ -138,6 +139,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [
LineaTestnet,
MantleTestnet,
KromaSepoliaTestnet,
KromaMainnet,
]

export enum ChainId {
Expand Down Expand Up @@ -208,4 +210,6 @@ export enum ChainId {
LineaTestnet = 59140,
ArbitrumNova = 42170,
MantleTestnet = 5001,
Kroma = 255,
KromaSepolia = 2358,
}
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useConfig.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
19 changes: 19 additions & 0 deletions packages/core/src/model/chain/kroma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

3 comments on commit 0b953e8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.