Skip to content

Commit

Permalink
Merge pull request #152 from gnosis/issue-#151_networks
Browse files Browse the repository at this point in the history
Add Optimism and Arbitrum networks to the app
  • Loading branch information
auryn-macmillan authored Oct 28, 2022
2 parents 7155ec0 + ae1ab02 commit 90f44f6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/app/src/utils/explorers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,27 @@ export const EXPLORERS_CONFIG: Record<NETWORK, ExplorerData> = {
explorerApiKey: REACT_APP_ETHERSCAN_KEY,
rpcUrl: `https://goerli.infura.io/v3/${REACT_APP_INFURA_ID}`,
},
[NETWORK.OPTIMISM]: {
networkExplorerName: "Optimistic",
networkExplorerUrl: "https://optimistic.etherscan.io/",
networkExplorerApiUrl: "https://api-optimistic.etherscan.io/api",
safeTransactionApi: "https://safe-transaction.optimism.gnosis.io/",
safeUrl: "https://gnosis-safe.io/app/oeth:",
verifyContractUrl: "https://optimistic.etherscan.io/verifyContract",
explorerApiKey: REACT_APP_ETHERSCAN_KEY,
rpcUrl: `https://optimism-mainnet.infura.io/v3/${REACT_APP_INFURA_ID}`,

},
[NETWORK.ARBITRUM]: {
networkExplorerName: "Arbiscan",
networkExplorerUrl: "https://arbiscan.io/",
networkExplorerApiUrl: "https://api.arbiscan.io/api",
safeTransactionApi: "https://safe-transaction.arbitrum.gnosis.io/",
safeUrl: "https://gnosis-safe.io/app/arb1:",
verifyContractUrl: "https://arbiscan.io/verifyContract",
explorerApiKey: REACT_APP_ETHERSCAN_KEY,
rpcUrl: `https://arbitrum-mainnet.infura.io/v3/${REACT_APP_INFURA_ID}`,
},
}

export const getNetworkExplorerInfo = (chainId: number) => {
Expand Down
16 changes: 16 additions & 0 deletions packages/app/src/utils/networks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export enum NETWORK {
MAINNET = 1,
GOERLI = 5,
OPTIMISM = 10,
BSC = 56,
GNOSIS_CHAIN = 100,
POLYGON = 137,
ARBITRUM = 42161,
}

export interface Coin {
Expand Down Expand Up @@ -38,6 +40,12 @@ export const NETWORKS: Record<NETWORK, Network> = {
shortName: "gor",
nativeAsset: NATIVE_ASSET.ETH,
},
[NETWORK.OPTIMISM]: {
chainId: NETWORK.OPTIMISM,
name: "optimism",
shortName: "oeth",
nativeAsset: NATIVE_ASSET.ETH,
},
[NETWORK.GNOSIS_CHAIN]: {
chainId: NETWORK.GNOSIS_CHAIN,
name: "gnosis_chain",
Expand All @@ -56,12 +64,20 @@ export const NETWORKS: Record<NETWORK, Network> = {
shortName: "matic",
nativeAsset: NATIVE_ASSET.MATIC,
},
[NETWORK.ARBITRUM]: {
chainId: NETWORK.ARBITRUM,
name: "arbitrum",
shortName: "arb1",
nativeAsset: NATIVE_ASSET.ETH,
},
}

export const NETWORK_NATIVE_ASSET: Record<NETWORK, Coin> = {
[NETWORK.MAINNET]: NATIVE_ASSET.ETH,
[NETWORK.GOERLI]: NATIVE_ASSET.ETH,
[NETWORK.OPTIMISM]: NATIVE_ASSET.ETH,
[NETWORK.GNOSIS_CHAIN]: NATIVE_ASSET.XDAI,
[NETWORK.POLYGON]: NATIVE_ASSET.MATIC,
[NETWORK.BSC]: NATIVE_ASSET.BNB,
[NETWORK.ARBITRUM]: NATIVE_ASSET.ETH,
}

1 comment on commit 90f44f6

@vercel
Copy link

@vercel vercel bot commented on 90f44f6 Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zodiac-safe-app – ./packages/app

zodiac-safe-app-git-master-gnosis-guild.vercel.app
zodiac-safe-app-kappa.vercel.app
zodiac-safe-app-gnosis-guild.vercel.app

Please sign in to comment.