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, Implementation.
numberOfVersions()
Retrieves the number of versions that have been deployed.
registry_number_of_versions
function numberOfVersions() external view returns (uint256);
Source code: 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.
registry_get_canonical_rollup
function getCanonicalRollup() external view returns (IHaveVersion);
Source code: 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.
registry_get_rollup
function getRollup(uint256 _chainId) external view returns (IHaveVersion);
Source code: 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 - L1 to L2 message passing
- Outbox - L2 to L1 message passing
- L1-L2 Communication (Portals) - Overview of cross-chain messaging