From e41864eb5e7665c0407c28b7bcf47c3a0d8c7210 Mon Sep 17 00:00:00 2001 From: Cyrille Derche Date: Fri, 30 Aug 2024 19:03:50 +0200 Subject: [PATCH] fix config --- hardhat.config.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 7aa31b5..902f9ad 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,9 +1,14 @@ import { type HardhatUserConfig, vars } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox-viem"; import "@nomiclabs/hardhat-solhint"; +import { generatePrivateKey } from "viem/accounts"; -const PRIVATE_KEY = vars.get("PRIVATE_KEY"); -const ETHERSCAN_API_KEY = vars.get("ETHERSCAN_API_KEY"); +const PRIVATE_KEY = vars.has("PRIVATE_KEY") + ? vars.get("PRIVATE_KEY") + : generatePrivateKey(); +const ETHERSCAN_API_KEY = vars.has("ETHERSCAN_API_KEY") + ? vars.get("ETHERSCAN_API_KEY") + : ""; const config: HardhatUserConfig = { solidity: {