Fungible Token Standard
Outdated Version
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
Summary
The FungibleMintable
trait extends the FungibleToken
trait to provide the capability to mint tokens.
Events
mint_event
: broadcasted to the network when themint()
function is invoked.
- Capped
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
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 theburn()
orburn_from()
function is invoked.
- Metadata
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.