API Version: v1.5.1

CCIP v1.5.1 LockReleaseTokenPool Contract API Reference

LockReleaseTokenPool

A specialized token pool for managing native tokens through a lock and release mechanism, with support for liquidity management.

Git Source

Inherits:

Events

LiquidityTransferred

event LiquidityTransferred(address indexed from, uint256 amount);

Parameters

NameTypeIndexedDescription
fromaddressYesThe source pool address
amountuint256NoThe amount of liquidity transferred

Errors

InsufficientLiquidity

error InsufficientLiquidity();

LiquidityNotAccepted

error LiquidityNotAccepted();

State Variables

i_acceptLiquidity

bool internal immutable i_acceptLiquidity;

s_rebalancer

address internal s_rebalancer;

typeAndVersion

string public constant override typeAndVersion = "LockReleaseTokenPool 1.5.1";

Functions

canAcceptLiquidity

Determines whether the pool can accept external liquidity.

function canAcceptLiquidity() external view returns (bool);

Returns

TypeDescription
boolTrue if the pool accepts external liquidity

constructor

constructor(
  IERC20 token,
  uint8 localTokenDecimals,
  address[] memory allowlist,
  address rmnProxy,
  bool acceptLiquidity,
  address router
) TokenPool(token, localTokenDecimals, allowlist, rmnProxy, router);

Parameters

NameTypeDescription
tokenIERC20The token contract to manage
localTokenDecimalsuint8The decimal precision for the local token
allowlistaddress[]Initial list of authorized addresses
rmnProxyaddressAddress of the RMN proxy contract
acceptLiquidityboolWhether the pool accepts external liquidity
routeraddressAddress of the router contract

getRebalancer

Returns the current rebalancer address.

function getRebalancer() external view returns (address);

Returns

TypeDescription
addressThe current liquidity manager address

lockOrBurn

Locks tokens in the pool for cross-chain transfer.

function lockOrBurn(
  Pool.LockOrBurnInV1 calldata lockOrBurnIn
) external virtual override returns (Pool.LockOrBurnOutV1 memory);

Parameters

NameTypeDescription
lockOrBurnInPool.LockOrBurnInV1Input parameters for the lock operation

Returns

TypeDescription
Pool.LockOrBurnOutV1Contains destination token address and pool data

provideLiquidity

Adds external liquidity to the pool.

function provideLiquidity(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256The amount of liquidity to provide

releaseOrMint

Releases tokens from the pool to a recipient.

function releaseOrMint(
  Pool.ReleaseOrMintInV1 calldata releaseOrMintIn
) external virtual override returns (Pool.ReleaseOrMintOutV1 memory);

Parameters

NameTypeDescription
releaseOrMintInPool.ReleaseOrMintInV1Input parameters for the release operation

Returns

TypeDescription
Pool.ReleaseOrMintOutV1Contains the final amount released in local tokens

setRebalancer

Updates the rebalancer address.

function setRebalancer(address rebalancer) external onlyOwner;

Parameters

NameTypeDescription
rebalanceraddressThe new rebalancer address to set

supportsInterface

Checks interface support using ERC165.

function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool);

Parameters

NameTypeDescription
interfaceIdbytes4The interface identifier to check

Returns

TypeDescription
boolTrue if the interface is supported

transferLiquidity

Transfers liquidity from an older pool version.

function transferLiquidity(address from, uint256 amount) external onlyOwner;

Parameters

NameTypeDescription
fromaddressThe address of the source pool
amountuint256The amount of liquidity to transfer

withdrawLiquidity

Removes liquidity from the pool.

function withdrawLiquidity(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256The amount of liquidity to withdraw

Get the latest Chainlink content straight to your inbox.