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
| Field | Type | Description |
|---|---|---|
token | address | ERC20 token or native token sentinel. |
creator | address | Depositor and cancellation recipient. |
recipient | address | Claim recipient or hop authorizer. |
expiryBlocks | uint256 | Blocks after initialization before cancellation is allowed. |
commitmentHash | bytes32 | SHA-256 commitment hash. |
amount | uint256 | Amount required in the vault. |
l1Hop | bool | Whether this vault settles through ICM bridge routing. |
External functions
| Function | Access | Description |
|---|---|---|
pause() | owner | Pauses new escrow creation. |
unpause() | owner | Resumes escrow creation. |
whitelistToken(address) | owner | Enables a token. |
delistToken(address) | owner | Disables a token. |
createEscrow(EscrowParams) | public | Creates a deterministic pre-funded escrow. |
createEscrowBatch(EscrowParams[]) | public | Creates multiple pre-funded escrows atomically. |
createEscrowNative(EscrowParams) | payable | Creates a native token escrow. l1Hop must be false. |
createEscrowPermit(EscrowParams,uint256,bytes) | public | Executes permit, pulls ERC20, and deploys escrow. |
createEscrowSigned(EscrowParams,bytes) | public | Verifies EIP-712 authorization, pulls ERC20, and deploys escrow. |
getEscrowAddress(EscrowParams) | view | Predicts the deterministic vault address. |
Events
| Event | Description |
|---|---|
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
claimHopfor hop vaults andclaimfor non-hop vaults.
Errors
Same categories asEscrowFactory, with Avalanche-specific names, plus:
| Error | Meaning |
|---|---|
AvalancheEscrowFactory__NativeNotSupportedForHop | Native-token escrow attempted with l1Hop = true. |