Skip to content

Commit

Permalink
Add zksync and gnosis to abi.ts, reorder chains in .env.example, add …
Browse files Browse the repository at this point in the history
…heimdall url
  • Loading branch information
portdeveloper committed Sep 25, 2024
1 parent ca29d35 commit 2757139
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/nextjs/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@

NEXT_PUBLIC_MAINNET_ETHERSCAN_API_KEY=
NEXT_PUBLIC_OPTIMISM_ETHERSCAN_API_KEY=
NEXT_PUBLIC_BASE_ETHERSCAN_API_KEY=
NEXT_PUBLIC_GNOSIS_ETHERSCAN_API_KEY=
NEXT_PUBLIC_ZKSYNC_ETHERSCAN_API_KEY=
NEXT_PUBLIC_POLYGON_ETHERSCAN_API_KEY=
NEXT_PUBLIC_ARBITRUM_ETHERSCAN_API_KEY=
NEXT_PUBLIC_ZKSYNC_ETHERSCAN_API_KEY=
NEXT_PUBLIC_SCROLL_ETHERSCAN_API_KEY=
NEXT_PUBLIC_BASE_ETHERSCAN_API_KEY=
NEXT_PUBLIC_BSC_ETHERSCAN_API_KEY=

NEXT_PUBLIC_HEIMDALL_URL=

NEXT_PUBLIC_ALCHEMY_API_KEY=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
4 changes: 4 additions & 0 deletions packages/nextjs/utils/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const getEtherscanApiKey = (chainId: number): string => {
1: process.env.NEXT_PUBLIC_MAINNET_ETHERSCAN_API_KEY,
10: process.env.NEXT_PUBLIC_OPTIMISM_ETHERSCAN_API_KEY,
8453: process.env.NEXT_PUBLIC_BASE_ETHERSCAN_API_KEY,
100: process.env.NEXT_PUBLIC_GNOSIS_ETHERSCAN_API_KEY,
324: process.env.NEXT_PUBLIC_ZKSYNC_ETHERSCAN_API_KEY,
137: process.env.NEXT_PUBLIC_POLYGON_ETHERSCAN_API_KEY,
42161: process.env.NEXT_PUBLIC_ARBITRUM_ETHERSCAN_API_KEY,
534352: process.env.NEXT_PUBLIC_SCROLL_ETHERSCAN_API_KEY,
Expand Down Expand Up @@ -46,6 +48,8 @@ export const fetchContractABIFromEtherscan = async (verifiedContractAddress: Add
// First call to get source code and check for implementation
const sourceCodeUrl = `${chain.blockExplorers.default.apiUrl}?module=contract&action=getsourcecode&address=${verifiedContractAddress}${apiKeyUrlParam}`;

console.log("Source code URL:", sourceCodeUrl);

const sourceCodeResponse = await fetch(sourceCodeUrl);
const sourceCodeData = await sourceCodeResponse.json();

Expand Down

0 comments on commit 2757139

Please sign in to comment.