Hyperlane Warp Route Type | Description |
---|---|
Native Token HWR | Enables direct transfers of native gas tokens (e.g., ETH) across chains without wrapping. |
Collateral-Backed ERC20 | Locks ERC20 tokens as collateral on the source chain for cross-chain transfers. |
Synthetic ERC20 | Mints new ERC20 tokens on the destination chain to represent the original tokens. |
Hyperlane Warp Routes 2.0 | Allows liquidity to be sourced from multiple collateral tokens. |
Specialized HWR | Adds advanced features or integrates with specific use cases (e.g., vaults, fiat-backed tokens.) |
Core HWR Types
Native Token HWRs
Implemented inHypNative.sol
, native HWRs handle the transfer of native gas tokens (e.g. ETH on Ethereum or Arbitrum, MNT on Mantle) across different chains.
Features
- Directly transfers native tokens without wrapping.
- Uses
msg.value
for transfer amount. - Handles excess
msg.value
as hook payment. - Supports donations through a
receive()
function.
Collateral-Backed ERC20 HWR
Implemented inHypERC20Collateral.sol
, collateral HWR enable ERC20 tokens to be locked as collateral on the source chain and then used to mint a synthetic representation on the destination chain.
Features
- Wraps existing ERC20 tokens as collateral for transfers.
- Locks tokens in the contract on the source chain.
- Releases equivalent tokens on the destination chain.
- Uses SafeERC20 for secure token transfers.
Synthetic ERC20 HWR
Implemented inHypERC20.sol
, synthetic HWRs mint new tokens on the destination chain that represent the original tokens from the source chain. The original tokens are not transferred but remain locked.
Features
- Maintains consistent total supply across all chains.
- Supports custom token attributes (name, symbol, decimals).
- Mints new tokens on the destination chain.
- Burns tokens on the source chain when transferred back.
Advanced Features
TokenRouter functionality
All HWRs extend theTokenRouter
contract, which provides the core functionality for HWR token transfers.
Features
- Message Structure: Uses TokenMessage library for encoding and decoding token transfer messages.
-
Transfer Initiation:
transferRemote
function initiates cross-chain transfers. -
Message Handling:
_handle
function processes incoming transfer messages. -
Abstract Methods:
_transferFromSender
: Implemented by all HWRs to handle token collection._transferTo
: Implemented by all HWRs to handle token distribution.
TokenMessage Format
FastTokenRouter Transfers
Implemented inFastTokenRouter.sol
, this router extends TokenRouter and provides faster token transfers through a liquidity provider mechanism.
Features
- Allows liquidity providers to fulfill transfer requests before message processing.
- Includes a
fastFee
to incentivize liquidity providers. - Introduces
fastTransferId
for unique transfer identification.
Specialized HWR Extensions
1. Fast Collateral Transfers (FastHypERC20Collateral)
- Combines fast transfer capabilities with collateral-backed ERC20 functionality.
- See the implementation for more details.
2. Vault Integration (HypERC4626OwnerCollateral, HypERC4626Collateral)
- Allows for yield generation on collateral by integrating with ERC-4626 vaults.
- See the implementation & rebasing variant and for more details.
3. Fiat-Backed Tokens (HypFiatToken)
- Designed for stablecoins and other fiat-backed tokens, implementing specific mint and burn operations.
- See the implementation for more details.
4. Scaled Native Tokens (HypNativeScaled)
- Scales native token values for consistency across chains with different decimals.
- See the implementation for more details.
5. xERC20 Integration (HypXERC20 & HypXERC20Lockbox)
- Enables cross-chain transfers of xERC20 tokens, integrating with lockbox mechanisms for conversions.
- See the HypXERC20 implementation and the HypXERC20Lockbox implementation for more details.