Core Functions

propose(targets[],values[],callDatas[],description):proposalIdpropose(targets[], values[], callDatas[], description): proposalId

  • Creates a new unique proposal

  • Marks next voting epoch as active if it is the first submitted proposal for the next voting epoch

  • Charges proposal fee

  • Returns proposalIdproposalIdof the newly created proposal.

castVote(proposalId,support):weightcastVote(proposalId, support): weight

  • Reverts if proposal is not Active

  • Reverts if voting weightweight of msg.sendermsg.sender is 0

  • Reverts if msg.sendermsg.sender already voted

  • Gets votes from the previous epoch as weightweight of msg.sendermsg.sender

  • Accounts for msg.sendermsg.sender supportsupport vote

  • Increases numberOfProposalsVotedOnAtnumberOfProposalsVotedOnAt for msg.sendermsg.sender

  • If numberOfProposalsVotedOnAt==numberOfEpochProposalsnumberOfProposalsVotedOnAt == numberOfEpochProposals:

    • Marks msg.sendermsg.sender participation for POWER inflation of token holders

    • Increase msg.sendermsg.sender voting power by epoch inflatorinflator amount

    • Mints ZERO rewards to msg.sendermsg.sender

  • Returns weightweight of msg.sendermsg.sender.

castVotes(proposalIds[],supports):weightcastVotes(proposalIds[], supports): weight

  • Votes in batch for all proposalIds[]proposalIds[].

See castVote(proposalId,support)castVote(proposalId, support)

execute(targets[],values[],callDatas[],description):proposalIdexecute(targets[], values[], callDatas[], description): proposalId

  • Reverts if the current epoch is 0

  • Reverts if there is no proposal in SucceededSucceeded state for calculated proposalIdproposalId

  • Executes governance action

  • Sends proposalFeeproposalFee back to proposalIdproposalId proposer.

sendProposalFeeToVault(proposalId)sendProposalFeeToVault(proposalId)

  • Reverts if proposalIdproposalId is not DefeatedDefeated or ExpiredExpired

  • Reverts if the proposalFeeproposalFee for this proposalIdproposalId is 0

  • Sends paid proposalFeeproposalFee to the Distribution vault.

setCashToken(newCashToken,newProposalFee)setCashToken(newCashToken, newProposalFee)

  • Reverts if not called by ZeroGovernorZeroGovernor

  • Sets newCashTokennewCashToken in StandardGovernorStandardGovernor

  • Sets newCashTokennewCashToken in POWERĀ tokenPOWER \ token

  • Sets newProposalFeenewProposalFee.

getProposal(proposalId)getProposal(proposalId)

  • Returns

    • start epoch;

    • end epoch;

    • state;

    • number of NO votes;

    • number of YES votes;

    • proposer address;

    • quorum, number of votes required to meet quorum.

state(proposalId)state(proposalId)

  • Returns one of states:

    • Pending

    • Active

    • Executed

    • Defeated

    • Succeeded

    • Expired

See lifecycle diagram for more information on stateā€™s transition for StandardGovernorStandardGovernor.

Last updated

Copyright 2024 M^0 Foundation