From d02005be006274f9e48f497aef539a6b628f66f3 Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Mon, 30 Oct 2023 16:34:18 +0100 Subject: [PATCH] chore: change hardhat conf --- hardhat.config.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index f512039..1cff51d 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -11,17 +11,10 @@ dotenv.config(); const deployPrivateKey = (process.env.DEPLOYER_PRIVATE_KEY as string) || ""; -const config: HardhatUserConfig = { - solidity: { - version: "0.8.20", - settings: { - optimizer: { - enabled: true, - runs: 400, - }, - }, - }, - networks: { +let networks = {}; + +if (deployPrivateKey !== "") { + networks = { goerli: { accounts: [deployPrivateKey], chainId: 5, @@ -77,7 +70,20 @@ const config: HardhatUserConfig = { chainId: 250, url: "https://rpc.fantom.network", }, + }; +} + +const config: HardhatUserConfig = { + solidity: { + version: "0.8.20", + settings: { + optimizer: { + enabled: true, + runs: 400, + }, + }, }, + networks, etherscan: { apiKey: { goerli: process.env.ETHERSCAN_API_KEY || "",