47 releases (29 major breaking)

new 31.0.0 Apr 9, 2024
30.0.0 Mar 18, 2024
29.0.0 Feb 26, 2024
28.0.0 Feb 13, 2024
2.0.0-alpha.5 Mar 24, 2020

#1357 in Magic Beans

Download history 468/week @ 2023-12-18 178/week @ 2023-12-25 775/week @ 2024-01-01 1125/week @ 2024-01-08 573/week @ 2024-01-15 799/week @ 2024-01-22 626/week @ 2024-01-29 806/week @ 2024-02-05 1420/week @ 2024-02-12 2154/week @ 2024-02-19 2088/week @ 2024-02-26 1013/week @ 2024-03-04 793/week @ 2024-03-11 1537/week @ 2024-03-18 1488/week @ 2024-03-25 1973/week @ 2024-04-01

5,882 downloads per month
Used in 67 crates (14 directly)

Apache-2.0

2.5MB
48K SLoC

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, 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 if 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 pallet.

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.

Dependencies

~17–30MB
~496K SLoC