EscrowFactory class
TheEscrowFactory class provides methods to calculate escrow contract addresses deterministically.
Constructor
The address of the escrow factory contract on the target chain
Methods
getEscrowAddress
Calculates the deterministic address of an escrow contract using CREATE2.The keccak256 hash of the immutables struct. See
Immutables.hash()The address of the escrow implementation contract on the same chain
getSrcEscrowAddress
Calculates the source escrow address for given parameters.The source immutables from the
SrcEscrowCreated event (with correct timeLock.deployedAt)The address of the source escrow implementation contract
Make sure you call this method on the source chain escrow factory instance.
getDstEscrowAddress
Calculates the destination escrow address for given parameters.The source immutables from the
SrcEscrowCreated eventThe destination immutables complement from the
SrcEscrowCreated eventThe block timestamp when the
DstEscrowCreated event was producedThe taker address from the
DstEscrowCreated eventThe address of the destination escrow implementation contract
Make sure you call this method on the destination chain escrow factory instance.
getMultipleFillInteraction
Creates an interaction for multiple-fill orders with merkle proof.The merkle proof for the secret at the given index
The index of the secret in the merkle tree
The keccak256 hash of the secret
Interaction object that can be used in order extensions
Deployment addresses
The SDK provides deployment addresses for all supported chains.Factory addresses
Implementation addresses
Supported chains
All deployment addresses are available for:- Ethereum
- Polygon
- Optimism
- Binance Smart Chain
- Avalanche
- Coinbase (Base)
- Fantom
- Gnosis
- Arbitrum
- zkSync (uses different addresses)
- Linea
- Sonic
- Unichain
Solana escrow factory
For Solana, use theSvmSrcEscrowFactory class:
createOrder()- Creates a Solana instruction to publish an order on-chainparseCreateInstruction()- Parses a create instruction from transaction datagetOrderAccount()- Calculates the PDA for an order accountgetEscrowAddress()- Calculates the escrow PDA
See the Solana order guide for complete Solana escrow factory usage.
Related types
- Events - Escrow creation events and immutables
- EvmAddress - EVM address type
- SolanaAddress - Solana address type