EpochBasedInflationaryVoteToken
Inherits: IEpochBasedInflationaryVoteToken, EpochBasedVoteToken
Author: M^0 Labs
State Variables
ONE
Returns 100% in basis point, to be used to correctly ascertain the participation inflation rate.
participationInflation
Returns the participation inflation rate used to inflate tokens for participation.
_participations
A mapping of delegatees to their participation snaps, marking epochs in which they have participated.
Functions
notDuringVoteEpoch
Reverts if the current epoch is a voting epoch.
onlyDuringVoteEpoch
Reverts if the current epoch is not a voting epoch.
constructor
Constructs a new EpochBasedInflationaryVoteToken contract.
Parameters
sync
Syncs account
so that its balance Snap array in storage, reflects their unrealized inflation.
Parameters
hasParticipatedAt
Returns whether delegatee
has participated in voting during clock value epoch
.
Parameters
Returns
_delegate
Delegate voting power from delegator_
to newDelegatee_
.
The inflation is first realized according to participation of the current delegatee by calling _sync()
.
Parameters
_markParticipation
Allows for the inflation of a delegatee's voting power (and total supply) up to one time per epoch.
Parameters
_mint
Mint amount_
tokens to recipient_
.
Parameters
_sync
Syncs account_
so that its balance Snap array in storage, reflects their unrealized inflation.
Parameters
_transfer
Transfers amount_
tokens from sender_
to recipient_
.
Parameters
_update
Update a storage VoidSnap array to contain the current epoch as the latest snap.
Parameters
Returns
_getBalance
Returns the balance of account_
plus any inflation that in unrealized before epoch_
.
Parameters
Returns
_getBalanceWithoutUnrealizedInflation
Returns the balance of account_
at epoch_
without any unrealized inflation.
Parameters
Returns
_getInflation
Returns the inflation of amount
due to participation inflation.
Parameters
Returns
_getLastSync
Returns the epoch of the last sync of account_
at or before epoch_
. Override this function in order to return the "default"/starting epoch if the account has never synced.
Parameters
Returns
_hasParticipatedAt
Returns whether delegatee_
has participated during the clock value epoch_
.
Parameters
Returns
_getUnrealizedInflation
Returns the unrealized inflation for account_
from their last sync to the epoch before lastEpoch_
.
Parameters
Returns
_revertIfInVoteEpoch
Reverts if the current epoch is a voting epoch.
_revertIfNotInVoteEpoch
Reverts if the current epoch is not a voting epoch.
_isVotingEpoch
Returns whether the clock value epoch_
is a voting epoch or not.
Parameters
Returns
_unsafeAccess
Returns the VoidSnap in an array at a given index without doing bounds checking.
Parameters
Returns
Structs
VoidSnap
A 32-byte struct containing a starting epoch that merely marks that something occurred in this epoch.