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
palletmodule in each FRAME pallet hosts the most important items needed to construct this pallet. - weights
- Autogenerated weights for pallet_dapp_staking
Structs§
- Account
Ledger - General info about an account’s lock & stakes.
- BTree
Map - An ordered map based on a B-Tree.
- Bonus
Status Wrapper - Wrapper struct that provides additional methods for
BonusStatus. - Cleanup
Marker - Describes which entries are next in line for cleanup.
- Contract
Stake Amount - Composite type that holds information about how much was staked on a contract in up to two distinct eras.
- DApp
Info - General information about a dApp.
- DApp
Tier Rewards - 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.
- EraReward
Span - Used to efficiently store era span information.
- EraStake
Pair Iter - Helper internal struct for iterating over
(era, stake amount)pairs. - Period
EndInfo - Struct with relevant information for a finished period.
- Period
Info - Info about the ongoing period.
- Protocol
State - General information & state of the dApp staking protocol.
- Singular
Staking Info - Information about how much a particular staker staked on a particular smart contract.
- Stake
Amount - Describes stake amount in an particular era/period.
- Tier
Parameters - Top level description of tier slot parameters used to calculate tier configuration.
- Tiers
Configuration - Configuration of dApp tiers.
- Unlocking
Chunk - How much was unlocked in some block.
- Vec
- A contiguous growable array type, written as
Vec<T>, short for ‘vector’.
Enums§
- Account
Ledger Error - Simple enum representing errors possible when using sparse bounded vector.
- Bonus
Update State - DApp
Tier Error - EraReward
Span Error - Forcing
Type - Force types to speed up the next era, and even period.
- Subperiod
- Distinct subperiods in dApp staking protocol.
- Tier
Threshold - Description of tier entry requirement.
Traits§
- Debug
?formatting.
Type Aliases§
- Account
Ledger For - Bonus
Status - Type alias for bonus status, where:
- Bonus
Status Wrapper For - Bonus
Update Cursor - Bonus
Update Cursor For - Bonus
Update State For - TODO: remove it once all BonusStatus are updated and the
ActiveBonusUpdateCursorstorage value is cleanup. - DApp
Info For - DApp
Tier Rewards For - EraReward
Span For
Derive Macros§
- Debug
- Derive macro generating an impl of the trait
Debug.