-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtruffle-config.js
191 lines (184 loc) · 5.17 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
require("@babel/register")({
ignore: [/node_modules/]
});
require("@babel/polyfill");
require("ts-node/register");
// if (process.env.NODE_ENV !== 'production') { // https://codeburst.io/process-env-what-it-is-and-why-when-how-to-use-it-effectively-505d0b2831e7
require("dotenv").load();
// }
const PrivateKeyProvider = require("truffle-hdwallet-provider-privkey");
const HDWalletProvider = require("truffle-hdwallet-provider");
const SafeHDWalletProvider = require("truffle-safe-hdwallet-provider");
const HttpProvider = require("web3-providers-http");
const mnemonic = process.env.MNEMONIC;
const privateKey = process.env.PRIVATE_KEY;
const infura_api = process.env.INFURA_API;
const alchemy_key = process.env.ALCHEMY_KEY;
const admin_mnemonic = process.env.ADMIN_MNEMONIC;
const admin_password = process.env.ADMIN_PASSWORD;
const FUSE_RPC = "https://rpc.fuse.io/";
const ropsten_settings = {
provider: function() {
return new HDWalletProvider(
mnemonic,
"https://eth-ropsten.alchemyapi.io/v2/" + alchemy_key,
// "https://ropsten.infura.io/v3/" + infura_api,
0,
10
);
},
gas: 3000000,
timeoutBlocks: 4000,
gasPrice: 25000000000,
network_id: 3,
skipDryRun: true
};
console.log({ mnemonic, admin_mnemonic, privateKey, infura_api, alchemy_key });
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
develop: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://localhost:9545/", 0, 10);
},
// used for 'truffle console' command for debugging purpose. https://truffleframework.com/tutorials/debugger-variable-inspection
host: "127.0.0.1",
port: 9545, // "truffle develop" runs on 9545
network_id: "4447", // Match any network id,
gas: 9000000,
gasPrice: 1000000000 //1 gwei
// from: '0x8ae536FAcb8C89163A0c5A5817Aaa75F65F1bcA6' // should be equal to first address in truffle UI list - address[0]
},
ganache: {
host: "127.0.0.1",
port: 8545,
network_id: "4447", // my "ganache " runs with 6000 network_id - configurable
gas: 8000000,
from: "0x9689dc4d84b36efa1f02260a90063ae91ef0cbd8"
},
test: {
host: "127.0.0.1",
port: 9545,
network_id: "*",
gas: 9000000,
gasPrice: 1000000000 //1 gwei
},
tdd: {
host: "127.0.0.1",
port: 9545,
network_id: "*",
gas: 9000000,
gasPrice: 1000000000 //1 gwei
},
coverage: {
host: "127.0.0.1",
network_id: "*", // eslint-disable-line camelcase
port: 8555,
gas: 0xfffffffffff,
gasPrice: 0x01
},
ropsten: ropsten_settings,
kovan: {
provider: function() {
return new HDWalletProvider(
mnemonic,
"https://kovan.infura.io/v3/" + infura_api,
0,
10
);
},
network_id: 42,
gas: 8000000,
skipDryRun: true,
gasPrice: 2000000000 //2 gwei
},
fuse: {
provider: function() {
return new HDWalletProvider(mnemonic, FUSE_RPC, 0, 10);
},
network_id: 122,
gas: 8500000,
skipDryRun: true,
gasPrice: 2000000000 //1 gwei
},
staging: {
provider: function() {
return new HDWalletProvider(mnemonic, FUSE_RPC, 0, 10);
},
network_id: 122,
gas: 8500000,
skipDryRun: true,
gasPrice: 2000000000 //1 gwei
},
"fuse-mainnet": ropsten_settings,
"staging-mainnet": ropsten_settings,
"production-mainnet": {
provider: () =>
new HDWalletProvider(
admin_mnemonic,
// "https://eth-mainnet.alchemyapi.io/v2/" + alchemy_key,
// "wss://mainnet.infura.io/ws",
"https://mainnet.infura.io/v3/" + infura_api,
0,
10
),
gas: 2000000,
timeoutBlocks: 400,
gasPrice: 51000000000,
network_id: 1,
skipDryRun: true,
networkCheckTimeout: 10000
},
"production-admin": {
provider: () =>
new SafeHDWalletProvider(admin_mnemonic, FUSE_RPC, 0, 10, admin_password),
gas: 3000000,
timeoutBlocks: 400,
gasPrice: 51000000000,
network_id: 122,
skipDryRun: true,
networkCheckTimeout: 5000
},
etoro: {
provider: function() {
return new PrivateKeyProvider([privateKey], FUSE_RPC);
},
network_id: 122,
gas: 8500000,
skipDryRun: true,
gasPrice: 2000000000 //1 gwei
},
production: {
provider: () => new HDWalletProvider(admin_mnemonic, FUSE_RPC, 0, 10),
network_id: 122,
gas: 8500000,
skipDryRun: true,
gasPrice: 1000000000 //1 gwei
}
},
plugins: ["solidity-coverage", "truffle-plugin-verify"],
mocha: {
reporter: "eth-gas-reporter",
reporterOptions: {
currency: "USD"
}
},
api_keys: {
etherscan: "IU57R7ENC6881PG2WN5DRU75DACWYQCXJY"
},
verify: {
preamble: "Support UBI! https://github.com/GoodDollar/GoodContracts"
},
compilers: {
solc: {
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
}
// test_file_extension_regexp: /.*\.test\.(ts|.js)$/
};