Skip to main content

Overview

EscrowPeriod is a dual-purpose contract, it functions as both a hook and a condition:
  • As a hook: Records the block.timestamp at payment authorization
  • As a condition: Returns true only after the escrow period has elapsed
Use the same address for both AUTHORIZE_POST_ACTION_HOOK and CAPTURE_PRE_ACTION_CONDITION slots on the operator. Type: Per-deployment via EscrowPeriodFactory

Architecture

EscrowPeriod extends AuthorizationTimeRecorderHook and adds ICondition implementation. You don’t need to deploy AuthorizationTimeRecorderHook on its own, use EscrowPeriod directly.

Logic

Checks:
  1. The payment has a recorded authorization timestamp
  2. Current time >= authorization time + escrow period

Deployment

Deploy via EscrowPeriodFactory:
Then configure the operator:

Composition with Freeze

Compose this condition with a separate Freeze condition via AndCondition to gate capture on both escrow elapsed and not frozen. See Composition Patterns for the wiring.

Use Cases

  • Time-lock releases: 7-day escrow for e-commerce
  • Delayed fund access: Grace period before receiver can access funds
  • Buyer protection: Give payers time to freeze or request refunds

Gas

Cost: ~20k gas per run() call (one SSTORE for the timestamp). The check() call is a view function with one SLOAD.

Next Steps

Freeze

Add freeze protection to escrow periods.

Factories

Deploy EscrowPeriod via factory.