EscrowFactory deploys deterministic EscrowVault clones and supports pre-funded, native token, permit, signed, and batch creation paths. Source: evm/src/EscrowFactory.sol

Constants

NameValue
CREATE_ESCROW_TYPEHASHEIP-712 typehash for CreateEscrowParams(address token,address creator,address recipient,uint256 expiryBlocks,bytes32 commitmentHash,uint256 amount).
NATIVE_TOKEN0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE

Structs

EscrowParams

FieldTypeDescription
tokenaddressERC20 token or native token sentinel.
creatoraddressDepositor and cancellation recipient.
recipientaddressClaim recipient.
expiryBlocksuint256Blocks after initialization before cancellation is allowed.
commitmentHashbytes32SHA-256 commitment hash.
amountuint256Amount required in the vault.

External functions

FunctionAccessDescription
pause()ownerPauses new escrow creation. Existing vaults can still settle.
unpause()ownerResumes escrow creation.
whitelistToken(address)ownerEnables a token for escrow creation.
delistToken(address)ownerDisables a token for new escrow creation.
createEscrow(address,address,address,uint256,bytes32,uint256)publicCreates a deterministic pre-funded escrow.
createEscrowBatch(EscrowParams[])publicCreates multiple pre-funded escrows atomically.
createEscrowNative(address,address,address,uint256,bytes32,uint256)payableCreates a native token escrow in one transaction.
createEscrowPermit(address,address,address,uint256,bytes32,uint256,uint256,bytes)publicExecutes permit, pulls ERC20, and deploys escrow.
createEscrowSigned(address,address,address,uint256,bytes32,uint256,bytes)publicVerifies EIP-712 authorization, pulls ERC20, and deploys escrow.
getEscrowAddress(address,address,address,uint256,bytes32,uint256)viewPredicts the deterministic vault address.

Events

EventDescription
EscrowCreated(address,address,address,address,bytes32,uint256,uint256)Emitted after clone deployment.
TokenWhitelisted(address)Emitted when a token is enabled.
TokenDelisted(address)Emitted when a token is disabled.

Errors

ErrorMeaning
EscrowFactory__InvalidAddressParametersCreator or recipient is zero, or creator equals recipient.
EscrowFactory__ZeroExpiryBlocksExpiry is zero.
EscrowFactory__ZeroAmountAmount is zero.
EscrowFactory__InsufficientFundsDepositedPredicted vault did not receive enough funds.
EscrowFactory__TokenNotAcceptedToken is not whitelisted.
EscrowFactory__EscrowAlreadyDeployedPredicted vault address was already used.
EscrowFactory__MsgValueAmountMismatchNative token value does not match amount.
EscrowFactory__NativeDepositFailedNative token transfer to predicted vault failed.
EscrowFactory__OnlyNativeTokenAllowedNative-only path received an ERC20 token.
EscrowFactory__OnlyERC20AllowedERC20-only path received native token sentinel.
EscrowFactory__InvalidSignatureEIP-712 signer did not match creator.
EscrowFactory__PermitFailedEIP-2612 permit call failed.
EscrowFactory__InvalidCommitmentHashCommitment hash is zero.
EscrowFactory__EmptyBatchBatch length is zero.