-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtruffle-config.js
126 lines (124 loc) · 4.34 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
require("@babel/polyfill");
require('chai/register-should');
const path = require("path");
require('dotenv').config();
const mnemonic = process.env.MAINNET_MNEMONIC;
const kovanPrivateKey = process.env.KOVAN_PRIVATE_KEY;
const HDWalletProvider = require("@truffle/hdwallet-provider");
const LedgerWalletProvider = require('@umaprotocol/truffle-ledger-provider');
const ledgerOptions = {
path: "44'/60'/0'/0/0", // ledger default derivation path
askConfirm: false,
accountsLength: 1,
accountsOffset: 0
};
module.exports = {
plugins: ["truffle-security", "solidity-coverage", "truffle-plugin-verify", "truffle-contract-size"],
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
api_keys: {
etherscan: process.env.ETHERSCAN_KEY
},
compilers: {
solc: {
version: "0.5.16",
settings: {
optimizer: {
enabled: true,
runs: 1
}
}
}
},
networks: {
ropsten: {
provider: () => new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/v3/' + process.env.INFURA_KEY),
network_id: '3',
gas: 4465030,
gasPrice: 5000000000, // 5 gwei
},
kovan: {
// provider: () => new HDWalletProvider(mnemonic, 'https://kovan.infura.io/v3/' + process.env.INFURA_KEY),
provider: () => new HDWalletProvider(kovanPrivateKey, 'https://eth-kovan.alchemyapi.io/v2/' + process.env.IDLE_ALCHEMY_KEY),
// provider: () => new LedgerWalletProvider({...ledgerOptions, networkId: 42}, 'https://kovan.infura.io/v3/' + process.env.INFURA_KEY),
network_id: '42',
gas: 3500000,
gasPrice: 5000000000, // 5 gwei
skipDryRun: true
},
rinkeby: {
provider: () => new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/" + process.env.INFURA_KEY),
network_id: 4,
gas: 3000000,
gasPrice: 5000000000 // 5 gwei
},
// main ethereum network(mainnet)
live: {
// provider: () => new HDWalletProvider(mnemonic, "https://mainnet.infura.io/v3/" + process.env.INFURA_KEY),
provider: () => new LedgerWalletProvider({...ledgerOptions, networkId: 1}, 'https://mainnet.infura.io/v3/' + process.env.INFURA_KEY),
network_id: 1,
gas: 450000,
gasPrice: 48 * 1e9, // 48 gwei
skipDryRun: true
},
mumbai: {
provider: () => new HDWalletProvider([process.env.MUMBAI_PRIVATE_KEY], "https://rpc-mumbai.maticvigil.com/v1/" + process.env.POLYGON_API_KEY),
// provider: () => new LedgerWalletProvider({...ledgerOptions, networkId: 80001}, 'https://rpc-mumbai.maticvigil.com/v1' + process.env.POLYGON_API_KEY),
network_id: 80001,
gas: 8500000,
// gas: 250000,
gasPrice: 5 * 1e9, // 5 gwei
skipDryRun: true
},
matic: {
provider: () => new HDWalletProvider([process.env.POLYGON_PRIVATE_KEY], "https://rpc-mainnet.maticvigil.com/v1/" + process.env.POLYGON_API_KEY),
// provider: () => new LedgerWalletProvider({...ledgerOptions, networkId: 137}, 'https://rpc-mainnet.maticvigil.com/v1/' + process.env.POLYGON_API_KEY),
network_id: 137,
gas: 3000000,
// gas: 250000,
gasPrice: 20 * 1e9,
skipDryRun: true
},
proxy: {
provider: () => new HDWalletProvider(mnemonic, 'http://127.0.0.1:9545'),
host: "127.0.0.1",
port: 9545,
network_id: "*",
gasPrice: 0,
skipDryRun: true
},
local: {
// provider: () => new HDWalletProvider(mnemonic, 'http://127.0.0.1:8545'),
// provider: () => new LedgerWalletProvider({...ledgerOptions, networkId: 1}, 'http://127.0.0.1:8545'),
host: '127.0.0.1',
port: 8545,
network_id: '*',
skipDryRun: true,
// gas: 300000,
gasPrice: 0x01
},
test: {
host: '127.0.0.1',
port: 8545,
network_id: '*',
gasPrice: 1000000000,
gasPrice: 0x01 // <-- Use this low gas price
},
soliditycoverage: {
host: "localhost",
network_id: "*",
port: 8555, // <-- If you change this, also set the port option in .solcover.js.
gas: 0xfffffffffff, // <-- Use this high gas value
gasPrice: 0x01 // <-- Use this low gas price
}
},
mocha: {
useColors: true,
// reporter: 'eth-gas-reporter',
// reporterOptions : {
// currency: 'EUR',
// gasPrice: 5,
// onlyCalledMethods: false
// }
}
};