Architecture
Origin Chain:OriginSettler
handles intent creation, signature verification, and fund escrowDestination Chain:
DestinationSettler
manages intent fulfillment and proof generation
OriginSettler
Entry point for creating cross-chain intents on source chains. Implements EIP-712 signature verification with domain name “EcoPortal” and version “1”.open()
Creates an intent directly on-chain with atomic funding.- Validates
orderDataType
matchesORDER_DATA_TYPEHASH
- Decodes
OrderData
from the order - Calls
_publishAndFund()
to create intent and transfer funds - Emits
Open
event with resolved order details
openFor()
Creates a gasless intent on behalf of a user using EIP-712 signatures.block.timestamp <= order.openDeadline
order.originSettler == address(this)
order.originChainId == block.chainid
orderDataType
matchesORDER_DATA_TYPEHASH
- Signature verification via
_validateOrderSig()
_publishAndFund()
through vault state checking (Initial, Funded, Withdrawn, Refunded).
Resolution Functions
Convert Eco-specific order data into ERC-7683 compliant format:- Converts
Reward
structure intoOutput[]
array (rewards + native ETH if present) - Calculates
routeHash
,rewardHash
, andintentHash
- Creates
FillInstruction
with encoded(route, rewardHash)
asoriginData
user
:orderData.reward.creator
originChainId
:block.chainid
fillDeadline
:orderData.routeDeadline
orderId
:intentHash
minReceived
: Reward outputs with origin chain IDsfillInstructions[0].destinationSettler
:orderData.routePortal
EIP-712 Signature
GaslessCrossChainOrder TypeHash:order.user
.
Abstract Method
DestinationSettler
Handles intent fulfillment on destination chains.fill()
Executes a cross-chain order on the destination.orderId
: Intent hash from origin chainoriginData
: Encoded(bytes route, bytes32 rewardHash)
fillerData
: Encoded(address prover, uint64 source, bytes32 claimant, bytes proverData)
- Decodes
originData
to extract route and rewardHash - Emits
OrderFilled(orderId, msg.sender)
- Decodes
fillerData
for prover details - Calls
fulfillAndProve()
with decoded parameters
Abstract Method
Data Types
OnchainCrossChainOrder
GaslessCrossChainOrder
OrderData
ResolvedCrossChainOrder
Output
FillInstruction
Integration Examples
Creating Direct Intent
Creating Gasless Intent
Fulfilling Intent
Error Handling
TypeSignatureMismatch()
: OrderDataType doesn’t match ORDER_DATA_TYPEHASHOpenDeadlinePassed()
: Current time exceeds opening deadlineInvalidOriginSettler()
: Order specifies wrong settler addressInvalidOriginChainId()
: Order targets different chainInvalidSignature()
: Signature verification failed
Eco-Specific Implementation Notes
- Recipient Field:
Output.recipient
always zero address; actual claimant specified infillerData
at fulfillment - ChainId Semantics:
minReceived
outputs use origin chainId (rewards claimed on source chain) - FillInstruction.originData: Contains
(route, rewardHash)
tuple instead of complete intent - Single Fill: Each order has exactly one fill instruction