Skip to content

Commit

Permalink
🔵 Adding Base Goerli Testnet to chains id (#1110)
Browse files Browse the repository at this point in the history
* adding base goerli

* adding base goerli changeset test

* fix multicall address

* Add missing newline

---------

Co-authored-by: Łukasz Stankiewicz <[email protected]>
  • Loading branch information
afa7789 and nezouse committed May 2, 2023
1 parent b60e349 commit 56a7c5f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/adding-base-goerli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@usedapp/core": patch
---

⛓ Add Base Görli test chain
5 changes: 0 additions & 5 deletions .changeset/swift-boxes-reflect.md

This file was deleted.

3 changes: 3 additions & 0 deletions packages/core/src/constants/chainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
Optimism,
Velas,
VelasTestnet,
BaseGoerli,
ZkSync,
ZkSyncTestnet,
ArbitrumRedditTestnet,
Expand Down Expand Up @@ -120,6 +121,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [
RootstockTestnet,
KlaytnTestnet,
Klaytn,
BaseGoerli,
]

export enum ChainId {
Expand Down Expand Up @@ -181,4 +183,5 @@ export enum ChainId {
RootstockTestnet = 31,
KlaytnTestnet = 1001,
Klaytn = 8217,
BaseGoerli = 84531,
}
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(58)
expect(result.current.networks?.length).to.eq(59)
expect(result.current.notifications?.checkInterval).to.eq(500)
expect(result.current.notifications?.expirationPeriod).to.eq(5000)
})
Expand Down
23 changes: 23 additions & 0 deletions packages/core/src/model/chain/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Chain } from '../../constants'
import { getAddressLink, getTransactionLink } from '../../helpers/chainExplorerLink'

const baseGoerliUrl = 'https://goerli.basescan.org'

export const BaseGoerli: Chain = {
chainId: 84531,
chainName: 'Base Goerli',
isTestChain: true,
isLocalChain: false,
multicallAddress: '0x1Be882bE320C2C21849891E441da4829a34e0627',
rpcUrl: 'https://goerli.base.org',
nativeCurrency: {
name: 'Goerli Ether',
symbol: 'ETH',
decimals: 18,
},
blockExplorerUrl: baseGoerliUrl,
getExplorerAddressLink: getAddressLink(baseGoerliUrl),
getExplorerTransactionLink: getTransactionLink(baseGoerliUrl),
}

export default { BaseGoerli }
1 change: 1 addition & 0 deletions packages/core/src/model/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ export * from './arbitrumReddit'
export * from './rootstock'
export * from './klaytn'
export * from './celo'
export * from './base'

2 comments on commit 56a7c5f

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