Skip to content

Commit

Permalink
Fix small typo in fungible token freeze docs (paritytech#4943)
Browse files Browse the repository at this point in the history
Hi!

In the course of a talk with @shawntabrizi in Singapore, we realized the
documentation related to freeze balances' a little bit confusing. It
stated that a frozen amount is released at some specified block number,
which isn't true in general.

This PR fixes that typo and further specifies that the frozen balance
may exceed the available balance, according to what we learned at the
PBA. This feature was not specified in the documentation AFAIK.

This is the first time I submit something to the polkadot SDK repo, so
please feel free to rephrase the docs I added in case I messed up!

---------

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: command-bot <>
  • Loading branch information
2 people authored and TarekkMA committed Aug 2, 2024
1 parent 8a1193a commit 61220cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions prdoc/pr_4943.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Update definition of frozen balance (docs PR)

doc:
- audience: Runtime Dev
description: |
This PR fixes a bug in the docs located in the definition of frozen balances. In addition, it extends that definition for completeness.

crates:
- name: frame-support
bump: patch
9 changes: 7 additions & 2 deletions substrate/frame/support/src/traits/tokens/fungible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,18 @@
//! 3 holds for 100 units, the account can spend its funds for any reason down to 300 units, at
//! which point the holds will start to come into play.
//!
//! - **Frozen Balance**: A freeze on a specified amount of an account's free balance until a
//! specified block number.
//! - **Frozen Balance**: A freeze on a specified amount of an account's balance. Tokens that are
//! frozen cannot be transferred.
//!
//! Multiple freezes always operate over the same funds, so they "overlay" rather than
//! "stack". This means that if an account has 3 freezes for 100 units, the account can spend its
//! funds for any reason down to 100 units, at which point the freezes will start to come into
//! play.
//!
//! It's important to note that the frozen balance can exceed the total balance of the account.
//! This is useful, eg, in cases where you want to prevent a user from transferring any fund. In
//! such a case, setting the frozen balance to `Balance::MAX` would serve that purpose
//! effectively.
//!
//! - **Minimum Balance (a.k.a. Existential Deposit, a.k.a. ED)**: The minimum balance required to
//! create or keep an account open. This is to prevent "dust accounts" from filling storage. When
Expand Down

0 comments on commit 61220cc

Please sign in to comment.