stacksdapp doctor if you hit toolchain errors.
Contents
- Edit contracts
- Add a contract
- Run tests
- Type-check contracts
- Redeploy after changes
- Project structure
- Code generation
- Frontend features
- Local development
Edit contracts
Open any.clar file in contracts/contracts/ and add a function:
stacksdapp dev / stacksdapp generate --watch handle it.
Redeploy to apply on-chain changes:
multiply function appears in the debug UI after regeneration and redeployment.
Add a contract
.clar file, updates Clarinet.toml, regenerates bindings, and updates the debug UI.
See Working with contracts for a full sample contract and tests.
Run tests
Type-check contracts
Redeploy after changes
Stacks contracts are immutable. Redeploying creates versioned contracts:Project structure
Code generation
See Code generation for the full pipeline, watch mode, ABI caching, and Hiro API keys. Summary:- Parse ABIs via
initSimnet()(cached undercontracts/.cache/) - Normalize Clarity types to TypeScript
- Render
contracts.ts,hooks.ts,DebugContracts.tsx - Write only when content changed
Frontend features
Debug UI
Every public function gets a typed input form. Read-only functions display results directly.
Reusable hooks
Wallet Connect
WalletConnect.tsx handles Leather and Xverse, including network detection.