stacksdapp add templates, Clarity functions, and generated frontend hooks.
Video tutorial
Watch how to add SIP-010 and SIP-009 contracts with Scaffold Stacks templates (stacksdapp add --template sip010 / sip009), then generate hooks, test, and deploy to testnet.
Continues from the donation jar tutorial (Part 1).
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.
For a complete SIP-010 app with custom UI (claim, mint, transfer), see DropClaim in Example dApps.
Trait errors: Troubleshooting