Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 37 additions & 20 deletions src/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import chainlinkLocalV023Contents from "./sidebar/chainlink-local/api-reference/
*/
export type SectionContent = {
title: string
url: string
url?: string
highlightAsCurrent?: string[]
children?: SectionContent[]
isCollapsible?: boolean
Expand Down Expand Up @@ -1583,27 +1583,44 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
url: "ccip/tutorials/evm/cross-chain-tokens",
children: [
{
title: "Deploy and Register Using Remix IDE",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-remix",
},
{
title: "Register from an EOA (Burn & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry"],
},
{
title: "Register from an EOA (Lock & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry"],
},
{
title: "Set Token Pool rate limits",
url: "ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-foundry"],
title: "Using Remix IDE",
children: [
{
title: "Deploy and Register from an EOA",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-remix",
},
],
},
{
title: "Register from a Safe Smart Account (Burn & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat",
title: "Using Hardhat / Foundry",
children: [
{
title: "Register from an EOA (Burn & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-burn-mint-foundry"],
},
{
title: "Register from an EOA (Lock & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/register-from-eoa-lock-mint-foundry"],
},
{
title: "Set Token Pool rate limits",
url: "ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-hardhat",
highlightAsCurrent: ["ccip/tutorials/evm/cross-chain-tokens/update-rate-limiters-foundry"],
},
{
title: "Register from a Safe Smart Account (Burn & Mint)",
url: "ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat",
},
{
title: "Configure Additional Networks",
url: "ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
highlightAsCurrent: [
"ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
],
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
section: ccip
date: Last Modified
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Foundry)"
metadata:
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."
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"
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
datePublished: "2025-10-30"
lastModified: "2025-10-30"
estimatedTime: "5 minutes"
difficulty: "beginner"
---

import { Aside, PageTabs } from "@components"

<PageTabs
pages={[
{
name: "Hardhat",
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
icon: "/images/tutorial-icons/hardhat-icn.png",
},
{
name: "Foundry",
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
icon: "/images/tutorial-icons/foundry-icn.png",
},
]}
/>

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.

## Add a Network

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)

```solidity
// Rest of the code...

constructor() {
// Rest of the existing networks...

else if (block.chainid == 11155420) {
activeNetworkConfig = getOptimismSepoliaConfig();
} else {
revert("Unsupported network");
}
}

// Rest of the existing network configurations...

function getOptimismSepoliaConfig() public pure returns (NetworkConfig memory) {
NetworkConfig memory optimismSepoliaConfig = NetworkConfig({
chainSelector: 5224473277236331295,
router: 0x114A20A10b43D4115e5aeef7345a1A71d2a60C57,
rmnProxy: 0xb40A3109075965cc09E93719e33E748abf680dAe,
tokenAdminRegistry: 0x1d702b1FA12F347f0921C722f9D9166F00DEB67A,
registryModuleOwnerCustom: 0x49c4ba01dc6F5090f9df43Ab8F79449Db91A0CBB,
link: 0xE4aB69C077896252FAFBD49EFD26B5D171A32410,
confirmations: 2,
nativeCurrencySymbol: "ETH"
});
return optimismSepoliaConfig;
}

function getNetworkConfig(uint256 chainId) public pure returns (NetworkConfig memory) {
// Rest of the existing networks...

else if (chainId == 11155420) {
return getOptimismSepoliaConfig();
} else {
revert("Unsupported chain ID");
}
}
```

Set the RPC URL:

```env
RPC_URL_OPTIMISM_SEPOLIA="INSERT_YOUR_RPC_URL_HERE"
```

<Aside type="note" title="Note">
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node
provider.
</Aside>

Save the `.env` file, then load the environment variable into the terminal session:

```bash
source .env
```

The network is now available in all Foundry commands using `--rpc-url $RPC_URL_OPTIMISM_SEPOLIA`.

## Configuration Fields

| Field | Required | Description | Source |
| --------------------------- | -------- | ------------------------------------------------------------------ | ------------------------------------------------------------- |
| `chainSelector` | Yes | CCIP identifier for the network | [CCIP Directory](/ccip/directory) |
| `router` | Yes | CCIP Router contract address | [CCIP Directory](/ccip/directory) |
| `rmnProxy` | Yes | RMN Proxy contract address | [CCIP Directory](/ccip/directory) |
| `tokenAdminRegistry` | Yes | Token Admin Registry address | [CCIP Directory](/ccip/directory) |
| `registryModuleOwnerCustom` | Yes | Registry Module Owner address | [CCIP Directory](/ccip/directory) |
| `link` | Yes | LINK token contract address | [CCIP Directory](/ccip/directory) |
| `confirmations` | No | Number of block confirmations before considering transaction final | Blockchain's finality characteristics and your risk tolerance |
| `nativeCurrencySymbol` | No | Native gas token symbol (e.g., `"ETH"`, `"AVAX"`, `"POL"`) | Blockchain's official documentation |

Find all CCIP addresses in the [CCIP Directory - Testnet](/ccip/directory/testnet) or [CCIP Directory - Mainnet](/ccip/directory/mainnet).

## Test

Deploy a token to verify the configuration:

```bash
forge script script/DeployToken.s.sol --rpc-url $RPC_URL_OPTIMISM_SEPOLIA --private-key $PRIVATE_KEY --broadcast
```

## Contract Verification (Optional)

Most networks are natively supported. Add `--verify` when deploying:

```bash
forge script script/DeployToken.s.sol --rpc-url $RPC_URL_OPTIMISM_SEPOLIA --private-key $PRIVATE_KEY --broadcast --verify
```

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:

```bash
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
```

With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
section: ccip
date: Last Modified
title: "Add CCIP Networks for Cross-Chain Token Tutorials (Hardhat)"
metadata:
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."
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"
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
datePublished: "2025-10-30"
lastModified: "2025-10-30"
estimatedTime: "5 minutes"
difficulty: "beginner"
---

import { Aside, PageTabs } from "@components"

<PageTabs
pages={[
{
name: "Hardhat",
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat",
icon: "/images/tutorial-icons/hardhat-icn.png",
},
{
name: "Foundry",
url: "/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry",
icon: "/images/tutorial-icons/foundry-icn.png",
},
]}
/>

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.

## Add a Network

Add the network configuration to [`config/networks.ts`](https://github.com/smartcontractkit/smart-contract-examples/blob/main/ccip/cct/hardhat/config/networks.ts):

```typescript
export const configData = {
// ... existing networks
optimismSepolia: {
chainFamily: "evm",
chainId: 11155420,
chainSelector: "5224473277236331295",
router: "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57",
rmnProxy: "0xb40A3109075965cc09E93719e33E748abf680dAe",
tokenAdminRegistry: "0x1d702b1FA12F347f0921C722f9D9166F00DEB67A",
registryModuleOwnerCustom: "0x49c4ba01dc6F5090f9df43Ab8F79449Db91A0CBB",
link: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
confirmations: 2,
nativeCurrencySymbol: "ETH",
},
}
```

Set the RPC URL:

```bash
npx env-enc set OPTIMISM_SEPOLIA_RPC_URL
```

<Aside type="note" title="Note">
You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node
provider.
</Aside>

The network is now available in all Hardhat tasks using `--network optimismSepolia`.

**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`.

## Configuration Fields

| Field | Required | Description | Source |
| --------------------------- | -------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| `chainFamily` | Yes | Blockchain VM type: `"evm"` for Ethereum-compatible chains, `"svm"` for Solana | `config/types.ts` |
| `chainId` | Yes | EVM chain ID | Blockchain's official documentation (preferred) or [ChainList](https://chainlist.org/) |
| `chainSelector` | Yes | CCIP identifier for the network | [CCIP Directory](/ccip/directory) |
| `router` | Yes | CCIP Router contract address | [CCIP Directory](/ccip/directory) |
| `rmnProxy` | Yes | RMN Proxy contract address | [CCIP Directory](/ccip/directory) |
| `tokenAdminRegistry` | Yes | Token Admin Registry address | [CCIP Directory](/ccip/directory) |
| `registryModuleOwnerCustom` | Yes | Registry Module Owner address | [CCIP Directory](/ccip/directory) |
| `link` | Yes | LINK token contract address | [CCIP Directory](/ccip/directory) |
| `confirmations` | No | Number of block confirmations before considering transaction final | Blockchain's finality characteristics and your risk tolerance |
| `nativeCurrencySymbol` | No | Native gas token symbol (e.g., `"ETH"`, `"AVAX"`, `"POL"`) | Blockchain's official documentation |

Find all CCIP addresses in the [CCIP Directory - Testnet](/ccip/directory/testnet) or [CCIP Directory - Mainnet](/ccip/directory/mainnet).

## Test

Deploy a token to verify the configuration:

```bash
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia
```

## Contract Verification (Optional)

Most networks are natively supported. Add `--verifycontract` when deploying:

```bash
npx hardhat deployToken --name "Test Token" --symbol TEST --network optimismSepolia --verifycontract
```

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`:

```typescript
chainDescriptors: {
12345: {
name: "New Network",
chainType: "generic",
blockExplorers: {
etherscan: {
name: "NewScan",
url: "https://newscan.io",
apiUrl: "https://api.newscan.io/api",
},
},
},
}
```

With [Etherscan API V2](https://docs.etherscan.io/introduction), a single `ETHERSCAN_API_KEY` works across all Etherscan-compatible networks.
4 changes: 4 additions & 0 deletions src/content/ccip/tutorials/evm/cross-chain-tokens/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ The tutorials will implement the logic of this process, which involves deploying
- [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.
- [Hardhat version](/ccip/tutorials/evm/cross-chain-tokens/register-from-safe-burn-mint-hardhat)

- [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.
- [Hardhat version](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-hardhat)
- [Foundry version](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry)

<CcipCommon callout="educationalDisclaimer" />
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
image: "/images/ccip/CCIP_enabled_tokens_flowchart.jpg"
excerpt: "Burn & Mint, Foundry, ERC-20, ERC20, token pools, admin, CCIP, validation"
datePublished: "2024-10-29"
lastModified: "2025-10-22"
lastModified: "2025-10-30"
estimatedTime: "40 minutes"
difficulty: "intermediate"
---
Expand Down Expand Up @@ -80,15 +80,13 @@ This tutorial will guide you through the process of enabling your own tokens in
RPC_URL_FUJI=<your_rpc_url_fuji>
RPC_URL_ARBITRUM_SEPOLIA=<your_rpc_url_arbitrum_sepolia>
ETHERSCAN_API_KEY=<your_etherscan_api_key>
ARBISCAN_API_KEY=<your_arbiscan_api_key>
```

Variables to configure:
- `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.
- `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.
- `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.
- `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).
- `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.

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

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

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

<Aside type="note" title="Using Different Networks">
This tutorial uses Avalanche Fuji and Arbitrum Sepolia by default. To test with other CCIP-supported networks, see
[Add CCIP Networks for Cross-Chain Token
Tutorials](/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry).
</Aside>

Example `config.json` file:

```json
Expand Down
Loading
Loading