Skip to main content

What is an Intent?

An intent represents a user’s desired outcome on a destination chain. It contains:
  • Route: The calls to execute on the destination chain, including required tokens
  • Reward: The compensation offered to solvers who execute the intent
  • Destination: The target chain ID where execution should occur
Intents separate what you want done from how it gets done, allowing specialized solvers to compete to execute your transactions efficiently.

Intent Structure

Eco Routes uses three core data structures defined in contracts/types/Intent.sol:

Intent

Intent.sol

Route

Intent.sol

Reward

Intent.sol

Creating Your First Intent

Here’s a complete example of creating an intent for a cross-chain token transfer.
1

Define the Intent Parameters

First, define what you want to happen on the destination chain:
2

Create Token Transfer Calls

Define the calls to execute on the destination chain:
3

Specify Required Tokens

Declare which tokens the solver must provide:
4

Define the Route

Combine the execution parameters:
5

Define the Reward

Specify compensation for the solver:
6

Create the Complete Intent

Assemble the full intent:

Publishing and Funding Intents

Once you’ve created an intent, you need to publish and fund it. The IntentSource contract provides several methods.

Function Signatures

From contracts/IntentSource.sol:
IntentSource.sol

Publish and Fund in One Transaction

For intents with ERC20 token rewards:

Separate Publish and Fund

You can also publish an intent first and fund it later:
Anyone can fund an intent once it’s published. The reward tokens are held in a deterministic vault contract until the intent is fulfilled.

Real-World Examples

Example 1: Cross-Chain Swap

Swap USDC on Ethereum for USDT on Arbitrum:

Example 2: Cross-Chain DeFi Interaction

Deposit funds into a lending protocol on another chain:

Example 3: Native Token Transfer

Transfer ETH to another chain:

Checking Intent Status

You can check if an intent has been funded using contracts/IntentSource.sol:
IntentSource.sol
Usage:

Important Considerations

Deadline Management: The route deadline must be before or equal to the reward deadline. Solvers need time to claim rewards after execution.
Sufficient Rewards: Ensure your rewards are attractive enough to incentivize solvers. Consider gas costs on both chains and solver profit margins.
Deterministic Vaults: Reward tokens are stored in deterministic vault contracts created via CREATE2. The vault address is the same across all chains for the same intent hash.
Partial Funding: Set allowPartial = true if you want to fund the intent gradually. This is useful for large intents or when multiple parties contribute to the reward.

Next Steps

Fulfilling Intents

Learn how solvers execute intents on destination chains

Proving Intents

Understand how fulfillment is proven cross-chain

ERC-7683 Integration

Use the standardized ERC-7683 interface