What is ERC-7683?
ERC-7683 is a standard interface for cross-chain order protocols. It provides:- Standardized Order Format: Common structure for cross-chain intents
- Gasless Orders: Support for meta-transactions with signatures
- Solver Interoperability: Compatible with any ERC-7683 solver infrastructure
- Unified Tooling: Works with existing ERC-7683 tools and services
- OriginSettler (
contracts/ERC7683/OriginSettler.sol): Handles order creation on source chains - DestinationSettler (
contracts/ERC7683/DestinationSettler.sol): Handles order fulfillment on destination chains
ERC-7683 Order Structures
OnchainCrossChainOrder
For direct on-chain order creation:ERC7683.sol
GaslessCrossChainOrder
For gasless orders signed by users:ERC7683.sol
OrderData
Eco-specific order data structure:ERC7683.sol
ResolvedCrossChainOrder
Standardized resolved order format:ERC7683.sol
Creating Orders (Origin Chain)
TheOriginSettler contract provides two methods for creating orders.
Function Signatures
Fromcontracts/ERC7683/OriginSettler.sol:
OriginSettler.sol
Method 1: Direct On-Chain Orders
Create orders directly from your wallet:1
Prepare OrderData
Encode your intent into ERC-7683 format:
2
Create OnchainCrossChainOrder
Wrap OrderData in the ERC-7683 order structure:
3
Approve Tokens and Open Order
Approve reward tokens and call
open():Method 2: Gasless Orders with Signatures
Allow solvers to create orders on behalf of users:- User: Sign Order
- Solver: Execute Order
Users create and sign orders off-chain:
Filling Orders (Destination Chain)
TheDestinationSettler contract handles order fulfillment.
Function Signature
Fromcontracts/ERC7683/DestinationSettler.sol:
DestinationSettler.sol
Fulfilling an Order
1
Monitor Orders
Listen for
Open events on origin chains:2
Prepare Fill Data
Encode the required data for filling:
3
Execute Fill
Call the This internally calls
fill function:fulfillAndProve() to execute and initiate proving.Resolving Orders
Get standardized order information:OriginSettler.sol
Complete ERC-7683 Example
Here’s a complete example using the ERC-7683 interface:- Create Order
- Fill Order
ERC-7683 Events
Origin Chain Events
Destination Chain Events
Comparing Native vs ERC-7683 Interfaces
- Native Interface
- ERC-7683 Interface
Direct Eco Routes interface:Pros:
- Simpler structure
- Direct access to all features
- More efficient (less encoding)
- Not compatible with ERC-7683 tooling
- Custom implementation for each protocol
Best Practices
Nonce Management: For gasless orders, track nonces carefully to prevent replay attacks. Use timestamps or incrementing counters.
Next Steps
Creating Intents
Learn about the native intent creation interface
Fulfilling Intents
Understand native intent fulfillment
Proving Intents
Learn about cross-chain proof mechanisms