Skip to content

Commit edfba32

Browse files
authored
Merge branch 'main' into 0g-verifierproxy-fix
2 parents 5e1ae9a + ceaa5ad commit edfba32

11 files changed

+349
-34
lines changed

src/config/sidebar.ts

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import chainlinkLocalV023Contents from "./sidebar/chainlink-local/api-reference/
2828
*/
2929
export type SectionContent = {
3030
title: string
31-
url: string
31+
url?: string
3232
highlightAsCurrent?: string[]
3333
children?: SectionContent[]
3434
isCollapsible?: boolean
@@ -1583,27 +1583,44 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
15831583
url: "ccip/tutorials/evm/cross-chain-tokens",
15841584
children: [
15851585
{
1586-
title: "Deploy and Register Using Remix IDE",
1587-
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-remix",
1588-
},
1589-
{
1590-
title: "Register from an EOA (Burn & Mint)",
1591-
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat",
1592-
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry"],
1593-
},
1594-
{
1595-
title: "Register from an EOA (Lock & Mint)",
1596-
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat",
1597-
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry"],
1598-
},
1599-
{
1600-
title: "Set Token Pool rate limits",
1601-
url: "ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-hardhat",
1602-
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-foundry"],
1586+
title: "Using Remix IDE",
1587+
children: [
1588+
{
1589+
title: "Deploy and Register from an EOA",
1590+
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-remix",
1591+
},
1592+
],
16031593
},
16041594
{
1605-
title: "Register from a Safe Smart Account (Burn & Mint)",
1606-
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat",
1595+
title: "Using Hardhat / Foundry",
1596+
children: [
1597+
{
1598+
title: "Register from an EOA (Burn & Mint)",
1599+
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat",
1600+
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry"],
1601+
},
1602+
{
1603+
title: "Register from an EOA (Lock & Mint)",
1604+
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat",
1605+
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry"],
1606+
},
1607+
{
1608+
title: "Set Token Pool rate limits",
1609+
url: "ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-hardhat",
1610+
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-foundry"],
1611+
},
1612+
{
1613+
title: "Register from a Safe Smart Account (Burn & Mint)",
1614+
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat",
1615+
},
1616+
{
1617+
title: "Configure Additional Networks",
1618+
url: "ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
1619+
highlightAsCurrent: [
1620+
"ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
1621+
],
1622+
},
1623+
],
16071624
},
16081625
],
16091626
},
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
section: ccip
3+
date: Last Modified
4+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Foundry)"
5+
metadata:
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"
9+
datePublished: "2025-10-30"
10+
lastModified: "2025-10-30"
11+
estimatedTime: "5 minutes"
12+
difficulty: "beginner"
13+
---
14+
15+
import { Aside, PageTabs } from "@components"
16+
17+
<PageTabs
18+
pages={[
19+
{
20+
name: "Hardhat",
21+
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
22+
icon: "/images/tutorial-icons/hardhat-icn.png",
23+
},
24+
{
25+
name: "Foundry",
26+
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
27+
icon: "/images/tutorial-icons/foundry-icn.png",
28+
},
29+
]}
30+
/>
31+
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+
34+
## Add a Network
35+
36+
Add the network configuration to [`script/HelperConfig.s.sol`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/foundry/script/HelperConfig.s.sol)
37+
38+
```solidity
39+
// Rest of the code...
40+
41+
constructor() {
42+
// Rest of the existing networks...
43+
44+
else if (block.chainid == 11155420) {
45+
activeNetworkConfig = getOptimismSepoliaConfig();
46+
} else {
47+
revert("Unsupported network");
48+
}
49+
}
50+
51+
// Rest of the existing network configurations...
52+
53+
function getOptimismSepoliaConfig() public pure returns (NetworkConfig memory) {
54+
NetworkConfig memory optimismSepoliaConfig = NetworkConfig({
55+
chainSelector: 5224473277236331295,
56+
router: 0x114A20A10b43D4115e5aeef7345a1A71d2a60C57,
57+
rmnProxy: 0xb40A3109075965cc09E93719e33E748abf680dAe,
58+
tokenAdminRegistry: 0x1d702b1FA12F347f0921C722f9D9166F00DEB67A,
59+
registryModuleOwnerCustom: 0x49c4ba01dc6F5090f9df43Ab8F79449Db91A0CBB,
60+
link: 0xE4aB69C077896252FAFBD49EFD26B5D171A32410,
61+
confirmations: 2,
62+
nativeCurrencySymbol: "ETH"
63+
});
64+
return optimismSepoliaConfig;
65+
}
66+
67+
function getNetworkConfig(uint256 chainId) public pure returns (NetworkConfig memory) {
68+
// Rest of the existing networks...
69+
70+
else if (chainId == 11155420) {
71+
return getOptimismSepoliaConfig();
72+
} else {
73+
revert("Unsupported chain ID");
74+
}
75+
}
76+
```
77+
78+
Set the RPC URL:
79+
80+
```env
81+
RPC_URL_OPTIMISM_SEPOLIA="INSERT_YOUR_RPC_URL_HERE"
82+
```
83+
84+
<Aside type="note" title="Note">
85+
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node
86+
provider.
87+
</Aside>
88+
89+
Save the `.env` file, then load the environment variable into the terminal session:
90+
91+
```bash
92+
source .env
93+
```
94+
95+
The network is now available in all Foundry commands using `--rpc-url $RPC_URL_OPTIMISM_SEPOLIA`.
96+
97+
## Configuration Fields
98+
99+
| Field | Required | Description | Source |
100+
| --------------------------- | -------- | ------------------------------------------------------------------ | ------------------------------------------------------------- |
101+
| `chainSelector` | Yes | CCIP identifier for the network | [CCIP Directory](/ccip/directory) |
102+
| `router` | Yes | CCIP Router contract address | [CCIP Directory](/ccip/directory) |
103+
| `rmnProxy` | Yes | RMN Proxy contract address | [CCIP Directory](/ccip/directory) |
104+
| `tokenAdminRegistry` | Yes | Token Admin Registry address | [CCIP Directory](/ccip/directory) |
105+
| `registryModuleOwnerCustom` | Yes | Registry Module Owner address | [CCIP Directory](/ccip/directory) |
106+
| `link` | Yes | LINK token contract address | [CCIP Directory](/ccip/directory) |
107+
| `confirmations` | No | Number of block confirmations before considering transaction final | Blockchain's finality characteristics and your risk tolerance |
108+
| `nativeCurrencySymbol` | No | Native gas token symbol (e.g., `"ETH"`, `"AVAX"`, `"POL"`) | Blockchain's official documentation |
109+
110+
Find all CCIP addresses in the [CCIP Directory - Testnet](/ccip/directory/testnet) or [CCIP Directory - Mainnet](/ccip/directory/mainnet).
111+
112+
## Test
113+
114+
Deploy a token to verify the configuration:
115+
116+
```bash
117+
forge script script/DeployToken.s.sol --rpc-url $RPC_URL_OPTIMISM_SEPOLIA --private-key $PRIVATE_KEY --broadcast
118+
```
119+
120+
## Contract Verification (Optional)
121+
122+
Most networks are natively supported. Add `--verify` when deploying:
123+
124+
```bash
125+
forge script script/DeployToken.s.sol --rpc-url $RPC_URL_OPTIMISM_SEPOLIA --private-key $PRIVATE_KEY --broadcast --verify
126+
```
127+
128+
For networks not in [Foundry's `StdChains.sol::StdChains::initializeStdChains()`](https://github.com/foundry-rs/forge-std/blob/master/src/StdChains.sol#L193) function, include the `--verifier`, `--verifier-url`, and `--verifier-api-key` flags together with `--verify` when deploying:
129+
130+
```bash
131+
forge script script/DeployToken.s.sol --rpc-url $RPC_URL_CUSTOM_NETWORK --private-key $PRIVATE_KEY --broadcast --verify --verifier custom --verifier-url $CUSTOM_EXPLORER_API_URL --verifier-api-key $CUSTOM_EXPLORER_API_KEY
132+
```
133+
134+
With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
section: ccip
3+
date: Last Modified
4+
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Hardhat)"
5+
metadata:
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"
9+
datePublished: "2025-10-30"
10+
lastModified: "2025-10-30"
11+
estimatedTime: "5 minutes"
12+
difficulty: "beginner"
13+
---
14+
15+
import { Aside, PageTabs } from "@components"
16+
17+
<PageTabs
18+
pages={[
19+
{
20+
name: "Hardhat",
21+
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
22+
icon: "/images/tutorial-icons/hardhat-icn.png",
23+
},
24+
{
25+
name: "Foundry",
26+
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
27+
icon: "/images/tutorial-icons/foundry-icn.png",
28+
},
29+
]}
30+
/>
31+
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+
34+
## Add a Network
35+
36+
Add the network configuration to [`config/networks.ts`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/hardhat/config/networks.ts):
37+
38+
```typescript
39+
export const configData = {
40+
// ... existing networks
41+
optimismSepolia: {
42+
chainFamily: "evm",
43+
chainId: 11155420,
44+
chainSelector: "5224473277236331295",
45+
router: "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57",
46+
rmnProxy: "0xb40A3109075965cc09E93719e33E748abf680dAe",
47+
tokenAdminRegistry: "0x1d702b1FA12F347f0921C722f9D9166F00DEB67A",
48+
registryModuleOwnerCustom: "0x49c4ba01dc6F5090f9df43Ab8F79449Db91A0CBB",
49+
link: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
50+
confirmations: 2,
51+
nativeCurrencySymbol: "ETH",
52+
},
53+
}
54+
```
55+
56+
Set the RPC URL:
57+
58+
```bash
59+
npx env-enc set OPTIMISM_SEPOLIA_RPC_URL
60+
```
61+
62+
<Aside type="note" title="Note">
63+
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node
64+
provider.
65+
</Aside>
66+
67+
The network is now available in all Hardhat tasks using `--network optimismSepolia`.
68+
69+
**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`.
70+
71+
## Configuration Fields
72+
73+
| Field | Required | Description | Source |
74+
| --------------------------- | -------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
75+
| `chainFamily` | Yes | Blockchain VM type: `"evm"` for Ethereum-compatible chains, `"svm"` for Solana | `config/types.ts` |
76+
| `chainId` | Yes | EVM chain ID | Blockchain's official documentation (preferred) or [ChainList](https://chainlist.org/) |
77+
| `chainSelector` | Yes | CCIP identifier for the network | [CCIP Directory](/ccip/directory) |
78+
| `router` | Yes | CCIP Router contract address | [CCIP Directory](/ccip/directory) |
79+
| `rmnProxy` | Yes | RMN Proxy contract address | [CCIP Directory](/ccip/directory) |
80+
| `tokenAdminRegistry` | Yes | Token Admin Registry address | [CCIP Directory](/ccip/directory) |
81+
| `registryModuleOwnerCustom` | Yes | Registry Module Owner address | [CCIP Directory](/ccip/directory) |
82+
| `link` | Yes | LINK token contract address | [CCIP Directory](/ccip/directory) |
83+
| `confirmations` | No | Number of block confirmations before considering transaction final | Blockchain's finality characteristics and your risk tolerance |
84+
| `nativeCurrencySymbol` | No | Native gas token symbol (e.g., `"ETH"`, `"AVAX"`, `"POL"`) | Blockchain's official documentation |
85+
86+
Find all CCIP addresses in the [CCIP Directory - Testnet](/ccip/directory/testnet) or [CCIP Directory - Mainnet](/ccip/directory/mainnet).
87+
88+
## Test
89+
90+
Deploy a token to verify the configuration:
91+
92+
```bash
93+
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia
94+
```
95+
96+
## Contract Verification (Optional)
97+
98+
Most networks are natively supported. Add `--verifycontract` when deploying:
99+
100+
```bash
101+
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia --verifycontract
102+
```
103+
104+
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`:
105+
106+
```typescript
107+
chainDescriptors: {
108+
12345: {
109+
name: "New Network",
110+
chainType: "generic",
111+
blockExplorers: {
112+
etherscan: {
113+
name: "NewScan",
114+
url: "https://newscan.io",
115+
apiUrl: "https://api.newscan.io/api",
116+
},
117+
},
118+
},
119+
}
120+
```
121+
122+
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/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ The tutorials will implement the logic of this process, which involves deploying
6464
- [Register from a Safe (Burn & Mint)](/ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat): Learn how to register a cross-chain token with the **Burn & Mint** mechanism using a Safe Smart Account.
6565
- [Hardhat version](/ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat)
6666

67+
- [Configure Additional Networks](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat): Learn how to configure your cross-chain tokens and pools to operate on additional networks beyond the initial setup.
68+
- [Hardhat version](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat)
69+
- [Foundry version](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry)
70+
6771
<CcipCommon callout="educationalDisclaimer" />

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
88
excerpt: "Burn & Mint, Foundry, ERC-20, ERC20, token pools, admin, CCIP, validation"
99
datePublished: "2024-10-29"
10-
lastModified: "2025-10-22"
10+
lastModified: "2025-10-30"
1111
estimatedTime: "40 minutes"
1212
difficulty: "intermediate"
1313
---
@@ -80,15 +80,13 @@ This tutorial will guide you through the process of enabling your own tokens in
8080
RPC_URL_FUJI=<your_rpc_url_fuji>
8181
RPC_URL_ARBITRUM_SEPOLIA=<your_rpc_url_arbitrum_sepolia>
8282
ETHERSCAN_API_KEY=<your_etherscan_api_key>
83-
ARBISCAN_API_KEY=<your_arbiscan_api_key>
8483
```
8584

8685
Variables to configure:
8786
- `PRIVATE_KEY`: The private key for your testnet wallet. If you use MetaMask, you can follow this [guide](https://support.metamask.io/managing-my-wallet/secret-recovery-phrase-and-private-keys/how-to-export-an-accounts-private-key/) to export your private key. **Note**: This key is required for signing transactions like token transfers.
8887
- `RPC_URL_FUJI`: The RPC URL for the Fuji testnet. You can get this from the [Alchemy](https://www.alchemy.com/) or [Infura](https://infura.io/) website.
8988
- `RPC_URL_ARBITRUM_SEPOLIA`: The RPC URL for the Arbitrum Sepolia testnet. You can get this from the [Alchemy](https://www.alchemy.com/) or [Infura](https://infura.io/) website.
9089
- `ETHERSCAN_API_KEY`: An API key from Etherscan to verify your contracts. You can obtain one from [Etherscan](https://docs.etherscan.io/getting-started/viewing-api-usage-statistics).
91-
- `ARBISCAN_API_KEY`: An API key from Arbiscan to verify your contracts on Arbitrum. See [this guide](https://docs.arbiscan.io/getting-started/viewing-api-usage-statistics) to get one from Arbiscan.
9290

9391
1. **Load the environment variables** into the terminal session where you will run the commands:
9492

@@ -118,6 +116,12 @@ Before running the scripts, you can customize the `config.json` within the `scri
118116

119117
**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.
120118

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+
121125
Example `config.json` file:
122126

123127
```json

0 commit comments

Comments
 (0)