-
Notifications
You must be signed in to change notification settings - Fork 18
/
truffle.js
31 lines (28 loc) · 855 Bytes
/
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
const yargs = require('yargs');
var provider, address;
if (yargs.argv.network == 'rinkeby' || yargs.argv.network == 'mainnet') {
var providerURL = `https://${yargs.argv.network}.infura.io/${yargs.argv.accessToken}`;
var HDWalletProvider = require('truffle-hdwallet-provider');
var mnemonic = yargs.argv.mnemonic;
provider = new HDWalletProvider(mnemonic, providerURL, 0);
address = "0x" + provider.wallet.getAddress().toString("hex");
console.log('Provider address', address);
console.log('Deploying to ', providerURL);
}
module.exports = {
networks: {
rinkeby: {
gasPrice: 800000000000, // 80 gwei,
provider: provider,
network_id: 3,
from: address
},
mainnet: {
gas: 2550000,
gasPrice: 1000000000, // 1 gwei
provider: provider,
network_id: 1,
from: address
}
}
};