14 releases (3 stable)

3.0.0 Feb 10, 2021
2.0.1 Jan 11, 2021
2.0.0 Sep 22, 2020
2.0.0-rc5 Jul 24, 2020
2.0.0-alpha.5 Mar 24, 2020

#1258 in Magic Beans

Download history 136/week @ 2021-08-07 120/week @ 2021-08-14 104/week @ 2021-08-21 42/week @ 2021-08-28 63/week @ 2021-09-04 325/week @ 2021-09-11 137/week @ 2021-09-18 129/week @ 2021-09-25 69/week @ 2021-10-02 109/week @ 2021-10-09 58/week @ 2021-10-16 91/week @ 2021-10-23 53/week @ 2021-10-30 67/week @ 2021-11-06 20/week @ 2021-11-13 84/week @ 2021-11-20

1,094 downloads per month
Used in 5 crates

Apache-2.0

1MB
21K SLoC

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 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 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.

Dependencies

~3.5–7MB
~135K SLoC

N$`