Customer-job builder bonus: 2,000 TSKR on 100% payout (0007) #3

Closed
george wants to merge 3 commits from feat/customer-job-bonus into feat/cr2-completion-review
Owner

Base: feat/cr2-completion-review · Head: feat/customer-job-bonus · Decided by George 2026-11-09. Not deployed.

Design

  • New BuilderBonus (Ownable2Step, owner = the Safe), separate from the Market: it only reads it (getJob, resolvedBuilderPct,
    reviews, isHeld, owner) and never touches escrow. Pull-based payouts.
  • 2,000 TSKR flat to the builder for the first 5,000 qualifying jobs (10M TSKR total). Per-builder cap DECIDED 2026-11-09:
    10 bonuses per builder per funding period (MAX_PER_BUILDER_PER_PERIOD).
  • reserve(jobId) (anyone, e.g. the website keeper) once the builder is accepted (Assigned/Delivered/Disputed): checks qualifying
    rules, the builder isn't held, the global and per-period caps. finalize(jobId) after Resolved: awards when the final builder
    payout is 100% (Kleros included) and the job still qualifies (reverts NotFunded if unfunded); otherwise releases the slot.
    A slot is never released while a dispute is pending.
  • Qualifying: not a project job, not a CR2 review job, customer ≠ Market owner (the Safe), customer ≠ builder, neither excluded,
    accepted price ≥ minBounty[token] (0 = token not eligible).
  • withdraw() is blocked while the Market holds the builder (OFAC). Governance can only setMinBounty, setExcluded, and
    returnExcess() (only TSKR above totalOwed + (5,000 − awarded) × 2,000, only to funder).
  • Market change: resolvedBuilderPct(jobId) set on resolution. Deploy script deploys TSKR and BuilderBonus.

Tests and coverage

  • forge test: 184 passed, 0 failed (new test/BuilderBonus.t.sol, 20 tests; test/invariant/BonusInvariant.t.sol starts near
    the cap and checks CountCap, TotalCap, AwardsFunded, AwardAccounting, PerBuilderPerPeriod).
  • Coverage: BuilderBonus 100% lines/statements/branches/functions; TaskulerMarket 99.75% lines, 98.06% branches.
  • Sizes: TaskulerMarket 22,554 B (22.03 KiB, limit 24,576), BuilderBonus 6,430 B. Slither: 32 results, all triaged.

Indexer events

  • SlotReserved(uint256 indexed jobId, address indexed builder, uint256 indexed period, uint256 slotsUsed)
  • BonusAwarded(uint256 indexed jobId, address indexed builder, uint256 amount, uint256 awarded)
  • SlotReleased(uint256 indexed jobId, address indexed builder, uint8 builderPct)
  • BonusWithdrawn(address indexed builder, uint256 amount)
  • MinBountySet(address indexed token, uint256 minBounty), ExclusionSet(address indexed account, bool excluded, string reasonURI)
  • ExcessReturned(address indexed to, uint256 amount)

PROVISIONAL defaults (George decision pending)

  • Funding period = 30-day periods from the community vault start (30 days given provisionally on 2026-11-09).
  • Minimum bounty = 0 for every token at deploy, so no token qualifies until the Safe calls setMinBounty (suggested USDC 100e6).
  • Funder (receives returnExcess) = the governance Safe by default via BONUS_FUNDER; changed from the deployer EOA in this PR.
  • Slot reuse: a released slot returns to the pool immediately and frees the builder's period count; never while open or disputed.
  • A bonus needs a final 100% payout (AgreedSplit, Reviewed or Kleros at 100% count); unreserved jobs get no bonus; no extra
    non-zero-fee requirement; the Safe keeps the excluded list; no expiry for unfinished jobs.
Base: `feat/cr2-completion-review` · Head: `feat/customer-job-bonus` · Decided by George 2026-11-09. Not deployed. ## Design - New `BuilderBonus` (Ownable2Step, owner = the Safe), separate from the Market: it only reads it (`getJob`, `resolvedBuilderPct`, `reviews`, `isHeld`, `owner`) and never touches escrow. Pull-based payouts. - 2,000 TSKR flat to the builder for the first 5,000 qualifying jobs (10M TSKR total). **Per-builder cap DECIDED 2026-11-09:** 10 bonuses per builder per funding period (`MAX_PER_BUILDER_PER_PERIOD`). - `reserve(jobId)` (anyone, e.g. the website keeper) once the builder is accepted (Assigned/Delivered/Disputed): checks qualifying rules, the builder isn't held, the global and per-period caps. `finalize(jobId)` after `Resolved`: awards when the final builder payout is 100% (Kleros included) and the job still qualifies (reverts `NotFunded` if unfunded); otherwise releases the slot. A slot is never released while a dispute is pending. - Qualifying: not a project job, not a CR2 review job, customer ≠ Market owner (the Safe), customer ≠ builder, neither excluded, accepted price ≥ `minBounty[token]` (0 = token not eligible). - `withdraw()` is blocked while the Market holds the builder (OFAC). Governance can only `setMinBounty`, `setExcluded`, and `returnExcess()` (only TSKR above `totalOwed + (5,000 − awarded) × 2,000`, only to `funder`). - Market change: `resolvedBuilderPct(jobId)` set on resolution. Deploy script deploys TSKR and BuilderBonus. ## Tests and coverage - `forge test`: 184 passed, 0 failed (new `test/BuilderBonus.t.sol`, 20 tests; `test/invariant/BonusInvariant.t.sol` starts near the cap and checks CountCap, TotalCap, AwardsFunded, AwardAccounting, PerBuilderPerPeriod). - Coverage: BuilderBonus 100% lines/statements/branches/functions; TaskulerMarket 99.75% lines, 98.06% branches. - Sizes: TaskulerMarket 22,554 B (22.03 KiB, limit 24,576), BuilderBonus 6,430 B. Slither: 32 results, all triaged. ## Indexer events - `SlotReserved(uint256 indexed jobId, address indexed builder, uint256 indexed period, uint256 slotsUsed)` - `BonusAwarded(uint256 indexed jobId, address indexed builder, uint256 amount, uint256 awarded)` - `SlotReleased(uint256 indexed jobId, address indexed builder, uint8 builderPct)` - `BonusWithdrawn(address indexed builder, uint256 amount)` - `MinBountySet(address indexed token, uint256 minBounty)`, `ExclusionSet(address indexed account, bool excluded, string reasonURI)` - `ExcessReturned(address indexed to, uint256 amount)` ## PROVISIONAL defaults (George decision pending) - Funding period = 30-day periods from the community vault start (30 days given provisionally on 2026-11-09). - Minimum bounty = 0 for every token at deploy, so no token qualifies until the Safe calls `setMinBounty` (suggested USDC `100e6`). - Funder (receives `returnExcess`) = the governance Safe by default via `BONUS_FUNDER`; changed from the deployer EOA in this PR. - Slot reuse: a released slot returns to the pool immediately and frees the builder's period count; never while open or disputed. - A bonus needs a final 100% payout (AgreedSplit, Reviewed or Kleros at 100% count); unreserved jobs get no bonus; no extra non-zero-fee requirement; the Safe keeps the `excluded` list; no expiry for unfinished jobs.
Taskuler-bot force-pushed feat/customer-job-bonus from 478f37962e to 9b2c41de71 2026-11-10 16:58:23 +00:00 Compare
Taskuler-bot closed this pull request 2026-11-10 16:58:46 +00:00
Member

Replaced by #6 (#6), reopened under the taskuler-bot account. Please review there.

Replaced by #6 (https://git.taskuler.com/taskuler/contracts/pulls/6), reopened under the taskuler-bot account. Please review there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
taskuler/contracts!3
No description provided.