Chainlink Local - Documentation
  • 💻Getting Started
    • Chainlink Local - Documentation
    • Architecture
  • 📖API Reference
    • API Reference
    • CCIPLocalSimulator.sol API
    • CCIPLocalSimulatorFork.sol API
    • CCIPLocalSimulatorFork.js API
    • MockV3Aggregator.sol API
    • MockOffchainAggregator.sol API
  • Guides
    • CCIPLocalSimulator.sol - usage with Foundry, Hardhat & Remix IDE
    • CCIPLocalSimulatorFork.sol - usage with Foundry
    • CCIPLocalSimulatorFork.js - usage with Hardhat
  • 🧑‍💻Learn more
    • Examples
    • Contribute to Chainlink Local
Powered by GitBook
On this page
  • API methods
  • [CCIPLocalSimulator].configuration()
  • [CCIPLocalSimulator].requestLinkFromFaucet()
  • [CCIPLocalSimulator].getSupportedTokens()
  • [CCIPLocalSimulator].isChainSupported()
  • [CCIPLocalSimulator].supportNewToken()
  1. API Reference

CCIPLocalSimulator.sol API

PreviousAPI ReferenceNextCCIPLocalSimulatorFork.sol API

Last updated 1 year ago

API methods

[CCIPLocalSimulator].configuration()

Call the .configuration() method on the deployed CCIPLocalSimulator 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.

📖
contract
configuration()
requestLinkFromFaucet()
getSupportedTokens()
isChainSupported()
supportNewToken()