-
Notifications
You must be signed in to change notification settings - Fork 7
/
hardhat.config.ts
69 lines (67 loc) · 1.82 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
69
import 'dotenv/config';
import {HardhatUserConfig} from 'hardhat/types';
import 'hardhat-deploy';
import 'hardhat-deploy-ethers';
import 'hardhat-gas-reporter';
import '@typechain/hardhat';
import '@nomiclabs/hardhat-etherscan';
import 'solidity-coverage';
import {node_url, accounts} from './utils/network';
const config: HardhatUserConfig = {
solidity: {
version: '0.8.0',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
namedAccounts: {
deployer: 0,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
// NB: hardhat verify currently doesn't support per-network API keys
// for contract verification. When verifying on Polygon chains, use
// process.env.POLYGONSCAN_API_KEY and process.env.ETHERSCAN_API_KEY
// for L1 ethereum chains. You'll need to get an API key from each
// of Etherscan and Polygonscan
},
networks: {
hardhat: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// this line ensure the use of the corresponding accounts
accounts: accounts(process.env.HARDHAT_FORK),
forking: process.env.HARDHAT_FORK
? {
url: node_url(process.env.HARDHAT_FORK),
blockNumber: process.env.HARDHAT_FORK_NUMBER
? parseInt(process.env.HARDHAT_FORK_NUMBER)
: undefined,
}
: undefined,
},
localhost: {
url: node_url('localhost'),
accounts: accounts(),
},
mainnet: {
url: node_url('mainnet'),
accounts: accounts('mainnet'),
},
rinkeby: {
url: node_url('rinkeby'),
accounts: accounts('rinkeby'),
timeout: 60000,
},
},
paths: {
sources: 'contracts/*',
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
};
export default config;