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
  • State Variables
  • _AUCTION_PERIODS
  • INITIAL_SUPPLY
  • bootstrapToken
  • standardGovernor
  • vault
  • bootstrapEpoch
  • _bootstrapSupply
  • _nextCashTokenStartingEpoch
  • _cashToken
  • _nextCashToken
  • _nextTargetSupplyStartingEpoch
  • _targetSupply
  • _nextTargetSupply
  • Functions
  • onlyStandardGovernor
  • constructor
  • buy
  • markNextVotingEpochAsActive
  • markParticipation
  • setNextCashToken
  • amountToAuction
  • cashToken
  • getCost
  • targetSupply
  • _bootstrap
  • _delegate
  • _sync
  • _getBalance
  • _getBootstrapBalance
  • _getTotalSupply
  • _getVotes
  • _getInternalOrBootstrap
  • _getLastSync
  • _getTargetSupply
  • _revertIfNotStandardGovernor
  • _divideUp
  1. Technical Documentation
  2. Source Code Reference
  3. TTG
  4. TTG Contracts
  5. Core TTG Contracts
  6. Tokens

PowerToken

PreviousPowerBootstrapTokenNextZeroToken

Inherits: IPowerToken, EpochBasedInflationaryVoteToken

Author: M^0 Labs

State Variables

_AUCTION_PERIODS

The number of auction periods in an epoch.

uint40 internal constant _AUCTION_PERIODS = 100;

INITIAL_SUPPLY

Returns the initial supply of the token.

uint240 public constant INITIAL_SUPPLY = 1_000_000;

bootstrapToken

Returns the address of the token in which token balances and voting powers are bootstrapped.

address public immutable bootstrapToken;

standardGovernor

Returns the address of the Standard Governor.

address public immutable standardGovernor;

vault

Returns the address of the Vault.

address public immutable vault;

bootstrapEpoch

Returns the epoch from which token balances and voting powers are bootstrapped.

uint16 public immutable bootstrapEpoch;

_bootstrapSupply

The total supply of the bootstrap token at the bootstrap epoch.

uint240 internal immutable _bootstrapSupply;

_nextCashTokenStartingEpoch

The starting epoch of the next cash token.

uint16 internal _nextCashTokenStartingEpoch;

_cashToken

The address of the cash token required to buy from the token auction.

address internal _cashToken;

_nextCashToken

The address of the next cash token.

address internal _nextCashToken;

_nextTargetSupplyStartingEpoch

The starting epoch of the next target supply.

uint16 internal _nextTargetSupplyStartingEpoch;

_targetSupply

The current target supply of the token.

uint240 internal _targetSupply;

_nextTargetSupply

The next target supply of the token.

uint240 internal _nextTargetSupply = INITIAL_SUPPLY;

Functions

onlyStandardGovernor

Reverts if the caller is not the Standard Governor.

modifier onlyStandardGovernor();

constructor

Constructs a new Power Token contract.

constructor(address bootstrapToken_, address standardGovernor_, address cashToken_, address vault_)
    EpochBasedInflationaryVoteToken("Power by M^0", "POWER", 0, ONE / 10);

Parameters

Name
Type
Description

bootstrapToken_

address

The address of the token to bootstrap balances and voting powers from.

standardGovernor_

address

The address of the Standard Governor contract to delegate control to.

cashToken_

address

The address of the token to auction the unowned inflated supply for.

vault_

address

The address of the vault to transfer cash tokens to.

buy

Allows a caller to buy amount tokens from the auction.

function buy(uint256 minAmount_, uint256 maxAmount_, address destination_, uint16 expiryEpoch_)
    external
    returns (uint240 amount_, uint256 cost_);

Parameters

Name
Type
Description

minAmount_

uint256

maxAmount_

uint256

destination_

address

expiryEpoch_

uint16

Returns

Name
Type
Description

amount_

uint240

amount The amount of token bought.

cost_

uint256

cost The total cash token cost of the purchase.

markNextVotingEpochAsActive

Marks the next voting epoch as targeted for inflation.

function markNextVotingEpochAsActive() external onlyStandardGovernor;

markParticipation

Marks delegatee as having participated in the current epoch, thus receiving voting power inflation.

function markParticipation(address delegatee_) external onlyStandardGovernor;

Parameters

Name
Type
Description

delegatee_

address

setNextCashToken

Queues the cash token that will take effect from the next epoch onward.

function setNextCashToken(address nextCashToken_) external onlyStandardGovernor;

Parameters

Name
Type
Description

nextCashToken_

address

amountToAuction

Returns the amount of tokens that can be bought in the auction.

function amountToAuction() public view returns (uint240);

cashToken

Returns the address of the cash token required to buy from the token auction.

function cashToken() public view returns (address);

getCost

Returns the total cost, in cash token, of purchasing amount tokens from the auction.

function getCost(uint256 amount_) public view returns (uint256);

Parameters

Name
Type
Description

amount_

uint256

Returns

Name
Type
Description

<none>

uint256

The total cost, in cash token, of amount tokens.

targetSupply

Returns the target supply, which helps determine the amount of tokens up for auction.

*Auction curve:

  • During every auction period (1/100th of an epoch) the price starts at some "leftPoint" and decreases linearly, with time, to some "rightPoint" (which is half of that "leftPoint"). This is done by computing the weighted average between the "leftPoint" and "rightPoint" for the time remaining in the auction period.

  • For the next auction period, the new "leftPoint" is half of the previous period's "leftPoint" (which also equals the previous period's "rightPoint").

  • Combined, this results in the price decreasing by half every auction period at a macro level, but decreasing linearly at a micro-level during each period, without any jumps. Relative price computation:

  • Since the parameters of this auction are fixed forever (there are no mutable auction parameters and this is not an upgradeable contract), and the token supply is expected to increase relatively quickly and consistently, the result would be that the price Y for some Z% of the total supply would occur earlier and earlier in the auction.

  • Instead, the desired behavior is that after X seconds into the auction, there will be a price Y for some Z% of the total supply. In other words, it will always cost 572,662,306,133 cash tokens to buy 1% of the previous epoch's total supply with 5 days left in the auction period.

  • To achieve this, the price is instead computed per basis point of the last epoch's total supply.*

function targetSupply() public view returns (uint256);

_bootstrap

Bootstrap the account's balance and voting power from the bootstrap token.

function _bootstrap(address account_) internal;

Parameters

Name
Type
Description

account_

address

The account to bootstrap.

_delegate

Delegate voting power from delegator_ to newDelegatee_.

function _delegate(address delegator_, address newDelegatee_) internal override;

Parameters

Name
Type
Description

delegator_

address

The address of the account delegating voting power.

newDelegatee_

address

The address of the account receiving voting power.

_sync

Syncs account_ so that its balance Snap array in storage, reflects their unrealized inflation.

function _sync(address account_) internal override;

Parameters

Name
Type
Description

account_

address

The address of the account to sync.

_getBalance

Returns the balance of account_ plus any inflation that is unrealized before epoch_.

function _getBalance(address account_, uint16 epoch_) internal view override returns (uint240);

Parameters

Name
Type
Description

account_

address

The account to get the balance for.

epoch_

uint16

The epoch to get the balance at.

Returns

Name
Type
Description

<none>

uint240

The balance of account_ plus any inflation that is unrealized before epoch_.

_getBootstrapBalance

This is the portion of the initial supply commensurate with the account's portion of the bootstrap supply.

function _getBootstrapBalance(address account_, uint16 epoch_) internal view returns (uint240);

Parameters

Name
Type
Description

account_

address

The account to get the bootstrap balance for.

epoch_

uint16

The epoch to get the bootstrap balance at.

Returns

Name
Type
Description

<none>

uint240

The bootstrap balance of account_ at epoch_.

_getTotalSupply

Returns the total supply at epoch_.

function _getTotalSupply(uint16 epoch_) internal view override returns (uint240);

Parameters

Name
Type
Description

epoch_

uint16

The epoch to get the total supply at.

Returns

Name
Type
Description

<none>

uint240

The total supply at epoch_.

_getVotes

Returns the amount of votes of account_ plus any inflation that should be realized at epoch_.

function _getVotes(address account_, uint16 epoch_) internal view override returns (uint240);

Parameters

Name
Type
Description

account_

address

The account to get the votes for.

epoch_

uint16

The epoch to get the votes at.

Returns

Name
Type
Description

<none>

uint240

The votes of account_ at epoch_.

_getInternalOrBootstrap

Returns the amount of balance/votes for account_ at clock value epoch_.

function _getInternalOrBootstrap(
    address account_,
    uint16 epoch_,
    function(address, uint16) internal view returns (uint240) getter_
) internal view returns (uint240);

Parameters

Name
Type
Description

account_

address

The account to get the balance/votes for.

epoch_

uint16

The epoch to get the balance/votes at.

getter_

function (address, uint16) internal view returns (uint240)

An internal view function that returns the balance/votes that are internally tracked.

Returns

Name
Type
Description

<none>

uint240

The balance/votes of account_ (plus any inflation that should be realized) at epoch_.

_getLastSync

Returns the epoch of the last sync of account_ at or before epoch_.

function _getLastSync(address account_, uint16 epoch_) internal view override returns (uint16);

Parameters

Name
Type
Description

account_

address

The account to get the last sync for.

epoch_

uint16

The epoch to get the last sync at or before.

Returns

Name
Type
Description

<none>

uint16

The epoch of the last sync of account_ at or before epoch_.

_getTargetSupply

Returns the target supply of the token at the current epoch.

function _getTargetSupply() internal view returns (uint240);

_revertIfNotStandardGovernor

Reverts if the caller is not the Standard Governor.

function _revertIfNotStandardGovernor() internal view;

_divideUp

Helper function to calculate x / y, rounded up.

Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)

function _divideUp(uint256 x, uint256 y) internal pure returns (uint256 z);
Git Source