forked from NomicFoundation/hardhat-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
67 lines (61 loc) · 1.67 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { HardhatUserConfig } from "hardhat/config"
import "@nomicfoundation/hardhat-toolbox"
import { config as dotEnvConfig } from "dotenv"
// To work with coverage.
import "solidity-coverage"
// To work with eth-gas-reporter.
import "hardhat-gas-reporter"
// To load all available tasks you should it via manual import.
// Thus, we imported index.ts of the ./tasks module.
import "./tasks"
// Enable deploy.
import "hardhat-deploy";
dotEnvConfig();
const DEFAULT_GAS_PRICE = 100_000_000_000
const PRIVATE_KEYS = process.env?.["PRIVATE_KEY"] ? [process.env?.["PRIVATE_KEY"]] : undefined
const config: HardhatUserConfig = {
solidity: {
version: "0.8.18",
settings: {
optimizer: {
enabled: true,
},
},
},
networks: {
testnet: {
url: process.env["TESTNET_RPC"] ?? "",
accounts: PRIVATE_KEYS,
chainId: 80001,
gasPrice: DEFAULT_GAS_PRICE,
},
testnetSepolia: {
url: process.env["TESTNET_SEPOLIA_RPC"] ?? "",
accounts: PRIVATE_KEYS,
chainId: 11155111,
gasPrice: DEFAULT_GAS_PRICE,
},
testnetMumbai: {
url: process.env["TESTNET_MUMBAI_RPC"] ?? "",
accounts: PRIVATE_KEYS,
chainId: 80001,
gasPrice: DEFAULT_GAS_PRICE,
},
// For the Hardhat dev node.
hardhatDevNode: {
url: process.env["HARDHAT_DEV_NODE_RPC"] ?? "",
accounts: process.env?.["HARDHAT_DEV_NODE_PRIVATE_KEY"] ? [process.env?.["HARDHAT_DEV_NODE_PRIVATE_KEY"]] : undefined,
chainId: 31337,
gasPrice: DEFAULT_GAS_PRICE,
},
},
gasReporter: {
enabled: !!(process.env.REPORT_GAS),
},
namedAccounts: {
deployer: {
default: 0,
}
},
};
export default config;