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/core/interfaces/messagebridge/IRegistry.sol#L31-L33
NameDescription
ReturnValueThe number of versions that have been deployed

getRollup()

Retrieves the current rollup contract.

registry_get_rollup
function getRollup() external view returns (IRollup);
Source code: l1-contracts/src/core/interfaces/messagebridge/IRegistry.sol#L12-L14
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/core/interfaces/messagebridge/IRegistry.sol#L16-L18
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/core/libraries/DataStructures.sol#L66-L76
registry_get_snapshot
function getSnapshot(uint256 _version)
external
view
returns (DataStructures.RegistrySnapshot memory);
Source code: l1-contracts/src/core/interfaces/messagebridge/IRegistry.sol#L20-L25
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/core/interfaces/messagebridge/IRegistry.sol#L27-L29
NameDescription
ReturnValue.rollupThe address of the rollup for the current _version
ReturnValue.blockNumberThe block number of the snapshot creation