Skip to content

Commit

Permalink
Docs update (#24)
Browse files Browse the repository at this point in the history
* docs update
  • Loading branch information
ozgunozerk authored Jan 31, 2025
1 parent 57b61a6 commit 01dbcb5
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 5 deletions.
9 changes: 7 additions & 2 deletions docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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


42 changes: 39 additions & 3 deletions docs/modules/ROOT/pages/tokens/fungible.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,49 @@
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= Fungible Token Standard

== Source Code link: // TODO
https://github.com/OpenZeppelin/stellar-contracts/tree/main/contracts/token/fungible[Source Code]

== Purpose

The Fungible Token Standard is a contract template designed to facilitate the creation and management of fungible tokens on the Stellar network.
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.
35 changes: 35 additions & 0 deletions docs/modules/ROOT/pages/utils/pausable.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
:source-highlighter: highlight.js
:highlightjs-languages: rust
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= 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);
}
```

0 comments on commit 01dbcb5

Please sign in to comment.