-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
96 lines (90 loc) · 2.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
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
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-ethers';
import '@nomicfoundation/hardhat-viem';
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-gas-reporter';
import 'hardhat-contract-sizer';
import 'hardhat-abi-exporter';
import '@typechain/hardhat';
import 'solidity-coverage';
import dotenv from 'dotenv';
import { parseUnits } from 'ethers';
dotenv.config();
const { ETH_MNEMONIC, ETH_PRIVATE_KEY, ALCHEMY_API_KEY } = process.env;
const MNEMONIC = ETH_MNEMONIC || '';
const ACCOUNTS = MNEMONIC ? { mnemonic: MNEMONIC } : ETH_PRIVATE_KEY ? [ETH_PRIVATE_KEY] : [];
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
compilers: [
{
version: '0.8.21',
settings: {
// evmVersion: 'shanghai', // PUSH0
evmVersion: 'paris',
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
mainnet: {
chainId: 1,
url: `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: ACCOUNTS,
},
goerli: {
chainId: 5,
url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: ACCOUNTS,
},
mumbai: {
chainId: 80001,
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: ACCOUNTS,
},
polygon: {
chainId: 137,
url: `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: ACCOUNTS,
gasPrice: 95853731849,
},
hardhat: {
chainId: 1337,
},
},
paths: {
artifacts: './artifacts',
cache: './cache',
sources: './contracts',
tests: './test',
},
gasReporter: {
enabled: false,
},
etherscan: {
apiKey: '',
},
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false,
},
abiExporter: {
runOnCompile: true,
clear: true,
flat: true,
pretty: true,
},
typechain: {
outDir: 'types',
target: 'ethers-v6',
},
mocha: {
timeout: 0,
},
};
export default config;