29 major breaking releases

new 32.0.0 Apr 9, 2024
31.0.0 Mar 18, 2024
30.0.0 Feb 26, 2024
29.0.0 Feb 13, 2024
0.0.0 Nov 21, 2022

#1018 in Magic Beans

Download history 268/week @ 2023-12-18 52/week @ 2023-12-25 620/week @ 2024-01-01 675/week @ 2024-01-08 256/week @ 2024-01-15 471/week @ 2024-01-22 403/week @ 2024-01-29 587/week @ 2024-02-05 906/week @ 2024-02-12 1157/week @ 2024-02-19 1288/week @ 2024-02-26 671/week @ 2024-03-04 502/week @ 2024-03-11 1003/week @ 2024-03-18 998/week @ 2024-03-25 1381/week @ 2024-04-01

3,928 downloads per month
Used in 15 crates (6 directly)

Apache-2.0

2.5MB
45K SLoC

Referenda Pallet

Overview

The Referenda pallet handles the administration of general stakeholder voting.


lib.rs:

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

  • Support: The number of aye-votes, pre-conviction, as a proportion of the total number of pre-conviction votes able to be cast in the population.

  • Config

  • Call

Dependencies

~17–31MB
~511K SLoC