API Version: v0.2.3

CCIPLocalSimulatorFork v0.2.3 API Reference

CCIPLocalSimulatorFork

A contract that simulates CCIP (Cross-Chain Interoperability Protocol) message routing in a Foundry test environment.

CCIPLocalSimulatorFork

Interfaces

IRouterFork

Interface for interacting with the CCIP Router contract in a forked environment.

OffRamp

struct OffRamp {
  uint64 sourceChainSelector;
  address offRamp;
}
FieldTypeDescription
sourceChainSelectoruint64The chain selector for the source chain
offRampaddressThe address of the offRamp contract

getOffRamps

function getOffRamps() external view returns (OffRamp[] memory)

Returns

ParameterTypeDescription
(unnamed)OffRamp[]Array of off-ramp configurations

IEVM2EVMOffRampFork

Interface for executing CCIP messages on an off-ramp contract in a forked environment.

executeSingleMessage

function executeSingleMessage(
    Internal.EVM2EVMMessage memory message,
    bytes[] memory offchainTokenData,
    uint32[] memory tokenGasOverrides
) external

Parameters

ParameterTypeDescription
messageEVM2EVMMessageThe CCIP message to be executed
offchainTokenDatabytes[]Additional off-chain token data
tokenGasOverridesuint32[]Gas limit overrides for token transfers

Events

CCIPSendRequested

event CCIPSendRequested(Internal.EVM2EVMMessage message)

Parameters

ParameterTypeDescription
messageEVM2EVMMessageThe EVM2EVM message that was sent

Variables

i_register

Register immutable i_register
address constant LINK_FAUCET = 0x4281eCF07378Ee595C564a59048801330f3084eE

s_processedMessages

mapping(bytes32 messageId => bool isProcessed) internal s_processedMessages

Functions

constructor

Initializes the contract and sets up logging and persistence.

constructor()

switchChainAndRouteMessage

Routes a cross-chain message on the destination network after switching to the specified fork.

function switchChainAndRouteMessage(uint256 forkId) external

Parameters

ParameterTypeDescription
forkIduint256The ID of the destination network fork (returned by createFork() or createSelectFork())

getNetworkDetails

Returns the network configuration details for a specified chain ID.

function getNetworkDetails(uint256 chainId) external view returns (Register.NetworkDetails memory)

Parameters

ParameterTypeDescription
chainIduint256The blockchain network chain ID (e.g., 11155111 for Ethereum Sepolia)

Returns

ParameterTypeDescription
(unnamed)NetworkDetailsThe network configuration details for the specified chain

setNetworkDetails

Updates or adds new network configuration details for a specified chain ID.

function setNetworkDetails(uint256 chainId, Register.NetworkDetails memory networkDetails) external

Parameters

ParameterTypeDescription
chainIduint256The blockchain network chain ID (e.g., 11155111 for Ethereum Sepolia)
networkDetailsNetworkDetailsThe network configuration details to be stored

requestLinkFromFaucet

Requests LINK tokens from the faucet for a specified address.

function requestLinkFromFaucet(address to, uint256 amount) external returns (bool success)

Parameters

ParameterTypeDescription
toaddressThe address to receive the LINK tokens
amountuint256The amount of LINK tokens to transfer

Returns

ParameterTypeDescription
successboolReturns true if the token transfer was successful

Get the latest Chainlink content straight to your inbox.