-
Notifications
You must be signed in to change notification settings - Fork 1
/
truffle.js
58 lines (53 loc) · 1.12 KB
/
truffle.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
require('babel-register')
require('babel-polyfill')
require('dotenv').config()
const INFURA_API_KEY = process.env.INFURA_API_KEY
const MNEMONIC = process.env.MNEMONIC
const HDWalletProvider = require('truffle-hdwallet-provider')
const NETWORK_IDS = {
// mainnet: 1,
ropsten: 3,
rinkeby: 4,
kovan: 42
}
module.exports = {
migrations_directory: './migrations',
networks: {
test: {
host: 'localhost',
port: 9545,
network_id: '*',
gas: 6.5e6,
gasPrice: 5e9,
websockets: true
}
},
compilers: {
solc: {
version: '^0.5.8',
settings: {
optimizer: {
enabled: true,
runs: 500
}
}
}
},
mocha: {
reporter: 'mocha-multi-reporters',
useColors: true,
enableTimeouts: false,
reporterOptions: {
configFile: './mocha-smart-contracts-config.json'
}
}
}
for (const networkName in NETWORK_IDS) {
module.exports.networks[networkName] = {
provider: new HDWalletProvider(
MNEMONIC,
'https://' + networkName + '.infura.io/' + INFURA_API_KEY
),
network_id: NETWORK_IDS[networkName]
}
}