Skip to content
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: add base network #240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion space-configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export type ZkBadgeAppConfig = AppCommonConfig & {
};
};

export type ZkDropChainName = Network.Gnosis | Network.Mumbai | Network.Sepolia | Network.Polygon | Network.Mainnet |Network.Goerli | Network.Optimism | Network.Arbitrum;
export type ZkDropChainName = Network.Gnosis | Network.Mumbai | Network.Sepolia | Network.Polygon | Network.Mainnet |Network.Goerli | Network.Optimism | Network.Arbitrum | Network.Base | Network.BaseGoerli;
export type ZkDropAppConfig = AppCommonConfig & {
type: "zkDrop";
templateConfig: {
Expand Down
12 changes: 12 additions & 0 deletions src/libs/contracts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export enum Network {
OptimismGoerli = "optimism-goerli",
Arbitrum = "arbitrum",
ArbitrumGoerli = "arbitrum-goerli",
Base = "base",
BaseGoerli = "base-goerli",
ScrollTestnet = "scroll-testnet",
}

Expand All @@ -27,6 +29,8 @@ export const networkChainIds: { [network in Network]: number } = {
[Network.OptimismGoerli]: 420,
[Network.Arbitrum]: 42161,
[Network.ArbitrumGoerli]: 421613,
[Network.Base]: 8453,
[Network.BaseGoerli]: 84531,
[Network.ScrollTestnet]: 534353,
};

Expand All @@ -41,12 +45,16 @@ export const networkLabels: { [network in Network]?: string } = {
[Network.OptimismGoerli]: "Optimism Goerli",
[Network.Arbitrum]: "Arbitrum",
[Network.ArbitrumGoerli]: "Arbitrum Goerli",
[Network.Base]: "Base",
[Network.BaseGoerli]: "Base Goerli",
[Network.ScrollTestnet]: "Scroll Testnet",
};

export const networkRpcUrls: { [network in Network]?: string } = {
[Network.Arbitrum]: "https://1rpc.io/arb",
[Network.ArbitrumGoerli]: "https://rpc.goerli.arbitrum.gateway.fm",
[Network.Base]: "https://mainnet.base.org",
[Network.BaseGoerli]: "https://goerli.base.org",
[Network.ScrollTestnet]: "https://alpha-rpc.scroll.io/l2",
};

Expand All @@ -61,6 +69,8 @@ export const explorers: { [network in Network]?: string } = {
[Network.OptimismGoerli]: "https://goerli-optimism.etherscan.io",
[Network.Arbitrum]: "https://arbiscan.io",
[Network.ArbitrumGoerli]: "https://goerli.arbiscan.io",
[Network.Base]: "https://basescan.org/",
[Network.BaseGoerli]: "https://goerli.basescan.org/",
};

export const getTxExplorer = ({ txHash, network }: { txHash: string; network: Network }) => {
Expand All @@ -83,11 +93,13 @@ export const getErc721Explorer = ({
case Network.Mumbai:
case Network.OptimismGoerli:
case Network.Sepolia:
case Network.BaseGoerli:
return `https://testnets.opensea.io/assets/${network}/${contractAddress}${
tokenId ? "/" + tokenId : ""
}`;
case Network.Mainnet:
return `https://opensea.io/assets/ethereum/${contractAddress}${tokenId ? "/" + tokenId : ""}`;
case Network.Base:
case Network.Optimism:
return `https://opensea.io/assets/${network}/${contractAddress}${
tokenId ? "/" + tokenId : ""
Expand Down
Loading