AvalancheEscrowVault supports two mutually exclusive claim modes:
  • l1Hop = false: standard HTLC claim on the current chain.
  • l1Hop = true: claim and bridge through ICMBridgeFactory.
Source: evm/src/AvalancheEscrows/AvalancheEscrowVault.sol

Immutable parameters

getEscrowParameters() returns:
FieldTypeDescription
tokenaddressERC20 token or native token sentinel.
creatoraddressDepositor and cancellation recipient.
recipientaddressStandard recipient or signer who authorizes hop data.
expiryBlocksuint256Blocks after initialization before cancellation is allowed.
commitmentHashbytes32SHA-256 hash required for claim.
l1HopboolWhether the vault must settle through claimHop.

HopData

FieldTypeDescription
bridgeFactoryaddressLocal ICMBridgeFactory.
destBlockchainIdbytes32Avalanche destination blockchain ID.
recipientaddressFinal recipient on the destination L1.
primaryFeeTokenaddressaddress(0) for no fee, or the bridge token address.
primaryRelayerFeeuint256Relayer incentive amount.

External functions

FunctionDescription
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:
keccak256(
  abi.encode(
    HOP_AUTHORIZATION_TYPEHASH,
    chainId,
    vault,
    commitmentHash,
    bridgeFactory,
    destBlockchainId,
    recipient,
    primaryFeeToken,
    primaryRelayerFee
  )
)
This prevents a mempool observer from stealing the secret and redirecting the bridge destination.

Events

EventDescription
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

ErrorMeaning
AvalancheEscrowVault__InvalidCommitmentPreimage does not match commitment hash.
AvalancheEscrowVault__EscrowNotExpiredCancel attempted before expiry.
AvalancheEscrowVault__NativeTransferFailedNative token transfer failed.
AvalancheEscrowVault__EscrowAlreadySettledVault was already claimed or cancelled.
AvalancheEscrowVault__IsHopEscrowclaim() called on a hop vault.
AvalancheEscrowVault__NotHopEscrowclaimHop() called on a non-hop vault.
AvalancheEscrowVault__InvalidHopSignatureHop payload was not signed by the expected recipient.
AvalancheEscrowVault__UnsupportedFeeTokenFee token is neither zero nor the bridge token.
AvalancheEscrowVault__InsufficientBalanceForFeeVault balance cannot cover requested fee.