IStandardGovernor

Git Source

Inherits: IBatchGovernor

Author: M^0 Labs

Functions

sendProposalFeeToVault

Sends the proposal fee for proposal proposalId to the vault, if it is Defeated or Expired.

function sendProposalFeeToVault(uint256 proposalId) external;

Parameters

setCashToken

Set the cash token and proposal fee to be used to create proposals going forward.

function setCashToken(address newCashToken, uint256 newProposalFee) external;

Parameters

addToList

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

function addToList(bytes32 list, address account) external;

Parameters

removeFromList

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

function removeFromList(bytes32 list, address account) external;

Parameters

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;

Parameters

setKey

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

function setKey(bytes32 key, bytes32 value) external;

Parameters

setProposalFee

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

function setProposalFee(uint256 newProposalFee) external;

Parameters

proposalFee

Returns the required amount of cashToken it costs an account to create a proposal.

function proposalFee() external view returns (uint256);

getProposal

Returns all the proposal details for a proposal with identifier proposalId.

function getProposal(uint256 proposalId)
    external
    view
    returns (
        uint48 voteStart,
        uint48 voteEnd,
        ProposalState state,
        uint256 noVotes,
        uint256 yesVotes,
        address proposer,
        uint256 quorum
    );

Parameters

Returns

getProposalFee

Returns the proposal fee information.

function getProposalFee(uint256 proposalId) external view returns (address cashToken, uint256 amount);

Parameters

Returns

maxTotalZeroRewardPerActiveEpoch

Returns the maximum amount of Zero Token that can be rewarded to all vote casters per active epoch.

function maxTotalZeroRewardPerActiveEpoch() external view returns (uint256);

numberOfProposalsAt

Returns the number of proposals at epoch epoch.

function numberOfProposalsAt(uint256 epoch) external view returns (uint256);

Parameters

Returns

numberOfProposalsVotedOnAt

Returns the number of proposals that were voted on at epoch.

function numberOfProposalsVotedOnAt(address voter, uint256 epoch) external view returns (uint256);

Parameters

Returns

hasVotedOnAllProposals

Returns whether voter has voted on all proposals in epoch.

function hasVotedOnAllProposals(address voter, uint256 epoch) external view returns (bool);

Parameters

Returns

cashToken

Returns the address of the Cash Token.

function cashToken() external view returns (address);

emergencyGovernor

Returns the address of the Emergency Governor.

function emergencyGovernor() external view returns (address);

registrar

Returns the address of the Registrar.

function registrar() external view returns (address);

vault

Returns the address of the Vault.

function vault() external view returns (address);

zeroGovernor

Returns the address of the Zero Governor.

function zeroGovernor() external view returns (address);

zeroToken

Returns the address of the Zero Token.

function zeroToken() external view returns (address);

Events

CashTokenSet

Emitted when the cash token is set to cashToken.

event CashTokenSet(address indexed cashToken);

Parameters

HasVotedOnAllProposals

Emitted when voter has voted on all the proposals in the current epoch currentEpoch.

event HasVotedOnAllProposals(address indexed voter, uint256 indexed currentEpoch);

Parameters

ProposalFeeSentToVault

Emitted when the proposal fee for the proposal, with identifier proposalFee, is sent to the vault.

event ProposalFeeSentToVault(uint256 indexed proposalId, address indexed cashToken, uint256 amount);

Parameters

ProposalFeeSet

Emitted when the proposal fee is set to proposalFee.

event ProposalFeeSet(uint256 proposalFee);

Parameters

Errors

FeeNotDestinedForVault

Revert message when the proposal fee for a yet defeated or yet expired proposal is trying to be moved.

error FeeNotDestinedForVault(ProposalState state);

Parameters

InvalidCashTokenAddress

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

error InvalidCashTokenAddress();

InvalidEmergencyGovernorAddress

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

error InvalidEmergencyGovernorAddress();

InvalidRegistrarAddress

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

error InvalidRegistrarAddress();

InvalidVaultAddress

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

error InvalidVaultAddress();

InvalidZeroGovernorAddress

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

error InvalidZeroGovernorAddress();

InvalidZeroTokenAddress

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

error InvalidZeroTokenAddress();

NoFeeToSend

Revert message when proposal fee trying to be moved to the vault is 0.

error NoFeeToSend();

NotSelfOrEmergencyGovernor

Revert message when the caller is not this contract itself nor the Emergency Governor.

error NotSelfOrEmergencyGovernor();

NotZeroGovernor

Revert message when the caller is not the Zero Governor.

error NotZeroGovernor();

TransferFailed

Revert message when a token transfer, from this contract, fails.

error TransferFailed();

TransferFromFailed

Revert message when a token transferFrom fails.

error TransferFromFailed();

Copyright 2024 M^0 Foundation