Skip to content

Commit

Permalink
chore: add default pk for local devnet
Browse files Browse the repository at this point in the history
  • Loading branch information
tamtamchik committed Dec 12, 2024
1 parent ee55926 commit ce8c268
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 3 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ce8c268

Please sign in to comment.