-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
48 lines (41 loc) · 1.08 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
import { config as loadConfig } from 'dotenv';
import { HardhatUserConfig } from 'hardhat/config';
import set from 'lodash/set';
import { join } from 'path';
import '@nomicfoundation/hardhat-toolbox';
loadConfig({ path: join(process.cwd(), '.env.local') });
const config: HardhatUserConfig = {
solidity: {
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
},
},
},
typechain: {
outDir: 'typings',
target: 'ethers-v5',
},
networks: {
hardhat: {
chainId: 1337,
},
mumbai: {
url: 'https://matic-mumbai.chainstacklabs.com',
chainId: 80001,
accounts: process.env.MUMBAI_PRIVATE_KEY ? [process.env.MUMBAI_PRIVATE_KEY] : [],
},
},
gasReporter: {
enabled: Boolean(process.env.REPORT_GAS),
currency: 'USD',
token: 'MATIC',
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},
};
if (process.env.POLYSCAN_API_KEY) {
set(config, 'etherscan.apiKey.polygon', process.env.POLYSCAN_API_KEY);
set(config, 'etherscan.apiKey.polygonMumbai', process.env.POLYSCAN_API_KEY);
}
export default config;