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

Add info spend period and remove info from archived treasury doc #5283

Merged
merged 15 commits into from
Oct 19, 2023
5 changes: 4 additions & 1 deletion components/RPC-Connection.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from "react";
import { ApiPromise, WsProvider } from "@polkadot/api";
import { HumanReadable, Precise, BlocksToDays, Percentage, ArrayLength } from "./utilities/filters";
import { HumanReadable, Precise, BlocksToDays, Percentage, PermillToPercent, ArrayLength } from "./utilities/filters";

/*
This component connects to the Polkadot/Kusama APIs and renders the response data.
Expand Down Expand Up @@ -146,6 +146,9 @@ function applyFilter(value, filter, network, setReturnValue) {
case "percentage":
Percentage(value, setReturnValue);
break;
case "permillToPercent":
PermillToPercent(value, setReturnValue);
break;
case "arrayLength":
ArrayLength(value, setReturnValue);
break;
Expand Down
6 changes: 6 additions & 0 deletions components/utilities/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ module.exports = {
setReturnValue(value.toString());
},

PermillToPercent: function (value, setReturnValue) {
value = (value) / 10000;
// Update value
setReturnValue(value.toString());
},

ArrayLength: function (value, setReturnValue) {
value = value.split(',').length;
// Update value
Expand Down
Binary file added docs/assets/treasury/treasury-spend-period.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/general/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,14 @@ consensus rules but upgraded clients are still compatible with old consensus rul
A collection of software tools (and programs) packaged together that can be used to develop
software.

## Spend Period

Successfully enacted Treasury track referenda will get funded at the end of the spending period that
resets every
{{ polkadot: <RPC network="polkadot" path="consts.treasury.spendPeriod" defaultValue={345600} filter="blocksToDays"/> :polkadot }}
{{ kusama: <RPC network="kusama" path="consts.treasury.spendPeriod" defaultValue={86400} filter="blocksToDays"/> :kusama }}
days. Treasury funds are directly sent to the beneficiary account at the end of the spend period.

## Staking

The act of bonding tokens for {{ polkadot: Polkadot (DOT) :polkadot }}
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/learn-guides-polkadot-opengov.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Once the proposal has been submitted, it will stay in the Lead-in period until t
within the track, and a
[track-dependent preparation period and decision deposit](../maintain/maintain-guides-polkadot-opengov.md#polkadot-opengov-terminology-and-parameters)
have been met. Failing to submit the decision deposit within a
{{ polkadot: <RPC network="polkadot" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
{{ polkadot: <RPC network="polkadot" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
period will lead to a referendum timeout.

## Claiming the Preimage and Decision Deposits
Expand All @@ -97,7 +97,7 @@ The submission deposit can be claimed by issuing the `refundSubmissionDeposit` e
Users can not refund their submission deposit while the referendum is `Ongoing` or `Rejected`.
Similarly, users cannot refund their submission deposit if the proposal has `TimedOut` (failing to
submit the decision deposit within a
{{ polkadot: <RPC network="polkadot" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
{{ polkadot: <RPC network="polkadot" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
period will lead to a referendum timeout). This behavior exists so that users can refrain from
spamming the chain with proposals that have no interest from the community. If a proposal is in the
`TimedOut` state, any user can call `slash_proposal_deposit`, which will move the funds from the
Expand Down
2 changes: 1 addition & 1 deletion docs/learn/learn-guides-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Briefly, you will need to:
{{ polkadot: [Polkadot Direction Element Channel](https://matrix.to/#/#Polkadot-Direction:parity.io) :polkadot }}{{ kusama: [Kusama Direction Element Channel](https://matrix.to/#/#Polkadot-Direction:parity.io) :kusama }}
about your referendum
- Place the decision deposit before the
{{ polkadot: <RPC network="polkadot" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="const.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
{{ polkadot: <RPC network="polkadot" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :polkadot }}{{ kusama: <RPC network="kusama" path="consts.referenda.undecidingTimeout" defaultValue={201600} filter="blocksToDays"/> :kusama }}-day
timeout
- Once the referendum ends you can
[claim the preimage and decision deposits back](./learn-guides-polkadot-opengov.md#claiming-the-preimage-and-decision-deposits)
22 changes: 16 additions & 6 deletions docs/learn/learn-polkadot-opengov-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,23 @@ mechanisms:

The outflow is determined by the following mechanisms:

- **Burned tokens:** at the end of each spending period lasting
{{ polkadot: 24 days on Polkadot, 1% :polkadot }}{{ kusama: 6 days on Kusama, 0.2% :kusama }} of
the available funds are burned, respectively.
- **Burned tokens:** at the end of each spend period
{{ polkadot: <RPC network="polkadot" path="consts.treasury.burn" defaultValue={10000} filter="permillToPercent"/> :polkadot }}{{ kusama: <RPC network="kusama" path="consts.treasury.burn" defaultValue={2000} filter="permillToPercent"/> :kusama }}%
of the available funds are burned.
- **Treasury proposals & Bounties:** they make up the largest share of outflow tokens to the
community and need to be approved by governance. Then, payouts occur at the end of a spending
period.
- **Tips:** smaller payouts directly to grantees that can happen within a spending period.
community and need to be approved by governance. Then, payouts occur at the end of a
[spend period](../general/glossary.md#spend-period).
- **Tips:** smaller payouts directly to grantees that can happen within a
[spend period](../general/glossary.md#spend-period).

:::info Spend Period Schedule

On Polkadot-JS UI, navigate to Governance > Treasury to view the status of current
[spend period](../general/glossary.md#spend-period).

![preimage-whitelist](../assets/treasury/treasury-spend-period.png)

:::

## Treasury Tracks

Expand Down
Loading