Skip to main content

Foundations templates

Ready-to-deploy state contracts in the Foundations category. Each is a running machine — protocols pre-composed into states and transitions, deployable as-is onto your state machine.

TemplateWhat it does
Scheduled Compute (Heartbeat)The automation primitive — a self-firing transition on the HulyaPulse cadence. running → running every 60 Zeqonds (swap every_zeqonds for a cron expression like
Threshold Monitor (Generic)Domain-agnostic watchdog. Watches a stream of reading events; KO42 evaluates the windowed average each fire. normal → breached when the average over the last
Oracle Feed (External Ingest)Brings the outside world in. Every 60 Zeqonds it calls your registered oracle external protocol, binds the response, runs KO42, and emits oracle_datum — a s
Approval Workflow (N-of-M)Multi-party sign-off as a contract. pending → approved once N approve events land (default 3), or → rejected the moment a single reject event arrives. Every
Timelock Release GateA generic release gate — no funds, no escrow. held → released once N sign events land (default 2), or → expired when a one_shot deadline passes. Set at_unix
Supply-Chain ProvenanceTamper-evident custody chain. Each handoff event advances the chain and emits custody_changed; a delivered event closes it. Every hop is Zeqond-stamped on
Telemetry Rollup (IoT)Fleet telemetry aggregator. Sums a metric across every telemetry event in a rolling window; collecting → flagged when the windowed total crosses your quota, a
Rate Limiter (Windowed)A windowed rate gate. allowing → limiting when more than threshold request events land inside the rolling window (default 100 / 60 Zeqonds), and back when t
Subscription / Recurring BillingA subscription lifecycle on a cron clock. active emits invoice_due on its billing schedule (default the 1st of each month); a payment_failed event moves it
Attestation / Notary TimestampA perpetual notary. Each notarize event runs KO42 through compute → prove → verify and emits attested — binding the submission to the Zeqond it arrived and

See the full Templates Library for all categories, or the State Contracts model for how to author your own.