From ce8c2683707f6956ac13dfa1f54aa8078082505a Mon Sep 17 00:00:00 2001 From: Yuri Tkachenko Date: Thu, 12 Dec 2024 11:23:33 +0000 Subject: [PATCH] chore: add default pk for local devnet --- .env.example | 3 +++ globals.d.ts | 3 +++ hardhat.config.ts | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index b654199fd..6f43447a5 100644 --- a/.env.example +++ b/.env.example @@ -61,3 +61,6 @@ GAS_MAX_FEE=100 # Etherscan API key for verifying contracts ETHERSCAN_API_KEY= + +# Local devnet private key +LOCAL_DEVNET_PK=0x0000000000000000000000000000000000000000000000000000000000000000 diff --git a/globals.d.ts b/globals.d.ts index 77a941088..ba0652a07 100644 --- a/globals.d.ts +++ b/globals.d.ts @@ -74,5 +74,8 @@ declare namespace NodeJS { /* for contract sourcecode verification with `hardhat-verify` */ ETHERSCAN_API_KEY?: string; + + /* for local devnet */ + LOCAL_DEVNET_PK?: string; } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 1e4341ab4..26d09c671 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -27,6 +27,8 @@ const HARDHAT_FORKING_URL = process.env.HARDHAT_FORKING_URL || ""; const INTEGRATION_WITH_SCRATCH_DEPLOY = process.env.INTEGRATION_WITH_SCRATCH_DEPLOY || "off"; +export const ZERO_PK = "0x0000000000000000000000000000000000000000000000000000000000000000"; + /* Determines the forking configuration for Hardhat */ function getHardhatForkingConfig() { if (INTEGRATION_WITH_SCRATCH_DEPLOY === "on" || !HARDHAT_FORKING_URL) { @@ -56,7 +58,7 @@ const config: HardhatUserConfig = { }, "local-devnet": { url: process.env.LOCAL_RPC_URL || RPC_URL, - accounts: [process.env.LOCAL_DEVNET_PK || ""], + accounts: [process.env.LOCAL_DEVNET_PK || ZERO_PK], }, "mainnet-fork": { url: process.env.MAINNET_RPC_URL || RPC_URL,