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;
}
NameTypeDescription
receiverbytesThe recipient of the tokens on the destination chain, abi encoded
remoteChainSelectoruint64The chain ID of the destination chain
originalSenderaddressThe original sender of the tx on the source chain
amountuint256The amount of tokens to lock or burn, denominated in the source token's decimals
localTokenaddressThe 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;
}
NameTypeDescription
destTokenAddressbytesThe 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.
destPoolDatabytesOptional 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;
}
NameTypeDescription
originalSenderbytesThe original sender of the tx on the source chain
remoteChainSelectoruint64The chain ID of the source chain
receiveraddressThe recipient of the tokens on the destination chain
amountuint256The amount of tokens to release or mint, denominated in the source token's decimals
localTokenaddressThe address on this chain of the token to release or mint
sourcePoolAddressbytesThe address of the source pool, abi encoded in the case of EVM chains
sourcePoolDatabytesThe data received from the source pool to process the release or mint
offchainTokenDatabytesThe offchain data to process the release or mint

ReleaseOrMintOutV1

This struct represents the output data from a releaseOrMint call.

struct ReleaseOrMintOutV1 {
  uint256 destinationAmount;
}
NameTypeDescription
destinationAmountuint256The number of tokens released or minted on the destination chain, denominated in the local token's decimals. Expected to match the input amount.

Get the latest Chainlink content straight to your inbox.