-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
132 lines (116 loc) · 2.84 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
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
import 'dotenv/config'
import 'hardhat-contract-sizer'
import 'hardhat-gas-reporter'
import '@nomicfoundation/hardhat-toolbox'
import '@openzeppelin/hardhat-upgrades'
import type { HardhatUserConfig } from 'hardhat/config'
import type { NetworksUserConfig } from 'hardhat/types'
const deploymentNetworks: NetworksUserConfig = {}
if (process.env.BASE_RPC_URL && process.env.DEPLOYER_PRIVATE_KEY) {
deploymentNetworks.base = {
url: process.env.BASE_RPC_URL,
accounts: [process.env.DEPLOYER_PRIVATE_KEY]
}
}
if (process.env.SEPOLIA_RPC_URL && process.env.DEPLOYER_PRIVATE_KEY) {
deploymentNetworks.sepolia = {
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.DEPLOYER_PRIVATE_KEY]
}
}
if (process.env.DEPLOYER_PRIVATE_KEY) {
deploymentNetworks.mode = {
url: 'https://mainnet.mode.network',
chainId: 34443,
accounts: [process.env.DEPLOYER_PRIVATE_KEY]
}
/*
deploymentNetworks.abstractTestnet = {
url: 'https://api.testnet.abs.xyz',
chainId: 11124,
accounts: [process.env.DEPLOYER_PRIVATE_KEY],
ethNetwork: 'sepolia',
zksync: true,
verifyURL:
'https://api-explorer-verify.testnet.abs.xyz/contract_verification'
}
*/
}
const config: HardhatUserConfig = {
/*
zksolc: {
version: 'latest',
settings: {
// Note: This must be true to call NonceHolder & ContractDeployer system contracts
enableEraVMExtensions: false
}
},
*/
solidity: {
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: true
}
},
viaIR: false
}
},
networks: {
hardhat: {
forking: {
url: process.env.BASE_RPC_URL as string,
blockNumber: 21110187
},
chainId: 8453
/*
forking: {
url: 'https://mainnet.mode.network',
blockNumber: 12774977
},
chainId: 34443,
*/
/*
forking: {
url: 'https://api.testnet.abs.xyz',
blockNumber: 421315
},
zksync: true,
*/
},
...deploymentNetworks
},
etherscan: {
enabled: true,
apiKey: {
base: process.env.BASESCAN_API_KEY as string,
baseSepolia: process.env.BASESCAN_API_KEY as string,
mode: process.env.ETHERSCAN_API_KEY as string,
sepolia: process.env.ETHERSCAN_API_KEY as string
},
// if not in npx hardhat verify --list-networks
customChains: [
{
network: 'mode',
chainId: 34443,
urls: {
apiURL: 'https://explorer.mode.network/api?',
browserURL: 'https://explorer.mode.network'
}
}
]
},
sourcify: {
enabled: true
},
gasReporter: {
enabled: process.env.COINMARKETCAP_KEY !== undefined,
token: 'ETH',
currency: 'EUR',
coinmarketcap: process.env.COINMARKETCAP_KEY
}
}
export default config