-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
88 lines (84 loc) · 2.17 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
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import 'dotenv/config';
import 'hardhat-gas-reporter';
import { HardhatUserConfig } from 'hardhat/types';
import 'solidity-coverage';
import 'hardhat-contract-sizer';
let accounts;
if (process.env.ACCOUNT_MNEMONIC) {
accounts = {
mnemonic: process.env.ACCOUNT_MNEMONIC,
};
} else if (process.env.ACCOUNT_PRIVATE_KEY) {
accounts = [process.env.ACCOUNT_PRIVATE_KEY];
}
const CHAIN_IDS = {
hardhat: 31337,
};
const config: HardhatUserConfig = {
solidity: {
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: 'none',
},
},
},
networks: {
hardhat: {
chainId: CHAIN_IDS.hardhat,
forking: {
enabled: true,
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
blockNumber: process.env.PINNED_BLOCK_NUMBER
? Number(process.env.PINNED_BLOCK_NUMBER)
: undefined,
},
},
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
},
ropsten: {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
},
kovan: {
url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
},
},
gasReporter: {
enabled: !!process.env.REPORT_GAS,
currency: 'USD',
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: false,
strict: true,
},
};
export default config;