-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
143 lines (133 loc) · 4.3 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
133
134
135
136
137
138
139
140
141
142
143
import 'dotenv/config'
import '@layerzerolabs/toolbox-hardhat'
import '@nomicfoundation/hardhat-verify'
import '@nomiclabs/hardhat-ethers'
import 'hardhat-contract-sizer'
import 'hardhat-deploy'
import { HardhatUserConfig, HttpNetworkAccountsUserConfig } from 'hardhat/types'
import { EndpointId } from '@layerzerolabs/lz-definitions'
// Set your preferred authentication method
//
// If you prefer using a mnemonic, set a MNEMONIC environment variable
// to a valid mnemonic
const MNEMONIC = process.env.MNEMONIC
// If you prefer to be authenticated using a private key, set a PRIVATE_KEY environment variable
const PRIVATE_KEY = process.env.PRIVATE_KEY
const SCROLL_API_KEY = process.env.SCROLL_API_KEY
const ZIRCUIT_API_KEY = process.env.ZIRCUIT_API_KEY
const BASE_API_KEY = process.env.BASE_API_KEY
const accounts: HttpNetworkAccountsUserConfig | undefined = MNEMONIC
? { mnemonic: MNEMONIC }
: PRIVATE_KEY
? [PRIVATE_KEY]
: undefined
if (accounts == null) {
console.warn(
'Could not find MNEMONIC or PRIVATE_KEY environment variables. It will not be possible to execute transactions in your example.'
)
}
const config: HardhatUserConfig = {
paths: {
cache: 'cache/hardhat',
},
solidity: {
compilers: [
{
version: '0.8.22',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
baseSepolia: {
eid: EndpointId.BASESEP_V2_TESTNET,
url: 'https://sepolia.base.org',
accounts,
},
scrollSepolia: {
eid: EndpointId.SCROLL_V2_TESTNET,
url: 'https://sepolia-rpc.scroll.io',
accounts,
},
arbitrumSepolia: {
eid: EndpointId.ARBSEP_V2_TESTNET,
url: 'https://sepolia-rollup.arbitrum.io/rpc',
accounts,
},
optimismSepolia: {
eid: EndpointId.OPTSEP_V2_TESTNET,
url: 'https://sepolia.optimism.io',
accounts,
},
zircuitTestnet: {
eid: EndpointId.ZIRCUIT_V2_TESTNET,
url: 'https://zircuit1.p2pify.com/',
accounts,
},
},
etherscan: {
apiKey: {
baseSepolia: 'mock', // not required by blockscout
arbitrumSepolia: 'mock', // not required by blockscout
optimismSepolia: 'mock', // not required by blockscout
scrollSepolia: SCROLL_API_KEY || '',
zircuitTestnet: ZIRCUIT_API_KEY || '',
},
customChains: [
{
network: 'baseSepolia',
chainId: 84532,
urls: {
apiURL: 'https://base-sepolia.blockscout.com/api',
browserURL: 'https://base-sepolia.blockscout.com/',
},
},
{
network: 'arbitrumSepolia',
chainId: 421614,
urls: {
apiURL: 'https://arbitrum-sepolia.blockscout.com/api',
browserURL: 'https://arbitrum-sepolia.blockscout.com/',
},
},
{
network: 'optimismSepolia',
chainId: 11155420,
urls: {
apiURL: 'https://optimism-sepolia.blockscout.com/api',
browserURL: 'https://optimism-sepolia.blockscout.com/',
},
},
{
network: 'scrollSepolia',
chainId: 534351,
urls: {
apiURL: 'https://api-sepolia.scrollscan.com/api',
browserURL: 'https://sepolia.scrollscan.com/',
},
},
{
network: 'zircuit',
chainId: 48899,
urls: {
apiURL: 'https://explorer.zircuit.com/api/contractVerifyHardhat',
browserURL: 'https://explorer.zircuit.com',
},
},
],
},
sourcify: {
enabled: false,
},
namedAccounts: {
deployer: {
default: 0, // wallet address of index[0], of the mnemonic in .env
},
},
}
export default config