The gatekeeper is a backend service that monitors and approves deposits into the Veilify pool.
In the contract ABI the gatekeeper is the guard address, set with setGuard().

Responsibilities

  1. Monitor DepositPending events.
  2. Screen depositors with chain-analysis tools.
  3. Approve with approveDeposit(), binding a trace key into the note.
  4. Reject with rejectDeposit(), refunding the depositor.
  5. Pull ERC-20 deposits with pullDeposit() against a signed PullIntent.

Gatekeeper address

The gatekeeper is a single privileged address in pool storage. Only it can approve, reject or pull. The admin can replace it with setGuard(). The gatekeeper key is treated as a hot key: it cannot change fees, roles, verifiers or the whitelist.

Approve

The contract recomputes keccak256(recipient, token, amount, depositor, gasEscrow) and compares it with the stored pending hash. The gatekeeper cannot approve modified parameters (InvalidDepositData). On approval the pool:
  1. charges the deposit fee in force at that moment
  2. inserts a note for amount − fee to the recipient’s inbox key
  3. emits NoteAdded, DepositStatusChanged(APPROVED), Deposit
  4. settles the gas escrow

Reject

The deposit is refunded. The check cost kept is the smallest of checkCost, checkFee[token] and 1% of the deposit. No protocol fee is charged.

Permit deposits

For ERC-20s, a depositor can sign an EIP-712 PullIntent and approve the pool. The gatekeeper checks the address first and pulls only clean funds, so nothing is ever pending.
  • Each requestId can be used once (PullRequestUsed).
  • Expired intents are refused (PullIntentExpired).
  • ECDSA is tried first, then ERC-1271, so EIP-7702 accounts and smart wallets both work.
  • The note always goes to the depositor’s own inbox key. There is no recipient parameter.
  • The gas withheld is capped at maxPullGasFee[token] and at 5% of what arrived.

Gas escrow settlement

The gatekeeper’s gas is reimbursed from the deposit’s escrow:
  • overhead is settleGasOverhead, or 45,000 gas while that is 0. On Robinhood Chain it is raised to cover the L1 data fee.
  • When one transaction settles several deposits, every settlement after the first gets 25,000 gas less, so batching can’t turn escrow into profit.
  • The depositor’s share is sent with a 30,000-gas stipend. A wallet that refuses it forfeits it to the gatekeeper, so it can never block its own credit.
Every settlement emits GasEscrowSettled(index, toGuard, toDepositor).