-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support base and base sepolia parent chains #1996
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
name: 'Base', | ||
logo: '/images/BaseWhite.svg', | ||
description: | ||
'Base is built as an Ethereum L2, decentralized with the Optimism Superchain, and incubated by Coinbase.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we want to update the copy, i grabbed it from their website
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for product
(isSourceChainArbitrum && isDestinationChainOrbit) | ||
const { isBase: isDestinationChainBase } = isNetwork(destinationChainId) | ||
|
||
const isDeposit = isDepositMode({ sourceChainId, destinationChainId }) | ||
|
||
const isWithdrawal = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this work?
const isWithdrawal = !isDeposit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking with @dewanshparashar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we cannot. Because our isSupported
flag in bridge-sdk>utils is a union of isDeposit || isWithdrawal || isTeleport
and having isWthdrawal = !isDeposit
will lead it to support all unsupported combinations.
packages/arb-token-bridge-ui/src/util/__tests__/networks.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Bartek <[email protected]>
// L3 Testnets | ||
L3Local = 333333 | ||
} | ||
|
||
type L1Network = { | ||
type NonArbParentNetwork = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spsjvc not sure about this name, any suggestions?
) | ||
const otherNetworks = chainIds.filter(chainId => isNetwork(chainId).isBase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we ever add other chains to this group this check would fail, so can we do
const otherNetworks = chainIds.filter(chainId => isNetwork(chainId).isBase) | |
const otherNetworks = chainIds.filter(chainId => !isNetwork(chainId).isCoreChain && !isNetwork(chainId).isOrbitChain) |
ChainId.ArbitrumSepolia | ||
ChainId.ArbitrumSepolia, | ||
ChainId.BaseSepolia, | ||
ChainId.Base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base shouldn't be part of this list, should be only testnets
if (isL1Chain(chain) && getChildrenForNetwork(chain.chainId).length === 0) { | ||
// exclude L1 chains or Base Chains with no child chains | ||
if ( | ||
!('parentChainId' in chain) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use isNonArbParentChain
instead
@@ -236,14 +270,19 @@ export const getExplorerUrl = (chainId: ChainId) => { | |||
export const getL1BlockTime = (chainId: number) => { | |||
const chain = getChainByChainId(getBaseChainIdByChainId({ chainId })) | |||
|
|||
if (!chain || !isL1Chain(chain)) { | |||
if (!chain || !('blockTime' in chain)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use isNonArbParentChain
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes FS-920