-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle.js
50 lines (45 loc) · 1.54 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
const HDWalletProvider = require('truffle-hdwallet-provider');
const DotEnv = require('dotenv');
DotEnv.config();
const mnemonic = process.env.MNEMONIC;
const infuraToken = 'IMsVbCijmt9z4RnBadCo';
function gwei(n) { return n * (10 ** 9); }
function mwei(n) { return n * (10 ** 6); }
const gasLimit = mwei(6);
const gasPrice = gwei(30);
module.exports = {
networks: {
ganache: {
host: 'localhost',
port: 7545,
network_id: '*', // Match any network id
},
ropsten: {
network_id: 3, // Official ropsten network id
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/${infuraToken}`),
gas: gasLimit,
gasPrice: gasPrice,
},
kovan: {
network_id: 42, // Official kovan network id
provider: () => new HDWalletProvider(mnemonic, `https://kovan.infura.io/${infuraToken}`),
gas: gasLimit,
gasPrice: gasPrice,
},
rinkeby: {
network_id: 4, // Official rinkeby network id
provider: () => new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/${infuraToken}`),
gas: gasLimit,
gasPrice: gasPrice,
},
mainnet: {
network_id: 1, // Official main network id
provider: () => new HDWalletProvider(mnemonic, `https://mainnet.infura.io/${infuraToken}`),
gas: gasLimit,
gasPrice: gasPrice,
}
},
mocha: {
reporter: 'eth-gas-reporter',
}
};