API Version: v1.6.1

CCIP v1.6.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

RebalancerSet

event RebalancerSet(address oldRebalancer, address newRebalancer);

Parameters

NameTypeIndexedDescription
oldRebalanceraddressNoThe address of the previous rebalancer
newRebalanceraddressNoThe address of the new rebalancer

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.6.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

provideLiquidity

Adds external liquidity to the pool.

function provideLiquidity(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256The amount of liquidity to provide

_releaseOrMint

Internal function that implements the token release logic for a LockReleaseTokenPool.

function _releaseOrMint(address receiver, uint256 amount) internal virtual override;

Parameters

NameTypeDescription
receiveraddressThe address to receive the tokens
amountuint256The number of tokens to release

setRebalancer

Updates the rebalancer address.

function setRebalancer(address rebalancer) external onlyOwner;

Parameters

NameTypeDescription
rebalanceraddressThe new rebalancer address to set

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.