-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fork pallet-treasury and revert to upstream polkadot-sdk
- Loading branch information
Showing
8 changed files
with
3,683 additions
and
448 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.