Skip to main content

Overview

Intents are the fundamental building blocks of Eco Routes Protocol, representing complete cross-chain execution requests. This page documents the Intent struct and related types, as well as the ERC-7683 compliant OrderData structure. Type Location: contracts/types/Intent.sol

Intent

Complete cross-chain intent combining routing and reward information.

Fields

uint64
Target chain ID where the intent should be executed. This identifies the destination blockchain using standard EVM chain IDs.Examples:
  • 1 - Ethereum Mainnet
  • 42161 - Arbitrum One
  • 10 - OP Mainnet
  • 8453 - Base
Route
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
See Route Type for detailed structure.
Reward
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
See Reward Type for detailed structure.

Intent Hash Calculation

Intents are uniquely identified by their hash:
This hash is used as the orderId in ERC-7683 events and throughout the protocol.

Usage Example


OrderData

ERC-7683 compliant order data structure that contains everything needed to publish an intent via the ERC-7683 interface. This is the decoded content of the orderData field in GaslessCrossChainOrder and OnchainCrossChainOrder. Type Location: contracts/types/ERC7683.sol

Fields

uint64
Destination chain ID for the intent (same as Intent.destination)
bytes
ABI-encoded Route struct containing execution instructions for the destination chain.Encoding:
Reward
Reward structure containing creator, prover, amounts, and deadline information (same as Intent.reward)
bytes32
Portal contract address on the destination chain, encoded as bytes32 for ERC-7683 compatibility.Encoding:
This is extracted from route.portal but stored separately for efficient ERC-7683 resolution.
uint64
Deadline for route execution on the destination chain (extracted from route.deadline)
Output[]
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 as bytes32 (or bytes32(0) for native token)
  • amount: Token amount
  • recipient: Recipient address as bytes32
  • chainId: Destination chain ID
See Output Type below for details.

EIP-712 Type Hash

This type hash is used for EIP-712 signature verification in gasless orders.

Usage in ERC-7683 Orders

Onchain Order:
Gasless Order:

Supporting Types

Call

Represents a single contract call with encoded function data. Used in the Route.calls array to define execution instructions.
address
The contract address to call on the destination chain
bytes
ABI-encoded function call dataExample:
uint256
Amount of native tokens (wei) to send with the call
Usage Example:

TokenAmount

Represents a token amount pair. Used in both Route and Reward structs to specify ERC20 token transfers.
address
Address of the ERC20 token contract
uint256
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
Usage Example:

Output

ERC-7683 compliant output specification. Used in ResolvedCrossChainOrder for both maxSpent and minReceived arrays. Type Location: contracts/types/ERC7683.sol
bytes32
Token address encoded as bytes32. Use bytes32(0) for native tokens.Encoding:
uint256
Amount of tokens to be sent or received
bytes32
Recipient address encoded as bytes32. Use bytes32(0) when recipient is not known at order creation (will be the filler).Encoding:
uint256
Chain ID where this output should be sent/receivedUsage:
  • For maxSpent: destination chain ID
  • For minReceived: origin chain ID (where rewards are escrowed)
Usage Example:

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 the Route as bytes in OrderData provides:
  1. Flexibility: Route structure can evolve without breaking ERC-7683 interface
  2. Gas Efficiency: Single encoding operation instead of individual field access
  3. Standardization: Conforms to ERC-7683’s implementation-specific orderData design

Intent Hash Security

The intent hash uses keccak256(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