Skip to content

Commit

Permalink
refactor: Make registry ownable (#7853)
Browse files Browse the repository at this point in the history
Fixes #7837
  • Loading branch information
LHerskind authored Aug 9, 2024
1 parent e437dba commit 043e219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions l1-contracts/src/core/messagebridge/Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright 2023 Aztec Labs.
pragma solidity >=0.8.18;

import {Ownable} from "@oz/access/Ownable.sol";

// Interfaces
import {IRegistry} from "../interfaces/messagebridge/IRegistry.sol";
import {IRollup} from "../interfaces/IRollup.sol";
Expand All @@ -19,14 +21,14 @@ import {Errors} from "../libraries/Errors.sol";
* Used as the source of truth for finding the "head" of the rollup chain. Very important information
* for L1<->L2 communication.
*/
contract Registry is IRegistry {
contract Registry is IRegistry, Ownable {
uint256 public override(IRegistry) numberOfVersions;

DataStructures.RegistrySnapshot internal currentSnapshot;
mapping(uint256 version => DataStructures.RegistrySnapshot snapshot) internal snapshots;
mapping(address rollup => uint256 version) internal rollupToVersion;

constructor() {
constructor() Ownable(msg.sender) {
// Inserts a "dead" rollup and message boxes at version 0
// This is simply done to make first version 1, which fits better with the rest of the system
upgrade(address(0xdead), address(0xdead), address(0xdead));
Expand Down

0 comments on commit 043e219

Please sign in to comment.