Overview
Arbiters are specialized contracts that handle settlement validation and resource unlocking for different protocols. They validate user signatures, unlock input tokens, and coordinate target operation execution.Arbiters are called by adapters to perform the actual settlement logic after pre-funding or other preparation steps are complete.
Arbiter Architecture
ArbiterBase
All arbiters inherit fromArbiterBase, which provides protocol integration:
ArbiterBase.sol
Router Access Control
Only Router can call arbiter functions via
onlyRouter modifierProtocol Integration
Immutable references to Compact, Executor, and AddressBook
Signature Validation
Validates user signatures before resource movements
Resource Unlocking
Claims user tokens from protocols (Compact, Permit2)
Settlement Flow
Arbiters orchestrate the settlement process in coordination with adapters:1
Pre-Funding (Adapter)
Adapter pre-funds recipient with output tokens before calling arbiter
2
Signature Validation (Arbiter)
Arbiter validates user signatures and order metadata
3
Pre-Claim Operations (Arbiter)
Execute any required setup operations (approvals, configurations)
4
Resource Unlock (Arbiter)
Unlock and transfer user’s input tokens to solver
5
Target Execution (Arbiter)
Execute user-specified operations (swaps, transfers)
SameChainArbiter
Handles same-chain settlements for both Compact and Permit2 protocols:Compact Settlement
SameChainArbiter.sol
Step-by-Step Breakdown
Step-by-Step Breakdown
STEP 1: Pre-Claim Validation
- Validates order signatures and metadata
- Executes pre-claim operations (approvals, setup)
- Generates mandate hash for resource unlock
- Ensures prerequisites before claiming
- Validates signatures against mandate hash
- Unlocks user’s input tokens from Compact
- Transfers tokens directly to relayer address
- Returns claim hash for tracking
- Checks execution conditions (recipient == sponsor, etc.)
- Executes user-specified operations without additional signatures
- Uses trusted execution pattern for gas efficiency
- Maintains atomic execution guarantees
Permit2 Settlement
Streamlined flow for Permit2-based orders:SameChainArbiter.sol
Permit2 settlement is more gas-efficient than Compact due to simplified validation and unlock process, making it optimal for straightforward token operations.
Trusted Execution Pattern
Arbiters use a trusted execution model for target operations:- Security Model
- Execution Conditions
- Gas Savings
- Avoids redundant signature validation (already done in pre-claim)
- Reduces gas costs significantly
- Maintains security through initial validation gate
Protocol-Specific Validation
Compact Pre-Claim
- Complex signature validation
- Pre-claim operation execution
- Gas stipend allocation
- Allocator data handling
Permit2 Pre-Claim
- Simplified validation
- No pre-claim operations
- Lower gas overhead
Resource Unlocking
Compact Unlock
Permit2 Unlock
Dual Protocol Support
- Compact
- Permit2
Use Case: Complex multi-step settlementsFeatures:
- Pre-claim operations
- Gas stipend allocation
- Allocator integration
- Multi-signature support
- Cross-chain coordination
- Complex settlement flows
- Multi-element orders
- Cross-chain operations
- Advanced authorization
Security Model
Access Control
ArbiterBase.sol
Atomicity Guarantees
If any step fails, the entire transaction reverts:Integration Example
How adapters integrate with arbiters:SameChainAdapter.sol
Target Operation Execution
Arbiters coordinate with IntentExecutor for final operations:- Target ops exist:
targetOps.data.length != 0 - Self-execution:
recipient == sponsor - Not emissary:
!isExecutionEmissary() - Signature mode match: Pre-claim and target ops use same mode
If conditions aren’t met, target operations are skipped (not reverted). This allows for flexible settlement patterns.
Related Concepts
Adapters
Learn how adapters coordinate with arbiters
Intent Execution
Understand intent executor and ERC-7579 integration