CCIPLocalSimulatorFork v0.2.3 API Reference
A contract that simulates CCIP (Cross-Chain Interoperability Protocol) message routing in a Foundry test environment.
CCIPLocalSimulatorFork
Interface for interacting with the CCIP Router contract in a forked environment.
struct OffRamp {
uint64 sourceChainSelector;
address offRamp;
}
Field | Type | Description |
---|
sourceChainSelector | uint64 | The chain selector for the source chain |
offRamp | address | The address of the offRamp contract |
function getOffRamps() external view returns (OffRamp[] memory)
Parameter | Type | Description |
---|
(unnamed) | OffRamp[] | Array of off-ramp configurations |
Interface for executing CCIP messages on an off-ramp contract in a forked environment.
function executeSingleMessage(
Internal.EVM2EVMMessage memory message,
bytes[] memory offchainTokenData,
uint32[] memory tokenGasOverrides
) external
Parameter | Type | Description |
---|
message | EVM2EVMMessage | The CCIP message to be executed |
offchainTokenData | bytes[] | Additional off-chain token data |
tokenGasOverrides | uint32[] | Gas limit overrides for token transfers |
event CCIPSendRequested(Internal.EVM2EVMMessage message)
Parameter | Type | Description |
---|
message | EVM2EVMMessage | The EVM2EVM message that was sent |
Register immutable i_register
address constant LINK_FAUCET = 0x4281eCF07378Ee595C564a59048801330f3084eE
mapping(bytes32 messageId => bool isProcessed) internal s_processedMessages
Initializes the contract and sets up logging and persistence.
constructor()
Routes a cross-chain message on the destination network after switching to the specified fork.
function switchChainAndRouteMessage(uint256 forkId) external
Parameter | Type | Description |
---|
forkId | uint256 | The ID of the destination network fork (returned by createFork() or createSelectFork() ) |
Returns the network configuration details for a specified chain ID.
function getNetworkDetails(uint256 chainId) external view returns (Register.NetworkDetails memory)
Parameter | Type | Description |
---|
chainId | uint256 | The blockchain network chain ID (e.g., 11155111 for Ethereum Sepolia) |
Parameter | Type | Description |
---|
(unnamed) | NetworkDetails | The network configuration details for the specified chain |
Updates or adds new network configuration details for a specified chain ID.
function setNetworkDetails(uint256 chainId, Register.NetworkDetails memory networkDetails) external
Parameter | Type | Description |
---|
chainId | uint256 | The blockchain network chain ID (e.g., 11155111 for Ethereum Sepolia) |
networkDetails | NetworkDetails | The network configuration details to be stored |
Requests LINK tokens from the faucet for a specified address.
function requestLinkFromFaucet(address to, uint256 amount) external returns (bool success)
Parameter | Type | Description |
---|
to | address | The address to receive the LINK tokens |
amount | uint256 | The amount of LINK tokens to transfer |
Parameter | Type | Description |
---|
success | bool | Returns true if the token transfer was successful |