Skip to main content

Overview

Freeze is a standalone condition that blocks capture on frozen payments. It manages freeze and unfreeze state with configurable authorization and an optional duration-based auto expiry. Type: Per-deployment via FreezeFactory

Architecture

  • Implements ICondition
  • Freeze/unfreeze authorization via ICondition contracts (passed to constructor)
  • Optionally linked to EscrowPeriod to restrict freezing to during the escrow window

Logic

// ICondition, returns false when frozen (blocks capture)
function check(
    AuthCaptureEscrow.PaymentInfo calldata paymentInfo,
    uint256,
    address,
    bytes calldata
) external view returns (bool allowed) {
    return !isFrozen(paymentInfo);
}

Deployment

Deploy via FreezeFactory:
// Deploy Freeze with payer freeze, arbiter unfreeze, 3-day duration
const freeze = await freezeFactory.deploy(
  PAYER_CONDITION,      // freeze condition (payer protection)
  ARBITER_CONDITION,    // unfreeze condition (dispute resolution)
  3 * 24 * 60 * 60,     // 3 days (auto-expires, 0 = permanent)
  escrowPeriod          // optional: link to EscrowPeriod (address(0) = unconstrained)
);

Composition Patterns

// Escrow period only:  capturePreActionCondition = escrowPeriod
// Freeze only:         capturePreActionCondition = freeze
// Both:                capturePreActionCondition = AndCondition([escrowPeriod, freeze])
Use AndCondition to require both escrow period elapsed and not frozen before capture.

Freeze Duration

  • Payment frozen at time T
  • Freeze expires at T + freezeDuration
  • After expiry, payment is automatically unfrozen
  • Can be manually unfrozen earlier by the authorized party
  • Duration of 0 means permanent freeze (until manually unfrozen)
DurationUse Case
1 dayQuick investigation period
3 daysStandard fraud check window
5-7 daysExtended investigation
14+ daysComplex dispute resolution
Freeze duration should balance payer protection with receiver UX. Too long and receivers may avoid the platform. Too short and payers can’t adequately investigate.

Use Cases

  • Buyer protection: Payer freezes suspicious payments during escrow
  • Dispute holds: Arbiter freezes payments pending investigation
  • Compliance: Compliance officer freezes flagged transactions

Gas

Cost: ~20k gas per freeze/unfreeze (one SSTORE). The check() call is a view with one SLOAD.

Next Steps

EscrowPeriod

Add time-based capture restrictions.

Factories

Deploy Freeze via FreezeFactory.