# Add CCIP Networks for Cross-Chain Token Tutorials (Foundry)
Source: https://docs.chain.link/ccip/tutorials/evm/cross-chain-tokens/configure-additional-networks-foundry
Last Updated: 2025-10-30

> For the complete documentation index, see [llms.txt](/llms.txt).

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

> **NOTE: Note**
>
> You can obtain RPC URLs from [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), or another node
> provider.

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.