Config using .env for private key and alchemy api

This commit is contained in:
Keshav Gupta 2022-06-23 17:25:07 +02:00
parent 5544cd7ce2
commit f2fa9a5015
1 changed files with 10 additions and 2 deletions

View File

@ -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;