This commit is contained in:
pradyuman-verma 2021-12-11 03:42:05 +05:30 committed by Ishan Jain
parent 6e7381056f
commit 3998538598
2 changed files with 9 additions and 3 deletions

View File

@ -34,13 +34,17 @@ if (!alchemyApiKey) {
throw new Error("Please set your ALCHEMY_API_KEY in a .env file"); throw new Error("Please set your ALCHEMY_API_KEY in a .env file");
} }
const PRIVATE_KEY = process.env.PRIVATE_KEY; let PRIVATE_KEY;
const ETHERSCAN_API = process.env.ETHERSCAN_API_KEY; const ETHERSCAN_API = process.env.ETHERSCAN_API_KEY;
const POLYGONSCAN_API = process.env.POLYGON_API_KEY; const POLYGONSCAN_API = process.env.POLYGON_API_KEY;
const ARBISCAN_API = process.env.ARBISCAN_API_KEY; const ARBISCAN_API = process.env.ARBISCAN_API_KEY;
const SNOWTRACE_API = process.env.SNOWTRACE_API_KEY; const SNOWTRACE_API = process.env.SNOWTRACE_API_KEY;
const mnemonic = process.env.MNEMONIC; const mnemonic = process.env.MNEMONIC;
if(!mnemonic) {
PRIVATE_KEY = process.env.PRIVATE_KEY
}
function createTestnetConfig( function createTestnetConfig(
network: keyof typeof chainIds network: keyof typeof chainIds
): NetworkUserConfig { ): NetworkUserConfig {

View File

@ -1,6 +1,8 @@
import { addresses as addressesPolygon } from "./polygon/addresses"; import { addresses as addressesPolygon } from "./polygon/addresses";
import { addresses } from "./mainnet/addresses"; import { addresses } from "./mainnet/addresses";
import { abis } from "../constant/abis"; import { abis } from "../constant/abis";
import { addresses as addressesArbitrum } from "./arbitrum/addresses";
import { addresses as addressesAvalanche } from "./avalanche/addresses";
import hre from "hardhat"; import hre from "hardhat";
import type { Signer, Contract } from "ethers"; import type { Signer, Contract } from "ethers";
@ -18,8 +20,8 @@ interface DeployInterface {
function getAddress(network: string | undefined) { function getAddress(network: string | undefined) {
if (network === "polygon") return addressesPolygon; if (network === "polygon") return addressesPolygon;
// else if (network === "arbitrum") return addressesPolygon; else if (network === "arbitrum") return addressesArbitrum;
// else if (network === "avalanche") return addressesPolygon; else if (network === "avalanche") return addressesAvalanche;
else return addresses; else return addresses;
} }