CCIP v1.5.1 TokenAdminRegistry Contract API Reference
TokenAdminRegistry
A contract that manages token pool configurations and administrator access for CCIP-enabled tokens.
Inherits:
Functions
acceptAdminRole
Accepts the administrator role for a token.
function acceptAdminRole(address localToken) external;
Parameters
Name | Type | Description |
---|---|---|
localToken | address | The token to accept the administrator role |
addRegistryModule
Adds a new registry module to the allowed modules list.
function addRegistryModule(address module) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
module | address | The module to authorize |
getAllConfiguredTokens
Returns a paginated list of configured tokens.
function getAllConfiguredTokens(uint64 startIndex, uint64 maxCount) external view returns (address[] memory tokens);
Parameters
Name | Type | Description |
---|---|---|
startIndex | uint64 | Starting position in the list (0 for beginning) |
maxCount | uint64 | Maximum tokens to retrieve (use type(uint64).max for all) |
Returns
Type | Description |
---|---|
address[] | List of configured token addresses |
getPool
Returns the pool address for a specific token.
function getPool(address token) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
token | address | The token to query |
Returns
Type | Description |
---|---|
address | The token's pool address |
getPools
Returns pool addresses for multiple tokens.
function getPools(address[] calldata tokens) external view returns (address[] memory);
Parameters
Name | Type | Description |
---|---|---|
tokens | address[] | Tokens to query |
Returns
Type | Description |
---|---|
address[] | Array of corresponding pool addresses |
getTokenConfig
Returns the complete configuration for a token.
function getTokenConfig(address token) external view returns (TokenConfig memory);
Parameters
Name | Type | Description |
---|---|---|
token | address | Token to query |
Returns
Type | Description |
---|---|
TokenConfig | Complete token configuration |
isAdministrator
Checks if an address is the administrator for a token.
function isAdministrator(address localToken, address administrator) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
localToken | address | Token to check |
administrator | address | Address to verify |
Returns
Type | Description |
---|---|
bool | True if address is current administrator |
isRegistryModule
Checks if an address is an authorized registry module.
function isRegistryModule(address module) public view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
module | address | Address to verify |
Returns
Type | Description |
---|---|
bool | True if address is authorized module |
proposeAdministrator
Proposes an initial administrator for a token.
function proposeAdministrator(address localToken, address administrator) external;
Parameters
Name | Type | Description |
---|---|---|
localToken | address | Token to configure |
administrator | address | Proposed administrator address |
removeRegistryModule
Removes a registry module from the allowed modules list.
function removeRegistryModule(address module) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
module | address | The module to remove |
setPool
Sets or updates the pool for a token.
function setPool(address localToken, address pool) external onlyTokenAdmin(localToken);
Parameters
Name | Type | Description |
---|---|---|
localToken | address | Token to configure |
pool | address | New pool address (or 0 to delist) |
transferAdminRole
Initiates transfer of administrator role.
function transferAdminRole(address localToken, address newAdmin) external onlyTokenAdmin(localToken);
Parameters
Name | Type | Description |
---|---|---|
localToken | address | The token contract whose admin role is being transferred |
newAdmin | address | The proposed new administrator address (or 0 to cancel) |
Events
AdministratorTransferRequested
event AdministratorTransferRequested(address indexed token, address indexed currentAdmin, address indexed newAdmin);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
token | address | Yes | The token contract whose admin role is being transferred |
currentAdmin | address | Yes | The current administrator address |
newAdmin | address | Yes | The proposed new administrator address |
AdministratorTransferred
event AdministratorTransferred(address indexed token, address indexed newAdmin);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
token | address | Yes | The token contract whose admin role has been transferred |
newAdmin | address | Yes | The new administrator address |
PoolSet
event PoolSet(address indexed token, address indexed previousPool, address indexed newPool);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
token | address | Yes | The token address being configured |
previousPool | address | Yes | The previous pool address |
newPool | address | Yes | The new pool address |
RegistryModuleAdded
event RegistryModuleAdded(address module);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
module | address | No | The address of the newly authorized module |
RegistryModuleRemoved
event RegistryModuleRemoved(address indexed module);
Parameters
Name | Type | Indexed | Description |
---|---|---|---|
module | address | Yes | The address of the removed module |
Errors
AddressZero
error ZeroAddress();
AlreadyRegistered
error AlreadyRegistered(address token);
Parameters
Name | Type | Description |
---|---|---|
token | address | The token address that already has an administrator |
InvalidTokenPoolToken
error InvalidTokenPoolToken(address token);
Parameters
Name | Type | Description |
---|---|---|
token | address | The token address that is not supported by the pool |
OnlyAdministrator
error OnlyAdministrator(address sender, address token);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The unauthorized caller's address |
token | address | The token address being accessed |
OnlyPendingAdministrator
error OnlyPendingAdministrator(address sender, address token);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The unauthorized caller's address |
token | address | The token address being accessed |
OnlyRegistryModuleOrOwner
error OnlyRegistryModuleOrOwner(address sender);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The 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";