Skip to content

Commit

Permalink
🪥 Adding base (#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
afa7789 authored Aug 1, 2023
1 parent 3f02a75 commit c112082
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/add_Base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@@ -0,0 +1,5 @@
---
"@usedapp/core": patch
---

⛓ Add Base Mainnet to chain ID
3 changes: 3 additions & 0 deletions packages/core/src/constants/chainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
Velas,
VelasTestnet,
BaseGoerli,
Base,
ZkSync,
ZkSyncTestnet,
ArbitrumRedditTestnet,
Expand Down Expand Up @@ -127,6 +128,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [
KlaytnTestnet,
Klaytn,
BaseGoerli,
Base,
ScrollAlphaTestnet,
LineaTestnet,
MantleTestnet,
Expand Down Expand Up @@ -192,6 +194,7 @@ export enum ChainId {
KlaytnTestnet = 1001,
Klaytn = 8217,
BaseGoerli = 84531,
Base = 8453,
ScrollAlpha = 534353,
LineaTestnet = 59140,
ArbitrumNova = 42170,
Expand Down
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(63)
expect(result.current.networks?.length).to.eq(64)
expect(result.current.notifications?.checkInterval).to.eq(500)
expect(result.current.notifications?.expirationPeriod).to.eq(5000)
})
Expand Down
24 changes: 23 additions & 1 deletion packages/core/src/model/chain/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,26 @@ export const BaseGoerli: Chain = {
getExplorerTransactionLink: getTransactionLink(baseGoerliUrl),
}

export default { BaseGoerli }
const baseUrl = 'https://basescan.org'

export const Base: Chain = {
chainId: 8453,
chainName: 'Base',
isTestChain: false,
isLocalChain: false,
multicallAddress: '0x38641b7a50CDcfde75a7A83eB7c02581F3279362',
rpcUrl: 'https://base.org',
nativeCurrency: {
name: 'Ether',
symbol: 'ETH',
decimals: 18,
},
blockExplorerUrl: baseUrl,
getExplorerAddressLink: getAddressLink(baseUrl),
getExplorerTransactionLink: getTransactionLink(baseUrl),
}

export default {
BaseGoerli,
Base,
}

3 comments on commit c112082

@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.