EscrowFactory deploys deterministic EscrowVault clones and supports pre-funded, native token, permit, signed, and batch creation paths.
Source: evm/src/EscrowFactory.sol
Constants
| Name | Value |
|---|---|
CREATE_ESCROW_TYPEHASH | EIP-712 typehash for CreateEscrowParams(address token,address creator,address recipient,uint256 expiryBlocks,bytes32 commitmentHash,uint256 amount). |
NATIVE_TOKEN | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
Structs
EscrowParams
| Field | Type | Description |
|---|---|---|
token | address | ERC20 token or native token sentinel. |
creator | address | Depositor and cancellation recipient. |
recipient | address | Claim recipient. |
expiryBlocks | uint256 | Blocks after initialization before cancellation is allowed. |
commitmentHash | bytes32 | SHA-256 commitment hash. |
amount | uint256 | Amount required in the vault. |
External functions
| Function | Access | Description |
|---|---|---|
pause() | owner | Pauses new escrow creation. Existing vaults can still settle. |
unpause() | owner | Resumes escrow creation. |
whitelistToken(address) | owner | Enables a token for escrow creation. |
delistToken(address) | owner | Disables a token for new escrow creation. |
createEscrow(address,address,address,uint256,bytes32,uint256) | public | Creates a deterministic pre-funded escrow. |
createEscrowBatch(EscrowParams[]) | public | Creates multiple pre-funded escrows atomically. |
createEscrowNative(address,address,address,uint256,bytes32,uint256) | payable | Creates a native token escrow in one transaction. |
createEscrowPermit(address,address,address,uint256,bytes32,uint256,uint256,bytes) | public | Executes permit, pulls ERC20, and deploys escrow. |
createEscrowSigned(address,address,address,uint256,bytes32,uint256,bytes) | public | Verifies EIP-712 authorization, pulls ERC20, and deploys escrow. |
getEscrowAddress(address,address,address,uint256,bytes32,uint256) | view | Predicts the deterministic vault address. |
Events
| Event | Description |
|---|---|
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
| Error | Meaning |
|---|---|
EscrowFactory__InvalidAddressParameters | Creator or recipient is zero, or creator equals recipient. |
EscrowFactory__ZeroExpiryBlocks | Expiry is zero. |
EscrowFactory__ZeroAmount | Amount is zero. |
EscrowFactory__InsufficientFundsDeposited | Predicted vault did not receive enough funds. |
EscrowFactory__TokenNotAccepted | Token is not whitelisted. |
EscrowFactory__EscrowAlreadyDeployed | Predicted vault address was already used. |
EscrowFactory__MsgValueAmountMismatch | Native token value does not match amount. |
EscrowFactory__NativeDepositFailed | Native token transfer to predicted vault failed. |
EscrowFactory__OnlyNativeTokenAllowed | Native-only path received an ERC20 token. |
EscrowFactory__OnlyERC20Allowed | ERC20-only path received native token sentinel. |
EscrowFactory__InvalidSignature | EIP-712 signer did not match creator. |
EscrowFactory__PermitFailed | EIP-2612 permit call failed. |
EscrowFactory__InvalidCommitmentHash | Commitment hash is zero. |
EscrowFactory__EmptyBatch | Batch length is zero. |