Skip to main content

Registry

The registry is a contract deployed on L1, that contains addresses for the Rollup. It also keeps track of the different versions that have been deployed and let you query prior deployments easily.

Links: Interface (GitHub link), Implementation (GitHub link).

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#L32-L34
NameDescription
ReturnValueThe number of versions that have been deployed

getRollup()

Retrieves the current rollup contract.

registry_get_rollup
function getRollup() external view returns (address);
Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L13-L15
NameDescription
ReturnValueThe current rollup

getVersionFor(address _rollup)

Retrieve the version of a specific rollup contract.

registry_get_version_for
function getVersionFor(address _rollup) external view returns (uint256);
Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L17-L19
NameDescription
_rollupThe address of the rollup to lookup
ReturnValueThe version number of _rollup

Edge cases

Will revert with Registry__RollupNotRegistered(_rollup) if the rollup have not been registered.

getSnapshot(uint256 _version)

Retrieve the snapshot of a specific version.

registry_snapshot
/**
* @notice Struct for storing address of cross communication components and the block number when it was updated
* @param rollup - The address of the rollup contract
* @param blockNumber - The block number of the snapshot
*/
struct RegistrySnapshot {
address rollup;
uint256 blockNumber;
}
Source code: l1-contracts/src/governance/libraries/DataStructures.sol#L14-L24
registry_get_snapshot
function getSnapshot(uint256 _version)
external
view
returns (DataStructures.RegistrySnapshot memory);
Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L21-L26
NameDescription
_versionThe version number to fetch data for
ReturnValue.rollupThe address of the rollup for the _version
ReturnValue.blockNumberThe block number of the snapshot creation

getCurrentSnapshot()

Retrieves the snapshot for the current version.

registry_get_current_snapshot
function getCurrentSnapshot() external view returns (DataStructures.RegistrySnapshot memory);
Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L28-L30
NameDescription
ReturnValue.rollupThe address of the rollup for the current _version
ReturnValue.blockNumberThe block number of the snapshot creation