Crate pallet_dapp_staking

Source
Expand description

§dApp Staking v3 Pallet

For detailed high level documentation, please refer to the attached README.md file. The crate level docs will cover overall pallet structure & implementation details.

§Overview

Pallet that implements the dApp staking v3 protocol. It covers everything from locking, staking, tier configuration & assignment, reward calculation & payout.

The types module contains all of the types used to implement the pallet. All of these types are extensively tested in their dedicated test_types module.

Rest of the pallet logic is concentrated in the lib.rs file. This logic is tested in the tests module, with the help of extensive testing_utils.

Re-exports§

pub use weights::WeightInfo;
pub use pallet::*;

Modules§

migration
pallet
The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
weights
Autogenerated weights for pallet_dapp_staking

Structs§

AccountLedger
General info about an account’s lock & stakes.
BTreeMap
An ordered map based on a B-Tree.
BonusStatusWrapper
Wrapper struct that provides additional methods for BonusStatus.
CleanupMarker
Describes which entries are next in line for cleanup.
ContractStakeAmount
Composite type that holds information about how much was staked on a contract in up to two distinct eras.
DAppInfo
General information about a dApp.
DAppTierRewards
Information about all of the dApps that got into tiers, and tier rewards
EraInfo
Info about an era, including the rewards, how much is locked, unlocking, etc.
EraReward
Information required for staker reward payout for a particular era.
EraRewardSpan
Used to efficiently store era span information.
EraStakePairIter
Helper internal struct for iterating over (era, stake amount) pairs.
PeriodEndInfo
Struct with relevant information for a finished period.
PeriodInfo
Info about the ongoing period.
ProtocolState
General information & state of the dApp staking protocol.
SingularStakingInfo
Information about how much a particular staker staked on a particular smart contract.
StakeAmount
Describes stake amount in an particular era/period.
TierParameters
Top level description of tier slot parameters used to calculate tier configuration.
TiersConfiguration
Configuration of dApp tiers.
UnlockingChunk
How much was unlocked in some block.
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

AccountLedgerError
Simple enum representing errors possible when using sparse bounded vector.
BonusUpdateState
DAppTierError
EraRewardSpanError
ForcingType
Force types to speed up the next era, and even period.
Subperiod
Distinct subperiods in dApp staking protocol.
TierThreshold
Description of tier entry requirement.

Traits§

Debug
? formatting.

Type Aliases§

AccountLedgerFor
BonusStatus
Type alias for bonus status, where:
BonusStatusWrapperFor
BonusUpdateCursor
BonusUpdateCursorFor
BonusUpdateStateFor
TODO: remove it once all BonusStatus are updated and the ActiveBonusUpdateCursor storage value is cleanup.
DAppInfoFor
DAppTierRewardsFor
EraRewardSpanFor

Derive Macros§

Debug
Derive macro generating an impl of the trait Debug.