-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
106 lines (102 loc) · 2.6 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
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
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import "hardhat-contract-sizer";
import "hardhat-gas-reporter";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-etherscan";
import * as fs from "fs";
function mnemonic() {
try {
return fs.readFileSync("./mnemonic.txt").toString().trim();
} catch (e) {
console.log("Couldn't read mnemonic", e);
}
return "";
}
function deployerPk() {
try {
return fs.readFileSync("./pk.txt").toString().trim();
} catch (e) {
console.log("Couldn't read pk", e);
}
return "";
}
const infuraId = "643e4d7aeffa4bd1b56c33e0c99b7604";
module.exports = {
networks: {
hardhat: {
chainId: 1337,
// accounts: [
// {
// privateKey:
// "c6cbd7d76bc5baca530c875663711b947efa6a86a900a9e8645ce32e5821484e",
// balance: "100000000000000000000000",
// },
// ],
},
localhost: {
url: "http://localhost:8545",
},
rinkeby: {
url: "https://rinkeby.infura.io/v3/" + infuraId,
accounts: [deployerPk()],
},
goerli: {
url: "https://goerli.infura.io/v3/" + infuraId,
accounts: [deployerPk()],
},
kovan: {
url: "https://kovan.infura.io/v3/" + infuraId,
accounts: [deployerPk()],
},
mainnet: {
url: "https://mainnet.infura.io/v3/" + infuraId,
accounts: [deployerPk()],
gasPrice: 10e9,
},
},
etherscan: {
apiKey: {
rinkeby: `5NE8T9T1Q6PT9DTHC5DTB8GU4BK76W7SMQ`,
goerli: `5NE8T9T1Q6PT9DTHC5DTB8GU4BK76W7SMQ`,
kovan: `5NE8T9T1Q6PT9DTHC5DTB8GU4BK76W7SMQ`,
mainnet: `5NE8T9T1Q6PT9DTHC5DTB8GU4BK76W7SMQ`,
// mainnet: `${process.env.ETHERSCAN_API_KEY}`,
},
},
solidity: {
version: "0.8.12",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
namedAccounts: {
deployer: 0,
dev: 1,
fee: 2,
},
paths: {
sources: "./contracts",
cache: "./cache",
artifacts: "./artifacts",
},
mocha: {
timeout: 100000000,
},
typechain: {
outDir: "typechain-types",
target: "ethers-v5",
alwaysGenerateOverloads: false, // should overloads with full signatures like deposit(uint256) be generated always, even if there are no overloads?
// externalArtifacts: ["externalArtifacts/*.json"], // optional array of glob patterns with external artifacts to process (for example external libs from node_modules)
},
gasReporter: {
currency: "USD",
gasPrice: 14,
coinmarketcap: "cde088de-a8a7-493c-84d8-e9ecd6fac3a9",
},
};