Skip to content

Commit

Permalink
fix .env load and add example file
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAleksaOpacic committed Mar 16, 2024
1 parent dc40420 commit be05e8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MUMBAI_PRIVATE_KEY=""
MUMBAI_ALCHEMY_KEY=""
SEPOLIA_PRIVATE_KEY=""
SEPOLIA_ALCHEMY_KEY=""
PRODUCTION_PRIVATE_KEY=""
PRODUCTION_ALCHEMY_KEY=""
8 changes: 8 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ require("hardhat-deploy");
require('hardhat-deploy-ethers');
require('hardhat-contract-sizer');

import "dotenv/config";
import './tasks/modular-test'

const DEFAULT_PRIVATE_KEY = "0x" + "0".repeat(64); // 32 bytes of zeros placeholder to pass config validation

const MUMBAI_PRIVATE_KEY = process.env.MUMBAI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const MUMBAI_ALCHEMY_KEY = process.env.MUMBAI_ALCHEMY_KEY || "";

const SEPOLIA_PRIVATE_KEY = process.env.SEPOLIA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const SEPOLIA_ALCHEMY_KEY = process.env.SEPOLIA_ALCHEMY_KEY || "";

Expand Down Expand Up @@ -47,6 +51,10 @@ module.exports = {
},
localhost: {
url: "http://127.0.0.1:8545",
},
mumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${MUMBAI_ALCHEMY_KEY}`,
accounts: [MUMBAI_PRIVATE_KEY]
}
},
etherscan: {
Expand Down

0 comments on commit be05e8c

Please sign in to comment.