Previous Versionsv0.2.0Tokens

Fungible Token Standard

Outdated Version

You're viewing an older version (v0.2.0) The latest documentation is available for the current version. Click here to visit latest version.

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

We provide the below extensions to enhance the capabilities of the Fungible Token Standard.

- Mintable

Source Code

Summary

The FungibleMintable 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.

- Capped

Source Code

Summary

The Capped trait extends the FungibleToken trait to provide the capability to set a maximum supply for the token.

Note that the Capped trait is designed to be used in conjunction with the Mintable trait.

Events

There are no custom events associated with the Capped trait.

- Burnable

Source Code

Summary

The FungibleBurnable 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 FungibleBurnable 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

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.

Misc

To comply with the SEP-41 specification, a contract must implement both the FungibleToken and FungibleBurnable traits. These traits together provide all the necessary methods to conform to soroban_sdk::token::TokenInterface, offering another way to meet the SEP-41 requirements.

For contracts that implement both FungibleToken and FungibleBurnable, and also need to implement TokenInterface, we provide the impl_token_interface! macro. This macro automatically generates the required boilerplate, simplifying the implementation process.