-
Notifications
You must be signed in to change notification settings - Fork 1
/
truffle-config.js
61 lines (56 loc) · 1.45 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
require('dotenv').config();
const HDWalletProvider = require('@truffle/hdwallet-provider');
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
const bscMainnetProvider = new HDWalletProvider({
privateKeys: [DEPLOYER_PRIVATE_KEY],
providerOrUrl: 'https://bsc-dataseed.binance.org/',
addressIndex: 0,
numberOfAddresses: 1,
});
const bscTestnetProvider = new HDWalletProvider({
privateKeys: [DEPLOYER_PRIVATE_KEY],
providerOrUrl: 'https://data-seed-prebsc-2-s2.binance.org:8545/',
addressIndex: 0,
numberOfAddresses: 1,
});
const deployerAddress = bscMainnetProvider.getAddress();
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
compilers: {
solc: {
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 50000,
},
},
},
},
networks: {
bscDev: {
host: 'localhost',
port: 8545,
network_id: '5656',
gasPrice: 20000000000, // 20 gwei
gas: 8000000,
},
bscTestnet: {
network_id: '97',
provider: bscTestnetProvider,
gasPrice: 20000000000, // 20 gwei
gas: 4000000,
from: deployerAddress,
timeoutBlocks: 60,
},
bscMainnet: {
network_id: '56',
provider: bscMainnetProvider,
gasPrice: 20000000000, // 20 gwei
gas: 4000000,
from: deployerAddress,
timeoutBlocks: 60,
},
},
};