-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
60 lines (58 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
import "dotenv/config";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-solhint";
import 'hardhat-typechain'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import 'hardhat-deploy'
import 'solidity-coverage'
import 'hardhat-gas-reporter'
import { randomBytes } from 'crypto';
const configureNetwork = (network: string, chainId: number) => ({
url: `https://${network}.infura.io/v3/${process.env.INFURA_API_KEY}`,
chainId,
accounts: [process.env[`${network.toUpperCase()}_PVT_KEY`] ?? randomBytes(32).toString('hex')]
});
export default {
gasReporter: {
enabled: true,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
namedAccounts: {
deployer: {
default: 0,
},
},
mocha: {
timeout: 200000
},
networks: {
coverage: {
url: 'http://localhost:8555'
},
hardhat: {
allowUnlimitedContractSize: false,
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
blockNumber: 12667185
}
},
mainnet: configureNetwork('mainnet', 1),
kovan: configureNetwork('kovan', 42),
rinkeby: configureNetwork('rinkeby', 4)
},
solidity: {
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 800,
},
metadata: {
bytecodeHash: 'none',
},
},
},
}