Skip to main content
Edit Clarity contracts, regenerate bindings, run tests, and redeploy. Requires Clarinet 3.23+ for Clarity 6 devnet. 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, 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

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 unless you pass --no-auto-version.

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. Wallet signing is for testnet/mainnet. Devnet uses public burner keys with no wallet popup.

State management

Jotai atoms sync wallet and network state across the template.

Local development

See Local devnet for manual deploy, PoX settings, and devnet caveats.