-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtruffle.js
41 lines (37 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
require('babel-polyfill')
require('babel-register')({
// Ignore everything in node_modules except node_modules/zeppelin-solidity.
presets: ['es2015'],
plugins: ['syntax-async-functions', 'transform-regenerator'],
ignore: /node_modules\/(?!zeppelin-solidity)/
})
require('dotenv').config()
const Web3 = require('web3')
const web3 = new Web3()
let rinkebyProvider, mainnetProvider
const HDWalletProvider = require('truffle-hdwallet-provider-privkey')
if (!process.env.SOLIDITY_COVERAGE && process.env.PRIVATE_KEY) {
rinkebyProvider = new HDWalletProvider(process.env.PRIVATE_KEY, 'https://rinkeby.infura.io')
mainnetProvider = new HDWalletProvider(process.env.PRIVATE_KEY, 'https://rinkeby.infura.io')
}
module.exports = {
networks: {
testrpc: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
},
rinkeby: {
provider: rinkebyProvider,
gas: 4600000,
gasPrice: web3.toWei('20', 'gwei'),
network_id: '3'
},
mainnet: {
provider: mainnetProvider,
gas: 4600000,
gasPrice: web3.toWei('20', 'gwei'),
network_id: '1'
}
}
}