IZeroGovernor

Git Source

Inherits: IThresholdGovernor

Author: M^0 Labs

Functions

resetToPowerHolders

One of the valid proposals. Reset the Standard Governor, Emergency Governor, and Power Token to the Power Token holders. This would be used by Zero Token holders in the event that inflation is soon to result in Power Token overflowing, and/or there is a loss of faith in the state of either the Standard Governor or Emergency Governor.

function resetToPowerHolders() external;

resetToZeroHolders

One of the valid proposals. Reset the Standard Governor, Emergency Governor, and Power Token to the ZeroToken holders. This would be used by Zero Token holders if they no longer have faith in the current set of PowerToken holders and/or the state of either the Standard Governor or Emergency Governor.

function resetToZeroHolders() external;

setCashToken

One of the valid proposals. Sets the Cash Token of the system.

function setCashToken(address newCashToken, uint256 newProposalFee) external;

Parameters

NameTypeDescription

newCashToken

address

The address of the new cash token.

newProposalFee

uint256

The amount of cash token required onwards to create Standard Governor proposals.

setEmergencyProposalThresholdRatio

One of the valid proposals. Sets the threshold ratio for Emergency Governor proposals.

function setEmergencyProposalThresholdRatio(uint16 newThresholdRatio) external;

Parameters

NameTypeDescription

newThresholdRatio

uint16

The new threshold ratio.

setZeroProposalThresholdRatio

One of the valid proposals. Sets the threshold ratio for this governor's proposals.

function setZeroProposalThresholdRatio(uint16 newThresholdRatio) external;

Parameters

NameTypeDescription

newThresholdRatio

uint16

The new threshold ratio.

isAllowedCashToken

Returns whether token is an allowed Cash Token of the system, as a parameter in setCashToken proposal.

function isAllowedCashToken(address token) external view returns (bool);

Parameters

NameTypeDescription

token

address

The address of some token.

Returns

NameTypeDescription

<none>

bool

Whether token is an allowed Cash Token.

emergencyGovernor

Returns the address of the Emergency Governor.

function emergencyGovernor() external view returns (address);

emergencyGovernorDeployer

Returns the address of the Emergency Governor Deployer.

function emergencyGovernorDeployer() external view returns (address);

powerTokenDeployer

Returns the address of the Power Token Deployer.

function powerTokenDeployer() external view returns (address);

standardGovernor

Returns the address of the Standard Governor.

function standardGovernor() external view returns (address);

standardGovernorDeployer

Returns the address of the Standard Governor Deployer.

function standardGovernorDeployer() external view returns (address);

Events

AllowedCashTokensSet

Emitted upon contract deployment, once the set of allowed cash tokens is finalized.

event AllowedCashTokensSet(address[] allowedCashTokens);

Parameters

NameTypeDescription

allowedCashTokens

address[]

An array of addressed that are allowed as cash tokens.

ResetExecuted

Emitted upon a Reset, resulting in a new Standard Governor, Emergency Governor, and Power Token.

event ResetExecuted(
    address indexed bootstrapToken, address standardGovernor, address emergencyGovernor, address powerToken
);

Parameters

NameTypeDescription

bootstrapToken

address

The address of token (Zero Token or old Power Token), that bootstraps the reset.

standardGovernor

address

The address of the new Standard Governor.

emergencyGovernor

address

The address of the new Emergency Governor.

powerToken

address

The address of the new Power Token.

Errors

InvalidCashToken

Revert message when the Cash Token specified is not in the allowed set.

error InvalidCashToken();

InvalidCashTokenAddress

Revert message when the Cash Token specified in the constructor is address(0).

error InvalidCashTokenAddress();

InvalidEmergencyGovernorDeployerAddress

Revert message when the Emergency Governor Deployer specified in the constructor is address(0).

error InvalidEmergencyGovernorDeployerAddress();

InvalidPowerTokenDeployerAddress

Revert message when the Power Token Deployer specified in the constructor is address(0).

error InvalidPowerTokenDeployerAddress();

InvalidStandardGovernorDeployerAddress

Revert message when the Standard Governor Deployer specified in the constructor is address(0).

error InvalidStandardGovernorDeployerAddress();

NoAllowedCashTokens

Revert message when the set of allowed cash tokens specified in the constructor is empty.

error NoAllowedCashTokens();

UnexpectedPowerTokenDeployed

Revert message when the address of the deployed Power Token differs fro what was expected.

error UnexpectedPowerTokenDeployed(address expected, address deployed);

Parameters

NameTypeDescription

expected

address

The expected address of the deployed Power Token.

deployed

address

The actual address of the deployed Power Token.

UnexpectedStandardGovernorDeployed

Revert message when the address of the deployed Standard Governor differs fro what was expected.

error UnexpectedStandardGovernorDeployed(address expected, address deployed);

Parameters

NameTypeDescription

expected

address

The expected address of the deployed Standard Governor.

deployed

address

The actual address of the deployed Standard Governor.

Copyright 2024 M^0 Foundation