This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle-config.js
57 lines (49 loc) · 1.58 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
require('dotenv').config();
// OpenZeppelin public network deployment guide
// https://docs.openzeppelin.com/sdk/2.6/public-deploy
const mnemonic = process.env.MNEMONIC;
const HDWalletProvider = require('truffle-hdwallet-provider');
// Create your own key for Production environments (https://infura.io/)
const INFURA_ID = process.env.INFURA_ID || 'd6760e62b67f4937ba1ea2691046f06d';
const configNetwork = (network, networkId, path = "m/44'/60'/0'/0/", gas = 4465030, gasPrice = 1e10) => ({
provider: () => new HDWalletProvider(
mnemonic, `https://${network}.infura.io/v3/${INFURA_ID}`,
0, 1, true, path,
),
networkId,
gas,
gasPrice,
});
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
plugins: [
'truffle-security', // MythX plugin
'solidity-coverage', // https://github.com/sc-forks/solidity-coverage
],
networks: {
development: {
host: '127.0.0.1',
port: 8545,
network_id: '*',
},
ropsten: configNetwork('ropsten', 3),
kovan: configNetwork('kovan', 42),
rinkeby: configNetwork('rinkeby', 4),
main: configNetwork('mainnet', 1),
},
// Configure compiler settings
compilers: {
solc: {
// 0.5.12 is the version used by Dai
version: '0.5.12', // Fetch exact version from solc-bin (default: truffle's version)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200,
},
// evmVersion: 'byzantium',
},
},
},
};