# CCIP v1.5.0 RegistryModuleOwnerCustom Contract API Reference
Source: https://docs.chain.link/ccip/api-reference/evm/v1.5.0/registry-module-owner-custom

> For the complete documentation index, see [llms.txt](/llms.txt).

<Aside type="note" title="Integrate Chainlink CCIP v1.5.0 into your project">
  <Tabs sharedStore="ccip-v1-5-0-package" client:visible>
    <Fragment slot="tab.1">npm</Fragment>
    <Fragment slot="tab.2">yarn</Fragment>
    <Fragment slot="tab.3">foundry</Fragment>

    <Fragment slot="panel.1">
      If you use [NPM](https://www.npmjs.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      npm install @chainlink/contracts-ccip@1.5.0
      ```
    </Fragment>

    <Fragment slot="panel.2">
      If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      yarn add @chainlink/contracts-ccip@1.5.0
      ```
    </Fragment>

    <Fragment slot="panel.3">
      If you use [Foundry](https://book.getfoundry.sh/), install the package:

      ```shell
      forge install smartcontractkit/ccip@5c711214167b7e6f05cf6de74bdab9f6e26763b2
      ```
    </Fragment>
  </Tabs>
</Aside>

The [`RegistryModuleOwnerCustom`](https://github.com/smartcontractkit/ccip/tree/release/contracts-ccip-1.5.0/contracts/src/v0.8/ccip/tokenAdminRegistry/RegistryModuleOwnerCustom.sol) contract is responsible for registering the administrator of a token in the [`TokenAdminRegistry`](/ccip/api-reference/evm/v1.5.0/token-admin-registry). This contract allows for the registration of token administrators through either the `getCCIPAdmin()` method (for tokens with a CCIP admin) or the `owner()` method (for standard tokens with an owner). The contract enforces that only the rightful administrator of the token can register themselves, ensuring secure and accurate registration within the `TokenAdminRegistry`. The contract also emits an event, `AdministratorRegistered`, whenever a token administrator is successfully registered.

## Errors

### CanOnlySelfRegister

```solidity
error CanOnlySelfRegister(address admin, address token)
```

### AddressZero

```solidity
error AddressZero()
```

## Events

### AdministratorRegistered

```solidity
event AdministratorRegistered(address token, address administrator)
```

## Constants

### typeAndVersion

```solidity
string typeAndVersion
```

## Variables

### i\_tokenAdminRegistry

```solidity
ITokenAdminRegistry i_tokenAdminRegistry
```

## Functions

### constructor

```solidity
constructor(address tokenAdminRegistry) public
```

### registerAdminViaGetCCIPAdmin

```solidity
function registerAdminViaGetCCIPAdmin(address token) external
```

Registers the admin of the token using the `getCCIPAdmin` method.

*The caller must be the admin returned by the `getCCIPAdmin` method.*

#### Parameters

| Name  | Type    | Description                          |
| ----- | ------- | ------------------------------------ |
| token | address | The token to register the admin for. |

### registerAdminViaOwner

```solidity
function registerAdminViaOwner(address token) external
```

Registers the admin of the token using the `owner` method.

*The caller must be the admin returned by the `owner` method.*

#### Parameters

| Name  | Type    | Description                          |
| ----- | ------- | ------------------------------------ |
| token | address | The token to register the admin for. |

### \_registerAdmin

```solidity
function _registerAdmin(address token, address admin) internal
```

Registers the admin of the token to msg.sender given that the admin is equal to msg.sender.

#### Parameters

| Name  | Type    | Description                          |
| ----- | ------- | ------------------------------------ |
| token | address | The token to register the admin for. |
| admin | address | The caller must be the admin.        |