Warp Router’s security model relies on multiple layers of protection to ensure safe execution of cross-chain operations and protocol integrations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rhinestonewtf/warp-router/llms.txt
Use this file to discover all available pages before exploring further.
Delegatecall Context
Adapters are always executed via delegatecall from the Router contract. This is a critical security consideration.Understanding Delegatecall Execution
When the Router calls an adapter:- Storage context: Adapter code runs in Router’s storage space
- Balance access: Adapters can access Router’s token balances
- msg.sender: Preserved from original caller
- address(this): Equals Router address during execution
Adapter Security Requirements
From AdapterBase.sol:17-21:OnlyViaRouter Modifier
All adapter functions must use theonlyViaRouter modifier:
- During delegatecall:
address(this)equals_ROUTER✓ - During direct call:
address(this)equals adapter address ✗
Atomic Fill Signatures
All fill operations require a signature from the designated atomic signer to prevent unauthorized execution.Signature Validation
From RouterLogic.sol:145-154:- Authorization Control: Only designated signer can approve batches
- Replay Protection: Hash binds signature to specific calldata
- Immutable Signer: Set at deployment, cannot be changed
- Pause Mechanism: Setting signer to
address(0)pauses fills
What Gets Signed
From RouterLogic.sol:200:- All adapter calldatas in the batch
- Order and content of operations
- Function selectors and parameters
Arbiter Access Control
Arbiters have exclusive access to protocol-level settlement functions.OnlyRouter Pattern
From ArbiterBase.sol:289-302:- Arbiters unlock user funds from protocols (TheCompact, Permit2)
- Only Router should trigger these operations
- Prevents unauthorized claim attempts
- Ensures proper settlement flow
Pre-Claim Operations
From ArbiterBase.sol:165-188:- Pre-claim ops execute before settlement
- Must validate signatures properly
- Gas stipend limits execution time
- Failure reverts entire transaction
Reentrancy Protection
All external Router functions are protected against reentrancy.ReentrancyGuardTransient
From RouterLogic.sol:74:Adapter Development Guidelines
Required Implementations
From AdapterBase.sol:23-60:Storage Safety
From AdapterBase.sol:39:Pre-Funding Security
Same-chain settlements use pre-funding to prevent manipulation attacks.Pre-Funding Pattern
From SameChainAdapter.sol:233-246:- Atomic execution: If arbiter fails, pre-funding reverts
- Front-run protection: Recipients get outputs before inputs unlock
- MEV resistance: Prevents sandwich attacks on settlements
Gas Stipend Validation
From ArbiterBase.sol:118-125:- Griefing attacks with insufficient gas
- Failed operations due to gas underestimation
- EIP-150 gas forwarding limits
Security Checklist
For Adapter Developers
For Adapter Developers
- All fill/claim functions use
onlyViaRoutermodifier - All functions return their own selector
-
supportsInterfaceincludes all selectors - No direct calls to untrusted contracts
- No storage variables (use immutable only)
- Only interact with audited protocols
- Proper relayer context validation
For Router Operators
For Router Operators
- Atomic fill signer is secure (hardware wallet/multisig)
- Only install audited adapters
- Adapter adder role is restricted
- Adapter remover role can respond to emergencies
- Regular security audits scheduled
- Monitoring for suspicious activity
For Solvers
For Solvers
- Validate all order signatures off-chain first
- Check token balances before settlement
- Monitor for gas price attacks
- Implement slippage protection
- Use secure key management
- Monitor for failed transactions
Audit Resources
Router Security
Core routing logic with atomic signatures and reentrancy protection
Adapter Security
Delegatecall context and trusted protocol integration
Arbiter Security
Access control and settlement validation
Pre-Funding
Atomic settlement and MEV protection