added dummy mnemonic

This commit is contained in:
pradyuman-verma 2021-12-11 04:16:46 +05:30 committed by Ishan Jain
parent 3998538598
commit 21a2dd0e10

View File

@ -34,16 +34,13 @@ 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");
} }
let PRIVATE_KEY; const PRIVATE_KEY = process.env.PRIVATE_KEY;
const test = "test test test test test test test test test test test junk";
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 ?? test;
if(!mnemonic) {
PRIVATE_KEY = process.env.PRIVATE_KEY
}
function createTestnetConfig( function createTestnetConfig(
network: keyof typeof chainIds network: keyof typeof chainIds
@ -122,15 +119,19 @@ const config: HardhatUserConfig = {
ropsten: createTestnetConfig("ropsten"), ropsten: createTestnetConfig("ropsten"),
mainnet: { mainnet: {
url: getNetworkUrl("mainnet"), url: getNetworkUrl("mainnet"),
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
}, },
polygon: { polygon: {
url: getNetworkUrl("polygon"), url: getNetworkUrl("polygon"),
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
}, },
avalanche: { avalanche: {
url: getNetworkUrl("avalanche"), url: getNetworkUrl("avalanche"),
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
}, },
arbitrum: { arbitrum: {
url: getNetworkUrl("arbiturm"), url: getNetworkUrl("arbiturm"),
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
}, },
}, },
paths: { paths: {