CCIP v1.5.1 TokenAdminRegistry Contract API Reference

The TokenAdminRegistry contract manages which tokens can be transferred through CCIP and who can configure them. Key features:

  • Token developers can register their tokens without needing permission from CCIP
  • Each token has an administrator who controls its CCIP settings
  • Administrators can enable or disable their tokens for CCIP transfers
  • The contract is not upgradeable to ensure data persistence

Errors

OnlyRegistryModuleOrOwner

error OnlyRegistryModuleOrOwner(address sender)

Thrown when someone tries to perform an action restricted to registry modules or the owner.

ParameterTypeDescription
senderaddressAddress that attempted the restricted action

OnlyAdministrator

error OnlyAdministrator(address sender, address token)

Thrown when someone tries to perform an action restricted to the token's administrator.

ParameterTypeDescription
senderaddressAddress that attempted the restricted action
tokenaddressToken address that was being configured

OnlyPendingAdministrator

error OnlyPendingAdministrator(address sender, address token)

Thrown when someone other than the pending administrator tries to accept the administrator role.

ParameterTypeDescription
senderaddressAddress that attempted to accept the role
tokenaddressToken address involved

AlreadyRegistered

error AlreadyRegistered(address token)

Thrown when trying to register a token that already has an administrator.

ParameterTypeDescription
tokenaddressToken address that was already registered

ZeroAddress

error ZeroAddress()

Thrown when trying to set a critical address to zero (except for specific allowed cases).

InvalidTokenPoolToken

error InvalidTokenPoolToken(address token)

Thrown when trying to set a pool that doesn't support the specified token.

ParameterTypeDescription
tokenaddressToken address that the pool doesn't support

Events

PoolSet

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

Emitted when a token's pool address is changed. This indicates a change in how the token is handled in CCIP.

ParameterTypeDescription
tokenaddressToken address whose pool was changed
previousPooladdressOld pool address (can be address(0))
newPooladdressNew pool address (can be address(0) to disable CCIP for the token)

AdministratorTransferRequested

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

Emitted when the first step of an administrator transfer is initiated.

ParameterTypeDescription
tokenaddressToken address whose administrator is being changed
currentAdminaddressCurrent administrator address (can be address(0) for new registrations)
newAdminaddressProposed new administrator address

AdministratorTransferred

event AdministratorTransferred(
    address indexed token,
    address indexed newAdmin
)

Emitted when an administrator transfer is completed (after the new administrator accepts the role).

ParameterTypeDescription
tokenaddressToken address whose administrator changed
newAdminaddressAddress of the new administrator

RegistryModuleAdded

event RegistryModuleAdded(address module)

Emitted when a new registry module is added to the system.

ParameterTypeDescription
moduleaddressAddress of the newly added registry module

RegistryModuleRemoved

event RegistryModuleRemoved(address indexed module)

Emitted when a registry module is removed from the system.

ParameterTypeDescription
moduleaddressAddress of the removed registry module

Data Structures

TokenConfig

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

Configuration data for each token:

FieldTypeDescription
administratoraddressCurrent administrator who can manage the token's CCIP settings
pendingAdministratoraddressAddress nominated to become the new administrator (part of 2-step transfer)
tokenPooladdressPool contract that handles the token's cross-chain transfers. If set to address(0), the token is disabled for CCIP

Core Query Functions

getPools

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

Gets the pool addresses for multiple tokens at once.

Parameters

NameTypeDescription
tokensaddress[]Array of token addresses to query

Return Value

TypeDescription
address[]Array of pool addresses. Will be address(0) for tokens without pools

getPool

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

Gets the pool address for a single token.

Parameters

NameTypeDescription
tokenaddressToken address to query

Return Value

TypeDescription
addressPool address for the token, or address(0) if not configured

getTokenConfig

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

Gets the complete configuration for a token.

Parameters

NameTypeDescription
tokenaddressToken address to query

Return Value

TypeDescription
TokenConfigComplete token configuration including administrator, pending administrator, and pool

getAllConfiguredTokens

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

Gets a list of all configured tokens, with pagination support to handle large lists.

Parameters

NameTypeDescription
startIndexuint64Position to start reading from (0 for beginning)
maxCountuint64Maximum number of tokens to return. Use type(uint64).max for all remaining tokens

Return Value

TypeDescription
address[]Array of token addresses

Administrator Management Functions

setPool

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

Sets or changes the pool for a token. Only callable by the token's administrator.

Parameters

NameTypeDescription
localTokenaddressToken to configure
pooladdressNew pool address, or address(0) to disable

transferAdminRole

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

Initiates the transfer of administrator rights to a new address.

Parameters

NameTypeDescription
localTokenaddressToken whose administrator is being changed
newAdminaddressProposed new administrator (or address(0) to cancel pending transfer)

acceptAdminRole

function acceptAdminRole(
    address localToken
) external

Completes the transfer of administrator rights. Must be called by the pending administrator.

Parameters

NameTypeDescription
localTokenaddressToken to accept administrator role for

isAdministrator

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

Checks if an address is the administrator for a token.

Parameters

NameTypeDescription
localTokenaddressToken to check
administratoraddressAddress to verify

Return Value

TypeDescription
boolTrue if the address is the token's administrator

proposeAdministrator

function proposeAdministrator(
    address localToken,
    address administrator
) external

Proposes an initial administrator for a token. Can only be called by registry modules or owner.

Parameters

NameTypeDescription
localTokenaddressToken to set administrator for
administratoraddressProposed administrator address

Registry Module Management

isRegistryModule

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

Checks if an address is an authorized registry module.

Parameters

NameTypeDescription
moduleaddressAddress to check

Return Value

TypeDescription
boolTrue if the address is an authorized registry module

addRegistryModule

function addRegistryModule(
    address module
) external onlyOwner

Adds a new registry module. Only callable by owner.

Parameters

NameTypeDescription
moduleaddressAddress of module to add

removeRegistryModule

function removeRegistryModule(
    address module
) external onlyOwner

Removes a registry module. Only callable by owner.

Parameters

NameTypeDescription
moduleaddressAddress of module to remove

typeAndVersion

string public constant override typeAndVersion = "TokenAdminRegistry 1.5.0"

Returns the type and version of the contract.

Return Value

TypeDescription
stringThe string "TokenAdminRegistry 1.5.0"

Get the latest Chainlink content straight to your inbox.