IPowerToken
Inherits: IEpochBasedInflationaryVoteToken
Author: M^0 Labs
Functions
buy
Allows a caller to buy amount
tokens from the auction.
Parameters
minAmount
uint256
The minimum amount of tokens the caller is interested in buying.
maxAmount
uint256
The maximum amount of tokens the caller is interested in buying.
destination
address
The address of the account to send the bought tokens.
expiryEpoch
uint16
The epoch number at the end of which the buy order expires.
Returns
amount
uint240
The amount of token bought.
cost
uint256
The total cash token cost of the purchase.
markNextVotingEpochAsActive
Marks the next voting epoch as targeted for inflation.
markParticipation
Marks delegatee
as having participated in the current epoch, thus receiving voting power inflation.
Parameters
delegatee
address
The address of the account being marked as having participated.
setNextCashToken
Queues the cash token that will take effect from the next epoch onward.
Parameters
nextCashToken
address
The address of the cash token taking effect from the next epoch onward.
amountToAuction
Returns the amount of tokens that can be bought in the auction.
bootstrapEpoch
Returns the epoch from which token balances and voting powers are bootstrapped.
bootstrapToken
Returns the address of the token in which token balances and voting powers are bootstrapped.
cashToken
Returns the address of the cash token required to buy from the token auction.
getCost
Returns the total cost, in cash token, of purchasing amount
tokens from the auction.
Parameters
amount
uint256
Some amount of tokens.
Returns
<none>
uint256
The total cost, in cash token, of amount
tokens.
standardGovernor
Returns the address of the Standard Governor.
targetSupply
Returns the target supply, which helps determine the amount of tokens up for auction.
vault
Returns the address of the Vault.
INITIAL_SUPPLY
Returns the initial supply of the token.
Events
Buy
Emitted when buyer
has bought amount
tokens from the auction, as a total cash token value of cost
.
Parameters
buyer
address
The address of account that bought tokens from the auction.
amount
uint240
The amount of tokens bought.
cost
uint256
The total cash token cost of the purchase.
NextCashTokenSet
Emitted when the cash token is queued to become nextCashToken
at the start of epoch startingEpoch
.
Parameters
startingEpoch
uint16
The epoch number as a clock value in which the new cash token takes effect.
nextCashToken
address
The address of the cash token taking effect at startingEpoch
.
Tagline
Emitted in the constructor at deployment.
Parameters
tagline
string
The tagline of the contract.
TargetSupplyInflated
Emitted when the target supply is queued to become targetSupply
at the start of epoch targetEpoch
.
Parameters
targetEpoch
uint16
The epoch number as a clock value in which the new target supply takes effect.
targetSupply
uint240
The target supply taking effect at startingEpoch
.
Errors
BootstrapSupplyTooLarge
Revert message when the total supply of the bootstrap token is larger than type(uint240).max
.
BootstrapSupplyZero
Revert message when the total supply of the bootstrap token is 0.
InsufficientAuctionSupply
Revert message when the amount available for auction is less than the minimum requested to buy.
Parameters
amountToAuction
uint240
The amount available for auction.
minAmountRequested
uint240
The minimum amount that was requested to buy.
InvalidBootstrapTokenAddress
Revert message when the Bootstrap Token specified in the constructor is address(0).
InvalidCashTokenAddress
Revert message when the Cash Token specified in the constructor is address(0).
InvalidStandardGovernorAddress
Revert message when the Standard Governor specified in the constructor is address(0).
InvalidVaultAddress
Revert message when the Vault specified in the constructor is address(0).
NotStandardGovernor
Revert message when the caller is not the Standard Governor.
TransferFromFailed
Revert message when a token transferFrom fails.
DivisionByZero
Revert message when auction calculations use zero as denominator.
ExpiredBuyOrder
Revert message when the buy order has expired using epoch-based expiration clock.
ZeroPurchaseAmount
Revert message when the buy order has zero maximum and minimum amounts.
SyncBeforeBootstrap
Revert message when trying to sync to an epoch that is before the bootstrap epoch.
Parameters
bootstrapEpoch
uint16
The bootstrap epoch.
epoch
uint16
The epoch attempting to be synced to, not inclusively.