CCIP v1.5.1 Pool Library API Reference
The Pool
library provides various token pool functions to construct return data for cross-chain operations in Chainlink's CCIP.
import { Pool } from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Pool.sol";
Types and Constants
CCIP_POOL_V1
The tag used to signal support for the Pool v1 standard.
bytes4 public constant CCIP_POOL_V1 = 0xaff2afbf;
CCIP_POOL_V1_RET_BYTES
The number of bytes in the return data for a pool v1 releaseOrMint call.
uint16 public constant CCIP_POOL_V1_RET_BYTES = 32;
CCIP_LOCK_OR_BURN_V1_RET_BYTES
The default max number of bytes in the return data for a pool v1 lockOrBurn call.
uint32 public constant CCIP_LOCK_OR_BURN_V1_RET_BYTES = 32;
LockOrBurnInV1
This struct represents the input data for a lockOrBurn
call.
struct LockOrBurnInV1 {
bytes receiver;
uint64 remoteChainSelector;
address originalSender;
uint256 amount;
address localToken;
}
Name | Type | Description |
---|---|---|
receiver | bytes | The recipient of the tokens on the destination chain, ABI encoded |
remoteChainSelector | uint64 | The chain ID of the destination chain |
originalSender | address | The original sender of the transaction on the source chain |
amount | uint256 | The amount of tokens to lock or burn, denominated in the source token's decimals |
localToken | address | The address on this chain of the token to lock or burn |
LockOrBurnOutV1
This struct represents the output data from a lockOrBurn
call.
struct LockOrBurnOutV1 {
bytes destTokenAddress;
bytes destPoolData;
}
Name | Type | Description |
---|---|---|
destTokenAddress | bytes | The address of the destination token, ABI encoded in the case of EVM chains. This value is UNTRUSTED as any pool owner can return whatever value they want. |
destPoolData | bytes | Optional pool data to be transferred to the destination chain. By default this is capped at CCIP_LOCK_OR_BURN_V1_RET_BYTES bytes. If more data is required, the TokenTransferFeeConfig.destBytesOverhead has to be set for the specific token. |
ReleaseOrMintInV1
This struct represents the input data for a releaseOrMint
call.
struct ReleaseOrMintInV1 {
bytes originalSender;
uint64 remoteChainSelector;
address receiver;
uint256 amount;
address localToken;
bytes sourcePoolAddress;
bytes sourcePoolData;
bytes offchainTokenData;
}
Name | Type | Description |
---|---|---|
originalSender | bytes | The original sender of the transaction on the source chain |
remoteChainSelector | uint64 | The chain ID of the source chain |
receiver | address | The recipient of the tokens on the destination chain |
amount | uint256 | The amount of tokens to release or mint, denominated in the source token's decimals |
localToken | address | The address on this chain of the token to release or mint |
sourcePoolAddress | bytes | The address of the source pool, abi encoded in the case of EVM chains |
sourcePoolData | bytes | The data received from the source pool to process the release or mint |
offchainTokenData | bytes | The offchain data to process the release or mint |
ReleaseOrMintOutV1
This struct represents the output data from a releaseOrMint
call.
struct ReleaseOrMintOutV1 {
uint256 destinationAmount;
}
Name | Type | Description |
---|---|---|
destinationAmount | uint256 | The number of tokens released or minted on the destination chain, denominated in the local token's decimals. Expected to match the input amount. |