-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
93 lines (87 loc) · 2.26 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
import * as dotenv from 'dotenv'
import { zeroAddress } from 'viem'
import type { HardhatUserConfig } from 'hardhat/config'
import type { HardhatNetworkUserConfig } from 'hardhat/types'
import '@nomicfoundation/hardhat-toolbox-viem'
import '@nomicfoundation/hardhat-ledger'
import 'hardhat-chai-matchers-viem'
import 'hardhat-contract-sizer'
import './tasks/accounts'
import './tasks/chain'
import './tasks/export-abis'
dotenv.config()
const LEDGER_ACCOUNTS: string[]|undefined = process.env.LEDGER_ACCOUNT ? [process.env.LEDGER_ACCOUNT] : undefined
const ACCOUNT_PRVKEYS: string[]|undefined = process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY ] : undefined
const HARDHAT_NETWORK_CONFIG: HardhatNetworkUserConfig = {
chainId: 1337,
ledgerAccounts: LEDGER_ACCOUNTS,
forking: {
enabled: true,
url: process.env.MAINNET_URL || '',
blockNumber: 21374700,
},
}
const config: HardhatUserConfig = {
solidity: {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 100_000,
},
},
},
networks: {
mainnet: {
url: process.env.MAINNET_URL || "",
accounts: ACCOUNT_PRVKEYS,
ledgerAccounts: LEDGER_ACCOUNTS,
},
sepolia: {
url: process.env.SEPOLIA_URL || "",
accounts: ACCOUNT_PRVKEYS,
ledgerAccounts: LEDGER_ACCOUNTS,
},
holesky: {
url: process.env.HOLESKY_URL || "",
accounts: ACCOUNT_PRVKEYS,
ledgerAccounts: LEDGER_ACCOUNTS,
},
localhost: {
...HARDHAT_NETWORK_CONFIG,
},
hardhat: HARDHAT_NETWORK_CONFIG,
},
gasReporter: {
enabled: process.env.REPORT_GAS === 'true',
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
currency: 'USD',
gasPrice: 23,
},
contractSizer: {
alphaSort: true,
},
ignition: {
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY as string,
sepolia: process.env.ETHERSCAN_API_KEY as string,
holesky: process.env.ETHERSCAN_API_KEY as string,
},
customChains: [
{
network: 'holesky',
chainId: 17000,
urls: {
apiURL: 'https://api-holesky.etherscan.io/api',
browserURL: 'https://holesky.etherscan.io'
}
}
],
},
mocha: {
timeout: 120_000,
},
}
export default config