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
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
section: ccip
3
3
date: Last Modified
4
-
title: "Configure Additional Networks using Foundry"
4
+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Foundry)"
5
5
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."
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."
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.
33
33
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:
title: "Configure Additional Networks using Hardhat"
4
+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Hardhat)"
5
5
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."
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."
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.
33
33
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
35
35
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**:
<Asidetype="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.
Add the network configuration to [`config/networks.ts`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/hardhat/config/networks.ts):
85
37
86
38
```typescript
87
-
// Rest of the code...
88
-
89
-
exportconst 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
<Asidetype="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:
182
57
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
+
```
186
61
187
-
1.**Test the configuration** by running a simple deployment:
62
+
The network is now available in all Hardhat tasks using `--network optimismSepolia`.
188
63
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`.
192
65
193
-
<br></br>
66
+
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node provider.
194
67
195
-
#### Contract Verification (Optional)
68
+
## Configuration Fields
196
69
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.
|`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 |
199
82
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).
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:
207
88
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
+
```
210
92
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)
226
94
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:
231
96
232
-
**Note:** With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
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`:
235
102
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
+
```
237
118
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.
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,12 @@ Before running the scripts, you can customize the `config.json` within the `scri
116
116
117
117
**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.
118
118
119
+
<Asidetype="note"title="Using Different Networks">
120
+
This tutorial uses Avalanche Fuji and Arbitrum Sepolia by default. To test with other CCIP-supported networks, see
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,12 @@ This tutorial will guide you through the process of enabling your own tokens in
105
105
1.**Fund your EOA with LINK and native gas tokens**:
106
106
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.
107
107
108
+
<Asidetype="note"title="Using Different Networks">
109
+
This tutorial uses Avalanche Fuji and Ethereum Sepolia by default. To test with other CCIP-supported networks, see
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,12 @@ Before running the scripts, you can customize the `config.json` within the `scri
116
116
117
117
**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.
118
118
119
+
<Asidetype="note"title="Using Different Networks">
120
+
This tutorial uses Avalanche Fuji and Arbitrum Sepolia by default. To test with other CCIP-supported networks, see
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,12 @@ This tutorial will guide you through the process of enabling your own tokens in
105
105
1.**Fund your EOA with LINK and native gas tokens**:
106
106
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.
107
107
108
+
<Asidetype="note"title="Using Different Networks">
109
+
This tutorial uses Avalanche Fuji and Ethereum Sepolia by default. To test with other CCIP-supported networks, see
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