-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
103 lines (97 loc) · 2.3 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
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
// based on https://github.com/PaulRBerg/hardhat-template
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
import '@nomicfoundation/hardhat-chai-matchers';
import * as dotenv from 'dotenv';
dotenv.config({ path: './.env' });
import 'hardhat-gas-reporter';
import 'hardhat-docgen';
import '@typechain/hardhat';
import '@nomiclabs/hardhat-ethers';
import 'solidity-coverage';
import { recoverColdWallet } from './tools/secretShares';
// Ensure that we have all the environment variables we need.
const mnemonic = recoverColdWallet();
const chainIds = {
avalanche: 43112,
fuji: 43113,
hardhat: 31337,
};
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
gasReporter: {
currency: 'USD',
enabled: true,
gasPrice: 25,
token: 'AVAX',
coinmarketcap: process.env.COINMARKETCAP_API_KEY || '',
excludeContracts: [],
src: './contracts',
},
networks: {
avalanche: {
accounts: {
count: 20,
mnemonic,
path: "m/44'/60'/0'/0",
},
gasPrice: 225000000000,
chainId: 43114,
url: 'https://api.avax.network/ext/bc/C/rpc',
},
fuji: {
accounts: {
count: 20,
mnemonic,
path: "m/44'/60'/0'/0",
},
gasPrice: 225000000000,
chainId: 43113,
url: 'https://api.avax-test.network/ext/bc/C/rpc',
},
hardhat: {
accounts: {
mnemonic,
},
chainId: chainIds.hardhat,
},
},
paths: {
artifacts: './artifacts',
cache: './cache',
sources: './contracts',
tests: './test',
},
solidity: {
version: '0.8.17',
settings: {
metadata: {
// Not including the metadata hash
// https://github.com/paulrberg/hardhat-template/issues/31
bytecodeHash: 'none',
},
// Disable the optimizer when debugging
// https://hardhat.org/hardhat-network/#solidity-optimizer-support
optimizer: {
enabled: true,
runs: 800,
},
},
},
docgen: {
path: './doc',
except: ['mock/*'],
clear: true,
runOnCompile: true,
},
typechain: {
outDir: 'types',
target: 'ethers-v5',
alwaysGenerateOverloads: false,
dontOverrideCompile: false,
},
mocha: {
timeout: 600_000 /* 10 minutes */,
},
};
export default config;