Skip to content

Commit 7a4247f

Browse files
committed
docs(ccip): optimize network configuration guides and add cross-references
- Restructure Hardhat network config guide using Stripe-style technical writing (immediate action, zero redundancy, scannable tables) - Optimize SEO metadata for both Hardhat and Foundry guides (title, description, keywords) - Add configuration fields reference table with sources - Clarify field descriptions (chainFamily, confirmations, nativeCurrencySymbol) - Add environment variable naming pattern explanation - Link network config guides from 7 CCT tutorials (Hardhat and Foundry) - Remove implementation file names from keywords (networks.ts, HelperConfig.s.sol) - Update OG images to CCIP enabled tokens flowchart - Make content future-proof (remove hardcoded network counts)
1 parent eaa1b75 commit 7a4247f

9 files changed

+104
-181
lines changed

src/content/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
section: ccip
33
date: Last Modified
4-
title: "Configure Additional Networks using Foundry"
4+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Foundry)"
55
metadata:
6-
description: "Learn how to configure additional networks in the smart-contract-examples repository to add support for more CCIP-supported chains using Foundry."
7-
excerpt: "network configuration, Foundry, HelperConfig.s.sol, CCIP Directory, chain configuration, smart-contract-examples"
8-
image: "/images/ccip/basic-architecture.png"
6+
description: "Add CCIP network support to test burn-mint and lock-mint token tutorials on additional blockchains. Configure network settings, RPC endpoints, and CCIP contract addresses in Foundry."
7+
excerpt: "burn-mint, lock-mint, token pools, CCIP networks, add network, Foundry configuration, cross-chain tokens, testnet, mainnet, RPC endpoints, CCIP Directory, EVM chains, network setup"
8+
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
99
datePublished: "2025-10-30"
1010
lastModified: "2025-10-30"
1111
estimatedTime: "5 minutes"
@@ -29,9 +29,9 @@ import { Aside, CopyText, PageTabs } from "@components"
2929
]}
3030
/>
3131

32-
When working with the [smart-contract-examples](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct) CCIP tutorials, you may need to add support for additional blockchain networks beyond the default testnet configurations (_Avalanche Fuji_, _Ethereum Sepolia_, _Arbitrum Sepolia_, and _Base Sepolia_, and _Polygon Amoy_).
32+
The [smart-contract-examples](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/foundry) repository includes default configurations for common CCIP testnet networks. This guide shows how to add support for additional networks.
3333

34-
This guide explains how to update the network configuration file in the [Foundry version of the repository](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/foundry). The configuration file stores network-specific information such as:
34+
The configuration file in the [Foundry version of the repository](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/foundry) stores network-specific information such as:
3535

3636
- Chain selectors (unique CCIP identifiers)
3737
- Router addresses
Lines changed: 56 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
section: ccip
33
date: Last Modified
4-
title: "Configure Additional Networks using Hardhat"
4+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Hardhat)"
55
metadata:
6-
description: "Learn how to configure additional networks in the smart-contract-examples repository to add support for more CCIP-supported chains using Hardhat."
7-
excerpt: "network configuration, Hardhat, networks.ts, CCIP Directory, chain configuration, smart-contract-examples"
8-
image: "/images/ccip/basic-architecture.png"
6+
description: "Add CCIP network support to test burn-mint and lock-mint token tutorials on additional blockchains. Configure network settings, RPC endpoints, and CCIP contract addresses in Hardhat."
7+
excerpt: "burn-mint, lock-mint, token pools, CCIP networks, add network, Hardhat configuration, cross-chain tokens, testnet, mainnet, RPC endpoints, CCIP Directory, EVM chains, network setup"
8+
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
99
datePublished: "2025-10-30"
1010
lastModified: "2025-10-30"
1111
estimatedTime: "5 minutes"
@@ -29,134 +29,17 @@ import { Aside, CopyText, PageTabs } from "@components"
2929
]}
3030
/>
3131

32-
When working with the [smart-contract-examples](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct) CCIP tutorials, you may need to add support for additional blockchain networks beyond the default testnet configurations (_Avalanche Fuji_, _Ethereum Sepolia_, _Arbitrum Sepolia_, and _Base Sepolia_, and _Polygon Amoy_).
32+
The [smart-contract-examples](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/hardhat) repository includes default configurations for common CCIP testnet networks. This guide shows how to add support for additional networks.
3333

34-
This guide explains how to update the network configuration file in the [Hardhat version of the repository](https://github.com/smartcontractkit/smart-contract-examples/tree/main/ccip/cct/hardhat). The configuration file stores network-specific information such as:
34+
## Add a Network
3535

36-
- Chain ids (unique identifiers for each blockchain network)
37-
- Chain selectors (unique CCIP identifiers)
38-
- Router contract addresses
39-
- RMN Proxy addresses
40-
- Token Admin Registry addresses
41-
- Registry Module Owner Custom addresses
42-
- LINK token addresses
43-
- Block confirmations
44-
- Native currency symbols
45-
- Chain families (e.g., `evm`, `svm`, etc.)
46-
47-
These values vary by network and must be accurate for your CCIP transactions to work correctly. If you want to use additional networks (e.g., Optimism Sepolia, BNB Chain Testnet, or mainnet networks) supported by CCIP, you'll need to update the configuration file following this guide.
48-
49-
## Find Network Configuration Values
50-
51-
All CCIP-supported networks and their configuration details are available in the **CCIP Directory**:
52-
53-
- **Testnet networks**: [CCIP Directory - Testnet](/ccip/directory/testnet)
54-
- **Mainnet networks**: [CCIP Directory - Mainnet](/ccip/directory/mainnet)
55-
56-
The CCIP Directory provides:
57-
58-
- Chain selectors (unique CCIP identifiers)
59-
- Router contract addresses
60-
- RMN Proxy addresses
61-
- Token Admin Registry addresses
62-
- Registry Module Owner Custom addresses
63-
- LINK token addresses
64-
65-
<Aside type="caution" title="Always Use Official Values">
66-
Always retrieve configuration values from the official [CCIP Directory](/ccip/directory) to ensure accuracy. Using
67-
incorrect addresses or chain selectors will cause your transactions to fail.
68-
</Aside>
69-
70-
## Add `RPC_URL` Environment Variable
71-
72-
To add support for additional networks, you need to configure the `<NEW_NETWORK_NAME>_RPC_URL` environment variable in your `.env.enc` file. This variable should point to the RPC endpoint of the network you want to add.
73-
74-
```bash
75-
npx env-enc set <NEW_NETWORK_NAME>_RPC_URL
76-
```
77-
78-
You can obtain an RPC URL by signing up for a personal endpoint from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node provider service.
79-
80-
## Update Configuration File
81-
82-
**File location**: [`smart-contract-examples/ccip/cct/hardhat/config/networks.ts`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/hardhat/config/networks.ts)
83-
84-
**Example structure**:
36+
Add the network configuration to [`config/networks.ts`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/hardhat/config/networks.ts):
8537

8638
```typescript
87-
// Rest of the code...
88-
89-
export const configData: Record<
90-
string,
91-
{
92-
chainFamily: string
93-
chainId: number | string
94-
chainSelector: string
95-
router?: string
96-
rmnProxy?: string
97-
tokenAdminRegistry?: string
98-
registryModuleOwnerCustom?: string
99-
link?: string
100-
confirmations?: number
101-
nativeCurrencySymbol?: string
102-
chainType?: string // Optional - will be auto-generated
103-
}
104-
> = {
105-
avalancheFuji: {
106-
chainId: 43113,
107-
chainSelector: "14767482510784806043",
108-
router: "0xF694E193200268f9a4868e4Aa017A0118C9a8177",
109-
rmnProxy: "0xAc8CFc3762a979628334a0E4C1026244498E821b",
110-
tokenAdminRegistry: "0xA92053a4a3922084d992fD2835bdBa4caC6877e6",
111-
registryModuleOwnerCustom: "0x97300785aF1edE1343DB6d90706A35CF14aA3d81",
112-
link: "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846",
113-
confirmations: 2,
114-
nativeCurrencySymbol: "AVAX",
115-
chainFamily: "evm",
116-
},
117-
118-
// Rest of the network configurations...
119-
}
120-
121-
// Rest of the code...
122-
```
123-
124-
**Steps to add a new network**:
125-
126-
1. Navigate to your cloned repository directory:
127-
128-
```bash
129-
cd smart-contract-examples/ccip/cct/hardhat
130-
```
131-
132-
1. Open `config/networks.ts` in your preferred editor
133-
134-
1. Visit the [CCIP Directory](/ccip/directory)
135-
136-
1. Locate your desired network in the directory and copy the following values:
137-
- Chain Selector
138-
- Router address
139-
- RMN Proxy address
140-
- Token Admin Registry address
141-
- Registry Module Owner Custom address
142-
- LINK token address
143-
144-
1. Add a new entry to the `configData` object
145-
146-
1. Set appropriate values for:
147-
- `chainId`: The EVM chain ID (find this on the network's official documentation or from [ChainList](https://chainlist.org/))
148-
- `confirmations`: Number of block confirmations to wait (typically 2-3 for testnets, 5-10 for mainnet)
149-
- `nativeCurrencySymbol`: The native currency symbol (e.g., "ETH", "AVAX", "POL")
150-
- `chainFamily`: "evm" for Ethereum-compatible chains
151-
152-
**Example: Adding Optimism Sepolia Testnet**:
153-
154-
```typescript
155-
// Rest of the code...
156-
15739
export const configData = {
15840
// ... existing networks
15941
optimismSepolia: {
42+
chainFamily: "evm",
16043
chainId: 11155420,
16144
chainSelector: "5224473277236331295",
16245
router: "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57",
@@ -166,73 +49,71 @@ export const configData = {
16649
link: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
16750
confirmations: 2,
16851
nativeCurrencySymbol: "ETH",
169-
chainFamily: "evm",
17052
},
17153
}
172-
173-
// Rest of the code...
17454
```
17555

176-
<Aside type="caution" title="Test Before Production">
177-
Always test your configuration on testnet before deploying to mainnet. Incorrect configuration values can result in
178-
failed transactions or loss of funds.
179-
</Aside>
180-
181-
## Next Steps
56+
Set the RPC URL:
18257

183-
Once you've updated your network configuration in the smart-contract-examples repository:
184-
185-
1. **Fund your wallet** with native tokens and LINK for the new network using the [Chainlink faucets](https://faucets.chain.link/) (for testnets)
58+
```bash
59+
npx env-enc set OPTIMISM_SEPOLIA_RPC_URL
60+
```
18661

187-
1. **Test the configuration** by running a simple deployment:
62+
The network is now available in all Hardhat tasks using `--network optimismSepolia`.
18863

189-
```bash
190-
npx hardhat deployToken --name "Test Token" --symbol TEST --network newNetworkName
191-
```
64+
**Environment variable naming**: The system converts network names from camelCase to SNAKE_CASE and adds `_RPC_URL`. Examples: `optimismSepolia``OPTIMISM_SEPOLIA_RPC_URL`, `avalancheFuji``AVALANCHE_FUJI_RPC_URL`.
19265

193-
<br></br>
66+
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node provider.
19467

195-
#### Contract Verification (Optional)
68+
## Configuration Fields
19669

197-
**Automatic Verification (Natively Supported):**
198-
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.
70+
| Field | Required | Description | Source |
71+
| --------------------------- | -------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
72+
| `chainFamily` | Yes | Blockchain VM type: `"evm"` for Ethereum-compatible chains, `"svm"` for Solana | `config/types.ts` |
73+
| `chainId` | Yes | EVM chain ID | Blockchain's official documentation (preferred) or [ChainList](https://chainlist.org/) |
74+
| `chainSelector` | Yes | CCIP identifier for the network | [CCIP Directory](/ccip/directory) |
75+
| `router` | Yes | CCIP Router contract address | [CCIP Directory](/ccip/directory) |
76+
| `rmnProxy` | Yes | RMN Proxy contract address | [CCIP Directory](/ccip/directory) |
77+
| `tokenAdminRegistry` | Yes | Token Admin Registry address | [CCIP Directory](/ccip/directory) |
78+
| `registryModuleOwnerCustom` | Yes | Registry Module Owner address | [CCIP Directory](/ccip/directory) |
79+
| `link` | Yes | LINK token contract address | [CCIP Directory](/ccip/directory) |
80+
| `confirmations` | No | Number of block confirmations before considering transaction final | Blockchain's finality characteristics and your risk tolerance |
81+
| `nativeCurrencySymbol` | No | Native gas token symbol (e.g., `"ETH"`, `"AVAX"`, `"POL"`) | Blockchain's official documentation |
19982

200-
You just need to add the `--verifycontract` flag when deploying:
83+
Find all CCIP addresses in the [CCIP Directory - Testnet](/ccip/directory/testnet) or [CCIP Directory - Mainnet](/ccip/directory/mainnet).
20184

202-
```bash
203-
npx hardhat deployToken --name "Test Token" --symbol TEST --network newNetworkName --verifycontract
204-
```
85+
## Test
20586

206-
Or if already deployed, you can verify using the [`npx hardhat verify` command](https://hardhat.org/docs/learn-more/smart-contract-verification#verifying-a-contract).
87+
Deploy a token to verify the configuration:
20788

208-
**Custom Network Verification:**
209-
For networks not natively supported by Hardhat, you need to add a chain descriptor to `hardhat.config.ts`, like:
89+
```bash
90+
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia
91+
```
21092

211-
```typescript
212-
chainDescriptors: {
213-
12345: { // Your network's chainId
214-
name: "New Network",
215-
chainType: "generic",
216-
blockExplorers: {
217-
etherscan: {
218-
name: "NewScan",
219-
url: "https://newscan.io",
220-
apiUrl: "https://api.newscan.io/api",
221-
},
222-
},
223-
},
224-
}
225-
```
93+
## Contract Verification (Optional)
22694

227-
This is particularly useful for:
228-
- Newer networks not yet added to Hardhat
229-
- Private/enterprise chains
230-
- Custom testnets
95+
Most networks are natively supported. Add `--verifycontract` when deploying:
23196

232-
**Note:** With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
97+
```bash
98+
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia --verifycontract
99+
```
233100

234-
1. **Follow the tutorials** using your newly configured network
101+
For networks not in [Hardhat's chain descriptors](https://github.com/NomicFoundation/hardhat/blob/main/v-next/hardhat/src/internal/builtin-plugins/network-manager/chain-descriptors.ts), add to `hardhat.config.ts`:
235102

236-
## Adapt for Your Own Projects
103+
```typescript
104+
chainDescriptors: {
105+
12345: {
106+
name: "New Network",
107+
chainType: "generic",
108+
blockExplorers: {
109+
etherscan: {
110+
name: "NewScan",
111+
url: "https://newscan.io",
112+
apiUrl: "https://api.newscan.io/api",
113+
},
114+
},
115+
},
116+
}
117+
```
237118

238-
While this guide focuses on the smart-contract-examples repository structure, you can adapt these principles for your own projects.
119+
With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.

src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ Before running the scripts, you can customize the `config.json` within the `scri
116116

117117
**Note**: If you decide to change the chain IDs in the `remoteChains` section to use different networks, you will also need to update your `.env` file with the appropriate RPC URLs for those networks.
118118

119+
<Aside type="note" title="Using Different Networks">
120+
This tutorial uses Avalanche Fuji and Arbitrum Sepolia by default. To test with other CCIP-supported networks, see
121+
[Add CCIP Networks for Cross-Chain Token
122+
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry).
123+
</Aside>
124+
119125
Example `config.json` file:
120126

121127
```json

src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ This tutorial will guide you through the process of enabling your own tokens in
105105
1. **Fund your EOA with LINK and native gas tokens**:
106106
Make sure your EOA has enough LINK and native gas tokens on Avalanche Fuji and Ethereum Sepolia to cover transaction fees. You can use the [Chainlink faucets](https://faucets.chain.link/) to get testnet tokens.
107107

108+
<Aside type="note" title="Using Different Networks">
109+
This tutorial uses Avalanche Fuji and Ethereum Sepolia by default. To test with other CCIP-supported networks, see
110+
[Add CCIP Networks for Cross-Chain Token
111+
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat).
112+
</Aside>
113+
108114
## Tutorial
109115

110116
<Aside type="note" title="Explore the Code">

src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ Before running the scripts, you can customize the `config.json` within the `scri
116116

117117
**Note**: If you decide to change the chain IDs in the `remoteChains` section to use different networks, you will also need to update your `.env` file with the appropriate RPC URLs for those networks.
118118

119+
<Aside type="note" title="Using Different Networks">
120+
This tutorial uses Avalanche Fuji and Arbitrum Sepolia by default. To test with other CCIP-supported networks, see
121+
[Add CCIP Networks for Cross-Chain Token
122+
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry).
123+
</Aside>
124+
119125
Example `config.json` file:
120126

121127
```json

src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ This tutorial will guide you through the process of enabling your own tokens in
105105
1. **Fund your EOA with LINK and native gas tokens**:
106106
Make sure your EOA has enough LINK and native gas tokens on Avalanche Fuji and Ethereum Sepolia to cover transaction fees. You can use the [Chainlink faucets](https://faucets.chain.link/) to get testnet tokens.
107107

108+
<Aside type="note" title="Using Different Networks">
109+
This tutorial uses Avalanche Fuji and Ethereum Sepolia by default. To test with other CCIP-supported networks, see
110+
[Add CCIP Networks for Cross-Chain Token
111+
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat).
112+
</Aside>
113+
108114
## Tutorial
109115

110116
<Aside type="note" title="Explore the Code">

src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ By the end of this tutorial, you will have successfully deployed, registered, co
189189
submissions.
190190
</Aside>
191191

192+
<Aside type="note" title="Using Different Networks">
193+
This tutorial uses Ethereum Sepolia and BASE Sepolia by default. To test with other CCIP-supported networks that
194+
support Safe Transaction Service, see [Add CCIP Networks for Cross-Chain Token
195+
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat).
196+
</Aside>
197+
192198
### Deploy Safe Smart Accounts
193199

194200
In this step, you will deploy a Safe smart account on both Ethereum Sepolia and BASE Sepolia using the `deploySafe` task. The Safe smart account will serve as the multi-signature account, requiring approvals from multiple owners to authorize transactions. You can customize the number of owners and the required threshold for signatures.

0 commit comments

Comments
 (0)