stacksdapp add templates, Clarity functions, and generated frontend hooks.
Contents
- Official specifications
- Scaffold commands
- impl-trait rules
- SIP-010 fungible tokens
- SIP-009 NFTs
- End-to-end workflow
- Customizing templates
Official specifications
Metadata: SIP-016 · SIP-019 metadata updates
Scaffold commands
contracts/contracts/<name>.clarwith all required SIP functionscontracts/tests/<name>.test.ts(if no test file exists)[contracts.<name>]entry inClarinet.tomlwith correct epoch[[project.requirements]]for the mainnet trait (Clarinet simnet type-checking)- Regenerated hooks in
frontend/src/generated/hooks.ts
impl-trait rules
Common mistake
(impl-trait 'sip-010-trait) — a short name with no full SP… contract path.
Network rules
Mainnet trait addresses
Scaffold templates include a comment with the exact mainnet
impl-trait line to uncomment before mainnet deploy.
SIP-010 fungible tokens
Seven functions wallets and apps expect:
The scaffold template also includes:
Default: 6 decimals, owner = deployer at deploy time.
Frontend hooks
use{ContractPascal}_{FunctionPascal}. See Frontend guide for parsing get-balance results.
SIP-009 NFTs
Four functions for NFT interoperability:
The scaffold template also includes:
Frontend hooks
End-to-end workflow
--template sip009.
Customizing templates
After edits:
check → generate → test → deploy.
Trait errors: Troubleshooting