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

CCIPLocalSimulator v0.2.2 API Reference

CCIPLocalSimulator

A contract that simulates local CCIP (Cross-Chain Interoperability Protocol) operations for testing and development purposes.

CCIPLocalSimulator

Errors

CCIPLocalSimulator__MsgSenderIsNotTokenOwner

error CCIPLocalSimulator__MsgSenderIsNotTokenOwner()

Thrown when a caller attempts to add a token but is not the token owner or CCIP admin.

Variables

CHAIN_SELECTOR

uint64 constant CHAIN_SELECTOR = 16015286601757825753

i_ccipBnM

BurnMintERC677Helper internal immutable i_ccipBnM

i_ccipLnM

BurnMintERC677Helper internal immutable i_ccipLnM

i_linkToken

LinkToken internal immutable i_linkToken

i_mockRouter

MockCCIPRouter internal immutable i_mockRouter

i_wrappedNative

WETH9 internal immutable i_wrappedNative

s_supportedTokens

address[] internal s_supportedTokens

Functions

constructor

Initializes the contract by deploying and configuring all required token instances.

constructor()

configuration

Retrieves the complete configuration for local CCIP simulations.

function configuration()
    public
    view
    returns (
        uint64 chainSelector_,
        IRouterClient sourceRouter_,
        IRouterClient destinationRouter_,
        WETH9 wrappedNative_,
        LinkToken linkToken_,
        BurnMintERC677Helper ccipBnM_,
        BurnMintERC677Helper ccipLnM_
    )

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 which can be used for CCIP fees
linkToken_LinkTokenThe LINK token
ccipBnM_BurnMintERC677HelperThe ccipBnM token
ccipLnM_BurnMintERC677HelperThe ccipLnM token

getSupportedTokens

Retrieves the list of tokens supported for cross-chain transfers.

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

Parameters

ParameterTypeDescription
chainSelectoruint64The unique CCIP Chain Selector

Returns

ParameterTypeDescription
tokensaddress[]Returns a list of token addresses that are supported for cross-chain transfers by the simulator

isChainSupported

Verifies if a given chain selector is supported by the simulator.

function isChainSupported(uint64 chainSelector) public pure returns (bool supported)

Parameters

ParameterTypeDescription
chainSelectoruint64The unique CCIP Chain Selector

Returns

ParameterTypeDescription
supportedboolReturns true if chainSelector is supported by the simulator

requestLinkFromFaucet

Transfers LINK tokens from the faucet to a specified recipient address.

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

Parameters

ParameterTypeDescription
toaddressThe address to which LINK tokens are to be sent
amountuint256The amount of LINK tokens to send

Returns

ParameterTypeDescription
successboolReturns true if the transfer of tokens was successful, otherwise false

supportNewTokenViaGetCCIPAdmin

Adds support for a new token using CCIP admin verification.

function supportNewTokenViaGetCCIPAdmin(address tokenAddress) external

Parameters

ParameterTypeDescription
tokenAddressaddressThe address of the token to add to the list of supported tokens

supportNewTokenViaOwner

Adds support for a new token using owner verification.

function supportNewTokenViaOwner(address tokenAddress) external

Parameters

ParameterTypeDescription
tokenAddressaddressThe address of the token to add to the list of supported tokens

Get the latest Chainlink content straight to your inbox.