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
TheCompactIntentExecutor enables secure cross-chain intent execution through a two-phase process using The Compact protocol for cross-chain verification.
Source: /src/executor/CompactIntent/CompactIntentExecutor.sol:41
Two-Phase Execution Flow
Phase 1 (Origin Chain):executePreClaimOpsWithCompactStub
- User signs an EIP-712 structured intent specifying cross-chain operations
- Arbiter calls this function to execute pre-claim operations (e.g., token approvals)
- Contract validates signature and computes claim hash for cross-chain verification
executeTargetOpsWithCompactStub
- Arbiter provides proof of origin chain execution via claim hash
- Contract validates the claim hash through The Compact protocol’s verification system
- If valid, executes the target operations on behalf of the user
Security Model
The security relies on:- EIP-712 signatures for user authorization
- The Compact protocol’s cross-chain verification system
- Router-only access control for cross-chain operations
- Expiration timestamps to prevent stale execution
Structs
EIP712CompactStub
Core Compact order data that remains consistent across all elements.Unique nonce for this Compact order to prevent replay attacks
Timestamp after which the entire Compact order expires
Chain ID where the order was originally notarized/signed
EIP712ElementStubOrigin
Stub data for EIP-712 element construction on origin chain.Array of other element hashes in the Compact Merkle tree
Minimum gas required for executing operations
Index position where this element should be inserted in the otherElements array
Hash of target operations that will be executed on destination chain
Hash of input token details for this element
Pre-computed hash of target attributes (account, tokenOut, chain, expires)
Hash of the qualifier data specific to this element
EIP712ElementStubDestination
Stub data for EIP-712 element construction on destination chain.Address that sponsored the original Compact order
Array of other element hashes in the Compact Merkle tree
Index position where this element should be inserted in the otherElements array
Hash of pre-claim operations that were executed on origin chain
Hash of input token details for this element
Hash of output token details for this element
Timestamp after which the fill operation expires
Hash of the qualifier data specific to this element
Functions
executePreClaimOpsWithCompactStub
The smart account address that owns the assets and signed the order
Core Compact order data (nonce, expires, notarized chain)
Element-specific data needed for origin chain execution
Operations to execute before cross-chain transfer (e.g., token approvals)
EIP-712 signature from the account authorizing these operations
sigOk(bool): True if signature validation passedexecOk(bool): True if pre-claim operations executed successfully
The caller (arbiter) is responsible for facilitating the cross-chain transfer. The arbiter address is included in the element hash computation.
executeTargetOpsWithCompactStub
The recipient account address for the target operations
The arbiter address that notarized the cross-chain transfer
Core Compact order data (nonce, expires, notarized chain)
Element-specific data needed for destination chain execution
Operations to execute on the destination chain
EIP-712 signature authorizing the target operations
bytes32 - The computed claim hash used for verification
isCompactIntentNonceConsumed
The nonce value to check
The account address that owns the nonce
bool - True if the nonce has been consumed, false otherwise
Execution Process
Origin Chain (Phase 1)
- Hash Computation: Reconstruct element hash using caller as arbiter
- Merkle Tree: Build complete Compact Merkle tree with all elements
- Claim Hash: Compute final EIP-712 claim hash
- Signature Validation: Verify user’s signature authorizing the operations
- Nonce Consumption: Mark nonce as used to prevent replay
- Execution: Execute pre-claim operations (typically token approvals)
Destination Chain (Phase 2)
- Hash Reconstruction: Recreate element hash from stub data
- Validation: Check correct chain and expiration
- Merkle Tree: Build complete Compact Merkle tree
- Claim Hash: Compute EIP-712 claim hash (must match origin)
- Signature Validation: Verify signature against claim hash
- Nonce Consumption: Mark nonce as used to prevent replay
- Execution: Execute target operations on destination chain
Example Usage
Error Handling
Thrown when signature validation fails
Thrown when fill expiration has passed or parameters are invalid
Thrown when
executeTargetOpsWithCompactStub is called by non-router addressSecurity Considerations
Related
- IntentExecutor - Main executor contract
- Permit2IntentExecutor - Permit2-based execution
- StandaloneIntentExecutor - Self-contained execution