forked from alcueca/ERC3156
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
86 lines (83 loc) · 2.13 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
const fs = require('fs')
const path = require('path')
import "@nomiclabs/hardhat-truffle5";
import "solidity-coverage";
import "hardhat-deploy";
import "hardhat-gas-reporter";
function nodeUrl(network: any) {
let infuraKey
try {
infuraKey = fs.readFileSync(path.resolve(__dirname, '.infuraKey')).toString().trim()
} catch(e) {
infuraKey = ''
}
return `https://${network}.infura.io/v3/${infuraKey}`
}
let mnemonic = process.env.MNEMONIC;
if (!mnemonic) {
try {
mnemonic = fs.readFileSync(path.resolve(__dirname, '.secret')).toString().trim()
} catch(e){}
}
const accounts = mnemonic ? {
mnemonic,
}: undefined;
export default {
defaultNetwork: "hardhat",
networks: {
kovan: {
accounts,
url: nodeUrl('kovan'),
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
gasPrice: 10000000000, // 10 gwei
skipDryRun: false // Skip dry run before migrations? (default: false for public nets )
},
goerli: {
accounts,
url: nodeUrl('goerli'),
},
rinkeby: {
accounts,
url: nodeUrl('rinkeby')
},
ropsten: {
accounts,
url: nodeUrl('ropsten')
},
mainnet: {
accounts,
url: nodeUrl('mainnet'),
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
gasPrice: 50000000000, // 50 gwei
skipDryRun: false // Skip dry run before migrations? (default: false for public nets )
},
coverage: {
url: 'http://127.0.0.1:8555',
},
},
solidity: {
compilers: [
{
version: "0.8.0"
},
{
version: "0.7.5",
settings: { }
}
],
settings: {
optimizer: {
enabled: true,
runs: 20000
},
},
},
gasReporter: {
enabled: true
},
paths: {
artifacts: "./build",
coverage: "./coverage",
coverageJson: "./coverage.json",
},
};