Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Centurylong/sanctifier/llms.txt
Use this file to discover all available pages before exploring further.
sanctifier verify scans a contract directory or workspace for functions annotated with #[sanctify::invariant] and attempts to verify each one using the built-in Z3 SMT solver. Each invariant receives one of four statuses — PROVEN, REFUTED, UNKNOWN, or KANI ↗ — which are printed in a color-coded table. The command is designed to slot into CI pipelines via the --strict flag.
Usage
Arguments and options
Path to a contract directory, workspace directory, or a single
.rs file.
Sanctifier recursively discovers all .rs files, skipping paths listed in
.sanctify.toml’s ignore_paths (e.g. target, .git).Exit with a non-zero status code if any invariant is Refuted or
Unknown. Without this flag the command always exits
0, which is useful
for informational runs. Enable --strict in CI to block merges when
invariants cannot be proven.Emit results as a JSON array instead of the human-readable colored table.
Each element contains
contract, invariant, location, and result
fields.Suppress the summary line (
N proven N refuted N dispatched to Kani) at
the end of human-readable output. Individual invariant results are still
printed.The four output states
| Status | Color | Meaning |
|---|---|---|
| PROVEN | Green | The Z3 solver confirmed the invariant holds for all possible inputs |
| REFUTED | Red | The solver found a concrete counterexample that violates the invariant |
| UNKNOWN | Yellow | The solver timed out or could not determine satisfiability |
| KANI ↗ | Blue | The invariant requires Kani for bounded model checking; a cargo kani command is printed |
Annotating invariants
Decorate a function with#[sanctify::invariant] to register it for verification:
sanctifier verify will discover and attempt to prove this invariant automatically.
Sample text output
JSON output
CI integration with —strict
Addsanctifier verify to your CI pipeline to block merges that introduce refuted invariants:
1. Use --json together with --strict to feed structured results into downstream reporting tools:
What Z3 can and cannot prove
The Z3 SMT verifier used by Sanctifier reasons about arithmetic, logical, and comparison expressions symbolically. It can prove invariants involving:- Integer bounds (
balance >= 0,supply <= MAX_SUPPLY) - Arithmetic identities (
a + b == b + a) - Boolean preconditions over known-type inputs
- Cross-transaction state reasoning (state is not carried between calls in the SMT encoding)
- Properties over unbounded loops or recursive data structures
- Assertions that depend on external contract calls