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

Docs update #24

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
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);
}
```