Core Functions

buy(minAmount,maxAmount,destination,expiryEpoch):amount,costbuy(minAmount, maxAmount, destination, expiryEpoch): amount, cost Allows any user to purchase POWER token inflation of inactive participants.

  • Reverts if currentEpoch>expiryEpochcurrentEpoch > expiryEpoch

  • Reverts if minAmountminAmount OR maxAmountmaxAmount are equal to 0

  • Calculates the amount for purchase as max(available,maxAmount)max(available, maxAmount)

  • Reverts if the available amount is less than minAmountminAmount

  • Calculates costcost for purchase

  • Transfers costcost of CASHCASH tokens from msg.sendermsg.sender to Vault

  • Mints amountamount of POWERPOWER tokens to msg.sendermsg.sender

  • Returns (amount,cost)(amount, cost).

markNextVotingEpochAsActive()markNextVotingEpochAsActive()

  • Reverts if not called by StandardGovernorStandardGovernor

  • Sets target inflated supply for a next voting epoch.

markParticipation()markParticipation()

  • Reverts if not called by StandardGovernorStandardGovernor

  • If msg.sendermsg.sender voted on all proposals in the current epoch: - Inflate their voting power - Add inflation to totalSupplytotalSupply of POWER token.

setNextCashToken(amount)setNextCashToken(amount)

  • Reverts if not called by StandardGovernorStandardGovernor

  • Saves value of next cash token for starting next Auction with new Cash token.

amountToAuction()amountToAuction()

  • Returns the total amount of tokens available for the auction: - If epoch is Voting epoch, return 0 - If epoch is Transfer epoch, return targetSupplyāˆ’totalSupplytargetSupply - totalSupply.

getCost(amount)getCost(amount) Returns cost in CashTokenCashToken per amount in POWERPOWER token.

targetSupply(amount)targetSupply(amount) Returns target supply of POWER token if all POWER inflation is minted (i.e. was auctioned of).

Last updated

Copyright 2024 M^0 Foundation