-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle-config.js
66 lines (60 loc) · 1.95 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
// trufle-config.js
// required for running ES6 tests
require('babel-register');
require('babel-polyfill');
require('dotenv').config();
const Web3 = require('web3');
const web3 = new Web3();
const HDWalletProvider = require('truffle-hdwallet-provider');
const providerWithMnemonic = (mnemonic, rpcEndpoint) => new HDWalletProvider(mnemonic, rpcEndpoint);
const infuraEndpoint = network => `https://${network}.infura.io/${process.env.INFURA_API_KEY}`;
const infuraProvider = network =>
providerWithMnemonic(process.env.MNEMONIC || '', infuraEndpoint(network));
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
migrations_directory: './migrations', // eslint-disable-line camelcase
networks: {
development: {
host: 'localhost',
network_id: '*', // eslint-disable-line camelcase
port: 8545,
},
coverage: {
host: 'localhost',
network_id: '*', // eslint-disable-line camelcase
port: 8555, // <-- If you change this, also set the port option in .solcover.js.
gas: 0xfffffffffff, // <-- Use this high gas value
gasPrice: 0x01, // <-- Use this low gas price
},
ganache: {
host: '127.0.0.1',
network_id: 5777, // eslint-disable-line camelcase
port: 7545,
},
rinkeby: {
provider: () => infuraProvider('rinkeby'),
network_id: 4, // eslint-disable-line camelcase
gas: 4700000,
gasPrice: web3.utils.toWei('50', 'gwei'),
},
ropsten: {
provider: () => infuraProvider('ropsten'),
network_id: 3, // eslint-disable-line camelcase
gas: 6721974,
gasPrice: web3.utils.toWei('20', 'gwei'),
},
mainnet: {
provider: () => infuraProvider('mainnet'),
network_id: 1, // eslint-disable-line camelcase
gas: 4712388,
gasPrice: web3.utils.toWei('10', 'gwei'),
},
},
solc: {
optimizer: {
enabled: true,
runs: 500,
},
},
};