diff --git a/packages/nextjs/.env.example b/packages/nextjs/.env.example index daed05f3..b8e949a6 100644 --- a/packages/nextjs/.env.example +++ b/packages/nextjs/.env.example @@ -19,6 +19,7 @@ NEXT_PUBLIC_POLYGON_ETHERSCAN_API_KEY= NEXT_PUBLIC_ARBITRUM_ETHERSCAN_API_KEY= NEXT_PUBLIC_SCROLL_ETHERSCAN_API_KEY= NEXT_PUBLIC_BSC_ETHERSCAN_API_KEY= +NEXT_PUBLIC_ETHERSCAN_V2_API_KEY= NEXT_PUBLIC_HEIMDALL_URL= diff --git a/packages/nextjs/utils/abi.ts b/packages/nextjs/utils/abi.ts index 838ca1ea..b33e267c 100644 --- a/packages/nextjs/utils/abi.ts +++ b/packages/nextjs/utils/abi.ts @@ -2,7 +2,7 @@ import { isZeroAddress } from "./scaffold-eth/common"; import { Address } from "viem"; export const fetchContractABIFromEtherscan = async (verifiedContractAddress: Address, chainId: number) => { - const apiKey = process.env.NEXT_PUBLIC_MAINNET_ETHERSCAN_API_KEY; + const apiKey = process.env.NEXT_PUBLIC_ETHERSCAN_V2_API_KEY; // First call to get source code and check for implementation const sourceCodeUrl = `https://api.etherscan.io/v2/api?chainid=${chainId}&module=contract&action=getsourcecode&address=${verifiedContractAddress}&apikey=${apiKey}`;