From f2fa9a5015c82ea48e93b2d68f8ffb7831a7ae43 Mon Sep 17 00:00:00 2001 From: Keshav Gupta Date: Thu, 23 Jun 2022 17:25:07 +0200 Subject: [PATCH] Config using .env for private key and alchemy api --- hardhat.config.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index aff5983..b383ef0 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -6,6 +6,8 @@ import "hardhat-gas-reporter"; import "solidity-coverage"; dotenv.config(); +const {GOERLI_URL,PRIVATE_KEY} = process.env; + // This is a sample Hardhat task. To learn how to create your own go to // https://hardhat.org/guides/create-task.html @@ -21,7 +23,13 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => { // Go to https://hardhat.org/config/ to learn more const config: HardhatUserConfig = { - solidity: "0.7.4" + solidity: "0.7.4", + networks: { + goerli: { + url: GOERLI_URL, + accounts: [`${PRIVATE_KEY}`] + } + } }; -export default config; +export default config; \ No newline at end of file