-
Notifications
You must be signed in to change notification settings - Fork 107
/
truffle-config.js
81 lines (73 loc) · 1.68 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require('babel-register');
require('babel-polyfill');
const HDWalletProvider = require('@truffle/hdwallet-provider');
const fs = require('fs');
const mnemonic = fs
.readFileSync('.secret')
.toString()
.trim();
const infuraKey = fs
.readFileSync('.infuraKey')
.toString()
.trim();
const ethKey = fs
.readFileSync('.ethKey')
.toString()
.trim();
module.exports = {
networks: {
development: {
host: '127.0.0.1',
port: 7545,
network_id: '*', // Match any network id
},
//ROPSTEN Test net
ropsten: {
provider: function() {
return new HDWalletProvider(
mnemonic,
`https://ropsten.infura.io/v3/${infuraKey}`
);
},
network_id: 3,
gas: 4500000,
gasPrice: 10000000000,
},
//RINKEBY Test net
rinkeby: {
provider: function() {
return new HDWalletProvider(
mnemonic,
`https://rinkeby.infura.io/v3/${infuraKey}`
);
},
network_id: 4,
gas: 4500000,
gasPrice: 10000000000,
},
},
contracts_directory: './src/contracts/',
contracts_build_directory: './src/abis/',
compilers: {
solc: {
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: 'petersburg',
},
},
//etherscan API key
api_keys: {
etherscan: ethKey,
},
// plugin for verification
plugins: ['truffle-plugin-verify'],
};
//truffle test
// call console - truffle console
// get contract - await TestToken.deployed()
// to compile - truffle compile
// to deploy - truffle migrate --reset
// to deploy - truffle migrate --network rinkeby --reset
// to verify - truffle run verify Contract --network rinkeby