The escrow

The escrow holds the buyer's BNB, and only five calls can move it out: release, claim, reclaim, settle and expireDispute. Each is allowed to one party, from one status, in one time window. The contract is evm/src/GavelrEscrow.sol, deployed on BNB Smart Chain mainnet at 0xd16e6cb28fcea0d70a2098604db2a3451b2adfb5; it has no owner, takes no fee, and cannot be upgraded.

What it does

A job moves through seven statuses. The numbers are the contract's Status enum, which is also what getJob() returns.

Funded to Delivered by deliver; Delivered to Released by release or claim; Funded to Refunded by reclaim; Delivered to Disputed by dispute; Disputed to Settled by settle or expireDispute. hire()buyer deliver()seller, by the deadline release() · claim()buyer · anyone after window reclaim()buyer, after the deadline dispute()buyer, within the window settle() expireDispute()after 7 days, 50/50 the court rules on GenLayer Funded1 · price locked Delivered2 · window open Released4 · seller paid Refunded5 · buyer repaid Disputed3 · money frozen Settled6 · split paid out
Status 0 is None, a job that does not exist. Released, Refunded and Settled are final.
#StatusMeaningLeaves by
1FundedThe price is locked; waiting for delivery.deliver, reclaim
2DeliveredThe file and its hash are committed; the dispute window is running.release, claim, dispute
3DisputedThe buyer disputed; the money is frozen until a settlement.settle, expireDispute
4ReleasedThe seller was paid in full, by release or claim.Final
5RefundedThe buyer took the price back after a missed deadline.Final
6SettledA dispute was paid out: by a court ruling, by agreement, or by the 7-day timeout.Final

How to use it

Agents normally call these through the SDK or the MCP tools, which simulate each call first and stop before sending one that would revert.

CallWhoFromWhenResult
hireThe buyer; not the seller, not the court verifierNoneThe deadline is in the futureFunded; price locked
deliverThe sellerFundedUp to the deadlineDelivered; allowed once
reclaimThe buyerFundedAfter the deadlineRefunded; full price to the buyer
releaseThe buyerDeliveredAny timeReleased; full price to the seller
claimAnyoneDeliveredAfter delivery plus the dispute windowReleased; full price to the seller
disputeThe buyerDeliveredUp to delivery plus the dispute windowDisputed; money frozen
adjudicateAnyone, on GenLayerDisputedOnce per jobThe court stores its ruling; nothing moves on BNB Smart Chain
settleAnyone who holds two signatures from buyer, seller and verifierDisputedBefore the verdict's expiresAtSettled; split by the verdict
expireDisputeThe buyer or the sellerDisputedMore than 7 days after the disputeSettled; 50/50

Time and size limits

WhatLimitSet by
PriceMore than 0 BNBhire (BadAmount)
Delivery deadlineAny time in the future; the SDK's default is 24 hoursdeliverBy
Dispute window10 minutes to 30 days; the SDK's default is 6 hoursMIN_DISPUTE_WINDOW, MAX_DISPUTE_WINDOW
Unsettled disputeAfter 7 days either party may split 50/50DISPUTE_TIMEOUT
Terms1 to 4,000 bytesMAX_TERMS_BYTES
Kind1 to 64 byteshire
Dispute reason1 to 2,000 bytesdispute
Greenfield URI and evidence URLUp to 300 bytes eachdeliver
Evidence hashNot zerodeliver (EvidenceRequired)

The court reads less than the escrow stores: the first 3,000 characters of the terms, 900 of the dispute reason and 14,000 of the file. See The court.

How it is built

The constructor takes four values and stores them as immutables: the ERC-8004 identity registry, the court verifier's address (which may not be zero), the court's chain id and the court's address. The live deployment was made by scripts/deploy_v2.mjs with the registry 0x8004…a432, the verifier 0x0DDD…9543, chain id 61999 (GenLayer Studionet) and the court 0x2aC8…A9F0. No function can change them, and no function reads the court's address or chain id; they are a public record of which court the escrow was deployed for. New disputes are now heard by court 2.1 at 0xc8A2…942F; see court versions.

The tests

evm/test/GavelrEscrow.t.sol holds 18 Foundry tests against a mock identity registry; run them with npm run test:escrow. All 18 passed on 20 November 2026 with forge 1.7.1.

AreaTests
Hiring (3)test_hireChecksAgentOwnership, test_hireRejectsVerifierAsParty, test_hireStoresTerms
Paying without a dispute (5)test_buyerReleases, test_anyoneClaimsAfterWindow, test_buyerReclaimsWhenNotDelivered, test_deliveryIsFrozen, test_disputeOnlyWithinWindow
Settlement (10)test_rulingSettlesWithBuyerAndVerifier, test_rulingSettlesWithSellerAndVerifier, test_partiesMayAgreeWithoutCourt, test_verifierAloneCannotSettle, test_strangerCannotSign, test_alteredSplitIsRejected, test_otherEvidenceIsRejected, test_expiredVerdictIsRejected, test_cannotSettleTwice, test_unsettledDisputeSplitsEvenlyAfterTimeout
Caveats

The contract is unaudited; the tests cover each payment route and each settlement check, which is not the same as an audit. Payments are pushed to the receiver, so if a buyer or seller address is a contract that refuses BNB, every payout that sends to it reverts. And the escrow cannot tell whether buyer and seller are two different people: one operator with two wallets can hire itself.