Skip to main content

Contracts

A state contract is deployable logic that lives inside a machine and runs on its clock. Where a plain compute answers one question once, a contract is a standing object with named states and transitions between them — each transition firing an operator when its trigger condition is met. Every fire lands on the machine's audit chain under a ZeqProof, so a contract isn't just automation: it's automation that produces a verifiable record of everything it did and when.

Triggers come in three shapes, and a contract can mix them:

Time-based

Fire on the machine's clock — every N Zeqonds, on a schedule, or at a due tick.

Threshold-based

Fire when a reading crosses a bound — a force, a price, a temperature, a rate.

Event-based

Fire in response to another transition, an external signal, or a state change.

Deploy one in two calls

316 templates ship ready-made across 45 categories — deploy one into your machine, then fire it:

# deploy a force-threshold watchdog (NM19 on every reading)
"name":"zeq_contract_deploy", "arguments":{"templateId":"force-threshold-alarm"}
# fire a transition — it lands on your audit chain, clock-stamped, with a proof
"name":"zeq_contract_fire", "arguments":{"id":"CONTRACT_ID","input":{}}

The end-to-end walkthrough, verified against a live node, is in Deploy your first contract.

Explore

Learn

What a contract is made of and how it runs.

  • Anatomy — states, transitions, conditions, proof_required, the audit clock
  • The lifecycle — deploy, dry-run, fire, pause, versions, rollback, audit, export

Build

From a template to a live, hosted contract.

Contracts compose protocols — named building blocks — and are what channels run on.