CCIPLocalSimulator.sol API

API methods

[CCIPLocalSimulator].configuration()

Call the .configuration() method on the deployed CCIPLocalSimulator contract to obtain the configuration details for pre-deployed contracts and services needed for local CCIP simulations.

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

Return values:

  • chainSelector_ (uint64): The unique CCIP Chain Selector.

  • sourceRouter_ (IRouterClient): The source chain Router contract.

  • destinationRouter_ (IRouterClient): The destination chain Router contract.

  • wrappedNative_ (WETH9): The wrapped native token which can be used for CCIP fees.

  • linkToken_ (LinkToken): The LINK token.

  • ccipBnM_ (BurnMintERC677Helper): The ccipBnM token.

  • ccipLnM_ (BurnMintERC677Helper): The ccipLnM token.


[CCIPLocalSimulator].requestLinkFromFaucet()

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

Requests LINK tokens from the faucet. The provided amount of tokens are transferred to provided destination address.

Parameters:

  • to (address): The address to which LINK tokens are to be sent.

  • amount (uint256): The amount of LINK tokens to send.

Return values:

  • success (bool): Returns true if the transfer of tokens was successful, otherwise false.


[CCIPLocalSimulator].getSupportedTokens()

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

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

Parameters:

  • chainSelector (uint64): The unique CCIP Chain Selector.

Return values:

  • tokens (address[]): Returns a list of token addresses that are supported for cross-chain transfers by the simulator.


[CCIPLocalSimulator].isChainSupported()

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

Checks whether the provided chainSelector is supported by the simulator.

Parameters:

  • chainSelector (uint64): The unique CCIP Chain Selector.

Return values:

  • supported (bool): Returns true if chainSelector is supported by the simulator.


[CCIPLocalSimulator].supportNewToken()

function supportNewToken(address tokenAddress) external;

Allows user to support any new token, besides CCIP BnM and CCIP LnM, for cross-chain transfers.

Parameters:

  • tokenAddress (address): The address of the token to add to the list of supported tokens.

Last updated