API Version: v0.2.1 Not using latest version (v0.2.3)

CCIPLocalSimulator v0.2.1 API Reference

CCIPLocalSimulator

CCIPLocalSimulator is a contract that provides local simulation capabilities for Cross-Chain Interoperability Protocol (CCIP) operations. It manages token deployments and routing configurations for testing CCIP functionality.

Variables

CHAIN_SELECTOR

uint64 constant CHAIN_SELECTOR = 16015286601757825753

The unique identifier for the simulated chain in CCIP operations.

i_ccipBnM

BurnMintERC677Helper internal immutable i_ccipBnM

The CCIP BnM token contract instance used for cross-chain token transfers.

i_ccipLnM

BurnMintERC677Helper internal immutable i_ccipLnM

The CCIP LnM token contract instance used for cross-chain token transfers.

i_linkToken

LinkToken internal immutable i_linkToken

The LINK token contract instance used for paying CCIP fees.

i_mockRouter

MockCCIPRouter internal immutable i_mockRouter

The mock CCIP router contract instance that simulates cross-chain message routing.

i_wrappedNative

WETH9 internal immutable i_wrappedNative

The wrapped native token contract instance used for fee payments.

Functions

constructor

Initializes the simulator by deploying necessary token contracts and configuring supported tokens.

configuration

Returns the configuration details for pre-deployed contracts and services needed for local CCIP simulations.

Returns:

ParameterTypeDescription
chainSelector_uint64The unique CCIP Chain Selector
sourceRouter_IRouterClientThe source chain Router contract
destinationRouter_IRouterClientThe destination chain Router contract
wrappedNative_WETH9The wrapped native token contract
linkToken_LinkTokenThe LINK token contract
ccipBnM_BurnMintERC677HelperThe CCIP-BnM token contract
ccipLnM_BurnMintERC677HelperThe CCIP-LnM token contract

getSupportedTokens

Gets a list of token addresses that are supported for cross-chain transfers by the simulator.

Parameters:

ParameterTypeDescription
chainSelectoruint64The unique CCIP Chain Selector

Returns:

ParameterTypeDescription
tokensaddress[] memoryList of supported token addresses

isChainSupported

Checks whether the provided chain selector is supported by the simulator.

Parameters:

ParameterTypeDescription
chainSelectoruint64The unique CCIP Chain Selector

Returns:

ParameterTypeDescription
supportedboolTrue if the chain selector is supported

requestLinkFromFaucet

Requests LINK tokens from the faucet for a specified address.

Parameters:

ParameterTypeDescription
toaddressThe address to receive LINK tokens
amountuint256The amount of LINK tokens to send

Returns:

ParameterTypeDescription
successboolTrue if the transfer was successful

supportNewToken

Allows users to add support for new tokens besides CCIP-BnM and CCIP-LnM for cross-chain transfers.

Parameters:

ParameterTypeDescription
tokenAddressaddressThe address of the token to add to supported tokens

Get the latest Chainlink content straight to your inbox.