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 Preimage Deposit #5264

Merged
merged 6 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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 added docs/assets/claim-preimage-deposit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 33 additions & 12 deletions docs/learn/learn-guides-polkadot-opengov.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ a referendum, you must specify the `referenda.cancel` extrinsic of referendum `2
![cancel-referenda-preimage-creation](../assets/cancel-referenda-preimage-creation.png)

This call will cancel the referendum and return the deposit. You can also kill a referendum using
the `referenda.kill` extrinsic. This will cancel the referendum and slash the deposit. Note that
creating a preimage will reserve some funds proportionally to the amount of information stored
within the preimage. In this case, the deposit was 1.33 KSM (see
[Subscan](https://kusama.subscan.io/extrinsic/19143604-2)).
the `referenda.kill` extrinsic. This will cancel the referendum and slash the deposit.

:::info Preimage Submission Deposit

A deposit is required for the preimage to be stored on chain. The preimage deposit is proportional
to the amount of information stored within the preimage. The deposit amount required for a preimage
with a treasury spend transaction is around
{{ polkadot: 41 DOT :polkadot }}{{ kusama: 1.4 KSM :kusama }}. Ensure you have enough account
balance to pay for the submission deposit and the transaction fees.
filippoweb3 marked this conversation as resolved.
Show resolved Hide resolved

:::

Once a preimage is submitted, it can be checked under
[Governance > Preimages](https://polkadot.js.org/apps/#/preimages).
Expand Down Expand Up @@ -66,16 +73,30 @@ 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
period will lead to a referendum timeout.

## Request Submission and Decision Deposit Back
## Claiming the Preimage and Decision Deposits

After a referendum finishes its life cycle (and gets approved or rejected or timed out), the
preimage and decision deposits can be claimed. For claiming the preimage deposit, navigate to
[Polkadot-JS UI > Governance > Preimages](https://polkadot.js.org/apps/#/preimages) and click on
unnote button shown on the preimage you submitted.

![Claim Preimage Deposit](../assets/claim-preimage-deposit.png)

Similarly, to claim the decision deposit, navigate to
[Polkadot-JS UI > Governance > Referenda](https://polkadot.js.org/apps/#/referenda) and scroll down
to the end of the page to click on the referenda with the decision deposit and claim it.

![Claim Referendum Deposits](../assets/claim-referendum-decision-deposit.png)

## Claiming the Submission Deposit
filippoweb3 marked this conversation as resolved.
Show resolved Hide resolved

If you submitted a proposal and a referendum for such proposal has ended, you can claim your
submission and decision deposits back by issuing the `refundSubmissionDeposit` and the
`refundDecisionDeposit` extrinsics, respectively. Those calls will succeed if the proposal is
completed as passing or failing.
The submission deposit for a referendum can be claimed
[only if the referendum was `Approved` or `Canceled`](https://github.com/paritytech/polkadot-sdk/blob/cfb29254f74412cea35e8048d8aea94bc789fcb1/substrate/frame/referenda/src/types.rs#L261).
The submission deposit can be claimed by issuing the `refundSubmissionDeposit` extrinsic.

Users can not refund their submission deposit while the referendum is `Ongoing`. Similarly, users
cannot refund their submission deposit if the proposal has `TimedOut` (failing to submit the
decision deposit within a
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
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
Expand Down
28 changes: 17 additions & 11 deletions docs/learn/learn-guides-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ that requests 100 DOT from Treasury.

:::info Preimage Submission Deposit

A deposit is required for the preimage to be stored on chain. The deposit amount required for a
preimage with a treasury spend transaction is around
A deposit is required for the preimage to be stored on chain. The preimage deposit is proportional
to the amount of information stored within the preimage. The deposit amount required for a preimage
with a treasury spend transaction is around
{{ polkadot: 41 DOT :polkadot }}{{ kusama: 1.4 KSM :kusama }}. Ensure you have enough account
balance to pay for the submission deposit and the transaction fees.

Expand Down Expand Up @@ -103,13 +104,8 @@ in this document.

![Submit Treasury Proposal Decision Deposit](../assets/treasury/treasury-proposal-decision-deposit.png)

### Claiming the Preimage and Decision Deposits

After the referendum finishes its life cycle (and gets approved or rejected or timed out), the
deposits can be claimed. For claiming the preimage deposit, navigate to Polkadot-JS UI >
Governance > Preimages and click on unnote button shown on the preimage you submitted. Similarly, to
claim the decision deposit, navigate to Polkadot-JS UI > Governance > Referenda and scroll down to
the end of the page to click on the referenda with the decision deposit and claim it.
The preimage and decision deposits
[can be claimed once the referendum ends](./learn-guides-polkadot-opengov.md#claiming-the-preimage-and-decision-deposits).

## Requesting Tips from the Treasury

Expand All @@ -121,5 +117,15 @@ 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, and
- Submit a proposal to the right track (i.e. `30` or `31`) using the preimage hash.
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
- Notify the
{{ 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
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)