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.
Inherits:
Events
LiquidityTransferred
event LiquidityTransferred(address indexed from, uint256 amount);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
from | address | Yes | The source pool address |
amount | uint256 | No | The 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
Type | Description |
---|---|
bool | True 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
Name | Type | Description |
---|---|---|
token | IERC20 | The token contract to manage |
localTokenDecimals | uint8 | The decimal precision for the local token |
allowlist | address[] | Initial list of authorized addresses |
rmnProxy | address | Address of the RMN proxy contract |
acceptLiquidity | bool | Whether the pool accepts external liquidity |
router | address | Address of the router contract |
getRebalancer
Returns the current rebalancer address.
function getRebalancer() external view returns (address);
Returns
Type | Description |
---|---|
address | The 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
Name | Type | Description |
---|---|---|
lockOrBurnIn | Pool.LockOrBurnInV1 | Input parameters for the lock operation |
Returns
Type | Description |
---|---|
Pool.LockOrBurnOutV1 | Contains destination token address and pool data |
provideLiquidity
Adds external liquidity to the pool.
function provideLiquidity(uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The 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
Name | Type | Description |
---|---|---|
releaseOrMintIn | Pool.ReleaseOrMintInV1 | Input parameters for the release operation |
Returns
Type | Description |
---|---|
Pool.ReleaseOrMintOutV1 | Contains the final amount released in local tokens |
setRebalancer
Updates the rebalancer address.
function setRebalancer(address rebalancer) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
rebalancer | address | The new rebalancer address to set |
supportsInterface
Checks interface support using ERC165.
function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | The interface identifier to check |
Returns
Type | Description |
---|---|
bool | True if the interface is supported |
transferLiquidity
Transfers liquidity from an older pool version.
function transferLiquidity(address from, uint256 amount) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
from | address | The address of the source pool |
amount | uint256 | The amount of liquidity to transfer |
withdrawLiquidity
Removes liquidity from the pool.
function withdrawLiquidity(uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of liquidity to withdraw |