AvalancheEscrowFactory extends the standard escrow factory design with an l1Hop flag. When l1Hop is true, the deployed vault must settle through AvalancheEscrowVault.claimHop(). Source: evm/src/AvalancheEscrows/AvalancheEscrowFactory.sol

Key difference from EscrowFactory

EscrowParams includes bool l1Hop, and that boolean is included in both clone immutable args and the deterministic salt. The same escrow parameters with different l1Hop values produce different vault addresses.

Structs

EscrowParams

FieldTypeDescription
tokenaddressERC20 token or native token sentinel.
creatoraddressDepositor and cancellation recipient.
recipientaddressClaim recipient or hop authorizer.
expiryBlocksuint256Blocks after initialization before cancellation is allowed.
commitmentHashbytes32SHA-256 commitment hash.
amountuint256Amount required in the vault.
l1HopboolWhether this vault settles through ICM bridge routing.

External functions

FunctionAccessDescription
pause()ownerPauses new escrow creation.
unpause()ownerResumes escrow creation.
whitelistToken(address)ownerEnables a token.
delistToken(address)ownerDisables a token.
createEscrow(EscrowParams)publicCreates a deterministic pre-funded escrow.
createEscrowBatch(EscrowParams[])publicCreates multiple pre-funded escrows atomically.
createEscrowNative(EscrowParams)payableCreates a native token escrow. l1Hop must be false.
createEscrowPermit(EscrowParams,uint256,bytes)publicExecutes permit, pulls ERC20, and deploys escrow.
createEscrowSigned(EscrowParams,bytes)publicVerifies EIP-712 authorization, pulls ERC20, and deploys escrow.
getEscrowAddress(EscrowParams)viewPredicts the deterministic vault address.

Events

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

Hop constraints

  • Native token escrows cannot use l1Hop.
  • Hop escrows require ERC20 tokens because ICTT bridging uses token home and token remote contracts.
  • Clients should use claimHop for hop vaults and claim for non-hop vaults.

Errors

Same categories as EscrowFactory, with Avalanche-specific names, plus:
ErrorMeaning
AvalancheEscrowFactory__NativeNotSupportedForHopNative-token escrow attempted with l1Hop = true.