Using Chainlink Local to Test CCIP in Your Hardhat Project

There are three guides to help you test Chainlink CCIP 2.0 in your Hardhat project using Chainlink Local - two for local mode and one for forked environments. The guides use the CCIP Hardhat Starter Kit (Hardhat 3), whose CCIP 2.0 examples (Example01-Example10) run as Hardhat tasks and Ignition modules on the Ethereum Sepolia → Polygon Amoy lane.

Read CCIP 2.0 behavior in Chainlink Local to understand what the simulator enforces in each mode, or the CCIP starter kit examples map for an index of every kit example.

Guides

This guide helps you set up and run CCIP 2.0 in a localhost environment within your Hardhat project. It provides step-by-step instructions on :

  • Cloning the CCIP Hardhat Starter Kit
  • Installing necessary dependencies
  • Running tests for token transfers between two accounts using ExtraArgsV3 with Fast Transfers

Using the local simulator without forking is ideal for initial development and testing in an isolated environment.

Sending data to a receiver with CCV config

This guide covers the receiver-side finality rules in local mode: a data-only message to a BasicMessageReceiverWithCCVs contract, where the local router enforces the receiver's minimum block depth for Fast Transfers.

This guide extends your testing capabilities by demonstrating how to use the Chainlink Local Simulator in a forked environment. It includes instructions on:

  • Setting up forks of real blockchain networks (Ethereum Sepolia and Polygon Amoy, a live CCIP 2.0 lane)
  • Routing messages across forks with the Hardhat 3 JavaScript fork helper for every CCIP era
  • Running the CCT fork tests (token and pool deployment, registration, Faster Than Finality gates)

Using the local simulator with forked environments is ideal for testing in a more realistic yet controlled setting.

Get the latest Chainlink content straight to your inbox.