forked from Good-Ghosting/goodghosting-protocol-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtruffle-config.js
More file actions
180 lines (170 loc) · 5.14 KB
/
truffle-config.js
File metadata and controls
180 lines (170 loc) · 5.14 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
const HDWalletProvider = require("@truffle/hdwallet-provider");
const Web3 = require("web3");
require("dotenv").config();
require("ts-node/register");
const ContractKit = require("@celo/contractkit");
const getAccount = require("./getAccount").getAccount;
// use mainnet rpc as default
const web3 = new Web3("https://forno.celo.org/");
const kit = ContractKit.newKitFromWeb3(web3);
async function awaitWrapper() {
let account = await getAccount();
if (account) {
kit.connection.addAccount(account.privateKey);
}
return kit.connection.web3.currentProvider;
}
awaitWrapper();
module.exports = {
test_file_extension_regexp: /.*\.ts$/,
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
plugins: [
//"truffle-security",
"solidity-coverage",
"truffle-plugin-verify",
],
// Set default mocha options here, use special reporters etc.
mocha: {
reporter: "eth-gas-reporter",
reporterOptions: {
currency: "USD",
showTimeSpent: true,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
excludeContracts: ["Migrations", "ForceSend"],
},
},
networks: {
celo: {
provider: kit.connection.web3.currentProvider, // CeloProvider
network_id: 42220,
gas: 9017622,
gasPrice: 100000000000,
},
"test-celo": {
// alfajores
provider: kit.connection.web3.currentProvider, // CeloProvider
network_id: 44787,
gas: 9017622,
gasPrice: 100000000000,
},
"local-polygon": {
host: "127.0.0.1",
port: 8545,
network_id: "*",
gasPrice: 900000000000,
gas: 9017622,
// gasPrice: 100000000000,
},
"local-variable-polygon": {
host: "127.0.0.1",
port: 8545,
network_id: "*",
gas: 9_017_622,
// gasPrice: 100_000_000_000,
},
"local-celo": {
host: "127.0.0.1",
port: 8545,
network_id: "*",
gas: 9017622,
gasPrice: 100000000000,
},
"local-variable-celo": {
host: "127.0.0.1",
port: 8545,
network_id: "*",
gas: 9017622,
gasPrice: 100000000000,
},
polygon: {
provider: () =>
new HDWalletProvider(
process.env.MNEMONIC,
process.env.RPC,
0, //address_index
10, // num_addresses
true, // shareNonce
),
network_id: 137, // Polygon mainnet id
networkCheckTimeout: 60000,
gas: 8000000,
gasPrice: 200000000000, // 200 Gwei
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 50, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: false, // Skip dry run before migrations? (default: false for public nets )
},
"test-polygon": {
// mumbai
provider: () =>
new HDWalletProvider(
process.env.MNEMONIC,
process.env.RPC,
0, //address_index
10, // num_addresses
true, // shareNonce
),
network_id: 80001, // Polygon testnet id
networkCheckTimeout: 60000,
gas: 7017622,
gasPrice: 200000000000, // 200 Gwei
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 50, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: false, // Skip dry run before migrations? (default: false for public nets )
},
base: {
provider: () =>
new HDWalletProvider(
process.env.MNEMONIC,
process.env.RPC,
0, //address_index
10, // num_addresses
true, // shareNonce
),
network_id: 8453,
skipDryRun: true, // Skip dry run before migrations? (default: false for public nets )
gas: 10000000,
networkCheckTimeout: 60000,
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 50, // # of blocks before a deployment times out (minimum/default: 50)
},
"test-base": {
provider: () =>
new HDWalletProvider(
process.env.MNEMONIC,
process.env.RPC,
0, //address_index
10, // num_addresses
true, // shareNonce
),
network_id: 84531, // base goerli network id
skipDryRun: true, // Skip dry run before migrations? (default: false for public nets)
gas: 10000000,
networkCheckTimeout: 60000,
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 50, // # of blocks before a deployment times out (minimum/default: 50)
},
},
compilers: {
solc: {
version: "0.8.7",
settings: {
optimizer: {
enabled: true,
runs: 10,
},
},
// A version or constraint - Ex. "^0.5.0"
// Can also be set to "native" to use a native solc
//docker: false, // Use a version obtained through docker
// parser: "solcjs", // Leverages solc-js purely for speedy parsing
},
},
api_keys: {
etherscan: process.env.ETHERSCAN_API_KEY,
polygonscan: process.env.POLYGONSCAN_API_KEY,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
};