OFAC payout hold (0005): time-boxed Safe holds, freeze without confiscation #4

Merged
Taskuler-bot merged 3 commits from feat/ofac-payout-hold into main 2026-11-11 03:45:15 +00:00
Member

Base: feat/phase1-contracts · Head: feat/ofac-payout-hold · Decided by George 2026-11-09/10 (taskuler/docs 0005). Not deployed. Replaces #1.

Design

  • placeHold(account, uint32 duration, bytes32 reasonHash, string reasonURI) (Safe only): hold for at most MAX_HOLD_DURATION
    (immutable, InitParams.maxHoldDuration, 1 s .. 30 days, default 30 days). On a held account it's a renewal and can only extend.
    liftHold(account, reasonHash, reasonURI) ends it early. Views: isHeld, holdUntil, reviewEndsAt.
  • Frozen, never confiscated: while held, withdraw reverts AccountHeld(account). Credits still land in claimable; nothing is
    redirected, and there is no admin path to escrow.
  • A held address can't post, bid, accept a bid, be accepted as builder, or start a Kleros dispute.
  • Timeouts: releaseAfterReview is blocked while the builder is held; a held customer's review clock restarts in full at hold end
    (reviewEndsAt = max(deliveredAt, holdUntil[customer]) + reviewPeriod). refundAfterDeadline, settlements, cancel, withdrawBid,
    arbitration-excess credits and Kleros rule() never revert because of a hold; the held party's share is credited and frozen.

DECIDED

  • 2026-11-09: max hold 30 days. Clearance: an exact sanctions-list address match never clears (renewed while listed); a softer flag
    clears only after a fresh screen plus a written review recorded by the Safe (liftHold reason URI), so the Safe signs off.
  • 2026-11-10: the review clock restarts in full after a hold ends; a held party (builder included) can't start a Kleros dispute.

PROVISIONAL (George decision pending)

  • A held address is also barred on-chain from starting new escrow (post, bid, accept), not only on the website.
  • refundAfterDeadline still resolves while the customer is held; the refund sits frozen in claimable.

Tests and coverage

  • forge test: 136 passed, 0 failed (test/OfacHold.t.sol 23 tests; invariant invariant_HeldFundsNeverLeave).
  • forge coverage --ir-minimum (invariants excluded): TaskulerMarket 99.75% lines, 99.37% statements, 97.89% branches, 100% functions; other src 100%.
  • TaskulerMarket runtime 22,123 B (limit 24,576). Slither: 25 results, all triaged in SECURITY-NOTES.

Indexer events

  • Constructor also emits TreasurySet(treasury) and MaxHoldDurationSet(uint32 maxHoldDuration).
  • 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(). InitParams gains maxHoldDuration (last field).

Changelog 2026-11-10

  • Review-clock restart and no Kleros from a held party moved from PROVISIONAL to DECIDED (comments, README, OPEN-QUESTIONS). No code change.
Base: `feat/phase1-contracts` · Head: `feat/ofac-payout-hold` · Decided by George 2026-11-09/10 (taskuler/docs 0005). Not deployed. Replaces #1. ## Design - `placeHold(account, uint32 duration, bytes32 reasonHash, string reasonURI)` (Safe only): hold for at most `MAX_HOLD_DURATION` (immutable, `InitParams.maxHoldDuration`, 1 s .. 30 days, default 30 days). On a held account it's a renewal and can only extend. `liftHold(account, reasonHash, reasonURI)` ends it early. Views: `isHeld`, `holdUntil`, `reviewEndsAt`. - **Frozen, never confiscated:** while held, `withdraw` reverts `AccountHeld(account)`. Credits still land in `claimable`; nothing is redirected, and there is no admin path to escrow. - A held address can't post, bid, accept a bid, be accepted as builder, or start a Kleros dispute. - Timeouts: `releaseAfterReview` is blocked while the builder is held; a held customer's review clock restarts in full at hold end (`reviewEndsAt = max(deliveredAt, holdUntil[customer]) + reviewPeriod`). `refundAfterDeadline`, settlements, cancel, `withdrawBid`, arbitration-excess credits and Kleros `rule()` never revert because of a hold; the held party's share is credited and frozen. ## DECIDED - 2026-11-09: max hold 30 days. Clearance: an exact sanctions-list address match never clears (renewed while listed); a softer flag clears only after a fresh screen plus a written review recorded by the Safe (`liftHold` reason URI), so the Safe signs off. - 2026-11-10: the review clock restarts in full after a hold ends; a held party (builder included) can't start a Kleros dispute. ## PROVISIONAL (George decision pending) - A held address is also barred on-chain from starting new escrow (post, bid, accept), not only on the website. - `refundAfterDeadline` still resolves while the customer is held; the refund sits frozen in `claimable`. ## Tests and coverage - `forge test`: 136 passed, 0 failed (`test/OfacHold.t.sol` 23 tests; invariant `invariant_HeldFundsNeverLeave`). - `forge coverage --ir-minimum` (invariants excluded): TaskulerMarket 99.75% lines, 99.37% statements, 97.89% branches, 100% functions; other src 100%. - TaskulerMarket runtime 22,123 B (limit 24,576). Slither: 25 results, all triaged in SECURITY-NOTES. ## Indexer events - Constructor also emits `TreasurySet(treasury)` and `MaxHoldDurationSet(uint32 maxHoldDuration)`. - `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()`. `InitParams` gains `maxHoldDuration` (last field). ## Changelog 2026-11-10 - Review-clock restart and no Kleros from a held party moved from PROVISIONAL to DECIDED (comments, README, OPEN-QUESTIONS). No code change.
- placeHold/liftHold (renewal = placeHold on a held account, extend only), MAX_HOLD_DURATION immutable <= 30 days (InitParams.maxHoldDuration)
- withdraw blocked while held; credits still land in claimable (frozen in place)
- held address can't post, bid, accept/be accepted, or prepay Kleros
- releaseAfterReview blocked while builder held; held customer's review clock restarts at hold end (reviewEndsAt)
- rule()/settlement/refundAfterDeadline/cancel/withdrawBid never blocked by holds
- events HoldPlaced/HoldRenewed/HoldLifted/MaxHoldDurationSet; constructor now emits TreasurySet
- tests: OfacHold.t.sol (23 incl. fuzz), invariant_HeldFundsNeverLeave; docs updated
Taskuler-bot changed target branch from feat/phase1-contracts to main 2026-11-11 03:43:31 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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!4
No description provided.