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.
Overview
TheIntentExecutor contract is the main entry point for executing intents in the Warp Router system. It aggregates multiple intent execution mechanisms into a unified ERC-7579 module that can be installed on smart contract wallets.
Source: /src/executor/IntentExecutor.sol:33
Key Features
- ERC-7579 Module Compliance: Implements the executor module interface for modular account compatibility
- Multi-Protocol Support: Unifies Compact, Permit2, and Standalone intent execution
- Cross-Chain Operations: Enables secure cross-chain intent execution with signature validation
- Trusted Execution: Supports execution from authorized parties without signature verification
Architecture
The contract inherits from multiple executor implementations:- CompactIntentExecutor: Cross-chain intents using The Compact protocol
- Permit2IntentExecutor: Gasless token approvals using Permit2
- StandaloneIntentExecutor: Self-contained multi-chain execution
- TrustedExecution: Operations from trusted parties
- ValidateSignature: EIP-712 signature validation with emissary support
Constructor
The router contract address for cross-chain operations
The Compact protocol contract address for cross-chain transfers
The RSAllocator contract address for resource allocation
The address book contract for managing trusted execution parties
The smart session emissary contract for session key validation
ERC-7579 Module Interface
isModuleType
The module type identifier to check against
bool - True if moduleTypeId matches MODULE_TYPE_EXECUTOR, false otherwise
isInitialized
The smart account address to check initialization status for
bool - True if the module is initialized for the account, false otherwise
onInstall
Installation data (currently unused but reserved for future use)
This function must be called by the smart account during module installation. It sets the initialization flag to enable intent execution.
onUninstall
Uninstallation data (currently unused but reserved for future cleanup)
Intent Execution Methods
TheIntentExecutor provides multiple execution methods inherited from its specialized executor contracts:
Compact Intent Execution
See CompactIntentExecutor for:executePreClaimOpsWithCompactStub- Origin chain pre-claim operationsexecuteTargetOpsWithCompactStub- Destination chain target operationsisCompactIntentNonceConsumed- Nonce status checking
Permit2 Intent Execution
See Permit2IntentExecutor for:executePreClaimOpsWithPermit2Stub- Permit2-based pre-claim operationsexecuteTargetOpsWithPermit2Stub- Permit2-based target operationsisPermit2IntentNonceConsumed- Nonce status checking
Standalone Intent Execution
See StandaloneIntentExecutor for:executeMultichainOps- Multi-chain operations without gas refundexecuteMultichainOpsWithGasRefund_ERC20- Multi-chain with ERC20 gas refundexecuteMultichainOpsWithGasRefund_ETH- Multi-chain with ETH gas refundexecuteSinglechainOps- Single-chain operations without gas refundexecuteSinglechainOpsWithGasRefund_ERC20- Single-chain with ERC20 gas refundexecuteSinglechainOpsWithGasRefund_ETH- Single-chain with ETH gas refundisStandaloneIntentNonceConsumed- Nonce status checking
Signature Validation
The contract uses sophisticated signature validation through theValidateSignature base contract, supporting multiple validation modes:
Validation Modes
- ERC1271: Direct signature validation using the account’s ERC-1271 implementation
- EMISSARY: Session key validation through authorized emissaries
- EMISSARY_EXECUTION: Execution-aware emissary validation with operation context
- Hybrid Modes: Fallback combinations (e.g.,
EMISSARY_ERC1271,ERC1271_EMISSARY)
Security Model
The signature validation system provides:- EIP-712 Structured Data: Type-safe signature generation and validation
- Emissary Authorization: Session keys authorized via The Compact protocol
- Execution Context: Validation can consider the operations being executed
- Nonce Management: Replay protection with per-account, per-protocol nonces
Security Considerations
Best Practices
- Module Installation: Only install on accounts with proper access controls
- Nonce Management: Track nonces separately for each execution protocol
- Signature Validation: Understand which validation mode is being used
- Cross-Chain Operations: Verify claim hashes match across chains
- Gas Refunds: Validate exchange rates and overhead parameters
Integration Example
Related Contracts
- CompactIntentExecutor - Cross-chain Compact protocol execution
- Permit2IntentExecutor - Permit2-based execution
- StandaloneIntentExecutor - Self-contained execution