API Version: v1.5.1

CCIP v1.5.1 TokenAdminRegistry Contract API Reference

TokenAdminRegistry

A contract that manages token pool configurations and administrator access for CCIP-enabled tokens.

Git Source

Inherits:

Functions

acceptAdminRole

Accepts the administrator role for a token.

function acceptAdminRole(address localToken) external;

Parameters

NameTypeDescription
localTokenaddressThe token to accept the administrator role

addRegistryModule

Adds a new registry module to the allowed modules list.

function addRegistryModule(address module) external onlyOwner;

Parameters

NameTypeDescription
moduleaddressThe module to authorize

getAllConfiguredTokens

Returns a paginated list of configured tokens.

function getAllConfiguredTokens(uint64 startIndex, uint64 maxCount) external view returns (address[] memory tokens);

Parameters

NameTypeDescription
startIndexuint64Starting position in the list (0 for beginning)
maxCountuint64Maximum tokens to retrieve (use type(uint64).max for all)

Returns

TypeDescription
address[]List of configured token addresses

getPool

Returns the pool address for a specific token.

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

Parameters

NameTypeDescription
tokenaddressThe token to query

Returns

TypeDescription
addressThe token's pool address

getPools

Returns pool addresses for multiple tokens.

function getPools(address[] calldata tokens) external view returns (address[] memory);

Parameters

NameTypeDescription
tokensaddress[]Tokens to query

Returns

TypeDescription
address[]Array of corresponding pool addresses

getTokenConfig

Returns the complete configuration for a token.

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

Parameters

NameTypeDescription
tokenaddressToken to query

Returns

TypeDescription
TokenConfigComplete token configuration

isAdministrator

Checks if an address is the administrator for a token.

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

Parameters

NameTypeDescription
localTokenaddressToken to check
administratoraddressAddress to verify

Returns

TypeDescription
boolTrue if address is current administrator

isRegistryModule

Checks if an address is an authorized registry module.

function isRegistryModule(address module) public view returns (bool);

Parameters

NameTypeDescription
moduleaddressAddress to verify

Returns

TypeDescription
boolTrue if address is authorized module

proposeAdministrator

Proposes an initial administrator for a token.

function proposeAdministrator(address localToken, address administrator) external;

Parameters

NameTypeDescription
localTokenaddressToken to configure
administratoraddressProposed administrator address

removeRegistryModule

Removes a registry module from the allowed modules list.

function removeRegistryModule(address module) external onlyOwner;

Parameters

NameTypeDescription
moduleaddressThe module to remove

setPool

Sets or updates the pool for a token.

function setPool(address localToken, address pool) external onlyTokenAdmin(localToken);

Parameters

NameTypeDescription
localTokenaddressToken to configure
pooladdressNew pool address (or 0 to delist)

transferAdminRole

Initiates transfer of administrator role.

function transferAdminRole(address localToken, address newAdmin) external onlyTokenAdmin(localToken);

Parameters

NameTypeDescription
localTokenaddressThe token contract whose admin role is being transferred
newAdminaddressThe proposed new administrator address (or 0 to cancel)

Events

AdministratorTransferRequested

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

Parameters

NameTypeIndexedDescription
tokenaddressYesThe token contract whose admin role is being transferred
currentAdminaddressYesThe current administrator address
newAdminaddressYesThe proposed new administrator address

AdministratorTransferred

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

Parameters

NameTypeIndexedDescription
tokenaddressYesThe token contract whose admin role has been transferred
newAdminaddressYesThe new administrator address

PoolSet

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

Parameters

NameTypeIndexedDescription
tokenaddressYesThe token address being configured
previousPooladdressYesThe previous pool address
newPooladdressYesThe new pool address

RegistryModuleAdded

event RegistryModuleAdded(address module);

Parameters

NameTypeIndexedDescription
moduleaddressNoThe address of the newly authorized module

RegistryModuleRemoved

event RegistryModuleRemoved(address indexed module);

Parameters

NameTypeIndexedDescription
moduleaddressYesThe address of the removed module

Errors

AddressZero

error ZeroAddress();

AlreadyRegistered

error AlreadyRegistered(address token);

Parameters

NameTypeDescription
tokenaddressThe token address that already has an administrator

InvalidTokenPoolToken

error InvalidTokenPoolToken(address token);

Parameters

NameTypeDescription
tokenaddressThe token address that is not supported by the pool

OnlyAdministrator

error OnlyAdministrator(address sender, address token);

Parameters

NameTypeDescription
senderaddressThe unauthorized caller's address
tokenaddressThe token address being accessed

OnlyPendingAdministrator

error OnlyPendingAdministrator(address sender, address token);

Parameters

NameTypeDescription
senderaddressThe unauthorized caller's address
tokenaddressThe token address being accessed

OnlyRegistryModuleOrOwner

error OnlyRegistryModuleOrOwner(address sender);

Parameters

NameTypeDescription
senderaddressThe unauthorized caller's address

Structs

TokenConfig

Configuration data structure for each token.

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

State Variables

s_registryModules

EnumerableSet.AddressSet internal s_registryModules;

s_tokenConfig

mapping(address token => TokenConfig) internal s_tokenConfig;

s_tokens

EnumerableSet.AddressSet internal s_tokens;

typeAndVersion

string public constant override typeAndVersion = "TokenAdminRegistry 1.5.0";

Get the latest Chainlink content straight to your inbox.