API Version: v0.3.1

CCIPLocalRouter v0.3.1 API Reference

CCIPLocalRouter

The local-mode router used by CCIPLocalSimulator. It mirrors MockCCIPRouter from @chainlink/contracts-ccip 2.0.0 (same ABI, events and behaviour) and additionally applies the CCIP 2.0 finality rules of the OnRamp and OffRamp, so a test that passes locally does not fail on a fork or in production.

CCIPLocalRouter

Errors

CanOnlySendOneTokenPerMessage

error CanOnlySendOneTokenPerMessage()

CannotSendZeroTokens

error CannotSendZeroTokens()

InvalidAddress

error InvalidAddress(bytes encodedAddress)

InvalidExtraArgsTag

error InvalidExtraArgsTag()

InvalidOptionalThreshold

error InvalidOptionalThreshold(uint8 wanted, uint256 got)

MessageGasLimitTooHigh

error MessageGasLimitTooHigh()

ReceiverError

error ReceiverError(bytes err)

TokenReceiverNotAllowed

error TokenReceiverNotAllowed(uint64 destChainSelector)

Events

MessageExecuted

event MessageExecuted(bytes32 messageId, uint64 sourceChainSelector, address offRamp, bytes32 calldataHash)

MsgExecuted

event MsgExecuted(bool success, bytes retData, uint256 gasUsed)

Constants

GAS_FOR_CALL_EXACT_CHECK

uint16 public constant GAS_FOR_CALL_EXACT_CHECK = 5_000

DEFAULT_GAS_LIMIT

uint32 public constant DEFAULT_GAS_LIMIT = 200_000

Functions

ccipSend

Sends the message locally to the receiver instead of on the destination chain.

function ccipSend(uint64 destinationChainSelector, Client.EVM2AnyMessage calldata message) external payable returns (bytes32)

getFee

Returns the fee set with setFee.

function getFee(uint64, Client.EVM2AnyMessage memory) public view returns (uint256)

setFee

Sets the fees returned by getFee.

function setFee(uint256 feeAmount) external

getOnRamp

function getOnRamp(uint64) external pure returns (address onRampAddress)

getSupportedTokens

function getSupportedTokens(uint64) external pure returns (address[] memory tokens)

isChainSupported

function isChainSupported(uint64) external pure returns (bool supported)

isOffRamp

function isOffRamp(uint64, address) external pure returns (bool)

routeMessage

Routes a message to a receiver directly, bypassing ccipSend validation.

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

Get the latest Chainlink content straight to your inbox.