Skip to main content

ICCIPTokenPoolAdmin

Git Source

Inherits: ICCIPTokenPoolGetters

Title: ICCIPTokenPoolAdmin

The owner-facing surface of a Chainlink CCIP TokenPool (version 1.5.1), together with the pool events and errors and the view surface inherited from ICCIPTokenPoolGetters.

The ChainUpdate struct layout is identical to TokenPool.ChainUpdate of Chainlink CCIP 1.6.0, so applyChainUpdates and setChainRateLimiterConfig declared here have the same selectors as the pool functions. Every state-changing function is restricted to the pool owner, except the rate limiter setters, which also accept the pool's rate limit admin. Remote addresses are ABI-encoded for EVM chains and encoded per the remote chain family otherwise.

Functions​

transferOwnership​

Proposes a new owner. Ownership moves when the proposed owner accepts.

function transferOwnership(address to) external;

Parameters

NameTypeDescription
toaddressThe proposed owner.

acceptOwnership​

Accepts a proposed ownership transfer. Callable only by the proposed owner.

function acceptOwnership() external;

applyChainUpdates​

Removes and then adds remote chains. The removals run before the additions, so a selector present in both arguments is replaced in place. Removing a chain deletes its remote pools, remote token and both buckets. Added chains start with both buckets full.

function applyChainUpdates(
uint64[] calldata remoteChainSelectorsToRemove,
ChainUpdate[] calldata chainsToAdd
) external;

Parameters

NameTypeDescription
remoteChainSelectorsToRemoveuint64[]The chain selectors to remove.
chainsToAddChainUpdate[]The chains to add.

addRemotePool​

Adds an accepted remote pool for a configured remote chain.

function addRemotePool(uint64 remoteChainSelector, bytes calldata remotePoolAddress) external;

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector of the remote chain.
remotePoolAddressbytesThe remote pool address to add.

removeRemotePool​

Removes an accepted remote pool from a configured remote chain. In-flight messages from the removed pool are rejected afterwards.

function removeRemotePool(
uint64 remoteChainSelector,
bytes calldata remotePoolAddress
) external;

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector of the remote chain.
remotePoolAddressbytesThe remote pool address to remove.

setRouter​

Sets the router through which the pool resolves ramp authorization.

function setRouter(address newRouter) external;

Parameters

NameTypeDescription
newRouteraddressThe router address.

setRateLimitAdmin​

Sets the rate limit admin, which may set rate limiter configurations alongside the owner. The zero address clears the role.

function setRateLimitAdmin(address rateLimitAdmin) external;

Parameters

NameTypeDescription
rateLimitAdminaddressThe rate limit admin address.

setChainRateLimiterConfig​

Sets both rate limiter configurations of a configured remote chain. The bucket fill level is clamped to the new capacity and is never raised.

function setChainRateLimiterConfig(
uint64 remoteChainSelector,
ICCIPRateLimiter.Config calldata outboundConfig,
ICCIPRateLimiter.Config calldata inboundConfig
) external;

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector of the remote chain.
outboundConfigICCIPRateLimiter.ConfigThe outbound rate limiter configuration.
inboundConfigICCIPRateLimiter.ConfigThe inbound rate limiter configuration.

setChainRateLimiterConfigs​

Sets both rate limiter configurations of several configured remote chains.

function setChainRateLimiterConfigs(
uint64[] calldata remoteChainSelectors,
ICCIPRateLimiter.Config[] calldata outboundConfigs,
ICCIPRateLimiter.Config[] calldata inboundConfigs
) external;

Parameters

NameTypeDescription
remoteChainSelectorsuint64[]The chain selectors of the remote chains.
outboundConfigsICCIPRateLimiter.Config[]The outbound rate limiter configurations, one per chain.
inboundConfigsICCIPRateLimiter.Config[]The inbound rate limiter configurations, one per chain.

applyAllowListUpdates​

Removes and then adds sender allowlist entries. Absent removals, duplicate additions and zero addresses are skipped silently.

function applyAllowListUpdates(address[] calldata removes, address[] calldata adds) external;

Parameters

NameTypeDescription
removesaddress[]The addresses to remove.
addsaddress[]The addresses to add.

Events​

Locked​

Emitted when tokens are locked in the pool.

event Locked(address indexed sender, uint256 amount);

Parameters

NameTypeDescription
senderaddressThe calling on-ramp.
amountuint256The amount locked.

Burned​

Emitted when tokens are burned by the pool.

event Burned(address indexed sender, uint256 amount);

Parameters

NameTypeDescription
senderaddressThe calling on-ramp.
amountuint256The amount burned.

Released​

Emitted when tokens are released by the pool.

event Released(address indexed sender, address indexed recipient, uint256 amount);

Parameters

NameTypeDescription
senderaddressThe calling off-ramp.
recipientaddressThe recipient of the tokens.
amountuint256The amount released, in local token units.

Minted​

Emitted when tokens are minted by the pool.

event Minted(address indexed sender, address indexed recipient, uint256 amount);

Parameters

NameTypeDescription
senderaddressThe calling off-ramp.
recipientaddressThe recipient of the tokens.
amountuint256The amount minted, in local token units.

ChainAdded​

Emitted when a remote chain is added.

event ChainAdded(
uint64 remoteChainSelector,
bytes remoteToken,
ICCIPRateLimiter.Config outboundRateLimiterConfig,
ICCIPRateLimiter.Config inboundRateLimiterConfig
);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector added.
remoteTokenbytesThe token address on the remote chain.
outboundRateLimiterConfigICCIPRateLimiter.ConfigThe outbound rate limiter configuration.
inboundRateLimiterConfigICCIPRateLimiter.ConfigThe inbound rate limiter configuration.

ChainConfigured​

Emitted when the rate limiter configurations of a remote chain are set.

event ChainConfigured(
uint64 remoteChainSelector,
ICCIPRateLimiter.Config outboundRateLimiterConfig,
ICCIPRateLimiter.Config inboundRateLimiterConfig
);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector configured.
outboundRateLimiterConfigICCIPRateLimiter.ConfigThe outbound rate limiter configuration.
inboundRateLimiterConfigICCIPRateLimiter.ConfigThe inbound rate limiter configuration.

ChainRemoved​

Emitted when a remote chain is removed.

event ChainRemoved(uint64 remoteChainSelector);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector removed.

RemotePoolAdded​

Emitted when a remote pool is added to a remote chain.

event RemotePoolAdded(uint64 indexed remoteChainSelector, bytes remotePoolAddress);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector of the remote chain.
remotePoolAddressbytesThe remote pool address added.

RemotePoolRemoved​

Emitted when a remote pool is removed from a remote chain.

event RemotePoolRemoved(uint64 indexed remoteChainSelector, bytes remotePoolAddress);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector of the remote chain.
remotePoolAddressbytesThe remote pool address removed.

AllowListAdd​

Emitted when an address is added to the sender allowlist.

event AllowListAdd(address sender);

Parameters

NameTypeDescription
senderaddressThe address added.

AllowListRemove​

Emitted when an address is removed from the sender allowlist.

event AllowListRemove(address sender);

Parameters

NameTypeDescription
senderaddressThe address removed.

RouterUpdated​

Emitted when the router is set.

event RouterUpdated(address oldRouter, address newRouter);

Parameters

NameTypeDescription
oldRouteraddressThe previous router.
newRouteraddressThe router set.

RateLimitAdminSet​

Emitted when the rate limit admin is set.

event RateLimitAdminSet(address rateLimitAdmin);

Parameters

NameTypeDescription
rateLimitAdminaddressThe rate limit admin set.

OwnershipTransferRequested​

Emitted when an ownership transfer is requested.

event OwnershipTransferRequested(address indexed from, address indexed to);

Parameters

NameTypeDescription
fromaddressThe current owner.
toaddressThe proposed owner.

OwnershipTransferred​

Emitted when an ownership transfer is accepted.

event OwnershipTransferred(address indexed from, address indexed to);

Parameters

NameTypeDescription
fromaddressThe previous owner.
toaddressThe new owner.

Errors​

CallerIsNotARampOnRouter​

Thrown when the caller is not a ramp of the configured router.

error CallerIsNotARampOnRouter(address caller);

Parameters

NameTypeDescription
calleraddressThe rejected caller.

ZeroAddressNotAllowed​

Thrown when a zero address or an empty encoded address is supplied.

error ZeroAddressNotAllowed();

SenderNotAllowed​

Thrown when the sender is not on the enabled allowlist.

error SenderNotAllowed(address sender);

Parameters

NameTypeDescription
senderaddressThe rejected sender.

AllowListNotEnabled​

Thrown when the allowlist is updated on a pool without an allowlist.

error AllowListNotEnabled();

NonExistentChain​

Thrown when a remote chain is not configured on the pool.

error NonExistentChain(uint64 remoteChainSelector);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector.

ChainNotAllowed​

Thrown when a transfer is attempted for a remote chain that is not configured.

error ChainNotAllowed(uint64 remoteChainSelector);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector.

CursedByRMN​

Thrown when the remote chain is cursed by the RMN.

error CursedByRMN();

ChainAlreadyExists​

Thrown when a remote chain is added twice.

error ChainAlreadyExists(uint64 chainSelector);

Parameters

NameTypeDescription
chainSelectoruint64The chain selector.

InvalidSourcePoolAddress​

Thrown when a message originates from a remote pool that is not accepted.

error InvalidSourcePoolAddress(bytes sourcePoolAddress);

Parameters

NameTypeDescription
sourcePoolAddressbytesThe rejected source pool address.

InvalidToken​

Thrown when the token of a transfer is not the pool token.

error InvalidToken(address token);

Parameters

NameTypeDescription
tokenaddressThe rejected token.

Unauthorized​

Thrown when the caller is not authorized.

error Unauthorized(address caller);

Parameters

NameTypeDescription
calleraddressThe rejected caller.

PoolAlreadyAdded​

Thrown when a remote pool is added twice for a remote chain.

error PoolAlreadyAdded(uint64 remoteChainSelector, bytes remotePoolAddress);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector.
remotePoolAddressbytesThe remote pool address.

InvalidRemotePoolForChain​

Thrown when a remote pool to remove is not configured for a remote chain.

error InvalidRemotePoolForChain(uint64 remoteChainSelector, bytes remotePoolAddress);

Parameters

NameTypeDescription
remoteChainSelectoruint64The chain selector.
remotePoolAddressbytesThe remote pool address.

InvalidRemoteChainDecimals​

Thrown when the decimals encoded by a remote pool are malformed.

error InvalidRemoteChainDecimals(bytes sourcePoolData);

Parameters

NameTypeDescription
sourcePoolDatabytesThe rejected pool data.

MismatchedArrayLengths​

Thrown when array arguments have different lengths.

error MismatchedArrayLengths();

OverflowDetected​

Thrown when a remote amount cannot be represented in local decimals.

error OverflowDetected(uint8 remoteDecimals, uint8 localDecimals, uint256 remoteAmount);

Parameters

NameTypeDescription
remoteDecimalsuint8The remote token decimals.
localDecimalsuint8The local token decimals.
remoteAmountuint256The remote amount.

InvalidDecimalArgs​

Thrown when the supplied token decimals differ from the token's decimals.

error InvalidDecimalArgs(uint8 expected, uint8 actual);

Parameters

NameTypeDescription
expecteduint8The supplied decimals.
actualuint8The token's decimals.

OwnerCannotBeZero​

Thrown when the owner is set to the zero address.

error OwnerCannotBeZero();

MustBeProposedOwner​

Thrown when acceptOwnership is called by an address other than the proposed owner.

error MustBeProposedOwner();

CannotTransferToSelf​

Thrown when the owner proposes itself as the new owner.

error CannotTransferToSelf();

OnlyCallableByOwner​

Thrown when an owner-only function is called by another address.

error OnlyCallableByOwner();

Structs​

ChainUpdate​

A remote chain to add to the pool.

struct ChainUpdate {
uint64 remoteChainSelector;
bytes[] remotePoolAddresses;
bytes remoteTokenAddress;
ICCIPRateLimiter.Config outboundRateLimiterConfig;
ICCIPRateLimiter.Config inboundRateLimiterConfig;
}

Properties

NameTypeDescription
remoteChainSelectoruint64The CCIP chain selector of the remote chain.
remotePoolAddressesbytes[]The pool addresses on the remote chain accepted as message
sources.
remoteTokenAddressbytesThe token address on the remote chain.
outboundRateLimiterConfigICCIPRateLimiter.ConfigThe rate limiter configuration for transfers to the
remote chain.
inboundRateLimiterConfigICCIPRateLimiter.ConfigThe rate limiter configuration for transfers from the
remote chain.