AvalancheEscrowVault supports two mutually exclusive claim modes:
l1Hop = false: standard HTLC claim on the current chain.l1Hop = true: claim and bridge throughICMBridgeFactory.
evm/src/AvalancheEscrows/AvalancheEscrowVault.sol
Immutable parameters
getEscrowParameters() returns:
| Field | Type | Description |
|---|---|---|
token | address | ERC20 token or native token sentinel. |
creator | address | Depositor and cancellation recipient. |
recipient | address | Standard recipient or signer who authorizes hop data. |
expiryBlocks | uint256 | Blocks after initialization before cancellation is allowed. |
commitmentHash | bytes32 | SHA-256 hash required for claim. |
l1Hop | bool | Whether the vault must settle through claimHop. |
HopData
| Field | Type | Description |
|---|---|---|
bridgeFactory | address | Local ICMBridgeFactory. |
destBlockchainId | bytes32 | Avalanche destination blockchain ID. |
recipient | address | Final recipient on the destination L1. |
primaryFeeToken | address | address(0) for no fee, or the bridge token address. |
primaryRelayerFee | uint256 | Relayer incentive amount. |
External functions
| Function | Description |
|---|---|
initialize() | Called once by the factory. Records deposit block. |
claim(bytes32) | Standard same-chain claim. Reverts if l1Hop is true. |
claimHop(bytes32,bytes,HopData) | Hop claim. Reverts if l1Hop is false. |
refund() | Solidity entrypoint used to cancel after expiry for both hop and non-hop vaults. |
getEscrowParameters() | Reads immutable clone arguments. |
Hop authorization hash
The recipient signs an EIP-191 personal-sign message over:Events
| Event | Description |
|---|---|
Claimed(address,bytes32) | Emitted for standard claims. |
ClaimedHop(bytes32,bytes32,address,uint256) | Emitted for hop claims dispatched to ICM. |
Refunded(address,bytes32) | Emitted for cancellations. |
Errors
| Error | Meaning |
|---|---|
AvalancheEscrowVault__InvalidCommitment | Preimage does not match commitment hash. |
AvalancheEscrowVault__EscrowNotExpired | Cancel attempted before expiry. |
AvalancheEscrowVault__NativeTransferFailed | Native token transfer failed. |
AvalancheEscrowVault__EscrowAlreadySettled | Vault was already claimed or cancelled. |
AvalancheEscrowVault__IsHopEscrow | claim() called on a hop vault. |
AvalancheEscrowVault__NotHopEscrow | claimHop() called on a non-hop vault. |
AvalancheEscrowVault__InvalidHopSignature | Hop payload was not signed by the expected recipient. |
AvalancheEscrowVault__UnsupportedFeeToken | Fee token is neither zero nor the bridge token. |
AvalancheEscrowVault__InsufficientBalanceForFee | Vault balance cannot cover requested fee. |