Registrar

Git Source

Inherits: IRegistrar

Author: M^0 Labs

State Variables

emergencyGovernorDeployer

Returns the address of the Emergency Governor Deployer.

address public immutable emergencyGovernorDeployer;

powerTokenDeployer

Returns the address of the Power Token Deployer.

address public immutable powerTokenDeployer;

standardGovernorDeployer

Returns the address of the Standard Governor Deployer.

address public immutable standardGovernorDeployer;

vault

Returns the address of the Vault.

address public immutable vault;

zeroGovernor

Returns the address of the Zero Governor.

address public immutable zeroGovernor;

zeroToken

Returns the address of the Zero Token.

address public immutable zeroToken;

_valueAt

A mapping of keys to values.

mapping(bytes32 key => bytes32 value) internal _valueAt;

Functions

onlyStandardOrEmergencyGovernor

Revert if the caller is not the Standard Governor nor the Emergency Governor.

modifier onlyStandardOrEmergencyGovernor();

constructor

Constructs a new Registrar contract.

constructor(address zeroGovernor_);

Parameters

Name
Type
Description

zeroGovernor_

address

The address of the ZeroGovernor contract.

addToList

Adds account to list.

function addToList(bytes32 list_, address account_) external onlyStandardOrEmergencyGovernor;

Parameters

Name
Type
Description

list_

bytes32

account_

address

removeFromList

Removes account from list.

function removeFromList(bytes32 list_, address account_) external onlyStandardOrEmergencyGovernor;

Parameters

Name
Type
Description

list_

bytes32

account_

address

setKey

Sets key to value.

function setKey(bytes32 key_, bytes32 value_) external onlyStandardOrEmergencyGovernor;

Parameters

Name
Type
Description

key_

bytes32

value_

bytes32

clock

Returns the current timepoint according to the mode the contract is operating on.

function clock() external view returns (uint48);

get

Returns the value of key.

function get(bytes32 key_) external view returns (bytes32);

Parameters

Name
Type
Description

key_

bytes32

Returns

Name
Type
Description

<none>

bytes32

Some value.

get

Returns the value of key.

function get(bytes32[] calldata keys_) external view returns (bytes32[] memory values_);

Parameters

Name
Type
Description

keys_

bytes32[]

Returns

Name
Type
Description

values_

bytes32[]

Some value.

listContains

Returns whether list contains account.

function listContains(bytes32 list_, address account_) external view returns (bool);

Parameters

Name
Type
Description

list_

bytes32

account_

address

Returns

Name
Type
Description

<none>

bool

Whether list contains account.

listContains

Returns whether list contains account.

function listContains(bytes32 list_, address[] calldata accounts_) external view returns (bool);

Parameters

Name
Type
Description

list_

bytes32

accounts_

address[]

Returns

Name
Type
Description

<none>

bool

Whether list contains account.

powerToken

Returns the address of the Power Token.

function powerToken() external view returns (address);

CLOCK_MODE

Returns a machine-readable string description of the clock the contract is operating on.

function CLOCK_MODE() external pure returns (string memory);

clockStartingTimestamp

Returns the starting timestamp of Epoch 1.

function clockStartingTimestamp() external pure returns (uint256);

clockPeriod

Returns the period/duration, in seconds, of an epoch.

function clockPeriod() external pure returns (uint256);

emergencyGovernor

Returns the address of the Emergency Governor.

function emergencyGovernor() public view returns (address);

standardGovernor

Returns the address of the Standard Governor.

function standardGovernor() public view returns (address);

_revertIfNotStandardOrEmergencyGovernor

Reverts if the caller is not the Standard Governor nor the Emergency Governor.

function _revertIfNotStandardOrEmergencyGovernor() internal view;

_getValueKey

Returns the key used to store the value of key_.

function _getValueKey(bytes32 key_) internal pure returns (bytes32);

Parameters

Name
Type
Description

key_

bytes32

The key of the value.

Returns

Name
Type
Description

<none>

bytes32

The key used to store the value of key_.

_getIsInListKey

Returns the key used to store whether account_ is in list_.

function _getIsInListKey(bytes32 list_, address account_) internal pure returns (bytes32);

Parameters

Name
Type
Description

list_

bytes32

The list of addresses.

account_

address

The address of the account.

Returns

Name
Type
Description

<none>

bytes32

The key used to store whether account_ is in list_.

Copyright 2024 M^0 Foundation