Overview
The Across Bridge Hooks enable automatic cross-chain token bridging when intents are fulfilled. They integrate with Across Protocol to bridge tokens from the source chain to a destination chain, enabling seamless cross-chain fiat on-ramps. Available Versions:AcrossBridgeHook- V1 implementation (works with Orchestrator)AcrossBridgeHookV2- V2 implementation (works with OrchestratorV2)
Key Features
Cross-Chain Compatibility
Supports both EVM and non-EVM chains:- EVM chains: Addresses are left-padded to bytes32
- Non-EVM chains (Solana): Native 32-byte addresses used directly
Graceful Fallback
If bridging fails, funds are transferred to the recipient on the source chain instead of reverting. This ensures users always receive funds after making off-chain payments.Two-Phase Data Model
Signal Time (Commitment):- Destination chain ID
- Output token address
- Recipient address
- Minimum output amount
- Actual output amount
- Fill deadline
- Exclusive relayer (from Across API)
- Exclusivity period
Important Limitations
Architecture
Contract References
V1:- Location:
contracts/hooks/AcrossBridgeHook.sol - Interface:
IPostIntentHook - Orchestrator: Single orchestrator address set at deployment
- Location:
contracts/hooks/AcrossBridgeHookV2.sol - Interface:
IPostIntentHookV2 - Orchestrator: Uses
IOrchestratorRegistryfor multi-orchestrator support
Dependencies
Data Structures
BridgeCommitment
Stored inintent.data (V1) or intent.signalHookData (V2) at signal time:
destinationChainId: Chain ID where tokens will be received- Example:
42161for Arbitrum,8453for Base
- Example:
outputToken: Token address on destination chain- EVM: Use
bytes32(uint256(uint160(tokenAddress)))to convert - Solana: Use native 32-byte public key
- EVM: Use
recipient: Where tokens will be sent on destination- EVM: Use
bytes32(uint256(uint160(recipientAddress)))to convert - Solana: Use native 32-byte public key
- EVM: Use
minOutputAmount: Minimum tokens to receive- Set to ~99.5% of expected output for stablecoins
- Protects against unfavorable price movement
AcrossFulfillData
Provided in_fulfillIntentData (V1) or _fulfillHookData (V2) at fulfill time:
intentHash: (V1 only) Intent identifier for event correlationoutputAmount: How many tokens recipient receives on destination- Must be ≥
minOutputAmountor hook falls back to local transfer
- Must be ≥
fillDeadlineOffset: Seconds from current block until fill expires- Typical range: 1800 (30 min) to 21600 (6 hours)
- Longer for slower routes, shorter for fast routes
exclusiveRelayer: Relayer with priority access (from Across suggested-fees API)- Ensures faster fulfillment by known relayers
exclusivityParameter: How long exclusive relayer has priority (seconds)- Prevents fill competition during exclusivity window
Usage
Deployment
V1:Signal Intent with Bridge Hook
V1 Example:Fulfill Intent with Bridge
Get Across API Data: Before fulfilling, query Across suggested-fees API:Execution Flow
Fallback Behavior
The hook implements graceful degradation to protect users:Fallback Triggers
-
OUTPUT_BELOW_MINIMUM:
outputAmount < minOutputAmount- Price moved unfavorably between signal and fulfill
- Common with volatile assets (reason not to use hook for non-stablecoins)
-
BRIDGE_CALL_FAILED:
spokePool.depositNow()reverted- SpokePool paused
- Route not supported
- Across liquidity issues
Fallback Action
When fallback is triggered:- Tokens are transferred to
intent.toon the source chain FallbackTransferevent is emitted with reason code- Transaction succeeds (does not revert)
Example Fallback Event
Events
AcrossBridgeInitiated
Emitted when bridge deposit successfully initiated:FallbackTransfer
Emitted when bridge cannot be initiated:Admin Functions
Both V1 and V2 include rescue functions for recovering stuck funds:Rescue ERC20
Rescue Native
Security Considerations
Authorization
V1: Only the specific orchestrator set at deployment can callexecute()
V2: Any orchestrator registered in IOrchestratorRegistry can call execute()
Token Handling
- Exact Pulls: Hook pulls exact approved amount from orchestrator
- Approval Hygiene: Approvals to SpokePool are reset to 0 after operations
- No Stranded Funds: Tokens are either bridged or sent to recipient (never stuck)
Price Movement
For stablecoins, setminOutputAmount to ~99.5% of expected:
- Allows minor bridge fee variation
- Prevents DoS from tiny price movements
- Still protects against significant slippage
- Price can drop >0.5% in minutes
- minOutputAmount check will fail
- User loses access to funds after payment
Reentrancy
Orchestr ator calls hook within reentrancy guard. Hook does not need additional protection.Cross-Chain Address Conversion
EVM Addresses to bytes32
Solana Addresses
Solana public keys are already 32 bytes:Integration Checklist
- Deploy hook with correct input token and spoke pool
- Verify spoke pool supports your destination chain
- Test bridge route with small amount first
- Integrate Across suggested-fees API for relayer parameters
- Set reasonable
fillDeadlineOffset(1800-21600 seconds) - Set
minOutputAmountto ~99.5% of expected output - Monitor
FallbackTransferevents for failed bridges - Implement fallback notification for users
- Test with both EVM and non-EVM destinations if needed
Related Contracts
- Hooks Overview - Hook system architecture
- Orchestrator - V1 orchestrator
- OrchestratorV2 - V2 orchestrator
- Across Protocol Documentation - External resource