CCIP Scripts

June 15, 2026 ยท View on GitHub

This directory contains reference implementation scripts for interacting with the Cross-Chain Interoperability Protocol (CCIP).

๐ŸŽฏ This is the main overview and quick reference guide
For detailed documentation: SVM (Solana) | EVM (Ethereum)

Table of Contents

Directory Structure

The scripts are organized by virtual machine type and functionality:

ccip-scripts/
โ”œโ”€โ”€ config/                    # Unified configuration for all chains
โ”œโ”€โ”€ evm/                      # Ethereum Virtual Machine scripts
โ”‚   โ”œโ”€โ”€ router/               # Cross-chain transfers and messaging
โ”‚   โ”œโ”€โ”€ token/                # Token operations (drip faucet)
โ”‚   โ””โ”€โ”€ utils/                # EVM utility functions
โ””โ”€โ”€ svm/                      # Solana Virtual Machine scripts
    โ”œโ”€โ”€ router/               # Cross-chain transfers and messaging
    โ”œโ”€โ”€ token/                # Token delegation and fee preparation
    โ”œโ”€โ”€ receiver/             # CCIP message receivers
    โ””โ”€โ”€ utils/                # SVM utility functions

Configuration

The configuration system provides a unified approach for both EVM and SVM chains. All network-specific settings, contract addresses, and chain selectors are centralized in the configuration files.

Key Configuration Elements

  • ChainId - Enum identifying supported chains (e.g., ETHEREUM_SEPOLIA, SOLANA_DEVNET)
  • CHAIN_SELECTORS - Official CCIP chain selector values
  • EVMChainConfig - Configuration for Ethereum chains
  • SVMChainConfig - Configuration for Solana chains

Using the Configuration

// Import configuration elements
import {
  ChainId,
  getEVMConfig,
  getCCIPSVMConfig,
  getEVMFeeTokenAddress,
  FeeTokenType,
} from "./config";

// Get Ethereum configuration
const evmConfig = getEVMConfig(ChainId.ETHEREUM_SEPOLIA);
console.log("Router address:", evmConfig.routerAddress);

// Get Solana configuration
const svmConfig = getCCIPSVMConfig(ChainId.SOLANA_DEVNET);
console.log("Router program ID:", svmConfig.routerProgramId);

Quick Start

For Solana (SVM) Development

  1. Setup: Install dependencies and fund wallet with SOL
  2. CCIP Preparation: yarn svm:token:wrap โ†’ yarn svm:token:delegate โ†’ yarn svm:token:check
  3. Send messages: yarn svm:token-transfer / yarn svm:arbitrary-messaging / yarn svm:data-and-tokens

Cross-chain token (CCT) pool setup moved to ccip-solana-bs58-generator.

For Ethereum (EVM) Development

  1. Setup: Install dependencies and fund wallet with test ETH
  2. Get Test Tokens: yarn evm:token:drip
  3. Send Messages: yarn evm:transfer / yarn evm:arbitrary-messaging

Script Categories

Solana VM (SVM) Scripts

Router Operations

ScriptPurpose
yarn svm:feeEstimate CCIP fees for cross-chain operations
yarn svm:token-transferTransfer tokens between chains
yarn svm:arbitrary-messagingSend arbitrary data between chains
yarn svm:data-and-tokensSend both data and tokens in one transaction

Token Operations

ScriptPurpose
yarn svm:token:wrapWrap SOL to wSOL for CCIP fees
yarn svm:token:delegateDelegate token authority to CCIP router
yarn svm:token:checkVerify token delegations and balances

CCIP Receivers

ScriptPurpose
yarn svm:receiver:deployDeploy a new CCIP receiver program
yarn svm:receiver:initializeInitialize receiver for incoming messages
yarn svm:receiver:get-messageGet latest received message
yarn svm:receiver:closeClose receiver storage accounts

๐Ÿ“– For detailed usage, options, and troubleshooting: See SVM Scripts Documentation

Ethereum VM (EVM) Scripts

Router Operations

ScriptPurpose
yarn evm:transferTransfer tokens from Ethereum to another chain
yarn evm:arbitrary-messagingSend arbitrary messages through CCIP
yarn evm:data-and-tokensSend both data and tokens in single transaction
yarn evm:check-feeEstimate CCIP fees without sending transactions

Token Operations

ScriptPurpose
yarn evm:token:dripGet test tokens on supported networks

๐Ÿ“– For detailed EVM documentation: See EVM Scripts Documentation

Prerequisites

General Requirements

  • Node.js v20+ (v23.11.0 recommended)
  • Yarn package manager
  • Git for cloning repositories

Solana (SVM) Requirements

  • Solana CLI tools
  • Wallet with SOL on Devnet for testing
  • Default keypair at ~/.config/solana/id.json
  • Optional: Test keypair at ~/.config/solana/keytest.json

Ethereum (EVM) Requirements

  • Web3 wallet (MetaMask, etc.)
  • Test ETH on supported networks
  • Private key configuration for scripts

Installation

# Install all dependencies
yarn install

# Verify TypeScript compilation
yarn type-check

Troubleshooting

Common Issues

Solana (SVM)

  • Insufficient Balance: Ensure sufficient SOL for transaction fees
  • Permission Errors: Run yarn svm:token:delegate before CCIP transfers
  • Network Issues: Verify devnet connection and RPC endpoints

Ethereum (EVM)

  • Gas Estimation Failures: Increase gas limits during network congestion
  • Token Approval Issues: Ensure sufficient token approvals for transfers
  • Network Configuration: Verify correct network settings in wallet

Debug Commands

# Increase logging verbosity for SVM scripts
yarn svm:fee -- --log-level DEBUG

# Skip preflight checks for complex transactions
yarn svm:token-transfer -- --skip-preflight

# Use test keypair for isolated testing
yarn svm:token:wrap -- --use-test-keypair

Getting Help

  • Detailed Guides: SVM Documentation | EVM Documentation
  • Configuration Issues: Check the config/ directory for network settings
  • Script-Specific Help: Add --help flag to any script for usage information

๐Ÿ”ง For comprehensive troubleshooting: See platform-specific documentation linked above