From 21a2dd0e10877b01485b73c48b0164a2ce08e498 Mon Sep 17 00:00:00 2001 From: pradyuman-verma Date: Sat, 11 Dec 2021 04:16:46 +0530 Subject: [PATCH] added dummy mnemonic --- hardhat.config.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index fa9c282e..0ee20be7 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -34,16 +34,13 @@ if (!alchemyApiKey) { 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 POLYGONSCAN_API = process.env.POLYGON_API_KEY; const ARBISCAN_API = process.env.ARBISCAN_API_KEY; const SNOWTRACE_API = process.env.SNOWTRACE_API_KEY; -const mnemonic = process.env.MNEMONIC; - -if(!mnemonic) { - PRIVATE_KEY = process.env.PRIVATE_KEY -} +const mnemonic = process.env.MNEMONIC ?? test; function createTestnetConfig( network: keyof typeof chainIds @@ -122,15 +119,19 @@ const config: HardhatUserConfig = { ropsten: createTestnetConfig("ropsten"), mainnet: { url: getNetworkUrl("mainnet"), + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, }, polygon: { url: getNetworkUrl("polygon"), + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, }, avalanche: { url: getNetworkUrl("avalanche"), + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, }, arbitrum: { url: getNetworkUrl("arbiturm"), + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, }, }, paths: {