Crate pallet_referenda
source ·Expand description
§Referenda Pallet
§Overview
A pallet for executing referenda. No voting logic is present here, and the Polling
and
PollStatus
traits are used to allow the voting logic (likely in a pallet) to be utilized.
A referendum is a vote on whether a proposal should be dispatched from a particular origin. The origin is used to determine which one of several tracks that a referendum happens under. Tracks each have their own configuration which governs the voting process and parameters.
A referendum’s lifecycle has three main stages: Preparation, deciding and conclusion. Referenda are considered “ongoing” immediately after submission until their eventual conclusion, and votes may be cast throughout.
In order to progress from preparating to being decided, three things must be in place:
- There must have been a Decision Deposit placed, an amount determined by the track. Anyone may place this deposit.
- A period must have elapsed since submission of the referendum. This period is known as the Preparation Period and is determined by the track.
- The track must not already be at capacity with referendum being decided. The maximum number of referenda which may be being decided simultaneously is determined by the track.
In order to become concluded, one of three things must happen:
- The referendum should remain in an unbroken Passing state for a period of time. This is known as the Confirmation Period and is determined by the track. A referendum is considered Passing when there is a sufficiently high support and approval, given the amount of time it has been being decided. Generally the threshold for what counts as being “sufficiently high” will reduce over time. The curves setting these thresholds are determined by the track. In this case, the referendum is considered Approved and the proposal is scheduled for dispatch.
- The referendum reaches the end of its deciding phase outside not Passing. It ends in rejection and the proposal is not dispatched.
- The referendum is cancelled.
A general time-out is also in place and referenda which exist in preparation for too long may conclude without ever entering into a deciding stage.
Once a referendum is concluded, the decision deposit may be refunded.
§Terms
Re-exports§
pub use self::weights::WeightInfo;
pub use self::pallet::*;
Modules§
- Democracy pallet benchmarking.
- Storage migrations for the referenda pallet.
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_referenda
Macros§
Structs§
- Info regarding an ongoing referendum.
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Enums§
- Type for describing a curve over the 2-dimensional space of axes between 0-1, as represented by
(Perbill, Perbill)
. - Info regarding a referendum, present or past.
Traits§
- A trait for querying a single value from a type.
- Information on the voting tracks.
Type Aliases§
- A referendum index.