Skip to main content

ICCIPTokenAdminRegistry

Git Source

Title: ICCIPTokenAdminRegistry

The token-specific surface of the Chainlink CCIP TokenAdminRegistry (version 1.5.0): the per-token administrator, its two-step transfer and the pool registration.

The registry holds one configuration per token. The administrator of a token selects the pool used for that token and nominates its successor; the successor completes the transfer by accepting it. Registering the zero address as pool delists the token. Functions that change the configuration of a token are restricted to its administrator, except acceptAdminRole, which is restricted to its pending administrator, and proposeAdministrator, which is restricted to the registry owner and its registry modules.

Functions​

getPool​

Returns the pool registered for a token.

function getPool(address token) external view returns (address pool);

Parameters

NameTypeDescription
tokenaddressThe token.

Returns

NameTypeDescription
pooladdressThe pool, or the zero address if none is registered.

getTokenConfig​

Returns the configuration of a token.

function getTokenConfig(address token) external view returns (TokenConfig memory config);

Parameters

NameTypeDescription
tokenaddressThe token.

Returns

NameTypeDescription
configTokenConfigThe configuration, with every field zero for an unknown token.

isAdministrator​

Returns whether an address is the administrator of a token.

function isAdministrator(
address localToken,
address administrator
) external view returns (bool isAdmin);

Parameters

NameTypeDescription
localTokenaddressThe token.
administratoraddressThe address to check.

Returns

NameTypeDescription
isAdminboolTrue if administrator is the administrator of localToken.

setPool​

Registers the pool of a token. The pool must support the token. The zero address delists the token from CCIP. Restricted to the administrator of the token.

function setPool(address localToken, address pool) external;

Parameters

NameTypeDescription
localTokenaddressThe token.
pooladdressThe pool to register.

transferAdminRole​

Nominates a new administrator of a token. The current administrator keeps the role until the nominee accepts. The zero address cancels a pending transfer. Restricted to the administrator of the token.

function transferAdminRole(address localToken, address newAdmin) external;

Parameters

NameTypeDescription
localTokenaddressThe token.
newAdminaddressThe nominated administrator.

acceptAdminRole​

Accepts the administrator role of a token. Restricted to the pending administrator of the token.

function acceptAdminRole(address localToken) external;

Parameters

NameTypeDescription
localTokenaddressThe token.

proposeAdministrator​

Proposes the first administrator of a token. Restricted to the registry owner and its registry modules.

function proposeAdministrator(address localToken, address administrator) external;

Parameters

NameTypeDescription
localTokenaddressThe token.
administratoraddressThe proposed administrator.

Events​

PoolSet​

Emitted when the pool of a token changes.

event PoolSet(address indexed token, address indexed previousPool, address indexed newPool);

Parameters

NameTypeDescription
tokenaddressThe token.
previousPooladdressThe pool registered before the change.
newPooladdressThe pool registered after the change.

AdministratorTransferRequested​

Emitted when an administrator transfer is requested.

event AdministratorTransferRequested(
address indexed token,
address indexed currentAdmin,
address indexed newAdmin
);

Parameters

NameTypeDescription
tokenaddressThe token.
currentAdminaddressThe current administrator, or the zero address for a first-time
proposal.
newAdminaddressThe nominated administrator.

AdministratorTransferred​

Emitted when an administrator transfer is accepted.

event AdministratorTransferred(address indexed token, address indexed newAdmin);

Parameters

NameTypeDescription
tokenaddressThe token.
newAdminaddressThe new administrator.

Errors​

OnlyRegistryModuleOrOwner​

Thrown when proposeAdministrator is called by an address that is neither a registry module nor the registry owner.

error OnlyRegistryModuleOrOwner(address sender);

Parameters

NameTypeDescription
senderaddressThe rejected caller.

OnlyAdministrator​

Thrown when an administrator function is called by an address other than the administrator of the token.

error OnlyAdministrator(address sender, address token);

Parameters

NameTypeDescription
senderaddressThe rejected caller.
tokenaddressThe token.

OnlyPendingAdministrator​

Thrown when acceptAdminRole is called by an address other than the pending administrator of the token, including when no transfer is pending.

error OnlyPendingAdministrator(address sender, address token);

Parameters

NameTypeDescription
senderaddressThe rejected caller.
tokenaddressThe token.

AlreadyRegistered​

Thrown when an administrator is proposed for a token that already has one.

error AlreadyRegistered(address token);

Parameters

NameTypeDescription
tokenaddressThe token.

ZeroAddress​

Thrown when the zero address is proposed as administrator.

error ZeroAddress();

InvalidTokenPoolToken​

Thrown when the pool to register does not support the token.

error InvalidTokenPoolToken(address token);

Parameters

NameTypeDescription
tokenaddressThe token.

Structs​

TokenConfig​

The configuration of a token.

struct TokenConfig {
address administrator;
address pendingAdministrator;
address tokenPool;
}

Properties

NameTypeDescription
administratoraddressThe current administrator of the token.
pendingAdministratoraddressThe address nominated to become the administrator, or the
zero address when no transfer is pending.
tokenPooladdressThe pool registered for the token, or the zero address when the token is
not deployed or not configured.