- Solidity 100%
| abis/arbitrum-sepolia | ||
| deployments | ||
| docs | ||
| lib | ||
| script | ||
| src | ||
| test | ||
| .env.example | ||
| .gitignore | ||
| .gitmodules | ||
| foundry.toml | ||
| LICENSE | ||
| README.md | ||
contracts
Smart contracts: TSKR and gTSKR tokens, staking, market escrow, arbitration
Phase 1 contracts (branch feat/phase1-contracts)
Foundry project. Setup: git submodule update --init --recursive (forge-std, OpenZeppelin v5.1.0 via .gitmodules) then forge test.
Solidity 0.8.24, via-IR, optimizer 200. Remappings are pinned in foundry.toml with auto_detect_remappings = false, so a clean clone reproduces the metadata hash. Env: copy .env.example to .env (gitignored); foundry.toml has arbitrum_sepolia rpc/etherscan entries reading ARB_SEPOLIA_RPC_URL (public default https://sepolia-rollup.arbitrum.io/rpc) and ARBISCAN_API_KEY.
| Contract | Purpose |
|---|---|
src/TaskulerMarket.sol |
Market + escrow, Kleros V2 arbitrable (IArbitrableV2). Fee max(price×bps, min) on top (hard cap 5%), deposits max(bounty×bps, min), bids/lower bids, delivery, accept, anyone-triggered timeouts, settlement offers (0/25/50/75/100), disputes with 5 choices (1..5 = 0..100%, 0 = 50/50), fee recomputed on paid amount, deposits forfeit only on clear loss, Kleros fees borne in proportion to ruling, pull-payment withdrawals, per-job snapshot of params + arbitrator, fee-free project jobs from allow-listed posters. Delivery closes at deadline + grace. A dispute on which Kleros stays silent (no ruling, first round still in its evidence period) for 180 days after creation can be closed by anyone (resolveStalledDispute, else RulingPending; disputes with an appeal round wait for Kleros): full refund to the customer, no protocol fee, builder deposit returned; a later rule() is accepted as a no-op. |
src/ReviewerRegistry.sol |
CR2 published reviewer list, signer-conflict list, per-token minimum reviewer fee (owner = Safe). |
src/PayoutLib.sol, src/ReviewLib.sol, src/DisputeLib.sol |
External libraries used by the Market: final-split accounting (credits, Kleros-cost reimbursement, WorkHistory record), CR2 review bookkeeping, and the dispute-timeout arbitrator-silence check (KlerosCore views, src/interfaces/kleros/IKlerosCoreViews.sol; works with the deployed 0.10.0 core and with rc.2). |
src/BuilderBonus.sol |
Customer-job bonus: 2,000 TSKR per qualifying job to the builder while the funded pool covers it (no count cap; 10M lifetime ceiling MAX_TOTAL), max 10 per builder and 3 per customer per funding period (the allocation vault's monthly release step), per-award pull withdrawals within 180 days; excess back to the initial-builder allocation vault. |
src/WorkHistory.sol |
Neutral on-chain record of every finished job; soulbound ERC-721 badge for each paid job. |
src/token/TSKR.sol |
Fixed 1,000,000,000 supply, minted once: 60% community vault, 35% Treasury vault, 5% liquidity reserve. No owner/mint. |
src/token/MonthlyVestingVault.sol |
Monthly-step vesting: community 0-month cliff / 48 months; Treasury no cliff, 36 monthly releases from month 1 (DECIDED 2026-11-12, replaces the 12-month cliff). Release callable by anyone. |
src/token/LiquidityReserve.sol |
Holds the 5%; only the governance Safe can release it, for pool seeding approved by a TSW vote (Phase 2), through a 48-hour timelock: scheduleRelease → executeRelease from 48h until 48h + 7 days (then ReleaseExpired), cancelRelease any time before execution. |
script/DeployPhase1.s.sol |
Draft deploy script (not executed). |
TSW (governance/stake weight, soulbound) is Phase 2 and not in this branch.
See docs/OPEN-QUESTIONS.md.
Configurable parameters (Market)
Set at deploy (InitParams, defaults in defaultInitParams()), then by governance for NEW jobs (snapshotted per job and emitted in JobParams):
maxDepositBps (deploy-time only, default 100% of the bounty, decided 2026-10-23 superseding 30%; also caps the builder deposit a customer can require; on tiny jobs exactly the per-token minimum is allowed even above 100% — both DECIDED 2026-10-23; emitted in MaxDepositBpsSet), feeBps (≤ 5% hard cap), depositBps,
minReviewPeriod (7d), minGracePeriod (1d), settlementWindow (5d per offer), maxCounters (3 = counters after the opening offer,
so 4 offers total; decided 2026-10-23), forfeitOnMissedDeadline (true: builder deposit → customer; decided 2026-10-23),
shareArbitrationCost (true: on ETH jobs the Kleros cost is shared by the ruling). Per-token minFee / minDeposit via configureToken
(snapshotted per job). The vesting "month" stays a 30-day constant.
Governance
At launch every onlyOwner (Market, WorkHistory, LiquidityReserve) is a 2-of-3 Safe with no timelock (decided 2026-10-23; address TBD),
set directly in the constructors from GOVERNANCE_SAFE_ADDRESS, which the deploy script requires to be nonzero with contract code
(Sepolia-only override ALLOW_NON_CONTRACT_GOVERNANCE_TESTNET=true). The Treasury (fee recipient, Treasury vault beneficiary) defaults to
the same Safe. Ownership is Ownable2Step: a later change needs transferOwnership + acceptOwnership by the new owner.
TSKR and the vesting vaults have no owner.
Currencies
Allow-listed ERC-20s and native ETH (token = address(0), decided 2026-10-23, 0004). ETH jobs: postJob/placeBid are payable and
msg.value must equal the amount due exactly; ERC-20 jobs must send no ETH. Payouts go through claimable/withdraw(address(0)).
Accounting: jobHeld[token] (job funds), arbitrationEthHeld (Kleros prepay excess in flight) and totalClaimable[token];
invariant balance == jobHeld + arbitrationEthHeld + totalClaimable (ETH) is fuzz-tested.
OFAC payout hold (decided 2026-11-09, taskuler/docs 0005)
Governance (the Safe) can put a time-boxed hold on an address with a potential or confirmed sanctions match:
placeHold(account, duration, reasonHash, reasonURI) (a second call on a held account is a renewal and may only extend),
liftHold(account, reasonHash, reasonURI), views isHeld(account), holdUntil(account), reviewEndsAt(jobId).
Each hold or renewal lasts at most MAX_HOLD_DURATION from the moment it is placed (immutable, InitParams.maxHoldDuration,
1 s .. 30 days, default 30 days).
- Frozen, never confiscated. While held,
withdrawreverts withAccountHeld(account). Credits still land inclaimableand stay there, and nothing is redirected. The balance becomes withdrawable the moment the hold is lifted or expires. - No new funds from or to a held address: it can't
postJob/postProjectJob,placeBid, accept a bid, have its bid accepted or prepay Kleros (requestArbitration). - Silence never pays a held party:
releaseAfterReviewreverts while the builder is held. If the customer is held after delivery, its review clock restarts when the hold ends (reviewEndsAt = max(deliveredAt, holdUntil[customer]) + reviewPeriod). - The counterparty is never stuck: acceptance, settlements,
refundAfterDeadline,cancelJob,withdrawBid, arbitration excess credits and Klerosrule()all still resolve (andrule()never reverts because of a hold). Only the held party's own credit is frozen. A customer facing a held builder can still dispute, accept or settle; a builder facing a held customer can dispute. - Clearance policy (DECIDED 2026-11-09, George; applied off-chain, recorded in each event's reason URI): an exact match against
OFAC's published sanctioned addresses never clears; it is renewed for as long as the address stays listed. A softer flag clears
only after a fresh re-screen plus a written review recorded by the Safe, so the Safe signs off (
liftHold). Max hold 30 days (DECIDED). - DECIDED 2026-11-10: the held-customer review clock restarts in full after the hold ends, and a held party (builder included)
can't start a Kleros dispute. PROVISIONAL (George decision pending): blocking new escrow (post, bid, accept) on-chain, and
refundAfterDeadlineresolving (frozen) while the customer is held; see OPEN-QUESTIONS 19.
CR2 completion review for pre-TSW build tasks (decided 2026-11-09, taskuler/docs 0007)
Build tasks are ordinary Market jobs where the governance Safe is the customer. ReviewerRegistry (owner = the Safe) holds the
published reviewer list, the signer-conflict list and the per-token minimum reviewer fee.
| Step | Call | Who | Notes |
|---|---|---|---|
| Publish reviewers | ReviewerRegistry.setReviewer(reviewer, listed, metadataURI) |
Safe | RL2 (DECIDED 2026-11-10): open off-chain application against published criteria, then the Safe lists the reviewer; metadataURI = application + criteria + independence statement. Delisting (listed = false) requires a non-empty reason in the same argument, else MissingReason (DECIDED 2026-11-12). Event ReviewerSet(reviewer, listed, metadataURI) |
| Conflict list | ReviewerRegistry.setConflicted(account, conflicted, reasonURI) |
Safe | Safe signers (incl. George) and their declared addresses; event ConflictSet |
| Min fee | ReviewerRegistry.setMinReviewerFee(token, amount) |
Safe | e.g. USDC 50e6 ($50); event MinReviewerFeeSet; fee = max(5% × bounty, min) (REVIEWER_FEE_BPS = 500) |
| Post + assign | postJob(p) then assignReviewer(jobId, reviewer) (one Safe multisend) |
Safe | Job must be Open (before work starts). Reviewer must be listed, not conflicted, not held, not the customer. Escrows the reviewer fee on top of the bounty (ETH: exact msg.value). Event ReviewerAssigned(jobId, reviewer, fee, 0) |
| Accept a bid | acceptBid |
Safe | Reverts Conflicted(builder) for a conflicted builder (on any Safe-customer job) and BadReviewer if the builder is the reviewer. On a review job, reverts TooEarly until REVIEWER_ACCEPT_DELAY (24 hours) after the reviewer was assigned, so bidders can see the review terms and withdraw (DECIDED 2026-11-12) |
| Review | submitRecommendation(jobId, builderPct, noteHash, noteURI) |
reviewer | Delivered only, builderPct ∈ {0,25,50,75,100} (100 = accept), before reviewDeadline(jobId) = max(deliveredAt, assignedAt) + reviewPeriod. The fee stays escrowed until resolution. Event RecommendationSubmitted(jobId, reviewer, builderPct, objectionEndsAt, noteHash, noteURI) |
| Follow | executeRecommendation(jobId) |
Safe at once only if the recommendation is 100% (DECIDED 2026-11-12); otherwise anyone, the Safe included, after objectionEndsAt = recommendedAt + OBJECTION_WINDOW (5 days, DECIDED 2026-11-10) |
Resolves at the recommended split, deposits returned, reviewer fee paid, WorkHistory outcome Reviewed |
| Escalate | requestArbitration(jobId) |
customer or builder, while Assigned/Delivered and before execution |
Unchanged: the raiser prepays the Kleros fee in ETH. A recommendation doesn't change the prepay. Reviewer fee (DECIDED 2026-11-10): paid if the ruling gives exactly the recommended split, refunded to the customer (j.customer, the Safe on build tasks) otherwise. Ruling 0 (refuse or tie, 50/50, DECIDED 2026-11-10): paid iff the recommendation was 50%. requestArbitration doesn't require reviewLapsed: either party can escalate any time after delivery, with or without a recommendation. rule() can't revert |
| Reviewer missed deadline | reassignReviewer(jobId, newReviewer) |
Safe | After reviewDeadline, at most MAX_REVIEWER_REASSIGNMENTS = 2 (DECIDED 2026-11-10). The new reviewer gets a fresh reviewPeriod. Event ReviewerAssigned(jobId, newReviewer, fee, n) |
| Nobody reviews | requestArbitration(jobId) |
builder whenever it wants, or the customer; no duty to escalate (DECIDED 2026-11-10) | DECIDED 2026-11-10: no silence payout on review jobs (releaseAfterReview never opens, reviewEndsAt = max). Once reviewLapsed(jobId) (2 reassignments used, last reviewer's deadline passed) only Kleros can end the job; funds stay in escrow until someone files. The filer prepays as usual; on ERC-20 jobs a filing builder bears the prepay and the Safe doesn't repay it (DECIDED 2026-11-10). The unearned fee goes back to the customer |
Binding, not advisory: on a review job the Safe can't acceptDelivery or use settlement offers (ReviewJob()). The only exits are
the recommendation (executed by the Safe at once if 100%, otherwise by anyone after the objection window), Kleros, or refundAfterDeadline (missed work deadline). Silence
never pays on a review job. A cancelled job, a job that resolves without a recommendation, or a Kleros ruling that differs from the
recommendation refunds the reviewer fee to the customer (j.customer, the Safe on build tasks). "Controls the builder" can't be detected on-chain: the gate blocks only listed addresses. Signers must
declare their addresses (and any entity they control) off-chain, and the Safe lists them.
DECIDED 2026-11-09: reviewer fee = 5% of the task budget with a $50 minimum (per-token minReviewerFee, e.g. USDC 50e6).
DECIDED 2026-11-10: objection window 5 days (OBJECTION_WINDOW); at most 2 reassignments; the conflict check covers every
Safe-funded job; no silence payout on review jobs, a lapsed review goes to Kleros; the reviewer fee is escrowed until resolution and
refunded to the customer if Kleros overrules; reviewers join via RL2 (open application, Safe-listed); a lapsed review has no duty to
escalate: the builder files whenever it wants (the customer can too) and funds stay in escrow until then; on ERC-20 jobs a filing
builder bears the Kleros prepay, not repaid by the Safe; ruling 0 (50/50) pays the reviewer iff it recommended 50%.
See OPEN-QUESTIONS 20.
New state: reviews(jobId) → (reviewer, assignedAt, recommendedAt, builderPct, reassignments, fee) (all zero on ordinary jobs),
views reviewDeadline(jobId), reviewEndsAt(jobId) and reviewLapsed(jobId), constant OBJECTION_WINDOW (5 days), immutable reviewerRegistry (new constructor argument after workHistory;
address(0) disables review jobs). No new Status values: a review job goes Open → Assigned → Delivered → Resolved | Disputed
as usual. New WorkHistory outcome: Reviewed (appended, value 5). The settlement core lives in PayoutLib and the review
bookkeeping in ReviewLib, the dispute-timeout check in DisputeLib (all external libraries, linked at deploy) to keep the Market under 24 KB.
Customer-job bonus (decided 2026-11-09; rules 0007 Nov 8)
src/BuilderBonus.sol is a separate contract (owner = the Safe, always the same owner as the Market: deployment invariant) holding TSKR for this track. The builder of a qualifying
customer-funded job gets a flat 2,000 TSKR (BONUS) while the pool funded into the contract can cover it (DECIDED
2026-11-13: no 5,000-job count; DECIDED 2026-11-13, 2:51 PM CT: a hard lifetime ceiling MAX_TOTAL = 10M TSKR on bonus TSKR
paid, owed and earmarked, lifetimeCommitted() = totalPaid + committed(); reserve reverts LifetimeCapReached above it).
The ceiling is counted from reservation (earmark) and award. A cancel, void, expiry or release gives its headroom back, because
exactly that 2,000 TSKR returns to the pool unpaid and the slot can never pay; a withdrawal moves it from owed to totalPaid,
so TSKR ever paid out can never exceed 10M. Each builder can get at most 10 per funding period (MAX_PER_BUILDER_PER_PERIOD), each customer 3. The
amount and the per-address caps are constants.
- Pool and earmarks:
committed() = totalOwed + reservedCount × 2,000,available() = balance − committed(). A reservation earmarks its 2,000 TSKR, soreserverevertsNotFundedwhenavailable() < 2,000(it can be retried after funding), and a reserved job'sfinalizenever fails for lack of funds. Releases, voids, cancels and expiries return TSKR to the pool. - Funding period (DECIDED 2026-11-10: follows the monthly builder-allocation release): the constructor reads
startandMONTH(30 days) from the allocation vault, soperiodOf(t) == allocationVault.monthsElapsed(t)at everyt(fuzz-tested). Period 0 is the vault's first month; period n starts at the same second the vault's n-th monthly release unlocks (vestedAmountsteps atstart + n × MONTH, no cliff).PERIODandperiodStartare immutables, not settings. reserve(jobId)(anyone, e.g. the website keeper) once a bid is accepted (Assigned/Delivered/Disputed). It checks the qualifying rules, the pool (available() >= 2,000), the per-Market period cap, the builder's count (max 10) and the customer's count (max 3, DECIDED 2026-11-12) in the current period. EventSlotReserved(jobId, builder, period, reservedCount, market).finalize(market, jobId)(anyone;market= the Market that reserved the slot) once the job isResolved. On a 100% payout (Market.resolvedBuilderPct(jobId) == 100, Kleros included) to a still-qualifying job it turns the earmark into a PENDING award of 2,000 TSKR (BonusAwarded(..., claimableAt)). Over the per-Market period cap it revertsMarketPeriodCapReachedand can be retried next period. Any other outcome releases the slot, its earmark and the builder's and customer's period counts (SlotReleased). It reverts while the job is open or disputed.- 14-day delay (DECIDED 2026-11-12):
cancelAward(market, jobId, reason)(Safe only, non-empty reason,BonusCancelled) withinCLAIM_DELAY(14 days) of the award; the TSKR returns to the pool. DECIDED 2026-11-12: the award's builder and customer are both barred from bonuses for 2 full funding periods from the cancel (BAR_PERIODS;barredUntiltimestamp = cancel + 2 ×PERIOD,isBarred, eventAccountBarred(account, until)), and the cancelled award keeps its place in both period counts. The team watchesBonusAwardedoff-chain during the 14 days (operational control, not code). - Claiming and the 180-day deadline (DECIDED 2026-11-13): there is no unlock step. The builder calls
withdraw(market, jobIds)for its awards fromclaimableAt(award + 14 days) untilclaimableAt + CLAIM_WINDOW(180 days, exclusive);claimWindow(market, jobId)returns both times. Each award emitsBonusClaimed, the callBonusWithdrawn; ids that can never pay (already claimed, expired, cancelled, voided or released, past the deadline, or unmatured on a revoked Market) are skipped, so someone expiring one id first can't fail the batch; it revertsNothingToWithdrawif nothing is paid. It still reverts for the whole call on an id that isn't the caller's or is unknown (NotBuilder), is only reserved (BadStatus) or not claimable yet (TooEarly), and on any hold (AccountHeld,HoldCheckFailed): those are requests for something that isn't payable to the caller now, and a hold must block every payout. From the deadline anyone callsexpire(market, jobIds)(batch, skips other ids), which returns the TSKR to the pool (BonusExpired); the earned bonus keeps its period counts, nobody is barred. Withdraw is blocked while any Market that was ever current (revoked or not, unless ignored) reports an OFAC hold on the builder. - Held time pauses the deadline (L-5, DECIDED 2026-11-13, 2:51 PM CT):
expirechecks the builder's holds with the same fail-closed rules aswithdraw(held, revert or garbage on any Market not ignored) and skips the id, so a held builder's award is never expired. Each builder has a hold clock (holdClock):pokeHold(builder)(anyone;expireandwithdrawdo the same) starts it when a hold is first observed (HoldObserved) and stops it when the hold is observed to have cleared (HoldCleared(builder, heldFor)), adding the held seconds to the deadline of every award the builder had at the time (heldBaselinerecords the credit at award time, so earlier holds don't count).claimWindowreturns the extended deadline. A hold nobody observed while it lasted isn't credited; one still in place at the deadline always blocks expiry. Keepers poke on the Markets'HoldPlaced/HoldRenewed/HoldLiftedevents and at a hold'suntil. Gas: oneisHeldcheck (at most 50,000 gas) per Market ever current, per id that is due, plus per id of a builder whose clock is running. - Market repoint (DECIDED 2026-11-13):
scheduleRepoint(newMarket)(Safe only; a contract answeringjobCount()whoseowner()is BuilderBonus's owner, not the current Market, one at a time),executeRepoint()(owner re-checked,OwnerMismatch) afterREPOINT_DELAY(48 hours) and beforeREPOINT_WINDOW(7 days) ends,cancelRepoint()any time. EventsRepointScheduled,RepointCancelled,MarketRepointed. Only themarketpointer changes: counts, bars, exclusions,minBountyand budget carry over. Slots are keyed by (Market, jobId), soreservetakes jobs from the current Market and older slots settle against the Market that reserved them. - Per-Market cap and revocation (re-review M-1): each Market makes at most
marketPeriodCapreservations and awards per period (default 250, Safe-settable 1..5,000 withsetMarketPeriodCap: a decrease applies at once and drops any pending increase; an increase is scheduled and applied withexecuteMarketPeriodCap()after 48 hours, within 7 days, cancellable withcancelMarketPeriodCap()). No carry-over of unused period allowance (DECIDED 2026-11-13).revokeMarket(m)(Safe, final, instant, also on the current Market) recordsrevokedAtand stops a wrong, hostile or stuck Market. Awards whoseclaimableAt <= revokedAtstill pay until their 180-day deadline. Anyone can void its reserved, never-awarded slots withfinalizeorreleaseSlots(m, ids); only the Safe can void its awards that had not matured at revocation, withvoidAwards(m, ids)(SlotVoided; TSKR back to the pool, period counts restored, no bars; ineligible ids are skipped).cancelAwards(m, ids, reason)batch-cancels pending awards with bars and skips ids that aren't cancellable.withdrawasks every Market that was ever current, revoked or not, and fails closed:truerevertsAccountHeld, and a revert, out-of-gas or malformed answer revertsHoldCheckFailed(market). The Safe can stop asking one Market withscheduleIgnoreHolds(m)+executeIgnoreHolds(m)(48 hours, 7-day window,cancelIgnoreHolds);honourHolds(m)undoes it at once. Revoked Markets use the same 48-hour schedule; only a revoked Market that is visibly broken (isHeld(address(0))reverts, runs out of gas, returns malformed data or true) can be ignored at once withignoreBrokenMarketHolds(m)(L-6, DECIDED 2026-11-16), and honouring a revoked Market again is timelocked (scheduleHonourHolds(m),executeHonourHolds(m)after 48 hours within 7 days,cancelHonourHolds(m);honourHoldsrevertsTimelocked). - Qualifying: not a project job, not a CR2 review job, customer is not the Market owner (Safe build tasks use the build-bounty
track), customer != builder, neither is
excludedor barred after a cancelled award, a minimum bounty is set for the token and the accepted price is at least it (minBounty[token]0 = token not eligible, DECIDED 2026-11-12), and the job's snapshotted fee rate is at least 2% (MIN_FEE_BPS, DECIDED 2026-11-12). - Governance:
setMinBounty(token, amount)(MinBountySet),setExcluded(account, excluded, reasonURI)(ExclusionSet), andreturnExcess(), which sends only the uncommitted pool (available()) and only toallocationVault(ExcessReturned). - Leftover TSKR → the 600M initial-builder allocation (DECIDED 2026-11-10):
allocationVaultis a constructor argument that must equal TSKR's genesiscommunityRewardsVault(the MonthlyVestingVault holding 60% = 600M); anything else revertsBadAllocationVault. No Safe default. Returned TSKR rejoins that vault and vests on its schedule (the vault counts total = balance + released, so the already-vested share becomes releasable to the distributor right away). - Minimum bounty (DECIDED 2026-11-10; amount DECIDED 2026-11-12): a Safe setting, default 0 for every token (nothing
qualifies). The Safe will call
setMinBounty(USDC, 1_000e6)($1,000, raised from $100;DeployPhase1.BONUS_MIN_BOUNTY_USDC) right after deploy. Per-token equivalents, notes only, set by the Safe at the time: ETH ≈ $1,000 worth (e.g.0.333 etherat $3,000), USDT1_000e6, DAI1_000e18; any other token stays 0 (not eligible). - Cap enforcement CE2 (DECIDED 2026-11-10): the per-address count above plus Safe exclusions with a published reason, using
the existing
excludedlist;setExcluded(account, true, reasonURI)revertsMissingReasonwithout a reason URI, andExclusionSet(account, excluded, reasonURI)carries it. - DECIDED 2026-11-09: 10 bonuses per builder per funding period. PROVISIONAL (George decision pending): released slots return at once and free the builder's count (never while open or disputed). See OPEN-QUESTIONS 21.
- Funding:
MonthlyVestingVault.releasecan only pay its fixed beneficiary, the rewards distributor (REWARDS_DISTRIBUTOR). The distributor then transfers TSKR to BuilderBonus, up to the 10M budgeted for this track (just in time). Community releases are 600M / 48 = 12.5M per month, so the whole 10M fits in one month's release, alongside the build-bounty track's share. - Market change: new view
resolvedBuilderPct(jobId), the final builder % recorded when a job resolves.
Circuit breaker
The Safe can pause() the Market (and unpause() it, immediately). While paused, postJob, postProjectJob, placeBid and
assignReviewer revert EnforcedPause; nothing else changes, so every job already in escrow can still finish (including
disputes and stalled-dispute timeouts) and everyone can withdraw. Events: Paused(address), Unpaused(address); view
paused(). Shipping a fixed Market after launch: docs/VERSIONED-REDEPLOY-RUNBOOK.md.
Indexer events
Constructor now also emits TreasurySet(treasury) and MaxHoldDurationSet(maxHoldDuration). New:
HoldPlaced(address indexed account, uint64 until, bytes32 reasonHash, string reasonURI),
HoldRenewed(address indexed account, uint64 until, bytes32 reasonHash, string reasonURI),
HoldLifted(address indexed account, bytes32 reasonHash, string reasonURI). Errors: AccountHeld(address), NotHeld().
CR2 (Market): ReviewerAssigned(uint256 indexed jobId, address indexed reviewer, uint256 fee, uint8 reassignment),
RecommendationSubmitted(uint256 indexed jobId, address indexed reviewer, uint8 builderPct, uint64 objectionEndsAt, bytes32 noteHash, string noteURI),
ReviewerFeeSettled(uint256 indexed jobId, address indexed to, uint256 amount, bool paidToReviewer) (new 2026-11-10, at resolution).
Changed 2026-11-10: Credited(address indexed account, address indexed token, uint256 amount, uint256 indexed jobId, uint8 reason)
(new topic hash). reason = CreditReason: 0 Payout, 1 Refund, 2 DepositReturn, 3 DepositForfeit, 4 ProtocolFee, 5 ReviewerFee,
6 ReviewerFeeRefund, 7 ArbitrationRefund (excess prepay), 8 ArbitrationReimbursement. A resolution now emits one Credited per
component (e.g. builder Payout + DepositReturn) instead of one per account; per-account totals are unchanged.
CR2 (ReviewerRegistry): ReviewerSet(address indexed reviewer, bool listed, string metadataURI),
ConflictSet(address indexed account, bool conflicted, string reasonURI), MinReviewerFeeSet(address indexed token, uint256 minReviewerFee).
JobResolved / Credited / ArbitrationCostReimbursed are now emitted from PayoutLib code, but still at the Market's address,
with the same signatures except Credited (reason added). WorkHistory.Outcome gains Reviewed (5).
BuilderBonus (after #16): SlotReserved(uint256 indexed jobId, address indexed builder, uint256 indexed period, uint256 reservedCount, address market),
BonusAwarded(uint256 indexed jobId, address indexed builder, address indexed market, uint256 amount, uint256 awarded, uint64 claimableAt),
SlotReleased(uint256 indexed jobId, address indexed builder, address indexed market, uint8 builderPct),
BonusClaimed(uint256 indexed jobId, address indexed builder, address indexed market, uint256 amount),
BonusExpired(uint256 indexed jobId, address indexed builder, address indexed market, uint256 amount),
BonusWithdrawn(address indexed builder, uint256 amount),
AccountBarred(address indexed account, uint256 until) (new 2026-11-12, emitted twice by cancelAward),
MinBountySet(address indexed token, uint256 minBounty), ExclusionSet(address indexed account, bool excluded, string reasonURI),
ExcessReturned(address indexed to, uint256 amount).
Behaviour notes
- Accept early:
acceptDeliveryworks fromAssigned(before any delivery) as well asDelivered; the builder is paid 100%. - Settlement offers: opening offer + up to
maxCounterscounters, each opensettlementWindow. Proposer can cancel; the other side can accept, counter or reject. Rejecting the final allowed offer, or letting any offer lapse, escalates (no more offers). - Arbitration can be requested only while a job is
Assigned(bid accepted) orDelivered, by the customer or builder; it closes a live offer. Only the raiser prepays the first-round Kleros fee in ETH and the dispute is created at Kleros immediately (decided 2026-10-23); excess ETH is credited back. After the ruling: ETH jobs (switch on) reimburse the raiser for the other party's ruling share (customer p%, builder 100−p%) out of that party's ETH payout for the job, capped (ArbitrationCostReimbursed); ERC-20 jobs: the raiser bears the fee with no reimbursement (both rules DECIDED 2026-10-23). - Events: every balance increase emits
Credited(account, token, amount, jobId, reason); URIs (ipfs://) accompany spec/proposal/delivery/note hashes.
Kleros V2 (Arbitrum Sepolia testnet) — see script/DeployPhase1.s.sol
KlerosCore proxy 0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479; extraData abi.encode(courtId=1, minJurors=3, disputeKitId=1).
Sources: https://github.com/kleros/kleros-v2/blob/dev/contracts/README.md ,
https://github.com/kleros/kleros-v2/blob/dev/contracts/src/arbitration/KlerosCore.sol ,
https://github.com/kleros/kleros-v2/blob/dev/contracts/src/libraries/Constants.sol
The Sepolia core has no arbitrable whitelist. The Arbitrum One core (KlerosCoreNeo) does: every Market (re)deploy there must be
whitelisted by Kleros before use (docs/DEPLOY-RUNBOOK.md, a mainnet blocker together with the DisputeRequest form, KI-5).
Audit readiness
- Scope, trust assumptions, nSLOC and design choices:
docs/AUDIT-SCOPE.md. - Slither and forge lint triage:
docs/SECURITY-NOTES.md. - Stateful invariants (funds-held, value conservation, no stuck escrow):
test/invariant/MarketInvariant.t.sol. - Coverage:
forge coverage --ir-minimum --no-match-path 'test/invariant/*' --report summary. - Fork tests (
test/fork/, real KlerosCore on Arbitrum Sepolia): needARB_SEPOLIA_RPC_URL(archive). WithCIorREQUIRE_FORK_TESTS=trueset and no RPC URL they fail; on a plain local run without the URL they are skipped. - Deploy go-live gates (Kleros whitelist and more):
docs/DEPLOY-RUNBOOK.md. - Pinned toolchain: solc 0.8.24 (exact pragma), OpenZeppelin v5.1.0, forge-std v1.9.4 (git submodules).
- Job data: the
jobsmapping is internal; read jobs withgetJob(uint256) returns (Job memory).