Overview
This comprehensive tutorial series guides you from using a pre-deployed FT contract to implementing every aspect of the NEP-141 fungible token standard and its extensions.FT Tutorial Series
Complete step-by-step fungible token tutorial
What you’ll learn
NEP-141 Core
The foundational FT standard for creating and transferring tokens
NEP-148 Metadata
Add token name, symbol, decimals, and icon
NEP-145 Storage
Implement storage management to prevent state bloat
Token Economics
Design tokenomics, supply, and distribution
Marketplace Integration
Enable buying NFTs with your fungible token
FT Events
Emit events for transfers and mints
Prerequisites
- Rust
- JavaScript
New to Rust? Start with the smart contract quickstart to learn the basics.
Tutorial steps
Progress through these chapters to master fungible tokens:Pre-deployed contract
Interact with an existing FT contract. Receive tokens without writing any code!Begin tutorial →
Contract architecture
Understand the FT contract structure and compile the skeleton code.View chapter →
Defining your token
Customize your token with name, symbol, decimals, and total supply.View chapter →
Circulating supply
Create an initial token supply and see your tokens in wallets.View chapter →
Registering accounts
Implement storage management to prevent account draining attacks.View chapter →
Transferring tokens
Implement the core transfer functionality.View chapter →
Marketplace integration
Use your FT to buy NFTs on a marketplace.View chapter →
Quick start example
Here’s a minimal fungible token contract:FT standards (NEPs)
NEP-141: Core Fungible Token
NEP-141: Core Fungible Token
The foundation for all fungible tokens on NEAR. Defines:
- Token transfers
- Balance queries
- Total supply tracking
NEP-148: Metadata
NEP-148: Metadata
Standardizes token information:
- Token name (e.g., “US Dollar Coin”)
- Symbol (e.g., “USDC”)
- Decimals (e.g., 6)
- Icon URL
NEP-145: Storage Management
NEP-145: Storage Management
Prevents state bloat attacks:
- Accounts must pay for their storage
- Registration before receiving tokens
- Storage deposit refunds
NEP-297: Events
NEP-297: Events
Storage management
A critical security feature:Testing your FT contract
Comprehensive testing example:Common use cases
Stablecoins
Create tokens pegged to fiat currencies
Governance tokens
Power DAO voting and decision-making
Reward points
Loyalty programs and user incentives
Gaming currency
In-game economies and virtual goods
Wrapped tokens
Bridge tokens from other chains
DeFi tokens
Build lending, DEX, and yield protocols
Token economics
Fixed supply
Fixed supply
Set total supply at initialization. No minting or burning:
Mintable supply
Mintable supply
Allow authorized accounts to mint new tokens:
Burnable tokens
Burnable tokens
Allow token holders to burn (destroy) their tokens:
Marketplace integration
Use your FT to buy NFTs:Next steps
Start the tutorial
Begin building your FT contract
FT primitives
Learn about using existing FT contracts
NFT tutorial
Build non-fungible token contracts
DEX primitives
Create token swapping functionality