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

# Registry

The Registry is a contract deployed on L1 that tracks canonical and historical rollup instances. It allows you to query the current rollup contract and look up prior deployments by version.

**Links**: [Interface](https://github.com/AztecProtocol/aztec-packages/blob/v6.0.0/l1-contracts/src/governance/interfaces/IRegistry.sol), [Implementation](https://github.com/AztecProtocol/aztec-packages/blob/v6.0.0/l1-contracts/src/governance/Registry.sol).

## `numberOfVersions()`

Retrieves the number of versions that have been deployed.

```solidity
function numberOfVersions() external view returns (uint256);
```

> [Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L25-L27](https://github.com/AztecProtocol/aztec-packages/blob/v6.0.0/l1-contracts/src/governance/interfaces/IRegistry.sol#L25-L27)

| Name        | Description                                    |
| ----------- | ---------------------------------------------- |
| ReturnValue | The number of versions that have been deployed |

## `getCanonicalRollup()`

Retrieves the current rollup contract.

```solidity
function getCanonicalRollup() external view returns (IHaveVersion);
```

> [Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L17-L19](https://github.com/AztecProtocol/aztec-packages/blob/v6.0.0/l1-contracts/src/governance/interfaces/IRegistry.sol#L17-L19)

| Name        | Description        |
| ----------- | ------------------ |
| ReturnValue | The current rollup |

## `getRollup(uint256 _version)`

Retrieves the rollup contract for a specific version.

```solidity
function getRollup(uint256 _chainId) external view returns (IHaveVersion);
```

> [Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L21-L23](https://github.com/AztecProtocol/aztec-packages/blob/v6.0.0/l1-contracts/src/governance/interfaces/IRegistry.sol#L21-L23)

| Name        | Description                          |
| ----------- | ------------------------------------ |
| `_version`  | The version identifier of the rollup |
| ReturnValue | The rollup for the specified version |

## Other view functions

| Function                 | Returns              | Description                                                                          |
| ------------------------ | -------------------- | ------------------------------------------------------------------------------------ |
| `getVersion(uint256)`    | `uint256`            | Returns the version number stored at the given index in the historical versions list |
| `getGovernance()`        | `address`            | Returns the governance contract address (owner)                                      |
| `getRewardDistributor()` | `IRewardDistributor` | Returns the reward distributor contract                                              |

## Related pages

* [Inbox](/developers/docs/foundational-topics/ethereum-aztec-messaging/inbox.md) - L1 to L2 message passing
* [Outbox](/developers/docs/foundational-topics/ethereum-aztec-messaging/outbox.md) - L2 to L1 message passing
* [L1-L2 Communication (Portals)](/developers/docs/foundational-topics/ethereum-aztec-messaging.md) - Overview of cross-chain messaging
