You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`BASE_SEPOLIA_RPC_URL`: RPC URL for Base Sepolia testnet
85
86
-`POLYGON_AMOY_RPC_URL`: RPC URL for Polygon Amoy testnet
86
87
88
+
**Optional (for contract verification):**
89
+
90
+
-`ETHERSCAN_API_KEY`: Single API key for all Etherscan-compatible explorers (Etherscan V2)
91
+
- Works across Ethereum, Arbitrum, Base, Polygon, and other Etherscan-compatible networks
92
+
- Get your API key from [Etherscan](https://etherscan.io/apis)
93
+
- No need for separate API keys per network (Etherscan V2 improvement)
94
+
87
95
**Security Notes:**
88
96
89
97
- The `.env.enc` file should be included in `.gitignore`
90
98
- Your encryption password is required each time you start a new terminal session
91
99
- Never commit your `.env.enc` file to version control
92
100
101
+
## Adding New Networks
102
+
103
+
The network configuration system uses a single source of truth architecture that automatically generates TypeScript types and Hardhat network configurations from the network data.
104
+
105
+
### Adding a Network
106
+
107
+
To add a new CCIP-supported network, add the network configuration to the `configData` object in `config/networks.ts`:
108
+
109
+
```typescript
110
+
exportconst configData = {
111
+
// ... existing networks
112
+
newNetwork: {
113
+
chainFamily: "evm", // or "svm" for non-EVM chains
The system automatically generates environment variable names from network names using this pattern:
150
+
- Convert camelCase to SNAKE_CASE
151
+
- Add `_RPC_URL` suffix
152
+
153
+
**Examples:**
154
+
-`newNetwork` → `NEW_NETWORK_RPC_URL`
155
+
-`optimismSepolia` → `OPTIMISM_SEPOLIA_RPC_URL`
156
+
-`bscTestnet` → `BSC_TESTNET_RPC_URL`
157
+
158
+
Set the RPC URL environment variable:
159
+
160
+
```bash
161
+
npx env-enc set NEW_NETWORK_RPC_URL
162
+
```
163
+
164
+
**For the example network above:**
165
+
```bash
166
+
npx env-enc set OPTIMISM_SEPOLIA_RPC_URL
167
+
```
168
+
169
+
### Contract Verification (Optional)
170
+
171
+
**Automatic Verification (Natively Supported):**
172
+
Most standard networks are natively supported by Hardhat for contract verification. Check [Hardhat's chain descriptors](https://github.com/NomicFoundation/hardhat/blob/main/v-next/hardhat/src/internal/builtin-plugins/network-manager/chain-descriptors.ts) for the complete list of supported networks.
173
+
174
+
**Custom Chain Descriptors Required:**
175
+
For networks not natively supported by Hardhat, add a chain descriptor to `hardhat.config.ts`. This is particularly useful for:
176
+
- Newer networks not yet added to Hardhat
177
+
- Private/enterprise chains
178
+
- Custom testnets
179
+
180
+
```typescript
181
+
chainDescriptors: {
182
+
12345: { // Your network's chainId
183
+
name: "New Network",
184
+
chainType: "generic",
185
+
blockExplorers: {
186
+
etherscan: {
187
+
name: "NewScan",
188
+
url: "https://newscan.io",
189
+
apiUrl: "https://api.newscan.io/api",
190
+
},
191
+
},
192
+
},
193
+
}
194
+
```
195
+
196
+
Note: With Etherscan V2, a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
0 commit comments