contracts/contracts/*.clar. For language depth, use official Stacks docs. This page routes you there and lists syntax you will use daily.
Contents
- Learning resources
- Scaffold workflow
- Syntax essentials
- Responses and errors
- Built-in context
- Maps and lists
- Tokens
Learning resources
Scaffold workflow
contracts/tests/*.test.ts — no Docker. See Testing.
Default new projects use Clarity 6 (epoch 4.0). See Clarity versions.
Syntax essentials
Clarity is LISP-like: expressions in parentheses.Data variables
Functions
Responses and errors
Public functions return(response T uint) — success (ok value) or error (err uint):
asserts!— aborts with err if condition is falsetry!— unwraps ok or propagates err
Built-in context
Use
tx-sender vs contract-caller carefully for access control. See Contracts.
Maps and lists
Tokens
For SIP-010 fungible tokens and SIP-009 NFTs, use scaffold templates instead of writing from scratch:impl-trait rules: SIP standards
Low-level token primitives:
Next steps
- Contracts — add and test contracts
- Clarity versions — C4/C5/C6 epoch mapping
- SIP standards — token and NFT templates
- Workflows — common development patterns