From 01ba9adb63ec0c99250174225c362a51e1ceba18 Mon Sep 17 00:00:00 2001 From: Nicole Zhu Date: Tue, 23 Apr 2019 20:03:33 +0200 Subject: [PATCH] Documentation: Treasury module (#2269) * Add: draft of treasury doc * Update srml/treasury/src/lib.rs Co-Authored-By: nczhu --- substrate/srml/treasury/src/lib.rs | 43 +++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/substrate/srml/treasury/src/lib.rs b/substrate/srml/treasury/src/lib.rs index 4c2bd0ede6..c0a43bc8f6 100644 --- a/substrate/srml/treasury/src/lib.rs +++ b/substrate/srml/treasury/src/lib.rs @@ -14,7 +14,48 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -//! The Treasury: Keeps account of the taxed cash and handles its deployment. +//! # Treasury Module +//! +//! The `treasury` module keeps account of currency in a `pot` and manages the subsequent +//! deployment of these funds. +//! +//! ## Overview +//! +//! Funds for treasury are raised in two ways: +//! 1. By minting new tokens, leading to inflation, and +//! 2. By channeling tokens from transaction fees and slashing. +//! +//! Treasury funds can be used to pay for developers who provide software updates, +//! any changes decided by referenda, and to generally keep the system running smoothly. +//! +//! Treasury can be used with other modules, such as to tax validator rewards in the `staking` module. +//! +//! ### Implementations +//! +//! The treasury module provides an implementation for the following trait: +//! - `OnDilution` - Mint extra funds upon dilution; maintain the ratio of `portion` diluted to `total_issuance`. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! - `propose_spend` - Propose a spending proposal and stake a proposal deposit. +//! - `set_pot` - Set the spendable balance of funds. +//! - `configure` - Configure the module's proposal requirements. +//! - `reject_proposal` - Reject a proposal and slash the deposit. +//! - `approve_proposal` - Accept the proposal and return the deposit. +//! +//! Please refer to the [`Call`](./enum.Call.html) enum and its associated variants for documentation on each function. +//! +//! ### Public Functions +//! +//! See the [module](./struct.Module.html) for details on publicly available functions. +//! +//! ## Related Modules +//! +//! The treasury module depends on the `system` and `srml_support` modules as well as +//! Substrate Core libraries and the Rust standard library. +//! #![cfg_attr(not(feature = "std"), no_std)]