forked from monerium/smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
165 lines (149 loc) · 3.98 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
const HDWalletProvider = require('@truffle/hdwallet-provider');
const toWei = new require('web3').utils.toWei;
const address = process.env['ADDRESS'];
const key = process.env['KEY'];
const mnemonic = process.env['MNEMONIC'];
const poahost = process.env['POA_HOST'];
const etherscanKey = process.env['ETHERSCAN_API'];
const polygonscanKey = process.env['POLYGONSCAN_API'];
const gnosisscanKey = process.env['GNOSISSCAN_API'];
var url = process.env['URL'];
var walletProvider;
console.log(url);
try {
if (key != undefined || mnemonic != undefined) {
if (address == undefined) {
throw Error('ADDRESS not set');
}
if (url == undefined) {
throw Error('URL not set');
}
walletProvider = new HDWalletProvider({
mnemonic,
privateKeys: [key],
providerOrUrl: url,
addressIndex: 0,
});
var walletAddress = walletProvider.getAddress();
if (walletAddress != address.toLowerCase()) {
throw Error(`Wallet address ${walletAddress} does not match ${address}`);
}
} else {
console.log("WARNING: both KEY and MNEMONIC undefined");
}
} catch (e) {
console.log(e.toString());
process.exit();
}
module.exports = {
networks: {
development: {
host: "localhost",
port: 9545,
network_id: "*", // Match any network id
},
poa: {
host: poahost != undefined ? poahost : "localhost",
port: 8545,
network_id: 12346,
},
goerli: {
provider: () => walletProvider,
network_id: 5,
gas: 5000000,
from: address,
gasPrice: toWei('10', 'gwei'),
timeoutBlocks: 200,
skipDryRun: true,
},
mainnet: {
provider: () => walletProvider,
network_id: 1,
gas: 6800000,
from: address,
gasPrice: toWei('15', 'gwei'),
},
polygon_pos_mumbai: {
provider: () => walletProvider,
network_id: 80001,
confirmation: 2,
timeoutBlocks: 200,
// chainId: 80001,
gas: 4465030,
gasPrice: toWei('41', 'gwei'),
},
polygon_pos_mainnet: {
provider: () => walletProvider,
network_id: 137,
confirmation: 2,
timeoutBlocks: 200,
// chainId: 137,
gas: 4465030,
},
gnosischain_chiado: {
provider: walletProvider,
network_id: 10200,
from: address,
gasPrice: toWei('2', 'gwei'),
timeoutBlocks: 200,
skipDryRun: true
},
gnosischain_mainnet: {
provider: walletProvider,
network_id: 100,
from: address,
// gasPrice: toWei('2', 'gwei'),
timeoutBlocks: 200,
maxFeePerGas: toWei('15', 'gwei'),
maxPriorityFeePerGas: toWei('2', 'gwei'),
skipDryRun: true
},
sepolia: {
provider: () => walletProvider,
network_id: 11155111, // Sepolia's id
confirmations: 1, // # of confirmations to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true, // Skip dry run before migrations? (default: false for public nets )
from: address,
gas: 4465030,
},
dashboard: {
network_id: 1,
// chainId: 80001,
confirmation: 2,
timeoutBlocks: 200,
// gasPrice: toWei('2', 'gwei'),
from: address,
// gasLimit: 30000000,
gas: 4465030,
maxFeePerGas: toWei('20', 'gwei'),
maxPriorityFeePerGas: toWei('4', 'gwei'),
},
},
compilers: {
solc: {
version: "0.8.11", // fetch exact version from solc-bin (default: truffle's version)
settings: { // see the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 1000
},
},
},
},
plugins: [
'truffle-plugin-verify',
'solidity-coverage'
],
api_keys: {
etherscan: etherscanKey,
polygonscan: polygonscanKey,
gnosisscan: gnosisscanKey,
},
mocha: {
reporter: 'eth-gas-reporter',
reporterOptions: {
excludeContracts: ['Migrations'],
},
},
};