EmergencyGovernor

Git Source

Inherits: IEmergencyGovernor, ThresholdGovernor

Author: M^0 Labs

State Variables

registrar

Returns the address of the Registrar.

address public immutable registrar;

standardGovernor

Returns the address of the Standard Governor.

address public immutable standardGovernor;

zeroGovernor

Returns the address of the Zero Governor.

address public immutable zeroGovernor;

Functions

onlyZeroGovernor

Throws if called by any account other than the Zero Governor.

modifier onlyZeroGovernor();

constructor

Constructs a new Emergency Governor contract.

constructor(
    address voteToken_,
    address zeroGovernor_,
    address registrar_,
    address standardGovernor_,
    uint16 thresholdRatio_
) ThresholdGovernor("EmergencyGovernor", voteToken_, thresholdRatio_);

Parameters

NameTypeDescription

voteToken_

address

The address of the Vote Token contract.

zeroGovernor_

address

The address of the Zero Governor contract.

registrar_

address

The address of the Registrar contract.

standardGovernor_

address

The address of the StandardGovernor contract.

thresholdRatio_

uint16

The initial threshold ratio.

setThresholdRatio

Sets the threshold ratio to use going forward for newly created proposals.

function setThresholdRatio(uint16 newThresholdRatio_) external onlyZeroGovernor;

Parameters

NameTypeDescription

newThresholdRatio_

uint16

addToList

One of the valid proposals. Adds account to list at the Registrar.

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

Parameters

NameTypeDescription

list_

bytes32

account_

address

removeFromList

One of the valid proposals. Removes account to list at the Registrar.

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

Parameters

NameTypeDescription

list_

bytes32

account_

address

removeFromAndAddToList

One of the valid proposals. Removes accountToRemove and adds accountToAdd to list at the Registrar.

function removeFromAndAddToList(bytes32 list_, address accountToRemove_, address accountToAdd_) external onlySelf;

Parameters

NameTypeDescription

list_

bytes32

accountToRemove_

address

accountToAdd_

address

setKey

One of the valid proposals. Sets key to value at the Registrar.

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

Parameters

NameTypeDescription

key_

bytes32

value_

bytes32

setStandardProposalFee

One of the valid proposals. Sets the proposal fee of the Standard Governor.

function setStandardProposalFee(uint256 newProposalFee_) external onlySelf;

Parameters

NameTypeDescription

newProposalFee_

uint256

_addToList

Adds account_ to list_ at the Registrar.

function _addToList(bytes32 list_, address account_) internal;

Parameters

NameTypeDescription

list_

bytes32

The key for some list.

account_

address

The address of some account to be added.

_removeFromList

Removes account_ from list_ at the Registrar.

function _removeFromList(bytes32 list_, address account_) internal;

Parameters

NameTypeDescription

list_

bytes32

The key for some list.

account_

address

The address of some account to be removed.

_revertIfInvalidCalldata

All proposals target this contract itself, and must call one of the listed functions to be valid.

function _revertIfInvalidCalldata(bytes memory callData_) internal pure override;

Parameters

NameTypeDescription

callData_

bytes

The call data to check.

Copyright 2024 M^0 Foundation