Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial treasury docs #5678

Merged
merged 16 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/assets/treasury/treasury-preimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/learn/learn-guides-polkadot-opengov.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Follow the steps below to submit a preimage as shown in the screenshot above.
2. Click on the "Add preimage" button.
3. From the _propose_ drop-down field, select `treasury`.
4. From the unlabeled drop-down field to the right of the _propose_ drop-down field, select
`spend(amount, beneficiary)`.
`spendLocal(amount, beneficiary)`.
5. In the `amount: Compact<u128> (BalanceOf)` text field, enter the spend amount.
6. The `beneficiary: MultiAddress (AccountIdLookupOf)` drop-down field will have `Id` selected by
default. Select the beneficiary from the `Id: AccountId` drop-down field.
Expand Down
6 changes: 3 additions & 3 deletions docs/learn/learn-guides-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ that requests 100 DOT from Treasury.
- Navigate to [Polkadot-JS UI > Governance > Preimages](https://polkadot.js.org/apps/#/preimages)
and then click on Add Preimage.
- Select the account which will be used to submit the preimage.
- Choose `treasury` pallet in the "propose" dropdown and the `spend(amount, beneficiary)`call
- Choose `treasury` pallet in the "propose" dropdown and the `spend_local(amount, beneficiary)`call
- Enter the DOT amount.
- Enter the AccountID of the beneficiary (which has a verified on-chain identity).
- Submit preimage
Expand Down Expand Up @@ -141,8 +141,8 @@ to the `32 / Small Spender` track, you will need to submit it to the `30 / Small

Briefly, you will need to:

- Create a preimage using the `treasury.Spend` extrinsic and specifying the number of tokens and the
beneficiary of the tip
- Create a preimage using the `treasury.spendLocal` extrinsic and specifying the number of tokens
and the beneficiary of the tip
- Submit a proposal to the right track (i.e. `30` or `31`) using the preimage hash
- Once you started the referendum go to [Polkassembly](https://polkassembly.io/), log in with the
proposer account and edit the referendum details
Expand Down
37 changes: 36 additions & 1 deletion docs/learn/learn-polkadot-opengov-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ slug: ../learn-polkadot-opengov-treasury
import RPC from "./../../components/RPC-Connection";

The Treasury is a pot of funds collected through a portion of block production rewards, transaction
fees, slashing, and [staking inefficiencies](./learn-inflation.md).Treasury funds are held in a
fees, slashing, and [staking inefficiencies](./learn-inflation.md). Treasury funds are held in a
[system account](./learn-account-advanced.md#system-accounts) that cannot be controlled by any
external account; only the system internal logic can access it.

Expand Down Expand Up @@ -79,6 +79,41 @@ track on-chain. Learn how to submit a treasury proposal for referendum

:::

## Sub-treasuries

The {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} treasury currently operates under
a single account on-chain. The above tracks manage the treasury and represent the funds on the
network. However, creating _sub_-treasuries that correspond to each
[collective](./learn-system-chains#collectives) is also possible.
CrackTheCode016 marked this conversation as resolved.
Show resolved Hide resolved

Rather than have many referenda on the relay chain, the overarching
CrackTheCode016 marked this conversation as resolved.
Show resolved Hide resolved
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} Treasury can allocate funds to each
sub-treasury (through [governance](./learn-polkadot-opengov)), from which each respective collective
can spend funds (depending on their specific rule set).

New treasuries could be added to respective
[system chains](./learn-system-chains#existing-system-chains) through governance by adding more
instances of this pallet.

## Multi-Asset Treasury Support

The use of [cross-consensus messaging](./learn-xcm.md) would also mean that these treasuries can
support multiple asset types, and thus can spend assets other than
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} held within the treasury. These assets have a
few requirements:
CrackTheCode016 marked this conversation as resolved.
Show resolved Hide resolved

1. The asset is listed on the [AssetHub system parachain](https://assethub-polkadot.subscan.io/).
2. The asset is active and has sufficient liquidity to be utilized for payouts.
3. The asset has a set conversion rate, as per OpenGov referenda on the Treasurer track (set via the
CrackTheCode016 marked this conversation as resolved.
Show resolved Hide resolved
asset rate pallet). This conversion rate defines a fixed-rate representation for converting from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? How can the conversion rate be fixed, given the assets are volatile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant a fixed point, not a fixed rate, although I think that is the case anyway, as the rate is a FixedI128 set in the StorageMap and can be updated. not sure what the strategy is to maintain it unless I am misunderstanding something.

For more detail, take a look here, and how the rate is set in the pallet: https://github.com/paritytech/polkadot-sdk/blob/475e7a147676a4e7a9d255ddc7969dd35ea22882/substrate/frame/asset-rate/src/lib.rs#L18

that asset to {{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }}.
4. The asset must be approved and onboarded via OpenGov to become spendable via the treasury as a
CrackTheCode016 marked this conversation as resolved.
Show resolved Hide resolved
valid spend method.

> For example,
> [see how USDT became approved as an asset on AssetHub](https://forum.polkadot.network/t/multi-asset-treasury-and-milestone-based-spends/6780),
> which can be used in the treasury.

## Bounties

### Parent Bounties
Expand Down
Loading