Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Fix registry interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewis committed Oct 10, 2023
1 parent b80e5e7 commit 8f8fda4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions KIPs/kip-149.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,7 @@ The registry should have data for the pre-deployed system contracts as soon as i
```solidity
pragma solidity ^0.8.0;
abstract contract Registry {
/* ========== TYPES ========== */
/// @dev Struct of system contracts
struct Record {
address addr;
uint256 activation;
}
abstract contract RegistryInterface {
/* ========== VARIABLES ========== */
/// The following variables are baked in the interface because their storage layout matters in protocol consensus
/// when inject initial states (pre-deployed system contracts, owner) of the Registry.
Expand All @@ -80,7 +73,14 @@ abstract contract Registry {
string[] public names;
/// @dev Owner of contract
address private _owner;
address internal _owner;
/* ========== TYPES ========== */
/// @dev Struct of system contracts
struct Record {
address addr;
uint256 activation;
}
/* ========== EVENTS ========== */
/// @dev Emitted when the contract owner is updated by `transferOwnership`.
Expand All @@ -91,24 +91,24 @@ abstract contract Registry {
/* ========== MUTATORS ========== */
/// @dev Registers a new system contract.
function register(string memory name, address addr, uint256 activation) external;
function register(string memory name, address addr, uint256 activation) external virtual;
/// @dev Transfers ownership to newOwner.
function transferOwnership(address newOwner) external;
function transferOwnership(address newOwner) external virtual;
/* ========== GETTERS ========== */
/// @dev Returns an address for active system contracts registered as name if exists.
/// It returns a zero address when there's no active system contract with name.
function getActiveAddr(string memory name) external returns (address);
function getActiveAddr(string memory name) external virtual returns (address);
/// @dev Returns all system contracts registered as name.
function getAllRecords(string memory name) external view returns (Record[] memory);
function getAllRecords(string memory name) external virtual view returns (Record[] memory);
/// @dev Returns all names of registered system contracts.
function getAllNames() external view returns (string[] memory);
function getAllNames() external virtual view returns (string[] memory);
/// @dev Returns owner of contract.
function owner() external view returns (address);
function owner() external virtual view returns (address);
}
```

Expand Down

0 comments on commit 8f8fda4

Please sign in to comment.