Skip to content

Commit

Permalink
fork pallet-treasury and revert to upstream polkadot-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Oct 22, 2024
1 parent dabfea0 commit ff229db
Show file tree
Hide file tree
Showing 8 changed files with 3,875 additions and 448 deletions.
667 changes: 343 additions & 324 deletions Cargo.lock

Large diffs are not rendered by default.

249 changes: 125 additions & 124 deletions Cargo.toml

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions pallets/treasury/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[package]
name = "pallet-treasury"
version = "36.0.1"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
homepage = "https://substrate.io"
repository.workspace = true
description = "FRAME pallet to manage treasury (polkadot v1.15.0)"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parity-scale-codec = { features = ["derive", "max-encoded-len"], workspace = true }
docify = { workspace = true }
impl-trait-for-tuples = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
serde = { features = ["derive"], optional = true, workspace = true, default-features = true }
frame-benchmarking = { optional = true, workspace = true }
frame-support.workspace = true
frame-system.workspace = true
pallet-balances.workspace = true
sp-runtime.workspace = true
sp-core = { optional = true, workspace = true }

[dev-dependencies]
sp-io = { workspace = true }
pallet-utility = { workspace = true }
sp-core = { workspace = true }

[features]
default = ["std"]
std = [
"parity-scale-codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"pallet-balances/std",
"scale-info/std",
"serde",
"sp-core?/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"dep:sp-core",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"sp-runtime/try-runtime",
]
47 changes: 47 additions & 0 deletions pallets/treasury/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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:
- `spend_local` - Propose and approve a spend of treasury funds, enables the
creation of spends using the native currency of the chain, utilizing the funds
stored in the pot
- `spend` - Propose and approve a spend of treasury funds, allows spending any
asset kind managed by the treasury
- `remove_approval` - Force a previously approved proposal to be removed from
the approval queue
- `payout` - Claim a spend
- `check_status` - Check the status of the spend and remove it from the storage
if processed
- `void_spend` - Void previously approved spend


## Release

polkadot v1.15.0
- `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.
Loading

0 comments on commit ff229db

Please sign in to comment.