CCIP v2.0.0 IRouter API Reference

Summary

IRouter defines the minimal interface for the CCIP Router.

It is used by:

  • OffRamp contracts to route verified messages to receivers.
  • Pools and verifiers to validate configured ramps.
  • Integrations that query routing configuration.

Contract

chains/evm/contracts/interfaces/IRouter.sol


Import

import {IRouter} from "chainlink-ccip/chains/evm/contracts/interfaces/IRouter.sol";

Interface surface

interface IRouter {

Errors

error OnlyOffRamp();

routeMessage

function routeMessage(
  Client.Any2EVMMessage calldata message,
  uint16 gasForCallExactCheck,
  uint256 gasLimit,
  address receiver
)
  external
  returns (
    bool success,
    bytes memory retBytes,
    uint256 gasUsed
  );

getOnRamp

function getOnRamp(
  uint64 destChainSelector
) external view returns (address);

isOffRamp

function isOffRamp(
  uint64 sourceChainSelector,
  address offRamp
) external view returns (bool);

}

Integration notes / expectations

  • routeMessage must only be callable by configured off-ramps.
  • getOnRamp and isOffRamp are used for ramp authorization checks.
  • Implementations are expected to enforce strict caller validation internally.

Get the latest Chainlink content straight to your inbox.