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

Closed
george wants to merge 3 commits from feat/ofac-payout-hold into feat/phase1-contracts
Owner

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

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 is a renewal that may 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 no admin path to escrow exists.
  • A held address can't post, bid, accept a bid, be accepted as builder, or prepay Kleros.
  • Timeouts: releaseAfterReview is blocked while the builder is held; a held customer's review clock restarts 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.
  • Clearance policy, DECIDED 2026-11-09: an exact sanctions-list address match never clears (renewed while listed); a softer flag
    clears only after a fresh re-screen plus a written review recorded by the Safe (liftHold reason URI), so the Safe signs off.
    Max hold 30 days, DECIDED.

Tests and coverage

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

Indexer events

  • Constructor now 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).

PROVISIONAL defaults (George decision pending)

  • Held customer's review window restarts when the hold ends (conservative: silence never pays while the customer can't act).
  • A held party, builder included, can't start Kleros (conservative: no ETH from a flagged wallet reaches jurors; the counterparty can still escalate).
  • A held address can't start new escrow on-chain (post, bid, accept), not only on the website.
  • refundAfterDeadline still resolves while the customer is held; the refund sits frozen.
Base: `feat/phase1-contracts` · Head: `feat/ofac-payout-hold` · Decided by George 2026-11-09 (taskuler/docs 0005). Not deployed. ## 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 is a renewal that may 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 no admin path to escrow exists. - A held address can't post, bid, accept a bid, be accepted as builder, or prepay Kleros. - Timeouts: `releaseAfterReview` is blocked while the builder is held; a held customer's review clock restarts 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. - **Clearance policy, DECIDED 2026-11-09:** an exact sanctions-list address match never clears (renewed while listed); a softer flag clears only after a fresh re-screen plus a written review recorded by the Safe (`liftHold` reason URI), so the Safe signs off. Max hold 30 days, DECIDED. ## Tests and coverage - `forge test`: 136 passed, 0 failed (new `test/OfacHold.t.sol`, 23 tests; invariant `invariant_HeldFundsNeverLeave` with hold/renew/lift actions). - `forge coverage --ir-minimum` (invariants excluded): TaskulerMarket 99.75% lines, 99.37% statements, 97.89% branches, 100% functions; other src 100%. - Market runtime size 22,123 B (limit 24,576). Slither: 25 results, all triaged in SECURITY-NOTES. ## Indexer events - Constructor now 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). ## PROVISIONAL defaults (George decision pending) - Held customer's review window restarts when the hold ends (conservative: silence never pays while the customer can't act). - A held party, builder included, can't start Kleros (conservative: no ETH from a flagged wallet reaches jurors; the counterparty can still escalate). - A held address can't start new escrow on-chain (post, bid, accept), not only on the website. - `refundAfterDeadline` still resolves while the customer is held; the refund sits frozen.
- 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 closed this pull request 2026-11-10 16:58:42 +00:00
Member

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

Replaced by #4 (https://git.taskuler.com/taskuler/contracts/pulls/4), 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!1
No description provided.