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 CCIP_POOL_V1

CCIP_POOL_V1_RET_BYTES

The number of bytes in the return data for a pool v1 releaseOrMint call.

uint16 CCIP_POOL_V1_RET_BYTES

CCIP_LOCK_OR_BURN_V1_RET_BYTES

The default maximum number of bytes in the return data for a pool v1 lockOrBurn call.

uint32 CCIP_LOCK_OR_BURN_V1_RET_BYTES

Structs

LockOrBurnInV1

This struct is used when locking or burning tokens for cross-chain operations.

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 transaction on the source chain.
amountuint256The amount of tokens to lock or burn, denominated in the source token's decimals.
localTokenaddressThe address of the token on this chain 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. This value is untrusted as any pool owner can modify it.
destPoolDatabytesOptional pool data to be transferred to the destination chain, capped by default at CCIP_LOCK_OR_BURN_V1_RET_BYTES.

ReleaseOrMintInV1

This struct is used to release or mint tokens on the destination chain.

struct ReleaseOrMintInV1 {
  bytes originalSender;
  uint64 remoteChainSelector;
  address receiver;
  uint256 amount;
  address localToken;
  bytes sourcePoolAddress;
  bytes sourcePoolData;
  bytes offchainTokenData;
}
NameTypeDescription
originalSenderbytesThe original sender of the transaction 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 of the token on this chain to release or mint.
sourcePoolAddressbytesThe address of the source pool, ABI encoded. This value must be verified before processing funds.
sourcePoolDatabytesData received from the source pool to process the release or mint.
offchainTokenDatabytesUntrusted 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.