-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtruffle.js
103 lines (98 loc) · 2.96 KB
/
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
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
let HDWalletProvider = require("@truffle/hdwallet-provider");
let Web3 = require("web3");
let provider = (endpoint) => {
if (process.env.HDWALLET_MNEMONIC) {
return new HDWalletProvider(process.env.HDWALLET_MNEMONIC, endpoint);
} else {
return new Web3.providers.HttpProvider(endpoint);
}
}
let truffleOptions = {
networks: {
local: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Any network ID
},
develop : {
host: "127.0.0.1",
port: 9545,
network_id: "*",
},
localhd: {
provider: () => provider("http://127.0.0.1:8545"),
network_id: "*" // Any network ID
},
kovan: {
gasPrice: 50000000000,
provider: () => provider("https://kovan.infura.io/v3/ea7f98d8d8ec45029085322fea33b752"),
network_id: "42" // Kovan network ID
},
ropsten: {
gasPrice: 50000000000,
provider: () => provider("https://ropsten.infura.io/v3/ea7f98d8d8ec45029085322fea33b752"),
network_id: "3", // ropsten network ID,
},
main: {
gasPrice: 70000000000,
provider: () => provider("https://mainnet.infura.io/v3/ea7f98d8d8ec45029085322fea33b752"),
network_id: "1" // mainnet network ID
},
bsctestnet: {
provider: () => provider( `https://data-seed-prebsc-1-s1.binance.org:8545`),
network_id: 97,
confirmations: 10,
timeoutBlocks: 1000,
skipDryRun: true
},
bscmainnet: {
provider: () => provider( `https://bsc-dataseed1.binance.org`),
network_id: 56,
confirmations: 10,
timeoutBlocks: 200,
skipDryRun: true
},
},
//plugin to verify the contract
plugins: [
'truffle-plugin-verify'
],
api_keys: {
etherscan: process.env.ETHERSCAN_API_KEY
},
mocha: {
reporter: 'eth-gas-reporter',
reporterOptions : {
currency: 'USD',
onlyCalledMethods: 'true',
showTimeSpent: 'true'
}
},
// Configure your compilers
compilers: {
solc: {
version: "0.6.12", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
//runs: 200
},
//evmVersion: "byzantium"
}
},
},
// solc: {
// optimizer: {
// enabled: true,
// runs: 200
// }
// }
};
let reporterArg = process.argv.indexOf('--reporter');
if (reporterArg >= 0) {
truffleOptions['mocha'] = {
reporter: process.argv[reporterArg + 1]
};
}
module.exports = truffleOptions;