Documentation Portal
Project Home
  • Core Documentation
    • Overview
    • Whitepaper
      • Abstract
      • I. Introduction
      • II. Protocol
        • II.I Operation
          • II.I.I Generation of M
          • II.I.II Protocol Fees
          • II.I.III Cancel and Freeze
          • II.I.IV Retrieving Free Collateral
          • II.I.V The Earn Mechanism
          • II.I.VI Removing a Permissioned Actor
          • II.I.VII Example Interactions and Flows
        • II.II Governance Controlled Protocol Actors
        • II.III Governance Controlled Protocol Parameters
      • III. Governance
        • III.I Inputs
        • III.II Operation
          • III.II.I Epochs
          • III.II.II Proposals
            • III.II.II.I Standard Proposals
            • III.II.II.II POWER Threshold Proposals
            • III.II.II.III ZERO Threshold Proposals
            • III.II.II.IV Proposal Matrix
          • III.II.III Checkpoints and Voting
          • III.II.IV Proposing
          • III.II.V Inflation Mechanics
          • III.II.VI Dutch Auction
          • III.II.VII Delegation
          • III.II.VIII ZERO Claiming of Residual Value
        • III.III Governance Controlled TTG Parameters
        • III.IV Immutable TTG Parameters
        • III.V Immutable POWER Parameters
        • III.VI Immutable ZERO Parameters
      • IV. The M0 Economy
        • IV.I Minters
        • IV.II Validators
        • IV.III Earners
      • V. Off-Chain Ecosystem
        • V.I Guidance
        • V.II Off-Chain Actors and Components
    • Adopted Guidance
      • Adopted Guidance v1.30
        • 1. Description of the Adopted Guidance
          • 1.1. Purpose of the Adopted Guidance
          • 1.2. Change Process for the Adopted Guidance
        • 2. Ecosystem Description
          • 2.1. Actors
          • 2.2. Mandatory Contracts
          • 2.3. Duty of Transparency
          • 2.4. Core Operational Flows
            • 2.4.1. Update Collateral Process
            • 2.4.2. Minting M
            • 2.4.3. Retrieval of Collateral
          • 2.5. High-Risk Jurisdictions
        • 3. Eligible Collateral
          • 3.1. Criteria for Eligible Collateral
          • 3.2. Valuation Policy for Eligible Collateral
          • 3.3. Collateral Storage
          • 3.4. Approved Jurisdictions
            • 3.4.1. Bankruptcy Remoteness
            • 3.4.2. Non-Petition and Non-Seizure Provisions
            • 3.4.3. Priority of Payments and Subordination
            • 3.4.4. Regulatory Compliance
            • 3.4.5. Legal and Regulatory Framework
            • 3.4.6. Political Stability
            • 3.4.7. Dispute Resolution
            • 3.4.8. Asset Segregation
            • 3.4.9. Limited Recourse
            • 3.4.10. Investor Protection
            • 3.4.11. Operational Infrastructure
            • 3.4.12. Custody Relationship
            • 3.4.13. Audit
        • 4. SPV Operators
          • 4.1. Contact Information of Currently Approved SPV Operators
          • 4.2. Eligibility Criteria for Approved SPV Operators
          • 4.3. Obligations of SPV Operators
            • 4.3.1. Obligations in the Normal Course of Business
            • 4.3.2. Obligations Outside of the Normal Course of Business
              • 4.3.2.1. Amicable Wind Down Process
              • 4.3.2.2. Non-Amicable Wind Down Process
              • 4.3.2.3. Minter Insolvency
              • 4.3.2.4. Unauthorized Termination of Minter – SPV Operator Agreement
            • 4.3.3. Operational Obligations of SPV Operators
              • 4.3.3.1. Co-signature of the SPV for significant payments
              • 4.3.3.2. Cooperation with Validators
              • 4.3.3.3. Maintenance of Administrative Buffer
              • 4.3.3.4. No Wire Back Instructions
          • 4.4. Guidelines for Submission of Approval Requests
        • 5. Validators
          • 5.1. Contact Information of Currently Permissioned Validators
          • 5.2. Eligibility Criteria for Permissioned Validators
          • 5.3. Obligations of Validators
          • 5.4. Guidelines for Submission of Permissioning Requests
        • 6. BD Minters and Minters
          • 6.1. Contact Information of Currently Permissioned Minters
          • 6.2. Eligibility Criteria for Permissioned Minters
          • 6.3. Obligations of Minters
          • 6.4. BD Minter and Minter Compliance Requirements
          • 6.5. Guidelines for Submission of Permissioning Requests
        • Adopted Guidance PDF Version
      • Adopted Guidance v1.20 (deprecated)
        • Adopted Guidance PDF Version
    • Glossary
    • Disclosures
    • Whitepaper PDF Version
  • Technical Documentation
    • Protocol Technical Specification
      • Main Invariants
      • Variables
        • Protocol Variables Controlled by TTG
        • Protocol Variables And Definitions
        • Protocol Variables Used For Interest Accruals
      • Protocol And M Token Actors And Actions
        • Protocol Core Functions
          • Minter Gateway
            • updateCollateral
            • proposeMint
            • mintM
            • cancelMint
            • freezeMinter
            • burnM
            • proposeRetrieval
            • activateMinter
            • deactivateMinter
          • M Token
            • startEarning
            • stopEarning
            • transfer
          • Interest Calculations And Indices
            • MinterGateway.updateIndex
            • MinterGateway.currentIndex
            • MToken.updateIndex
            • MToken.currentIndex
            • activeOwedM
          • Interest Rate Models
            • Stable Earner Interest Rate Model Contract
            • Minter Interest Rate Model Contract
    • TTG Technical Specification
      • Main Invariants
      • Core Architecture
        • 1. Registrar
          • Registrar Variables and Getters
          • Registrar Core Functions
        • 2. TTG Governors
          • Matrix Of TTG Proposals
          • 2.1 Standard Governor
            • Variables And Getters
            • Governor Proposal State Transitions
            • Core Functions
            • Core Governance Proposals
          • 2.2 Emergency Governor
            • Emergency Governor Variables And Getters
            • Governor Proposal State Transitions
            • Core functions
              • propose(targets[], values[], callDatas[], description): proposalId
              • castVote(proposalId, support): weight
              • castVotes(proposalIds[], supports): weight
              • execute(targets[], values[], callDatas[], description): proposalId
              • setThresholdRatio(newThresholdRatio)
              • getProposal(proposalId)
              • state(proposalId)
            • Core Governance Proposals
          • 2.3 ZERO Governor
            • Variables And Getters
            • Core Functions
            • Core Governance Proposals
        • 3. POWER Token
          • Variables And Getters
          • POWER Token Core Functions
        • 4. ZERO Token
          • ZERO Token Core Functions
        • 5. Distribution Vault
          • Variables And Getters
          • Core Functions
    • Source Code Reference
      • Protocol
        • Protocol Contracts
          • Core Protocol Contracts
            • MToken
            • MinterGateway
          • Abstract Protocol Contracts
            • ContinuousIndexing
          • Protocol Interfaces
            • IContinuousIndexing
            • IMToken
            • IMinterGateway
            • IRateModel
            • ITTGRegistrar
          • Libs
            • ContinuousIndexingMath
            • TTGRegistrarReader
          • Rate Models
            • Contracts
              • EarnerRateModel
              • MinterRateModel
            • Interfaces
              • IEarnerRateModel
              • IMinterRateModel
      • TTG
        • TTG Contracts
          • Core TTG Contracts
            • DistributionVault
            • Registrar
            • Governors
              • EmergencyGovernor
              • StandardGovernor
              • ZeroGovernor
            • Tokens
              • PowerBootstrapToken
              • PowerToken
              • ZeroToken
          • Abstract TTG Contracts
            • ERC5805
            • Governors
              • BatchGovernor
              • ThresholdGovernor
            • Tokens
              • EpochBasedInflationaryVoteToken
              • EpochBasedVoteToken
            • Interfaces
              • IBatchGovernor
              • IERC5805
              • IERC6372
              • IEpochBasedInflationaryVoteToken
              • IEpochBasedVoteToken
              • IGovernor
              • IThresholdGovernor
          • Deployers
            • EmergencyGovernorDeployer
            • PowerTokenDeployer
            • StandardGovernorDeployer
          • TTG Interfaces
            • IDistributionVault
            • IRegistrar
            • Deployers
              • IDeployer
              • IEmergencyGovernorDeployer
              • IPowerTokenDeployer
              • IStandardGovernorDeployer
            • Governors
              • IEmergencyGovernor
              • IStandardGovernor
              • IZeroGovernor
            • Tokens
              • IPowerBootstrapToken
              • IPowerToken
              • IZeroToken
          • Libs
            • PureEpochs
      • Common
        • Contracts
          • Main
            • ContractHelper
            • ERC20Extended
            • ERC3009
            • ERC712Extended
            • StatefulERC712
          • Interfaces
            • IERC1271
            • IERC20
            • IERC20Extended
            • IERC3009
            • IERC712
            • IERC712Extended
            • IStatefulERC712
          • Libs
            • SignatureChecker
            • UIntMath
    • 🏁Audits
    • 🔛Deployments
Powered by GitBook

M0 Project

  • Home
  • Research

Legal

  • Terms & Conditions
  • Privacy Policy

Copyright 2025 M0 Foundation

On this page
  • Functions
  • castVote
  • castVoteBySig
  • castVoteBySig
  • castVoteWithReason
  • castVoteWithReasonBySig
  • castVoteWithReasonBySig
  • execute
  • propose
  • COUNTING_MODE
  • getVotes
  • hashProposal
  • hasVoted
  • name
  • proposalDeadline
  • proposalProposer
  • proposalSnapshot
  • proposalThreshold
  • proposalVotes
  • quorum
  • state
  • token
  • votingDelay
  • votingPeriod
  • BALLOT_TYPEHASH
  • BALLOT_WITH_REASON_TYPEHASH
  • Events
  • ProposalCreated
  • ProposalExecuted
  • VoteCast
  • Enums
  • ProposalState
  1. Technical Documentation
  2. Source Code Reference
  3. TTG
  4. TTG Contracts
  5. Abstract TTG Contracts
  6. Interfaces

IGovernor

PreviousIEpochBasedVoteTokenNextIThresholdGovernor

Inherits: IERC6372, IERC712

Author: M^0 Labs

Functions

castVote

Allows the caller to cast a vote on a proposal with id proposalId.

function castVote(uint256 proposalId, uint8 support) external returns (uint256 weight);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

castVoteBySig

Allows a signer to cast a vote on a proposal with id proposalId via an ECDSA secp256k1 signature.

function castVoteBySig(uint256 proposalId, uint8 support, uint8 v, bytes32 r, bytes32 s)
    external
    returns (uint256 weight);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

v

uint8

An ECDSA secp256k1 signature parameter.

r

bytes32

An ECDSA secp256k1 signature parameter.

s

bytes32

An ECDSA secp256k1 signature parameter.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

castVoteBySig

Allows voter to cast a vote on a proposal with id proposalId via an arbitrary signature.

function castVoteBySig(address voter, uint256 proposalId, uint8 support, bytes memory signature)
    external
    returns (uint256 weight);

Parameters

Name
Type
Description

voter

address

The address of the account that casting their vote, and purported to have signed.

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

signature

bytes

An arbitrary signature.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

castVoteWithReason

Allows the caller to cast a vote with reason on a proposal with id proposalId.

function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason)
    external
    returns (uint256 weight);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

reason

string

The reason for which the caller casts their vote, if any.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

castVoteWithReasonBySig

Allows a signer to cast a vote with reason on a proposal with id proposalId via an ECDSA secp256k1 signature.

function castVoteWithReasonBySig(
    uint256 proposalId,
    uint8 support,
    string calldata reason,
    uint8 v,
    bytes32 r,
    bytes32 s
) external returns (uint256 weight);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

reason

string

The reason for which the caller casts their vote, if any.

v

uint8

An ECDSA secp256k1 signature parameter.

r

bytes32

An ECDSA secp256k1 signature parameter.

s

bytes32

An ECDSA secp256k1 signature parameter.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

castVoteWithReasonBySig

Allows voter to cast a vote with reason on a proposal with id proposalId via an arbitrary signature.

function castVoteWithReasonBySig(
    address voter,
    uint256 proposalId,
    uint8 support,
    string calldata reason,
    bytes memory signature
) external returns (uint256 weight);

Parameters

Name
Type
Description

voter

address

The address of the account that casting their vote, and purported to have signed.

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support to cast for the proposal.

reason

string

The reason for which the caller casts their vote, if any.

signature

bytes

An arbitrary signature.

Returns

Name
Type
Description

weight

uint256

The number of votes cast.

execute

Allows the caller to execute a proposal.

function execute(address[] memory targets, uint256[] memory values, bytes[] memory callDatas, bytes32 descriptionHash)
    external
    payable
    returns (uint256 proposalId);

Parameters

Name
Type
Description

targets

address[]

An array of addresses that will be called upon the execution.

values

uint256[]

An array of ETH amounts that will be sent to each respective target upon execution.

callDatas

bytes[]

An array of call data used to call each respective target upon execution.

descriptionHash

bytes32

The hash of the string of the description of the proposal.

Returns

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

propose

Allows the caller to create a proposal.

function propose(address[] memory targets, uint256[] memory values, bytes[] memory callDatas, string memory description)
    external
    returns (uint256 proposalId);

Parameters

Name
Type
Description

targets

address[]

An array of addresses that will be called upon the execution.

values

uint256[]

An array of ETH amounts that will be sent to each respective target upon execution.

callDatas

bytes[]

An array of call data used to call each respective target upon execution.

description

string

The string of the description of the proposal.

Returns

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

COUNTING_MODE

module:voting

A description of the possible "support" values for castVote and the way these votes are counted, meant to be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of key-value pairs that each describe one aspect, for example support=for,against&quorum=for. The string can be decoded by the standard URLSearchParams JavaScript class.

function COUNTING_MODE() external view returns (string memory);

getVotes

Returns the voting power of account at clock value timepoint.

function getVotes(address account, uint256 timepoint) external view returns (uint256);

Parameters

Name
Type
Description

account

address

The address of the account with voting power.

timepoint

uint256

The point in time, according to the clock mode the contract is operating on.

Returns

Name
Type
Description

<none>

uint256

The voting power of account at timepoint.

hashProposal

Returns the unique identifier for the proposal if it were created at this exact moment.

function hashProposal(
    address[] memory targets,
    uint256[] memory values,
    bytes[] memory callDatas,
    bytes32 descriptionHash
) external view returns (uint256);

Parameters

Name
Type
Description

targets

address[]

An array of addresses that will be called upon the execution.

values

uint256[]

An array of ETH amounts that will be sent to each respective target upon execution.

callDatas

bytes[]

An array of call data used to call each respective target upon execution.

descriptionHash

bytes32

The hash of the string of the description of the proposal.

Returns

Name
Type
Description

<none>

uint256

The unique identifier for the proposal.

hasVoted

Returns whether account has voted on the proposal with identifier proposalId.

function hasVoted(uint256 proposalId, address account) external view returns (bool);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

account

address

The address of some account.

Returns

Name
Type
Description

<none>

bool

Whether account has already voted on the proposal.

name

Returns the name of the contract.

function name() external view returns (string memory);

proposalDeadline

Returns the last clock value when voting on the proposal with identifier proposalId is allowed.

function proposalDeadline(uint256 proposalId) external view returns (uint256);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

Returns

Name
Type
Description

<none>

uint256

The last clock value when voting on the proposal is allowed.

proposalProposer

Returns the account that created the proposal with identifier proposalId.

function proposalProposer(uint256 proposalId) external view returns (address);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

Returns

Name
Type
Description

<none>

address

The address of the account that created the proposal.

proposalSnapshot

Returns the clock value used to retrieve voting power to vote on proposal with identifier proposalId.

function proposalSnapshot(uint256 proposalId) external view returns (uint256);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

Returns

Name
Type
Description

<none>

uint256

The clock value used to retrieve voting power.

proposalThreshold

Returns the required voting power an account needs to create a proposal.

function proposalThreshold() external view returns (uint256);

proposalVotes

Returns the vote support totals for the proposal with identifier proposalId.

function proposalVotes(uint256 proposalId)
    external
    view
    returns (uint256 noVotes, uint256 yesVotes, uint256 abstainVotes);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

Returns

Name
Type
Description

noVotes

uint256

The amount of votes cast against the proposal.

yesVotes

uint256

The amount of votes cast for the proposal.

abstainVotes

uint256

The amount of votes cast in abstention the proposal.

quorum

Returns the minimum number of eligible (COUNTING_MODE) votes for a proposal to succeed.

function quorum() external view returns (uint256);

state

Returns the state of a proposal with identifier proposalId.

function state(uint256 proposalId) external view returns (ProposalState);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

Returns

Name
Type
Description

<none>

ProposalState

The state of the proposal.

token

Returns the EIP-5805 token contact used for determine voting power and total supplies.

function token() external view returns (address);

votingDelay

Returns the number of clock values that must elapse before voting begins for a newly created proposal.

function votingDelay() external view returns (uint256);

votingPeriod

Returns the number of clock values between the vote start and vote end.

function votingPeriod() external view returns (uint256);

BALLOT_TYPEHASH

Returns the EIP712 typehash used in the encoding of the digest for castVoteBySig function.

function BALLOT_TYPEHASH() external pure returns (bytes32);

BALLOT_WITH_REASON_TYPEHASH

Returns the EIP712 typehash used in the encoding of the digest for castVoteWithReasonBySig function.

function BALLOT_WITH_REASON_TYPEHASH() external pure returns (bytes32);

Events

ProposalCreated

Emitted when a proposal has been created.

event ProposalCreated(
    uint256 proposalId,
    address proposer,
    address[] targets,
    uint256[] values,
    string[] signatures,
    bytes[] callDatas,
    uint256 voteStart,
    uint256 voteEnd,
    string description
);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

proposer

address

The address of the account that created the proposal.

targets

address[]

An array of addresses that will be called upon the execution.

values

uint256[]

An array of ETH amounts that will be sent to each respective target upon execution.

signatures

string[]

Empty string array required to be compatible with OZ governor contract.

callDatas

bytes[]

An array of call data used to call each respective target upon execution.

voteStart

uint256

The first clock value when voting on the proposal is allowed.

voteEnd

uint256

The last clock value when voting on the proposal is allowed.

description

string

The string of the description of the proposal.

ProposalExecuted

Emitted when a proposal has been executed.

event ProposalExecuted(uint256 proposalId);

Parameters

Name
Type
Description

proposalId

uint256

The unique identifier for the proposal.

VoteCast

Emitted when a vote for a proposal with id proposalId has been cast by voter.

event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);

Parameters

Name
Type
Description

voter

address

The address of the account that has casted their vote.

proposalId

uint256

The unique identifier for the proposal.

support

uint8

The type of support that has been cast for the proposal.

weight

uint256

The number of votes cast.

reason

string

The string of the reason voter has cast their vote, if any.

Enums

ProposalState

Proposal state.

enum ProposalState {
    Pending,
    Active,
    Canceled,
    Defeated,
    Succeeded,
    Queued,
    Expired,
    Executed
}
Git Source