Overview
The Intent Executor is a modular smart contract that executes user intents across multiple protocols and chains. It implements ERC-7579 for smart account compatibility and supports Compact, Permit2, and standalone execution patterns.The Intent Executor acts as the final execution layer for target operations after settlement validation and resource unlocking are complete.
Architecture
IntentExecutor
The main executor contract unifies multiple execution mechanisms:IntentExecutor.sol
Compact Intents
Cross-chain intents using The Compact protocol
Permit2 Intents
Gasless token approvals via Permit2
Standalone Intents
Independent execution without external protocols
Trusted Execution
Whitelisted execution without signature validation
ERC-7579 Integration
The executor implements the ERC-7579 module standard for smart account compatibility:IntentExecutor.sol
ERC-7579 Benefits:
- Smart account compatibility
- Modular execution patterns
- Standard installation/uninstallation
- Account-specific initialization tracking
Module Lifecycle
1
Install Module
Smart account calls
onInstall() to enable executor2
Execute Intents
Account can now execute intents through the module
3
Uninstall Module
Account calls
onUninstall() to disable executorExecution Patterns
Compact Intent Execution
Executes intents using The Compact protocol:CompactIntentExecutor.sol
- Signature Validation
- Pre-Claim Ops
- Target Ops
Permit2 Intent Execution
Executes intents with Permit2 token approvals:Permit2IntentExecutor.sol
Permit2 execution is more gas-efficient than Compact as it doesn’t require pre-claim operations or gas stipends.
Standalone Intent Execution
Executes intents independently without external protocols:StandaloneIntentExecutor.sol
Trusted Execution
Executes operations from whitelisted contracts without signature validation:TrustedExecution.sol
Operation Structure
Target operations are encoded using theTypes.Operation structure:
OrderTypes.sol
Signature Modes
- Standard Mode
- Session Key Mode
- Emissary Mode
Target Operation Execution
The core execution logic handles various operation types:Token Transfers
Token Transfers
Token Swaps
Token Swaps
Multi-Step Operations
Multi-Step Operations
Adapter Integration
The IntentExecutorAdapter forwards calls from Router to IntentExecutor:IntentExecutorAdapter.sol
Execution Path
1
Router Receives Fill
User/solver submits fill operation to Router
2
Adapter Delegatecall
Router delegatecalls IntentExecutorAdapter
3
Forward to Executor
Adapter forwards call to IntentExecutor
4
Validate & Execute
Executor validates signatures and executes operations
Gas Optimizations
Transient Storage
The executor uses transient storage for reentrancy protection:Batch Execution
Multiple operations execute in a single transaction:Trusted Execution Bypass
Skips signature validation for trusted callers:Gas Savings: Trusted execution saves ~5,000-10,000 gas per operation by avoiding redundant ECDSA signature recovery.
Security Model
Signature Validation
ValidateSignature.sol
Trusted Contract Whitelist
TrustedExecution.sol
Related Concepts
Arbiters
Learn how arbiters coordinate with intent execution
Fill & Claim
Understand fill and claim operation types