Skip to content

Commit

Permalink
feat: add base network
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e committed Aug 21, 2023
1 parent 058b73e commit b8234bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit b8234bb

Please sign in to comment.