forked from alcueca/ERC3156
-
Notifications
You must be signed in to change notification settings - Fork 2
/
buidler.config.js
94 lines (88 loc) · 2.32 KB
/
buidler.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
const fs = require('fs')
const path = require('path')
usePlugin('@nomiclabs/buidler-truffle5')
usePlugin('solidity-coverage')
usePlugin('buidler-gas-reporter')
usePlugin('buidler-deploy')
// REQUIRED TO ENSURE METADATA IS SAVED IN DEPLOYMENTS (because solidity-coverage disable it otherwise)
const {
TASK_COMPILE_GET_COMPILER_INPUT
} = require("@nomiclabs/buidler/builtin-tasks/task-names");
task(TASK_COMPILE_GET_COMPILER_INPUT).setAction(async (_, bre, runSuper) => {
const input = await runSuper();
input.settings.metadata.useLiteralContent = bre.network.name !== "coverage";
return input;
})
function nodeUrl(network) {
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;
module.exports = {
defaultNetwork: 'buidlerevm',
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',
},
},
solc: {
version: '0.7.5',
optimizer: {
enabled: true,
runs: 20000,
},
},
gasReporter: {
enabled: true,
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
coverage: './coverage',
coverageJson: './coverage.json',
artifacts: './artifacts',
},
namedAccounts: {
deployer: 0
}
}