Developer Workflow
Scaffold Stacks provides a streamlined development experience with live reloading, auto-generated bindings, and comprehensive testing.Edit contracts → see live updates
Open any.clar file in your contracts/contracts/ directory and add a function:
multiply function appears in the debug UI with typed inputs after redeployment.
Add a new contract
Create new contracts with built-in templates:- Creates the
.clarfile incontracts/contracts/ - Updates
Clarinet.toml - Regenerates all TypeScript bindings
- Updates the debug UI
Run tests
Test both contracts and frontend:- Contract tests in
contracts/tests/(Clarinet SDK) - Frontend tests in
frontend/(Vitest)
Type-check contracts
Validate Clarity syntax and types:Iterate and redeploy
Since Stacks contracts are immutable, redeploying creates versioned contracts:Project structure
Auto-code generation
Thestacksdapp generate command:
- Parse: Extract ABIs from all contracts using
initSimnet() - Normalize: Convert Clarity types to TypeScript (uint128 → bigint, tuples → objects)
- Render: Generate
contracts.ts,hooks.ts, andDebugContracts.tsx - Write: Update files only if content changed (fast hot reload)
.clar save during stacksdapp dev.
Frontend Features
Scaffold Stacks automatically generates a complete frontend development environment:Debug UI
A live debug interface is auto-generated from your contracts, allowing you to interact with all contract functions on-the-go. Every public function gets a typed input form, and read-only functions display results directly.
Reusable Hooks
Type-safe React hooks are generated for each contract function, making it easy to integrate contract calls throughout your application:Wallet Connect Component
A reusableWalletConnect.tsx component handles wallet connections with support for Leather and Xverse wallets, including automatic network detection.
State Management
Jotai atoms are used for global state management, providing a simple and powerful way to manage application state across components.Local development
For offline development with full Bitcoin + Stacks simulation:Devnet.toml.