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 generate --watch while you edit. stacksdapp dev does not regenerate bindings.
Redeploy to apply on-chain changes:
multiply function appears in the debug UI after regeneration and redeployment.
Add a contract
.clar file, a Vitest test file, updates Clarinet.toml with the correct epoch, and regenerates bindings.
See Working with contracts for SIP token templates and Clarity versions for version selection.
Run tests
Type-check contracts
Redeploy after changes
Stacks contracts are immutable. Redeploying creates versioned contracts:--no-auto-version. On devnet, a contract can still be on chain after you restart stacksdapp dev.
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. Wallet signing is for testnet/mainnet. Devnet uses public burner keys with no wallet popup.