forked from tatumio/smart-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
150 lines (138 loc) · 3.8 KB
/
hardhat.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
const fs = require('fs');
const path = require('path');
require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-solhint');
require('solidity-coverage');
require('hardhat-gas-reporter');
require('dotenv').config();
require('hardhat-deploy');
require("@nomiclabs/hardhat-etherscan");
for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) {
require(path.join(__dirname, 'hardhat', f));
}
const enableGasReport = !!process.env.ENABLE_GAS_REPORT;
/**
* @type import('hardhat/config').HardhatUserConfig
*/
require('@nomiclabs/hardhat-ethers');
//require("hardhat-deploy-ethers");in
module.exports = {
solidity: {
compilers: [
{
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
}
},
{
version: '0.5.5',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
}
},
{
version: '0.8.7',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
]
},
defaultNetwork: "alfajores",
namedAccounts: {
deployer: 0
},
networks: {
hardhat: {
blockGasLimit: 10000000,
},
ropsten: {
url: `https://eth-ropsten.alchemyapi.io/v2/${process.env.ALCHEMY_tatumRopsten_API_KEY}`,
accounts: [process.env.PKEY],
gasPrice: `auto`
},
goerli: {
url: `https://eth-ropsten.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: [process.env.PKEY],
gasPrice: 600000000000
},
alfajores: {
url: "https://alfajores-forno.celo-testnet.org",
accounts: [process.env.PKEY],
chainId: 44787,
gasPrice: 600000000000
},
polygon_mumbai: {
url: "https://rpc-mumbai.maticvigil.com",
accounts: [process.env.PKEY]
},
celo: {
url: "https://forno.celo.org",
accounts: {
mnemonic: process.env.MNEMONIC,
path: "m/44'/52752'/0'/0"
},
chainId: 42220
},
bsctest: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545/",
chainId: 97,
accounts: ['cd2fe348ecbde2a9b1caf0429dfaac4b656b9d969eca290cc106e6cbb38ef1e9'],
gasPrice: 30 * 1e9
},
},
etherscan : {
apiKey: {
celo: process.env.etherscanapike,
goerli: "<goerli-api-key>",
alfajores: process.env.etherscanapike,
},
customChains: [
{
network: 'celo',
chainId: 42220,
urls: {
apiURL: 'https://explorer.celo.org/api',
browserURL: 'https://explorer.celo.org/',
},
},
{
network: 'alfajores',
chainId: 44787,
urls: {
apiURL: 'https://api-alfajores.celoscan.io/api',
browserURL: 'https://api-alfajores.celoscan.io/api',
},
},
],
},
gasReporter: {
enable: enableGasReport,
currency: 'USD',
outputFile: process.env.CI ? 'gas-report.txt' : undefined,
},
mocha: {
grep: 'Marketplace|NftAuction'
}
};
task("flat", "Flattens and prints contracts and their dependencies (Resolves licenses)")
.addOptionalVariadicPositionalParam("files", "The files to flatten", undefined, types.inputFile)
.setAction(async ({ files }, hre) => {
let flattened = await hre.run("flatten:get-flattened-sources", { files });
// Remove every line started with "// SPDX-License-Identifier:"
flattened = flattened.replace(/SPDX-License-Identifier:/gm, "License-Identifier:");
flattened = `// SPDX-License-Identifier: MIXED\n\n${flattened}`;
// Remove every line started with "pragma experimental ABIEncoderV2;" except the first one
flattened = flattened.replace(/pragma experimental ABIEncoderV2;\n/gm, ((i) => (m) => (!i++ ? m : ""))(0));
console.log(flattened);
});