CCIP v1.5.1 RegistryModuleOwnerCustom Contract API Reference
The RegistryModuleOwnerCustom
contract provides different methods for token developers to register themselves as administrators for their tokens in CCIP.
Errors
CanOnlySelfRegister
error CanOnlySelfRegister(address admin, address token)
Thrown when someone tries to register an admin address that does not belong to them.
Parameter | Type | Description |
---|---|---|
admin | address | Expected admin address |
token | address | Token being registered |
RequiredRoleNotFound
error RequiredRoleNotFound(address msgSender, bytes32 role, address token)
Thrown when caller doesn't have the required role for registration.
Parameter | Type | Description |
---|---|---|
msgSender | address | Address that attempted registration |
role | bytes32 | Required role that was missing |
token | address | Token being registered |
AddressZero
error AddressZero()
Thrown when trying to set the TokenAdminRegistry address to zero.
Events
AdministratorRegistered
event AdministratorRegistered(address indexed token, address indexed administrator)
Emitted when an administrator is successfully registered for a token.
Parameter | Type | Description |
---|---|---|
token | address | Token address that got an administrator |
administrator | address | Address registered as administrator |
Functions
constructor
constructor(
address tokenAdminRegistry
)
Initializes the contract with the TokenAdminRegistry address.
Parameters
Name | Type | Description |
---|---|---|
tokenAdminRegistry | address | Address of the TokenAdminRegistry contract |
registerAdminViaGetCCIPAdmin
function registerAdminViaGetCCIPAdmin(
address token
) external
Registers an administrator using the token's getCCIPAdmin()
method.
Parameters
Name | Type | Description |
---|---|---|
token | address | Token address to register administrator for |
registerAdminViaOwner
function registerAdminViaOwner(
address token
) external
Registers an administrator using the token's owner()
method.
Parameters
Name | Type | Description |
---|---|---|
token | address | Token address to register administrator for |
registerAccessControlDefaultAdmin
function registerAccessControlDefaultAdmin(
address token
) external
Registers an administrator using OpenZeppelin's AccessControl DEFAULT_ADMIN_ROLE.
Parameters
Name | Type | Description |
---|---|---|
token | address | Token address to register administrator for |
typeAndVersion
string public constant override typeAndVersion = "RegistryModuleOwnerCustom 1.6.0"
Returns the type and version of the contract.
Return Value
Type | Description |
---|---|
string | The string "RegistryModuleOwnerCustom 1.6.0" |