Deposits move funds from the user's wallet into the Nullmask privacy pool. All deposits require guard approval before the note is added to the Merkle tree.
Convenience function that registers a receiving key and deposits in a single transaction.
receive()
The contract's receive function auto-deposits received ETH, unless the sender is the Uniswap router (during swaps).
Deposit Flow
User calls deposit() → funds are held by the contract
DepositPending event is emitted with deposit details
Guard service monitors for pending deposits
Guard screens the depositor address
Guard calls approveDeposit() or rejectDeposit()
Guard Operations
approveDeposit(...)
Only callable by the guard. Validates the deposit data hash, computes the note commitment, adds it to the Merkle tree, and pays the gas escrow to the guard.
The revocation key is published with the deposit for compliance (see Revocation Keys).
rejectDeposit(...)
Refunds the deposited funds to the original depositor and pays the gas escrow to the guard.
withdrawPendingDeposit(...)
Allows the original depositor to withdraw a pending deposit that hasn't been approved or rejected yet. Refunds both the deposit amount and gas escrow.
Gas Escrow
Each deposit includes a gas escrow (ETH sent as msg.value beyond the deposit amount). This escrow:
Pays for the guard's gas costs when approving or rejecting the deposit
Is paid to the guard regardless of whether the deposit is approved or rejected
Is refunded to the depositor if they withdraw the pending deposit
Deposit Note Commitment
When a deposit is approved, the note commitment is computed as:
The deposit note ciphertext contains unencrypted fields (no ephemeral key exchange for deposits):