diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index a60d4e5..41aaf32 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -12,10 +12,15 @@ Explore our implementations for token standards on Stellar Soroban: - **Non-Fungible Tokens**: Unique digital assets with verifiable ownership (work in progress). - **Multi-Token**: Hybrid tokens enabling both fungible and non-fungible token functionalities (work in progress). -== Audits +== Utilities +Discover our utility contracts for Stellar Soroban, applicable to all token standards mentioned above: + +- **xref:utils/pausable.adoc[Pausable]** + +// == Audits // TODO: You can find our audit reports here. -== Get Started +// == Get Started // TODO: link to the Wizard diff --git a/docs/modules/ROOT/pages/tokens/fungible.adoc b/docs/modules/ROOT/pages/tokens/fungible.adoc index e079e8c..dde7aa2 100644 --- a/docs/modules/ROOT/pages/tokens/fungible.adoc +++ b/docs/modules/ROOT/pages/tokens/fungible.adoc @@ -3,7 +3,7 @@ :github-icon: pass:[] = Fungible Token Standard -== Source Code link: // TODO +https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/token/fungible[Source Code] == Purpose @@ -11,5 +11,41 @@ The Fungible Token Standard is a contract template designed to facilitate the cr It provides a flexible and secure framework for defining and managing token standards, enabling developers to create and manage tokens with ease. == Extensions -* Mintable: // TODO -* Burnable: // TODO + +We provide the below extensions to enhance the capabilities of the Fungible Token Standard. + +=== - Mintable +https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/token/fungible/src/extensions/mintable[Source Code] + +==== Summary +The `Mintable` trait extends the `FungibleToken` trait to provide the capability to mint tokens. + +==== Events +* `mint_event` : broadcasted to the network when the `mint()` function is invoked. + +=== - Burnable +https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/token/fungible/src/extensions/burnable[Source Code] + +==== Summary +The `Burnable` trait extends the `FungibleToken` trait to provide the +capability to burn tokens. + +To fully comply with the SEP-41 specification one have to implement the +this `Burnable` trait along with the `[FungibleToken]` trait. +SEP-41 mandates support for token burning to be considered compliant. + +Excluding the `burn` functionality from the `[FungibleToken]` trait +is a deliberate design choice to accommodate flexibility and customization +for various smart contract use cases. + +==== Events +* `burn_event`: broadcasted to the network when the `burn()` or `burn_from()` function is invoked. + +=== - Metadata +https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/token/fungible/src/extensions/metadata[Source Code] + +==== Summary +Provides `setter` and `getter` methods for `symbol`, `name`, and `decimal` metadata information for your token. + +==== Events +There are no custom events associated with the `Metadata` trait. diff --git a/docs/modules/ROOT/pages/utils/pausable.adoc b/docs/modules/ROOT/pages/utils/pausable.adoc new file mode 100644 index 0000000..204f83e --- /dev/null +++ b/docs/modules/ROOT/pages/utils/pausable.adoc @@ -0,0 +1,35 @@ +:source-highlighter: highlight.js +:highlightjs-languages: rust +:github-icon: pass:[] += Fungible Token Standard + +== Source Code link: https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/utils/pausable[pausable] + +== Purpose + +Allows contracts to be paused and unpaused by authorized accounts. + +This utility contract can be used with any token standard (fungible, non-fungible, multi-token). + +== Design + +To make it easier to spot when inspecting the code, we turned this simple functionality into a macro that can annotate your smart contract functions. + + +An example: +```rust +#[when_paused] +pub fn emergency_reset(e: &Env) { + e.storage().instance().set(&DataKey::Counter, &0); +} +``` + +Which will expand into the below code: + +```rust +pub fn emergency_reset(e: &Env) { + when_paused(e); + + e.storage().instance().set(&DataKey::Counter, &0); +} +```