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:
Parameter | Type | Description |
---|---|---|
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 contract |
linkToken_ | LinkToken | The LINK token contract |
ccipBnM_ | BurnMintERC677Helper | The CCIP-BnM token contract |
ccipLnM_ | BurnMintERC677Helper | The CCIP-LnM token contract |
getSupportedTokens
Gets a list of token addresses that are supported for cross-chain transfers by the simulator.
Parameters:
Parameter | Type | Description |
---|---|---|
chainSelector | uint64 | The unique CCIP Chain Selector |
Returns:
Parameter | Type | Description |
---|---|---|
tokens | address[] memory | List of supported token addresses |
isChainSupported
Checks whether the provided chain selector is supported by the simulator.
Parameters:
Parameter | Type | Description |
---|---|---|
chainSelector | uint64 | The unique CCIP Chain Selector |
Returns:
Parameter | Type | Description |
---|---|---|
supported | bool | True if the chain selector is supported |
requestLinkFromFaucet
Requests LINK tokens from the faucet for a specified address.
Parameters:
Parameter | Type | Description |
---|---|---|
to | address | The address to receive LINK tokens |
amount | uint256 | The amount of LINK tokens to send |
Returns:
Parameter | Type | Description |
---|---|---|
success | bool | True 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:
Parameter | Type | Description |
---|---|---|
tokenAddress | address | The address of the token to add to supported tokens |