forked from bitsofether/erc20-onboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
67 lines (61 loc) · 1.3 KB
/
truffle-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
'use strict';
require('dotenv').config();
const HDWalletProvider = require("@truffle/hdwallet-provider");
const mnemonic = process.env.MNEMONIC;
const network_id = process.env.NETWORK_ID;
var network;
switch (network_id) {
case '1':
network = 'mainnet';
break;
case '4':
network = 'rinkeby';
break;
default:
network = 'rinkeby';
}
const rpc_url = `https://${network}.infura.io/v3/${process.env.INFURA_PROJECT_ID}`;
module.exports = {
networks: {
test: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:8545/");
},
network_id: '*',
},
local: {
host: 'localhost',
port: 9545,
gas: 5000000,
gasPrice: 5e9,
network_id: '*'
},
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, rpc_url, 0, 2)
},
network_id: '4'
// gasPrice: 10000000000
},
mainnet: {
provider: function() {
return new HDWalletProvider(mnemonic, rpc_url, 0, 2)
},
network_id: network_id,
gasPrice: 42e9,
network_id: '1'
}
},
compilers: {
solc: {
version: "0.5.17",
// docker: true,
// settings: {
// optimizer: {
// enabled: true,
// runs: 200
// }
// }
}
}
};