Overview
Intents are the fundamental building blocks of Eco Routes Protocol, representing complete cross-chain execution requests. This page documents theIntent struct and related types, as well as the ERC-7683 compliant OrderData structure.
Type Location: contracts/types/Intent.sol
Intent
Fields
Target chain ID where the intent should be executed. This identifies the destination blockchain using standard EVM chain IDs.Examples:
1- Ethereum Mainnet42161- Arbitrum One10- OP Mainnet8453- Base
Routing and execution instructions for the destination chain. Contains all information needed to execute the cross-chain message, including:
- Salt for uniqueness
- Execution deadline
- Portal contract address
- Native token amount
- Required ERC20 tokens
- Contract calls to execute
Reward and validation parameters for the intent. Defines who can execute the intent, what they receive, and when. Includes:
- Execution deadline
- Creator address
- Prover address
- Native token rewards
- ERC20 token rewards
Intent Hash Calculation
Intents are uniquely identified by their hash:orderId in ERC-7683 events and throughout the protocol.
Usage Example
OrderData
orderData field in GaslessCrossChainOrder and OnchainCrossChainOrder.
Type Location: contracts/types/ERC7683.sol
Fields
Destination chain ID for the intent (same as
Intent.destination)ABI-encoded
Route struct containing execution instructions for the destination chain.Encoding:Reward structure containing creator, prover, amounts, and deadline information (same as
Intent.reward)Portal contract address on the destination chain, encoded as This is extracted from
bytes32 for ERC-7683 compatibility.Encoding:route.portal but stored separately for efficient ERC-7683 resolution.Deadline for route execution on the destination chain (extracted from
route.deadline)Maximum outputs that the filler will send on the destination chain. This represents the upper bound on what the solver must provide to fulfill the intent.Each
Output contains:token: Token address asbytes32(orbytes32(0)for native token)amount: Token amountrecipient: Recipient address asbytes32chainId: Destination chain ID
EIP-712 Type Hash
Usage in ERC-7683 Orders
Onchain Order:Supporting Types
Call
Route.calls array to define execution instructions.
The contract address to call on the destination chain
ABI-encoded function call dataExample:
Amount of native tokens (wei) to send with the call
TokenAmount
Route and Reward structs to specify ERC20 token transfers.
Address of the ERC20 token contract
Amount of tokens in the token’s smallest unit (wei for 18-decimal tokens)Note: Always use the token’s native decimals. For USDC (6 decimals), 1 USDC = 1000000
Output
ResolvedCrossChainOrder for both maxSpent and minReceived arrays.
Type Location: contracts/types/ERC7683.sol
Token address encoded as
bytes32. Use bytes32(0) for native tokens.Encoding:Amount of tokens to be sent or received
Recipient address encoded as
bytes32. Use bytes32(0) when recipient is not known at order creation (will be the filler).Encoding:Chain ID where this output should be sent/receivedUsage:
- For
maxSpent: destination chain ID - For
minReceived: origin chain ID (where rewards are escrowed)
Design Considerations
Why Separate Intent and OrderData?
- Intent: Internal protocol representation optimized for on-chain processing
- OrderData: ERC-7683 compliant format for standardized cross-protocol interoperability
OrderData adds ERC-7683 specific fields (routePortal, routeDeadline, maxSpent) while keeping core intent data.
Why Encode Route as Bytes in OrderData?
Encoding theRoute as bytes in OrderData provides:
- Flexibility: Route structure can evolve without breaking ERC-7683 interface
- Gas Efficiency: Single encoding operation instead of individual field access
- Standardization: Conforms to ERC-7683’s implementation-specific
orderDatadesign
Intent Hash Security
The intent hash useskeccak256(abi.encodePacked(...)) with pre-hashed route and reward to:
- Prevent hash collisions from malicious input ordering
- Ensure consistent hashing across protocol implementations
- Support efficient on-chain verification
Related Types
- Route - Routing and execution instructions
- Reward - Reward and validation parameters
- OriginSettler - Uses OrderData for order creation
- DestinationSettler - Uses Route for execution