Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8a4b955
wip
liamaharon Dec 23, 2023
4aa41fd
Merge branch 'master' into liam-tokens-docs
liamaharon Feb 28, 2024
8e24dbc
update cargo.lock
liamaharon Feb 28, 2024
ef7c3dd
wip
liamaharon Feb 28, 2024
8a9a95a
Merge branch 'master' into liam-tokens-docs
liamaharon Feb 29, 2024
1204191
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 1, 2024
1d1b71e
wip fungible docs
liamaharon Mar 13, 2024
db18a5f
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 13, 2024
96c2993
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 13, 2024
3a0c39c
document pallets and traits
liamaharon Mar 15, 2024
c34c01d
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 15, 2024
5d4e2d4
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
f0e9ce5
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
304b6a7
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
bacaa72
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
25c1cb3
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
e86c7a9
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
41a3cb8
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
f389aa7
Update docs/sdk/src/reference_docs/mod.rs
liamaharon Mar 15, 2024
9ff81e1
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
c8d04a9
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
34d33a3
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
39227f2
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
fc10027
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
4ad31f5
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
e56bcbf
Update substrate/frame/balances/src/lib.rs
liamaharon Mar 15, 2024
58aca97
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
ca849d0
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 15, 2024
6101352
Update docs/sdk/src/reference_docs/tokens_in_substrate.rs
liamaharon Mar 15, 2024
44e22cd
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 19, 2024
566dd5d
rename frame tokens
liamaharon Mar 19, 2024
c0eab83
rustfmt
liamaharon Mar 19, 2024
b884b43
address comments
liamaharon Mar 19, 2024
32a86a0
Update substrate/frame/assets/src/lib.rs
liamaharon Mar 19, 2024
1b27d16
Update substrate/frame/balances/src/lib.rs
liamaharon Mar 19, 2024
7ac73c5
link back to parent doc
liamaharon Mar 20, 2024
af05963
add note regarding ItemOf
liamaharon Mar 20, 2024
28ef429
remove frame_currency
liamaharon Mar 20, 2024
d59f203
add additional notes on holds and freezes
liamaharon Mar 21, 2024
cbc8752
further freeze vs hold discussion
liamaharon Mar 21, 2024
463eb3e
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 21, 2024
dd14974
Update substrate/frame/balances/src/lib.rs
liamaharon Mar 22, 2024
1986c08
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
b6924b2
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
193ae2b
address comments
liamaharon Mar 26, 2024
2248dfb
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 26, 2024
7894ca0
Update substrate/frame/support/src/traits/tokens/fungible/mod.rs
liamaharon Mar 26, 2024
a4fd664
address comments
liamaharon Mar 26, 2024
1817539
merge
liamaharon Mar 26, 2024
11ebcfa
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 26, 2024
ed3bfff
fmt
liamaharon Mar 26, 2024
3521ea2
add note about removing hold/freeze reasons
liamaharon Mar 26, 2024
5654274
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
1774c51
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
1e67f42
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
77d9fc9
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
c7cca8a
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 26, 2024
0cb5e77
fix nft docs
liamaharon Mar 26, 2024
0f33d96
Update docs/sdk/src/reference_docs/frame_tokens.rs
liamaharon Mar 29, 2024
d4fd9e0
Merge branch 'master' into liam-tokens-docs
liamaharon Mar 29, 2024
3a8f2b2
Merge branch 'master' into liam-tokens-docs
kianenigma Mar 31, 2024
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
Prev Previous commit
Next Next commit
address comments
  • Loading branch information
liamaharon committed Mar 26, 2024
commit 193ae2b188cd5e4b12bdad1f5ac26b25dfce309c
52 changes: 27 additions & 25 deletions docs/sdk/src/reference_docs/frame_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
//! trait implementations.
//!
//! **Traits** define common interfaces that types of tokens should implement. For example, the
//! [`frame_support::traits::fungible::Inspect`] trait specifies an interface for *inspecting*
//! token state such as the total issuance of the token, the balance of individual accounts, etc.
//! [`fungible::Inspect`](`frame_support::traits::fungible::Inspect`) trait specifies an interface
//! for *inspecting* token state such as the total issuance of the token, the balance of individual
//! accounts, etc.
//!
//! **Trait implementations** are concrete implementations of these traits. For example, one of the
//! many traits [`pallet_balances`] implements is [`frame_support::traits::fungible::Inspect`]*.
//! many traits [`pallet_balances`] implements is
//! [`fungible::Inspect`](`frame_support::traits::fungible::Inspect`)*.
//!
//! The distinction between traits and trait implementations is helpful because it allows pallets
//! and other logic to be generic over their dependencies, avoiding tight coupling.
Expand All @@ -69,45 +71,45 @@
//! [`pallet_balances`], [`pallet_assets`], and every other token-handling pallet a user
//! could possibly specify, [`pallet_preimage`] does not specify a concrete pallet as a dependency
//! but instead accepts any dependency which implements the
//! [`frame_support::traits::tokens::currency::ReservableCurrency`] trait. This allows
//! [`pallet_preimage`] to support any arbitrary pallet implementing this trait, without needing any
//! knowledge of what those pallets may be or requiring changes to support new pallets which may be
//! written in the future.
//! [`currency::ReservableCurrency`](`frame_support::traits::tokens::currency::ReservableCurrency`)
//! trait. This allows [`pallet_preimage`] to support any arbitrary pallet implementing this trait,
//! without needing any knowledge of what those pallets may be or requiring changes to support new
//! pallets which may be written in the future.
//!
//! Read more about coupling, and the benefits to loose coupling
//! [here](crate::reference_docs::frame_pallet_coupling).
//!
//! ##### *Rust Advanced Tip
//!
//! The knowledge that [`pallet_balances`] implements [`frame_support::traits::fungible::Inspect`]
//! is not some arcane knowledge that you have to know by heart or memorize. One can
//! simply look at the list of the implementors of any trait in the Rust Doc to find all
//! implementors (e.g.
//! The knowledge that [`pallet_balances`] implements
//! [`fungible::Inspect`](`frame_support::traits::fungible::Inspect`) is not some arcane knowledge
//! that you have to know by heart or memorize. One can simply look at the list of the implementors
//! of any trait in the Rust Doc to find all implementors (e.g.
//! <https://paritytech.github.io/polkadot-sdk/master/frame/traits/tokens/fungible/trait.Mutate.html#implementors>),
//! or use the `rust-analyzer` `Implementations` action.
//!
//! ## Fungible Token Traits in FRAME
//!
//! The [`frame_support::traits::fungible`] crate contains the latest set of FRAME
//! The [`fungible`](`frame_support::traits::fungible`) crate contains the latest set of FRAME
//! fungible token traits, and is recommended to use for all new logic requiring a fungible token.
//! See the crate documentation for more info about these fungible traits.
//!
//! [`frame_support::traits::fungibles`] provides very similar functionality to
//! [`frame_support::traits::fungible`], except it supports managing multiple tokens.
//! [`fungibles`](`frame_support::traits::fungibles`) provides very similar functionality to
//! [`fungible`](`frame_support::traits::fungible`), except it supports managing multiple tokens.
//!
//! You may notice the trait [`frame_support::traits::Currency`] with similar functionality is also
//! used in the codebase, however this trait is deprecated and existing logic is in the process of
//! being migrated to [`frame_support::traits::fungible`] ([tracking issue](https://github.com/paritytech/polkadot-sdk/issues/226)).
//! You may notice the trait [`Currency`](`frame_support::traits::Currency`) with similar
//! functionality is also used in the codebase, however this trait is deprecated and existing logic
//! is in the process of being migrated to [`fungible`](`frame_support::traits::fungible`) ([tracking issue](https://github.com/paritytech/polkadot-sdk/issues/226)).
//!
//! ## Fungible Token Trait Implementations in FRAME
//!
//! [`pallet_balances`] implements [`frame_support::traits::fungible`], and is the most commonly
//! used fungible implementation in FRAME. Most of the time, it's used for managing the native
//! token of the blockchain network it's used in.
//! [`pallet_balances`] implements [`fungible`](`frame_support::traits::fungible`), and is the most
//! commonly used fungible implementation in FRAME. Most of the time, it's used for managing the
//! native token of the blockchain network it's used in.
//!
//! [`pallet_assets`] implements [`frame_support::traits::fungibles`], and is another popular
//! fungible token implementation. It supports the creation and management of multiple assets in a
//! single crate, making it a good choice when a network requires more assets in
//! [`pallet_assets`] implements [`fungibles`](`frame_support::traits::fungibles`), and is another
//! popular fungible token implementation. It supports the creation and management of multiple
//! assets in a single crate, making it a good choice when a network requires more assets in
//! addition to its native token.
//!
//! ## Non-Fungible Tokens in FRAME
Expand All @@ -120,7 +122,7 @@
//! # What Next?
//!
//! - If you are interested in implementing a single fungible token, continue reading the
//! [`frame_support::traits::fungible`] and [`pallet_balances`] docs.
//! [`fungible`](`frame_support::traits::fungible`) and [`pallet_balances`] docs.
//! - If you are interested in implementing a set of fungible tokens, continue reading the
//! [`frame_support::traits::fungibles`] trait and [`pallet_assets`] docs.
//! [`fungibles`](`frame_support::traits::fungibles`) trait and [`pallet_assets`] docs.
//! - If you are interested in implementing an NFT, continue reading the [`pallet_uniques`] docs.