-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtruffle-config.js
98 lines (96 loc) · 2.4 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
require('chai/register-should');
const solcStable = {
version: '0.8.3',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
};
const solcPre = {
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
};
const solcNightly = {
version: 'nightly',
docker: true,
};
const useSolcNightly = process.env.SOLC_NIGHTLY === 'false';
const HDWalletProvider = require('@truffle/hdwallet-provider');
const fs = require('fs');
const privateKey = fs.readFileSync(".pk").toString().trim() || "01234567890123456789";
const ethereum_privateKey = fs.readFileSync("ethereum.pk").toString().trim() || "01234567890123456789";
const goerli_privateKey = fs.readFileSync("goerli.pk").toString().trim() || "01234567890123456789";
const polygon_privateKey = fs.readFileSync("poly.pk").toString().trim() || "01234567890123456789";
const mnemonic = fs.readFileSync(".secret").toString().trim();
const ethereum_privateKeys = [
ethereum_privateKey
];
const goerli_privateKeys = [
goerli_privateKey
];
const polygon_privateKeys = [
polygon_privateKey
];
module.exports = {
networks: {
localhost: {
host : "localhost",
port: 8545,
network_id: 1337,
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
ethereum: {
host : "https://mainnet.infura.io/v3/",
port: 8545,
network_id: 1,
chain_id: 1,
provider: () =>
new HDWalletProvider({
privateKeys: ethereum_privateKeys,
providerOrUrl: "https://mainnet.infura.io/v3/",
}),
},
goerli: {
host : "https://goerli.infura.io/v3/",
port: 8545,
network_id: 5,
chain_id: 5,
provider: () =>
new HDWalletProvider({
privateKeys: goerli_privateKeys,
providerOrUrl: "https://goerli.infura.io/v3/",
}),
},
polygon: {
host : "https://polygon-mainnet.infura.io/v3/",
port: 8545,
network_id: 137,
chain_id: 137,
provider: () =>
new HDWalletProvider({
privateKeys: polygon_privateKeys,
providerOrUrl: "https://polygon-mainnet.infura.io/v3/",
}),
},
hardhat: {
chainId: 1337,
},
},
compilers: {
solc: solcStable
},
api_keys: {
etherscan: '',
polygonscan: '',
bscscan: ''
},
plugins: ['solidity-coverage', 'truffle-plugin-verify'],
};