-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
68 lines (65 loc) · 1.36 KB
/
hardhat.config.ts
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
import {HardhatUserConfig} from 'hardhat/config';
import 'hardhat-deploy';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import dotenv from 'dotenv';
import 'solidity-coverage';
import '@typechain/hardhat';
import 'hardhat-gas-reporter';
import {
getExplorerApiKey,
getInfuraProjectID,
getPrivateKey,
} from './scripts/utils/environmentConfig';
import '@nomiclabs/hardhat-etherscan';
dotenv.config();
const privateKey = getPrivateKey();
const explorerApiKey = getExplorerApiKey();
const infuraProjectID = getInfuraProjectID();
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.7',
},
{
version: '0.6.6',
},
],
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
namedAccounts: {
deployer: 0,
admin: 1,
admin1: 2,
user: 3,
user1: 4,
},
networks: {
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraProjectID}`,
gasPrice: 'auto',
accounts: privateKey !== undefined ? [privateKey] : [],
},
},
paths: {
sources: 'src',
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: 'USD',
},
typechain: {
outDir: 'src/types',
target: 'ethers-v5',
},
etherscan: {
apiKey: explorerApiKey || '',
},
};
export default config;