Deploy fully compliant SIP-010 fungible tokens on the Stacks blockchain in a single call.
StacksMint is an open-source token factory and registry built on Stacks using the Clarity smart contract language. Anyone can mint their own token, track all deployed tokens, and manage their token portfolio β no deep smart contract knowledge required.
- Overview
- Features
- Architecture
- SIP-010 Standard
- Contract Reference
- Getting Started
- Deploying a Token
- Registry
- Fee Structure
- Project Structure
- Testing
- Roadmap
- Contributing
- License
StacksMint solves a simple problem: deploying a SIP-010 token on Stacks requires writing and deploying a Clarity contract from scratch, which is a barrier for most users. StacksMint provides a battle-tested token template and a public registry so that:
- Developers can fork the template and deploy in minutes
- The community can discover and verify all tokens minted through StacksMint
- Token creators get a compliant, auditable contract out of the box
- β Full SIP-010 compliance β all required trait functions implemented
- π Token template β a clean, auditable base contract ready to fork and deploy
- π On-chain registry β every StacksMint token is logged with name, symbol, decimals, supply, and owner
- π Owner lookup β query all tokens deployed by a specific principal
- π Mint control β initial supply goes to deployer; optional mintable flag
- π Token URI support β link to off-chain metadata (IPFS, Arweave, HTTPS)
- πͺ STX registration fee β small fee to register in the public registry (anti-spam)
- π§ͺ Full test suite β unit tests with Clarinet
Because Clarity does not support dynamic contract deployment, StacksMint uses a two-contract architecture:
ββββββββββββββββββββββββββββββββββββββββββββββββ
β token-template.clar β
β (Deployed once per token by the creator) β
β - SIP-010 trait implementation β
β - Transfer, mint, burn logic β
β - Token metadata (name, symbol, decimals) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β creator registers token
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β stacksmint-registry.clar β
β (Single shared registry contract) β
β - Tracks all tokens deployed via StacksMint β
β - Owner β tokens lookup map β
β - Public token directory β
β - Registration fee collection β
ββββββββββββββββββββββββββββββββββββββββββββββββ
Workflow:
- Clone the token template
- Customize name, symbol, decimals, initial supply, and token URI
- Deploy your token contract to Stacks mainnet or testnet
- Call
register-tokenon the StacksMint registry to list your token publicly - Your token is now live and discoverable
All tokens minted via StacksMint implement the SIP-010 Fungible Token Standard, which requires the following trait functions:
| Function | Description |
|---|---|
transfer |
Transfer tokens between principals |
get-name |
Returns the token name |
get-symbol |
Returns the token ticker symbol |
get-decimals |
Returns number of decimal places |
get-balance |
Returns balance for a given principal |
get-total-supply |
Returns total token supply |
get-token-uri |
Returns optional URI for token metadata |
The base token contract. Fork this for each new token you want to deploy.
Constants (customize before deploying)
(define-constant token-name "My Token")
(define-constant token-symbol "MTK")
(define-constant token-decimals u6)
(define-constant initial-supply u1000000000000) ;; 1,000,000 tokens (with 6 decimals)
(define-constant token-uri (some u"https://example.com/token-metadata.json"))Key Functions
;; Transfer tokens
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))
;; Mint new tokens (owner only, if mintable)
(define-public (mint (amount uint) (recipient principal))
;; Burn tokens
(define-public (burn (amount uint) (sender principal))
;; Read-only getters
(define-read-only (get-name))
(define-read-only (get-symbol))
(define-read-only (get-decimals))
(define-read-only (get-balance (account principal)))
(define-read-only (get-total-supply))
(define-read-only (get-token-uri))The shared public registry. Deploy once; all token creators point to this.
Key Functions
;; Register your deployed token in the public registry
(define-public (register-token
(token-contract principal)
(name (string-ascii 32))
(symbol (string-ascii 10))
(decimals uint)
(total-supply uint)
(token-uri (optional (string-utf8 256))))
;; Look up a token by its contract principal
(define-read-only (get-token-info (token-contract principal)))
;; Get all tokens registered by an owner
(define-read-only (get-tokens-by-owner (owner principal)))
;; Get total number of tokens in the registry
(define-read-only (get-token-count))- Clarinet β Clarity development environment
- Stacks CLI β for mainnet/testnet deployments
- Node.js v18+ (for deployment scripts)
- A Hiro Wallet with STX for deployment fees
# Clone the repository
git clone https://github.com/your-username/stacksmint.git
cd stacksmint
# Install dependencies
npm install
# Check Clarinet is working
clarinet checkCopy the token template and update the constants at the top:
cp contracts/token-template.clar contracts/my-token.clarEdit contracts/my-token.clar:
(define-constant token-name "Degen Coin")
(define-constant token-symbol "DEGEN")
(define-constant token-decimals u6)
(define-constant initial-supply u500000000000) ;; 500,000 tokens
(define-constant token-uri (some u"ipfs://QmYourMetadataCIDHere"))clarinet test
clarinet consoleclarinet deployments apply --devnet # local devnet
clarinet deployments apply --testnet # Stacks testnetAfter deploying, call the registry to make your token publicly discoverable:
# Using Clarinet console or a deployment script
(contract-call? .stacksmint-registry register-token
'ST1234...yourtokencontract
"Degen Coin"
"DEGEN"
u6
u500000000000
(some u"ipfs://QmYourMetadataCIDHere"))View your token on the Hiro Explorer or Stacks Explorer.
The StacksMint registry is a permissionless, on-chain directory. Once a token is registered:
- It appears in the public token list
- Anyone can query it by contract address or owner
- The metadata is permanently on-chain and immutable
;; Get info about a specific token
(contract-call? .stacksmint-registry get-token-info 'SP1234...token-contract)
;; Find all tokens by an owner
(contract-call? .stacksmint-registry get-tokens-by-owner 'SP1234...owner-address)
;; Total tokens in the registry
(contract-call? .stacksmint-registry get-token-count)| Action | Fee |
|---|---|
| Deploying your token contract | Stacks network gas only |
| Registering in StacksMint registry | 1 STX (anti-spam) |
| Querying the registry | Free (read-only) |
Registration fees are collected by the registry contract owner and may be used for protocol maintenance and future development.
stacksmint/
βββ contracts/
β βββ token-template.clar # SIP-010 token base contract
β βββ stacksmint-registry.clar # Public token registry
βββ tests/
β βββ token-template_test.ts # Token unit tests
β βββ stacksmint-registry_test.ts # Registry unit tests
βββ scripts/
β βββ deploy-token.ts # Deployment helper script
β βββ register-token.ts # Registry registration script
βββ deployments/
β βββ devnet.yaml
β βββ testnet.yaml
β βββ mainnet.yaml
βββ settings/
β βββ Devnet.toml
βββ Clarinet.toml
βββ package.json
βββ README.md
StacksMint uses Clarinet for unit and integration testing.
# Run all tests
clarinet test
# Run a specific test file
clarinet test tests/token-template_test.ts
# Run tests with coverage
clarinet test --coverage
# Open interactive Clarinet console
clarinet console- SIP-010 trait compliance
- Transfer with and without memo
- Mint and burn access control
- Registry registration and lookup
- Fee enforcement
- Edge cases: zero transfers, overflow, unauthorized minting
- SIP-010 token template
- On-chain registry contract
- Web UI for no-code token deployment
- Token metadata standard (extended JSON schema)
- Batch registration support
- SIP-009 NFT factory (StacksMint for NFTs)
- Token verification badges
- Integration with Stacks DEXes (ALEX, Arkadiko)
- Token analytics dashboard
- Multisig mint control
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Write tests for your changes
- Ensure all tests pass (
clarinet test) - Open a pull request with a clear description
Please read CONTRIBUTING.md for our full contribution guidelines and code of conduct.
StacksMint is open source under the MIT License.
Built with β€οΈ on Stacks β Bitcoin's smart contract layer.