forked from ensdomains/ens-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
188 lines (179 loc) · 5.04 KB
/
hardhat.config.ts
File metadata and controls
188 lines (179 loc) · 5.04 KB
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import { configVariable, task, type HardhatUserConfig } from 'hardhat/config'
import dotenv from 'dotenv'
import HardhatChaiMatchersViemPlugin from '@ensdomains/hardhat-chai-matchers-viem'
import HardhatKeystore from '@nomicfoundation/hardhat-keystore'
import HardhatNetworkHelpersPlugin from '@nomicfoundation/hardhat-network-helpers'
import HardhatViem from '@nomicfoundation/hardhat-viem'
import HardhatDeploy from 'hardhat-deploy'
const realAccounts = [
configVariable('DEPLOYER_KEY'),
configVariable('OWNER_KEY'),
]
import { arbitrum, optimism } from 'viem/chains'
dotenv.config({ debug: false })
// circular dependency shared with actions
export const archivedDeploymentPath = './deployments/archive'
const config = {
networks: {
hardhat: {
type: 'edr-simulated',
allowUnlimitedContractSize: false,
},
localhost: {
type: 'http',
chainId: 31337,
url: 'http://127.0.0.1:8545/',
},
sepolia: {
type: 'http',
url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
chainId: 11155111,
accounts: realAccounts,
},
holesky: {
type: 'http',
url: `https://holesky.gateway.tenderly.co`,
chainId: 17000,
accounts: realAccounts,
},
mainnet: {
type: 'http',
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
chainId: 1,
accounts: realAccounts,
},
optimism: {
type: 'http',
url: optimism.rpcUrls.default.http[0],
chainId: optimism.id,
accounts: realAccounts,
},
arbitrum: {
type: 'http',
url: arbitrum.rpcUrls.default.http[0],
chainId: arbitrum.id,
accounts: realAccounts,
},
'mainnet-fork': {
type: 'edr-simulated',
forking: {
url:
process.env.MAINNET_FORK_URL ||
`https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
enabled: true,
},
},
},
solidity: {
compilers: [
{
version: '0.8.26',
settings: {
optimizer: {
enabled: true,
runs: 1_000_000,
},
metadata: {
bytecodeHash: 'ipfs',
useLiteralContent: true,
},
evmVersion: 'paris',
},
},
{
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 1200,
},
},
},
],
overrides: {
'contracts/wrapper/NameWrapper.sol': {
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 1200,
},
},
},
},
npmFilesToBuild: [
'@openzeppelin/contracts/utils/introspection/ERC165.sol',
'@openzeppelin/contracts/utils/introspection/IERC165.sol',
'@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol',
'@openzeppelin/contracts/token/ERC1155/IERC1155.sol',
],
},
paths: {
sources: {
solidity: ['./contracts'],
},
},
plugins: [
HardhatNetworkHelpersPlugin,
HardhatChaiMatchersViemPlugin,
HardhatViem,
HardhatDeploy,
HardhatKeystore,
],
tasks: [
task('accounts', 'Prints the list of accounts')
.setAction(() => import('./tasks/accounts.js'))
.build(),
task('archive-scan', 'Scans the deployments for unarchived deployments')
.setAction(() => import('./tasks/archive_scan.js'))
.build(),
task('create-l2-safe', 'Creates an L2 Safe')
.setAction(() => import('./tasks/create_l2_safe.js'))
.build(),
task('multichain-verify', 'Verify contracts using etherscan v2 api')
.addPositionalArgument({
name: 'contractName',
description: 'The contract name to verify',
})
.addPositionalArgument({
name: 'address',
description: 'The contract address to verify',
})
.addVariadicArgument({
name: 'deployArgs',
description: 'Constructor arguments',
})
.setAction(() => import('./tasks/etherscan-multichain.js'))
.build(),
task('save', 'Saves a specified contract as a deployed contract')
.addPositionalArgument({
name: 'contract',
description: 'The contract to save',
})
.addPositionalArgument({
name: 'block',
description: 'The block number the contract was deployed at',
})
.addPositionalArgument({
name: 'fullName',
description:
'(Optional) The fully qualified name of the contract (e.g. contracts/resolvers/PublicResolver.sol:PublicResolver)',
})
.setAction(() => import('./tasks/save.js'))
.build(),
task('seed', 'Creates test subbdomains and wraps them with Namewrapper')
.addPositionalArgument({
name: 'name',
description: 'The ENS label to seed subdomains',
})
.setAction(() => import('./tasks/seed.js'))
.build(),
],
} satisfies HardhatUserConfig
// safe's pkgs set addressType to string for some reason
declare module 'abitype' {
interface Register {
addressType: `0x${string}`
}
}
export default config