Fungible tokens are digital assets that can be sent, received, combined, and divided.
This contract implements a basic fungible token that conforms to the SIP-010 FT standard. Be sure to change the placeholder name of the collection, as well as any other variables or references to your new project.
In Stacks Improvement Proposal 010 (SIP-010), the Stacks community proposed and approved a standard set of functions that every fungible token contract is to implement to qualify as a compliant fungible token on the Stacks chain. This creates uniformity and predictability in contract interactions, as well as enables a handful of built-in Clarity functions accessible only to SIP-010 contracts (such as ft-transfer?
, etc.).
Those functions are specified in the SIP and must be implemented in each contract. Trait conformance is then asserted with an impl-trait
declaration at the top of the contract pointing to the relevant trait reference published on the Stacks mainnet.
You can see this sip-010-trait
reference in the Hiro Stacks Explorer.
You can manually test your contract in the Clarinet console. After entering the console with clarinet console
you can make contract function calls like
(contract-call? .ft mint u100)
(contract-call? .ft get-balance tx-sender)
You can programmatically test your contracts with unit tests. See the tests/
folder where you will find unit tests that ensures the mint
function returns the proper response and that the read-only functions work as expected.
- There are lots of ways to create an initial distribution of tokens
- Friedgar's SLIME token employs an airdrop model
- The xBTC protocol deploys a role-based scheme to manage token minting access
- This project permits fungible token minting only to those who own an NFT