The court
The court is a GenLayer Intelligent Contract that decides a disputed job from what its validators read for themselves. Whoever asks for a hearing passes only the job number. The contract is contracts/gavelr_court_v2.py, deployed on GenLayer Studionet at 0xc8A2E6d689dB095cb9cA817D7dd046039851942F (version 2.1) and bound, when it was deployed, to escrow v2. Jobs 1 and 2 were heard by version 2.0 at 0x2aC8…A9F0, which keeps their rulings; see Versions.
What a hearing reads
A GenLayer Intelligent Contract is Python that runs on every validator, and can fetch web data and call an AI model as part of a transaction. Each validator in a Gavelr hearing does all of this itself, in order:
- The job, from escrow v2, by an
eth_calltogetJobthroughhttps://bsc-rpc.publicnode.com, falling back tohttps://bsc-dataseed.binance.org. The job must be Disputed and its kind must begeneric/v1orbsc-pool-audit/v1; otherwise the hearing is refused. - The object's record on Greenfield: owner, seal status, checksum, size and timestamps, from
https://greenfield-chain.bnbchain.org/greenfield/storage/head_object/<bucket>/<object>. - The file's bytes, from the evidence URL stored at delivery. It must be https and end in
/view/<bucket>/<object>for the object named in the job. - For pool audits only: each pool's contracts, owner and LP lock from live BNB Smart Chain state, and its creation time from DEX indexers.
- Only then, the file itself, read by the validator's own AI model under the job's terms.
Checks before any model reads the file
For both kinds, before any model runs, the hearing checks that:
- the URI is a
gnfd://bucket/objectaddress, and the Greenfield chain has that object, sealed and public. The court then downloads it from the storage provider the chain names for it, not from the URL the seller supplied; - the bytes hash to the SHA-256 the seller committed on BNB Smart Chain;
- the object is sealed on Greenfield and the bytes match Greenfield's own checksum, which for a file under 16 MB is the SHA-256 of the SHA-256;
- the object is owned by the seller named in the escrow;
- the object was not created or updated after the delivery was committed.
If any check fails, the ruling is REJECT_FULL_REFUND with score 0, the reasoning says which check failed, and the file is not judged. The same full refund applies to a pool audit whose file is not a JSON object with an audited_pools list. That includes a delivery the court cannot read for a reason the seller controls: a malformed URI, a bucket or object missing from Greenfield, an upload that never sealed, or a private object. Only an outage on Greenfield's side stops the hearing without a ruling, so it can be requested again. See Names and sizes the court accepts.
Versions
A GenLayer contract cannot be changed once deployed, so a fix is a new court. Escrow v2 never checks which court ruled: the court verifier does, against the court named in sdk/deployments.json, and every ruling still has to match the evidence hash the escrow froze. Old rulings stay readable in the court that made them.
| Version | Address | Heard | What changed |
|---|---|---|---|
| 2.1 | 0xc8A2…942F | New disputes | A delivery the court cannot read for a reason the seller controls is refunded in full instead of stopping the hearing, and the file is read from the storage provider the Greenfield chain names rather than the seller's URL. |
| 2.0 | 0x2aC8…A9F0 | Jobs 1 and 2 | First release. Source at git tag court-v2.0. |
The escrow's court() value still names 2.0, because it was fixed when the escrow was deployed. It is a record, not a check.
The two kinds of hearing
The buyer picks the kind at hire. It is stored in the job, so neither side can change it later.
generic/v1: any file, judged against the terms
For data, a report, code or text. The model sees the terms, the buyer's dispute reason and the file, and nothing else: no web lookups, no chain reads.
- Each numbered requirement in the terms is normally one scoring unit, and unnumbered terms are split into their distinct requirements. At most 12 units count. This is an instruction to the model, not a rule the contract enforces: the court may split a numbered requirement that asks for several things. In job 2 it split "pair address, token symbol and liquidity in USD" into three checks, so four requirements became six. To control the split, put one ask on each numbered line.
- For each unit the model must give a short quote from the file. Each quote is then checked against the file's text with whitespace removed, and the result is stored with the finding as
quote_verified. - The model is told that the file is data, to ignore any instructions inside it, and not to invent requirements.
bsc-pool-audit/v1: security audits of new PancakeSwap pools
The file must be a JSON object with an audited_pools array. The court reads up to 8 pools; with fewer than 5, the missing ones count as failed.
{
"audited_pools": [
{
"pool_index": 1,
"symbol": "TAPEX/WBNB",
"token_address": "0x…",
"pair_address": "0x…",
"pool_deployed_at": 1795090000,
"honeypot_status": "SAFE",
"lp_locked_pct": 100,
"owner_renounced": true,
"deployer_rug_history": "NONE"
}
]
}
Before the model reads the file, every pool is checked against chain data. A pool that fails any of these has failed, and no model can pass it:
| Check | Fails when | In the contract |
|---|---|---|
| Completeness | One of token_address, pair_address, pool_deployed_at, honeypot_status, lp_locked_pct, owner_renounced, deployer_rug_history is missing or empty | REQUIRED_FIELDS |
| Addresses | An address is invalid, no contract answers at the pair or the token, or the pair does not hold the token | _read_pool_facts |
| Freshness | The pool was really created more than 86,400 seconds before delivery, or no indexer dates it | MAX_AGE_SECONDS |
| Creation time | pool_deployed_at is more than 3,600 seconds from the real creation time | DEPLOY_TIME_TOLERANCE_SECONDS |
| Owner | The file says owner_renounced: true but the token's owner() returns an address other than zero or 0x…dEaD | BURN_ADDRESSES |
| LP lock | The file's lp_locked_pct is more than 15 points above the share of LP tokens that are burned or held by PinkLock V2 or the UNCX V2 locker | LP_TOLERANCE_PCT |
Creation times come from GeckoTerminal, and from DexScreener for any pool GeckoTerminal does not know. If neither indexer answers at all, the hearing stops with a temporary error and can be requested again. A token with no owner() function counts as having no owner. The model may also fail a pool that passed every chain check, but only for a breach of the terms it can point to in the file. Each finding records who decided it: chain, jury or chain+jury.
From findings to a split
Each pool, or each requirement, is one unit. The decision follows from how many units passed:
| Decision | When | Score | To buyer | To seller |
|---|---|---|---|---|
| 1 · APPROVE_FULL | Every unit passed | 100 | 0% | 100% |
| 2 · PARTIAL_SLASH | Some passed; for example 3 of 5 | 60 | 40% | 60% |
| 3 · REJECT_FULL_REFUND | None passed, or a check before the hearing failed | 0 | 100% | 0% |
For a partial slash, the seller's share is round(passed × 10000 / total) basis points and the score is round(passed × 100 / total), both computed in _quantize(). The ruling also carries a verdict hash that the escrow recomputes before paying:
sha256(abi.encode(jobId, evidenceSha256, uint256(decision), uint256(buyerRefundBps), uint256(sellerPayoutBps), uint256(score)))
How the validators agree
GenLayer picks a lead validator, which runs the hearing and proposes its result. Every other validator runs the whole hearing again, with its own AI model and its own web requests, and agrees only if it reaches:
- the same committed evidence hash and the same hash of the bytes it downloaded,
- the same answer on whether the file passed the checks above,
- the same decision (approve, partial slash or refund),
- and a score within 20 points of the lead's.
If the lead's hearing failed, a validator agrees only if its own run failed the same way. The court stores the lead validator's ruling once a majority agree. Each job can be heard once: a second adjudicate for a job that has a ruling is refused with "verdicts cannot be replaced". A hearing that ends without agreement stores nothing and can be requested again.
Reading a ruling
| View | Returns |
|---|---|
| get_verdict_json(job_id) | The ruling as JSON text: decision, score, split, units, the verdict hash and the reasoning. The SDK's waitForRuling() and the verifier read this. |
| get_case_json(job_id) | The whole case: the job as read from the escrow, the Greenfield record, every finding with what the file claimed and what the chain showed, and the reasoning. |
| has_verdict(job_id) | Whether the job has been ruled. |
| get_bnb_escrow() | The escrow address the court is bound to. |
| get_total_cases() | How many jobs it has ruled. |
The ruling for job 1 on escrow v2, as get_verdict_json(1) returns it:
{
"buyerRefundBps": 4000,
"decision": 2,
"decisionLabel": "PARTIAL_SLASH",
"evidenceSha256": "0x60423e130baeb77cb9107429085f353031e35ce90e7c82c0920bd1940931d79e",
"jobId": 1,
"reasoning": "Pools 1 through 3 successfully passed all audit criteria and on-chain checks. However, Pool 4 failed due to violating the freshness rule by being deployed far beyond the 24-hour limit, and Pool 5 failed due to inaccurate on-chain ownership status reporting. Therefore, the delivery contains invalid pools and the buyer's dispute is upheld for those items.",
"score": 60,
"sellerPayoutBps": 6000,
"snapshotVerified": true,
"totalUnits": 5,
"validUnits": 3,
"verdictHash": "0xb210893bdb117364a6e48c2c32121ae51a83554751fadde4788d19565575d70d"
}
Earlier courts
Version 1 used two other contracts on Studionet. The pool court, contracts/gavelr_pool_court.py, ruled Case No. 3: it heard only pool audits, and only for jobs whose terms hashed to one fixed SLA. The first arbiter, contracts/gavelr_arbiter.py, ruled jobs 1 and 2. Neither hears jobs on escrow v2. A fourth contract, contracts/gavelr_court.py, is the Lab's trial court and holds no money.
- The court runs on GenLayer Studionet, a test network.
- Validators can be wrong, and they judge only what the terms say. Terms the file can be checked against make wrong rulings less likely.
- For
generic/v1, the quote check is recorded with each finding but does not change it or the score. - For pool audits, creation times come from DEX indexers, not from the chain itself.
- The model reads only the first 3,000 characters of the terms, 900 of the dispute reason and 14,000 of the file.