Clarity Smart Contract Audit

A Clarity audit is a security review of Stacks contracts written in Clarity, focused on post-conditions, trait and contract-call trust boundaries, Bitcoin-anchored finality assumptions, and the logic errors that remain despite Clarity's decidable, non-Turing-complete design.

Why Clarity code needs a specialist review

Clarity is interpreted, decidable and has no reentrancy in the EVM sense — the language deliberately removes several classic bug classes. What remains is everything about intent: whether your post-conditions actually constrain the transfer they are supposed to constrain, whether a dynamic contract-call trusts a trait implementation supplied by the caller, and whether your logic is correct about Bitcoin block ordering and reorg behaviour.

We review Clarity against the Stacks execution model, not a generalised smart-contract model. That means the post-condition mode of every transaction path, the trust placed in every trait, tx-sender versus contract-caller in every authorisation check, and how the contract behaves across Stacks blocks anchored to a Bitcoin chain that can reorganise.

Clarity-specific security considerations

Post-condition correctness

Allow-mode transactions that permit transfers the user never intended, and post-conditions that do not cover every asset the call can move.

tx-sender vs contract-caller

Authorisation checks using the wrong principal, which lets an intermediate contract act with the user's authority.

Trait and dynamic call trust

Dynamic contract-calls to a trait implementation supplied by the caller, and SIP-009/SIP-010 compliance assumed rather than verified.

Bitcoin finality and reorgs

Logic assuming Stacks block finality that Bitcoin anchoring does not yet provide, and behaviour across a Bitcoin reorg.

Arithmetic and response handling

Unchecked responses, unwrap panics on untrusted input, and integer maths in fee and reward paths.

Read-only and state assumptions

Read-only functions used off-chain for pricing or eligibility that can be made to return misleading values.

Tooling we run on Clarity

How the engagement runs

  1. Scoping and threat modelling

    We fix a commit hash, agree the in-scope contracts and read your architecture docs, then build a threat model: who the actors are, what the trust boundaries are, and which invariants must never break. Nothing is reviewed against assumptions we have not written down.

  2. Manual review

    Line-by-line review by at least two auditors working independently, focused on authorisation, accounting, upgrade paths, external integrations and the gap between what the code does and what the documentation claims it does. Most critical findings come from this phase, not from tooling.

  3. Static and dynamic analysis

    Static analysers appropriate to the language, plus property-based fuzzing and invariant testing to push the system into states no unit test covers. Tooling is used to widen coverage, never to replace the manual pass.

  4. Exploit-path simulation

    Candidate findings are proven on a forked network with a working proof of concept. We report what an attacker can actually do and what it costs them, not a theoretical severity label.

  5. Reporting

    Every finding gets a severity rating, reproduction steps, the affected code, the impact in concrete terms and a specific remediation. You get a draft for discussion before anything is finalised.

  6. Fix review and re-test

    We re-test every remediation against the original proof of concept and check that the fix has not opened a new path. The final report is yours to publish.

What you receive

Clarity audit: frequently asked questions

Clarity has no reentrancy — what is left to audit?

The design. Post-conditions that do not cover the assets they should, authorisation using tx-sender where contract-caller was meant, trait implementations trusted from the caller, and reward or fee arithmetic that is simply wrong. Clarity removes a bug class; it does not remove judgment.

Do you review post-conditions?

Yes, and it is one of the highest-value parts of a Stacks review. Post-conditions are the user's last defence, and allow-mode paths regularly leave that defence disabled.

How do Bitcoin reorgs affect our contract?

Anything that treats a recent Stacks block as final needs to be reviewed against the anchoring model. We test the reorg path explicitly rather than assuming it will not happen.

Do you check SIP-010 compliance?

Yes. Integrations assume standard behaviour, and a token that deviates from the trait breaks every protocol that lists it.

What do you need from us to start an audit?

A repository or contract address, a commit hash to freeze the scope, whatever architecture or spec documentation exists, and a point of contact who can answer design questions. If documentation is thin we will write our understanding of the system back to you and ask you to confirm it — that step alone catches design-level bugs.

How long does an audit take?

A single token contract is 24–48 hours. A typical dApp or mid-sized protocol runs one to two weeks. Large DeFi systems, L2s, bridges and ZK circuits are scoped per project after we have seen the code. We will give you a fixed timeline with the quote, not an estimate that moves.

Is a re-test included after we fix the issues?

Yes. Fix review is part of the engagement, not an upsell. We re-run the original proof of concept against your patched code and confirm the fix has not introduced a new path.

Chains that run Clarity

Related security services

Get a fixed quote in 24 hours

Send the repository and a commit hash through the contact form, message @bugtester25 on Telegram, or book a 30-minute scoping call. 200+ protocols audited · $4B+ secured · 0 hacks post-audit. Prefer email? info@safeedges.in.