Crate pallet_treasury
source ·Expand description
Made with Substrate, for Polkadot.
§Treasury Pallet
The Treasury pallet 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 Pallet itself provides the pot to store funds, and a means for stakeholders to propose and claim expenditures (aka spends). The chain will need to provide a method to approve spends (e.g. public referendum) and a method for collecting funds (e.g. inflation, fees).
By way of example, stakeholders 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.
- Pot: Unspent funds accumulated by the treasury pallet.
§Pallet API
See the pallet
module for more information about the interfaces this pallet exposes,
including its configuration trait, dispatchables, storage items, events and errors.
Re-exports§
pub use weights::WeightInfo;
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_treasury
Structs§
- A spending proposal.
- TypedGet implementation to get the AccountId of the Treasury.
Traits§
- 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 Aliases§
- An index of a proposal. Just a
u32
.