-
Notifications
You must be signed in to change notification settings - Fork 19
/
truffle.js
114 lines (105 loc) · 2.4 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const HDWalletProvider = require("@truffle/hdwallet-provider");
const fs = require('fs');
/*
if (fs.existsSync('secrets.json')) {
const secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8'));
({ MNEMONIC } = secrets);
}
if (fs.existsSync('apiKey.json')) {
const key = JSON.parse(fs.readFileSync('apiKey.json', 'utf8'));
({ INFURA_API_KEY } = key);
}
*/
let MNEMONIC;
let INFURA_API_KEY;
if (fs.existsSync('mnemonic.json')) {
const json = JSON.parse(fs.readFileSync('mnemonic.json', 'utf8'));
MNEMONIC = json.mnemonic;
INFURA_API_KEY = json.infura;
}
//const MNEMONIC = process.env.MNEMONIC_PHRASE;
//const INFURA_API_KEY = process.env.INFURA_API_KEY;
module.exports = {
plugins: ["truffle-security"],
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*",
gas: 6500000,
gasPrice: 7000000000
},
mybit: {
host: "localhost",
port: 8545,
network_id: "*",
gas: 6500000,
gasPrice: 7000000000
},
test: {
host: "localhost",
port: 8545,
network_id: "*",
gas: 6500000,
gasPrice: 7000000000
},
coverage: {
host: "localhost",
port: 8555,
network_id: "*",
gas: 0xfffffffffff,
gasPrice: 0x01
},
mainnet: {
provider: function() {
return new HDWalletProvider(MNEMONIC, "https://mainnet.infura.io/v3/"+INFURA_API_KEY)
},
network_id: 1,
// gas: 8000000,
gasPrice: 95000000000
},
ropsten: {
provider: function() {
return new HDWalletProvider(MNEMONIC, "https://ropsten.infura.io/v3/"+INFURA_API_KEY)
},
network_id: 3,
gasPrice: 40000000000
},
rinkeby: {
provider: function() {
return new HDWalletProvider(MNEMONIC, "https://rinkeby.infura.io/v3/"+INFURA_API_KEY)
},
network_id: 4,
gasPrice: 40000000000
},
ethpm: {
ipfs_host: "127.0.0.1",
ipfs_protocol: "http",
registry: "0x8011df4830b4f696cd81393997e5371b93338878",
install_provider_uri: "https://ropsten.infura.io/truffle"
}
},
mocha: {
enableTimeouts: false,
useColors: true,
bail: false
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
compilers: {
solc: {
version: "0.4.24"
}
}
/*
compilers: {
solc: {
version: "node_modules/solc"
}
}
*/
};