-
Notifications
You must be signed in to change notification settings - Fork 403
/
hardhat.config.cts
145 lines (137 loc) · 3.47 KB
/
hardhat.config.cts
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// from @nomicfoundation/hardhat-toolbox-viem to avoid module issue
import '@nomicfoundation/hardhat-ignition-viem'
import '@nomicfoundation/hardhat-verify'
import '@nomicfoundation/hardhat-viem'
import 'hardhat-gas-reporter'
import 'solidity-coverage'
import './tasks/hardhat-deploy-viem.cjs'
import dotenv from 'dotenv'
import 'hardhat-abi-exporter'
import 'hardhat-contract-sizer'
import 'hardhat-deploy'
import { HardhatUserConfig } from 'hardhat/config'
import('@ensdomains/hardhat-chai-matchers-viem')
// hardhat actions
import './tasks/esm_fix.cjs'
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
dotenv.config({ debug: false })
let real_accounts = undefined
if (process.env.DEPLOYER_KEY) {
real_accounts = [
process.env.DEPLOYER_KEY,
process.env.OWNER_KEY || process.env.DEPLOYER_KEY,
]
}
// circular dependency shared with actions
export const archivedDeploymentPath = './deployments/archive'
const config = {
networks: {
hardhat: {
saveDeployments: false,
tags: ['test', 'legacy', 'use_root'],
allowUnlimitedContractSize: false,
},
localhost: {
url: 'http://127.0.0.1:8545/',
saveDeployments: false,
tags: ['test', 'legacy', 'use_root'],
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
tags: ['test', 'legacy', 'use_root'],
chainId: 4,
accounts: real_accounts,
},
ropsten: {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`,
tags: ['test', 'legacy', 'use_root'],
chainId: 3,
accounts: real_accounts,
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
tags: ['test', 'legacy', 'use_root'],
chainId: 5,
accounts: real_accounts,
},
sepolia: {
url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
tags: ['test', 'legacy', 'use_root'],
chainId: 11155111,
accounts: real_accounts,
},
holesky: {
url: `https://holesky-rpc.nocturnode.tech`,
tags: ['test', 'legacy', 'use_root'],
chainId: 17000,
accounts: real_accounts,
},
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
tags: ['legacy', 'use_root'],
chainId: 1,
accounts: real_accounts,
},
},
mocha: {},
solidity: {
compilers: [
{
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 1200,
},
},
},
// for DummyOldResolver contract
{
version: '0.4.11',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
abiExporter: {
path: './build/contracts',
runOnCompile: true,
clear: true,
flat: true,
except: [
'Controllable$',
'INameWrapper$',
'SHA1$',
'Ownable$',
'NameResolver$',
'TestBytesUtils$',
'legacy/*',
],
spacing: 2,
pretty: true,
},
namedAccounts: {
deployer: {
default: 0,
},
owner: {
default: 1,
1: '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7',
},
},
external: {
contracts: [
{
artifacts: [archivedDeploymentPath],
},
],
},
} satisfies HardhatUserConfig
export default config