Crate pallet_treasury[][src]

Treasury Module

The Treasury module provides a "pot" of funds that can be managed by stakeholders in the system and a structure for making spending proposals from this pot.

Overview

The Treasury Module itself provides the pot to store funds, and a means for stakeholders to propose, approve, and deny expenditures. The chain will need to provide a method (e.g. inflation, fees) for collecting funds.

By way of example, the Council could vote to fund the Treasury with a portion of the block reward and use the funds to pay developers.

Terminology

  • Proposal: A suggestion to allocate funds from the pot to a beneficiary.
  • Beneficiary: An account who will receive the funds from a proposal iff the proposal is approved.
  • Deposit: Funds that a proposer must lock when making a proposal. The deposit will be returned or slashed if the proposal is approved or rejected respectively.
  • Pot: Unspent funds accumulated by the treasury module.

Interface

Dispatchable Functions

General spending/proposal protocol:

  • propose_spend - Make a spending proposal and stake the required deposit.
  • reject_proposal - Reject a proposal, slashing the deposit.
  • approve_proposal - Accept the proposal, returning the deposit.

GenesisConfig

The Treasury module depends on the GenesisConfig.

Re-exports

pub use weights::WeightInfo;
pub use $crate::traits::GetPalletVersion as _;

Modules

weights

Autogenerated weights for pallet_treasury

Structs

Approvals

Proposal indices that have been approved but not yet awarded.

DefaultInstance

Default module instance

GenesisConfig

Genesis config for the module, allow to build genesis storage.

Instance0

Module instance

Instance1

Module instance

Instance2

Module instance

Instance3

Module instance

Instance4

Module instance

Instance5

Module instance

Instance6

Module instance

Instance7

Module instance

Instance8

Module instance

Instance9

Module instance

Instance10

Module instance

Instance11

Module instance

Instance12

Module instance

Instance13

Module instance

Instance14

Module instance

Instance15

Module instance

Module
Proposal

A spending proposal.

Proposals

Proposals that have been made.

Enums

Call

Dispatchable calls.

Error

Error for the treasury module.

RawEvent

Events for this module.

Traits

Config
SpendFunds

A trait to allow the Treasury Pallet to spend it's funds for other purposes. There is an expectation that the implementer of this trait will correctly manage the mutable variables passed to it:

Type Definitions

BalanceOf
Event

RawEvent specialized for the configuration Config

NegativeImbalanceOf
PositiveImbalanceOf
ProposalIndex

An index of a proposal. Just a u32.