forked from FredrikBixo/DecentralizedMedium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
161 lines (157 loc) · 3.75 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
require("@nomiclabs/hardhat-waffle");
// The next line is part of the sample project, you don't need it in your
// project. It imports a Hardhat task definition, that can be used for
// testing the frontend.
require("./tasks/faucet");
const defaultNetwork = "localhost";
function mnemonic() {
try {
return fs.readFileSync("./mnemonic.txt").toString().trim();
} catch (e) {
if (defaultNetwork !== "localhost") {
console.log(
"☢️ WARNING: No mnemonic file created for a deploy account. Try `yarn run generate` and then `yarn run account`."
);
}
}
return "";
}
module.exports = {
defaultNetwork,
networks: {
localhost: {
url: "http://localhost:8545",
/*
notice no mnemonic here? it will just use account 0 of the hardhat node to deploy
(you can put in a mnemonic here to set the deployer locally)
*/
},
rinkeby: {
url: "https://rinkeby.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad", // <---- YOUR INFURA ID! (or it won't work)
accounts: {
mnemonic: mnemonic(),
},
},
kovan: {
url: "https://kovan.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad", // <---- YOUR INFURA ID! (or it won't work)
accounts: {
mnemonic: mnemonic(),
},
},
mainnet: {
url: "https://mainnet.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad", // <---- YOUR INFURA ID! (or it won't work)
accounts: {
mnemonic: mnemonic(),
},
},
ropsten: {
url: "https://ropsten.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad", // <---- YOUR INFURA ID! (or it won't work)
accounts: {
mnemonic: mnemonic(),
},
},
goerli: {
url: "https://goerli.infura.io/v3/460f40a260564ac4a4f4b3fffb032dad", // <---- YOUR INFURA ID! (or it won't work)
accounts: {
mnemonic: mnemonic(),
},
},
xdai: {
url: "https://rpc.xdaichain.com/",
gasPrice: 1000000000,
accounts: {
mnemonic: mnemonic(),
},
},
matic: {
url: "https://rpc-mainnet.maticvigil.com/",
gasPrice: 1000000000,
accounts: {
mnemonic: mnemonic(),
},
},
rinkebyArbitrum: {
url: "https://rinkeby.arbitrum.io/rpc",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
companionNetworks: {
l1: "rinkeby",
},
},
localArbitrum: {
url: "http://localhost:8547",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
companionNetworks: {
l1: "localArbitrumL1",
},
},
localArbitrumL1: {
url: "http://localhost:7545",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
companionNetworks: {
l2: "localArbitrum",
},
},
kovanOptimism: {
url: "https://kovan.optimism.io",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
ovm: true,
companionNetworks: {
l1: "kovan",
},
},
localOptimism: {
url: "http://localhost:8545",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
ovm: true,
companionNetworks: {
l1: "localOptimismL1",
},
},
localOptimismL1: {
url: "http://localhost:9545",
gasPrice: 0,
accounts: {
mnemonic: mnemonic(),
},
companionNetworks: {
l2: "localOptimism",
},
},
},
solidity: {
compilers: [
{
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
ovm: {
solcVersion: "0.7.6",
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
};