Skip to main content
Edit Clarity contracts, regenerate bindings, run tests, and redeploy. Requires Clarinet 3.21+. Run stacksdapp doctor if you hit toolchain errors.

Contents

Edit contracts

Open any .clar file in contracts/contracts/ and add a function:
Update bindings:
Or let stacksdapp dev / stacksdapp generate --watch handle it. Redeploy to apply on-chain changes:
The multiply function appears in the debug UI after regeneration and redeployment.

Add a contract

Each command creates the .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

See Testing for contract and frontend test patterns.

Type-check contracts

Redeploy after changes

Stacks contracts are immutable. Redeploying creates versioned contracts:
The CLI handles versioning automatically.

Project structure

Code generation

See Code generation for the full pipeline, watch mode, ABI caching, and Hiro API keys. Summary:
  1. Parse ABIs via initSimnet() (cached under contracts/.cache/)
  2. Normalize Clarity types to TypeScript
  3. Render contracts.ts, hooks.ts, DebugContracts.tsx
  4. Write only when content changed

Frontend features

Debug UI

Every public function gets a typed input form. Read-only functions display results directly.
Debug UI showing contract interaction forms

Reusable hooks

Wallet Connect

WalletConnect.tsx handles Leather and Xverse, including network detection.

State management

Jotai atoms sync wallet and network state across the template.

Local development

See Local devnet for manual deploy and devnet setup.