-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhardhat.config.js
96 lines (90 loc) · 2.1 KB
/
hardhat.config.js
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const dotenv = require("dotenv");
const { task } = require("hardhat/config");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-web3");
require("@nomiclabs/hardhat-truffle5");
require("hardhat-deploy");
dotenv.config();
task("accounts", "Prints the list of accounts", async (_, { ethers }) => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(await account.getAddress());
}
});
const PRIVATE_KEYS = JSON.parse(process.env.PRIVATE_KEYS);
module.exports = {
solidity: {
version: "0.7.4",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
paths: {
sources: "./contracts/0.7.x",
},
networks: {
hardhat: {
live: false,
saveDeployments: false,
tags: ["test", "local"],
},
kovan: {
chainId: 42,
url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [PRIVATE_KEYS[42]],
live: true,
saveDeployments: true,
tags: ["staging"],
},
goerli: {
chainId: 5,
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [PRIVATE_KEYS[5]],
live: true,
saveDeployments: true,
tags: ["staging"],
verify: {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
},
},
mainnet: {
chainId: 1,
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: [PRIVATE_KEYS[1]],
live: true,
saveDeployments: true,
tags: ["production"],
verify: {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
},
},
sokol: {
chainId: 77,
url: "https://sokol.poa.network",
accounts: [PRIVATE_KEYS[77]],
live: true,
saveDeployments: true,
tags: ["staging"],
},
xdai: {
chainId: 100,
url: "https://rpc.xdaichain.com",
accounts: [PRIVATE_KEYS[100]],
live: true,
saveDeployments: true,
tags: ["production"],
},
},
namedAccounts: {
deployer: {
default: 0,
},
},
};