Skip to main content

Pre-Intent Hooks

Overview​

note

OrchestratorV3 was retired on 2026-11-05. This page preserves its historical hook interfaces and examples; do not use them to signal or fulfill new intents. OrchestratorV4, which serves new intents, has no hooks; it admits intents through its signal policy.

OrchestratorV3 supports one optional pre-intent hook per EscrowV2 deposit. The hook runs during signalIntent, before the intent is stored or funds are locked. It approves by returning and rejects by reverting, which reverts the whole transaction.

The pre-intent hook is separate from the lifecycle hook. On OrchestratorV3, the governance-selected IntentLifecycleHookV1 applies the deposit whitelist and stake admission; depositors do not choose it. See Stake to Take.

Interface​

interface IPreIntentHook {
struct PreIntentContext {
address taker;
address escrow;
uint256 depositId;
uint256 amount;
address to;
bytes32 paymentMethod;
bytes32 fiatCurrency;
uint256 conversionRate;
IReferralFee.ReferralFee[] referralFees;
bytes preIntentHookData;
}

function validateSignalIntent(PreIntentContext calldata ctx) external;
}

Source: IPreIntentHook.sol

Set a hook​

  1. The depositor or delegate calls setDepositPreIntentHook(escrow, depositId, hook) on OrchestratorV3. Passing the zero address clears the slot.
  2. The taker passes any data the hook needs in SignalIntentParams.preIntentHookData.

SignatureGatingPreIntentHook (0x62D410a3d6FC766dd2192be2a67a5fc79c5c2e1F) is a built-in example: a signer the depositor configures authorizes each intent with an EIP-191 signature over the orchestrator, escrow, deposit, amount, taker, recipient, payment method, currency, conversion rate, referral fees, expiration and chain ID. The taker ABI-encodes the signature and expiration in preIntentHookData.

Write a hook​

  1. Implement IPreIntentHook.validateSignalIntent(ctx).
  2. Revert with a specific error to reject; return to approve.
  3. Read request-specific data from ctx.preIntentHookData.

Keep validation deterministic and cheap: a failing hook reverts the taker's signalIntent.