-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
94 lines (87 loc) · 2.42 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'
import './tasks/archive'
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 DEPLOY_AUTH: string = process.env.DEPLOY_AUTH || zeroAddress
const REDEPLOY_PROTECTION: string = process.env.REDEPLOY_PROTECTION === 'true' ? `01` : `00`
const ENTROPY: string = process.env.ENTROPY || `0000000000000000000009`
const SALT: string = `${DEPLOY_AUTH}${REDEPLOY_PROTECTION}${ENTROPY}`
const HARDHAT_NETWORK_CONFIG: HardhatNetworkUserConfig = {
chainId: 1337,
ledgerAccounts: LEDGER_ACCOUNTS,
forking: {
enabled: process.env.FORK_MAINNET === 'true',
url: process.env.MAINNET_URL || '',
blockNumber: 21085990
},
}
const config: HardhatUserConfig = {
solidity: {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 1_000,
},
viaIR: true
},
},
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: 10,
},
contractSizer: {
alphaSort: true,
},
ignition: {
strategyConfig: {
create2: {
salt: SALT,
},
},
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY as string,
sepolia: process.env.ETHERSCAN_API_KEY as string,
},
},
mocha: {
timeout: 120_000_000,
},
}
export default config