Crate democracy

source ·
Expand description

Democracy Pallet

Overview

The democracy pallet handles the administration of general stakeholder voting.

Proposals made by the community are added to a queue before they become a referendum.

Every launch period - a length defined in the runtime - this pallet will launch a referendum from the proposal queue. Any token holder in the system can vote on this.

Terminology

  • Enactment Period: The period between a proposal being approved and enacted.
  • Vote: A value that can either be in approval (“Aye”) or rejection (“Nay”) of a particular referendum.
  • Proposal: A submission to the chain that represents an action that a proposer (either an account or an external origin) suggests that the system adopt.
  • Referendum: A proposal that is in the process of being voted on for either acceptance or rejection as a change to the system.

Adaptive Quorum Biasing

A referendum can be either simple majority-carries in which 50%+1 of the votes decide the outcome or adaptive quorum biased. Adaptive quorum biasing makes the threshold for passing or rejecting a referendum higher or lower depending on how the referendum was originally proposed. There are two types of adaptive quorum biasing: 1) positive turnout bias makes a referendum require a super-majority to pass that decreases as turnout increases and 2) negative turnout bias makes a referendum require a super-majority to reject that decreases as turnout increases. Another way to think about the quorum biasing is that positive bias referendums will be rejected by default and negative bias referendums get passed by default.

Interface

Dispatchable Functions

Public

These calls can be made from any externally held account capable of creating a signed extrinsic.

Basic actions:

  • propose - Submits a sensitive action, represented as a hash. Requires a deposit.
  • second - Signals agreement with a proposal, moves it higher on the proposal queue, and requires a matching deposit to the original.
  • vote - Votes in a referendum, either the vote is “Aye” to enact the proposal or “Nay” to keep the status quo.
  • remove_vote - Cancel a previous vote, this must be done by the voter before the vote ends.
Fast Track Origin

This call can only be made by the FastTrackOrigin.

  • table_proposal - Upgrades a proposal to a referendum with the normal VotingPeriod.
  • fast_track - Upgrades a proposal to a referendum with the FastTrackVotingPeriod.
  • fast_track_referendum - Schedules an active referendum to end in FastTrackVotingPeriod blocks.
Root
  • cancel_referendum - Removes a referendum.
  • clear_public_proposals - Removes all public proposals.
  • cancel_proposal - Removes a proposal.

Re-exports

Modules

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.

Structs

  • Info regarding an ongoing referendum.
  • Info regarding an ongoing referendum.
  • A standard vote, one-way (approve or reject).
  • The account is voting directly.

Enums

Traits

Type Definitions