← gavel beta

Build judgments
developers can trust.

Generate evidence-aware GenLayer contracts, deploy them with a pinned runner, and read only finalized outcomes.

Install

npm install gavel-judgment-sdk

Node.js 22.13+. npm version 0.1.4 includes the mandatory-rule fix. Upgrade, regenerate, and redeploy existing contracts to use it. Release notes.

Generate a contract

Save as generate.mjs, then run node generate.mjs.

import { writeFile } from 'node:fs/promises';
import { earthquakeDemoContract } from 'gavel-judgment-sdk/contracts';
const contract = earthquakeDemoContract();
await writeFile('contract.py', contract.source);

Studio Next deployment

npx gavel prepare-studio-next contract.py studio-next-deployment
cd studio-next-deployment
npx --yes genlayer@0.40.0-rc.3 network set studio-dev
npx --yes genlayer@0.40.0-rc.3 deploy

The workflow checks chain ID 61997, estimates protocol fees, saves the transaction before waiting, and prints the Studio Next explorer link only after FINISHED_WITH_RETURN.

Mandatory resolution rules

Every declared rule is mandatory. A rule marked satisfied: false deterministically forces status UNRESOLVED, winnerIndex -1, and outcomeId UNRESOLVED. Validators reject an invalid RESOLVED candidate even if both model answers agree. Four regression cases cover leader finalization and validator acceptance.

Judgment patterns

These are application designs, not verified payouts or completed judgments. Explore the examples.

Supplier delivery disputes · content moderation appeals · insurance claims · prediction-market resolution.

Read the SDK on GitHub →

Verified on chain 61997

0xc1Cb384F4160FD7bC02E7aA26e21286c09352351

Transaction: 0xb06041b3754fce361e7d399049b0bd5972714120743f2ea9aa5bb74ef1732ed8
Status: FINALIZED
Execution: FINISHED_WITH_RETURN
get_progress: { attempts: 0, maxAttempts: 8, resolved: false }

Deployment and reads are verified. Judgment resolution has not been executed.

When a transaction is pending

PROPOSING / NOT_VOTED means consensus has not completed. Keep transaction.json and inspect the same transaction after an RPC interruption. Do not redeploy solely because polling failed.

npx --yes genlayer@0.40.0-rc.3 receipt 0xb06041b3754fce361e7d399049b0bd5972714120743f2ea9aa5bb74ef1732ed8

Developer verification

150 SDK tests and 64 direct contract tests pass. Version 0.1.4 enforces the mandatory-rule invariant; version 0.1.2 fixes strict TypeScript declarations, old package imports, missing packaged guides, preparation errors, and Windows runtime headers.

Full deployment and troubleshooting guide →