aere-contracts/contracts/intents/IERC7683.sol
Aere Network a13a649b77
Some checks are pending
contracts-ci / Install (lockfile) → compile → full test suite (push) Waiting to run
contracts-ci / PQC known-answer tests (NIST vectors) (push) Waiting to run
contracts-ci / Coverage (scoped, with artifacts) (push) Waiting to run
Initial public release
Aere Network public source. Everything here can be checked against the live
chain (chain id 2800, https://rpc.aere.network).

Scope note, stated up front rather than buried: consensus on chain 2800 is
classical secp256k1 ECDSA QBFT. The post-quantum work in this repository is at
the signature, precompile, account and transport layers. Nothing here makes the
consensus post-quantum, and no document in it should be read as claiming so.
2026-07-20 01:02:37 +03:00

101 lines
3.2 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
/**
* @title ERC-7683 — Cross-Chain Intents minimal interface
* @notice Subset of the canonical ERC-7683 specification implemented for AERE
* Network. ERC-7683 standardises the "intent" abstraction: a user
* signs a declarative order ('I want X on chain Y at price ≤ Z by
* deadline T'), a solver fills it, and the origin settler releases
* the user's deposited collateral to the solver after on-chain
* confirmation.
*
* @dev This file vendors only the structs and function signatures AERE
* uses; the full standard includes resolveFor / open variants and
* a richer FillInstruction.encodedInstruction format. AERE follows
* the canonical types so an Across V3 / Uniswap X solver written
* to ERC-7683 will work against AereSpokePool with no changes.
*/
struct Input {
bytes32 token; // bytes32-padded address
uint256 amount;
}
struct Output {
bytes32 token;
uint256 amount;
bytes32 recipient;
uint256 chainId;
}
/// @notice Order issued from this chain (the origin of the intent).
struct OnchainCrossChainOrder {
uint32 fillDeadline;
bytes32 orderDataType;
bytes orderData;
}
/// @notice Off-chain gas-less order signed by the user; relayed by anyone.
struct GaslessCrossChainOrder {
address originSettler;
address user;
uint256 nonce;
uint256 originChainId;
uint32 openDeadline;
uint32 fillDeadline;
bytes32 orderDataType;
bytes orderData;
}
struct FillInstruction {
uint64 destinationChainId;
bytes32 destinationSettler;
bytes originData;
}
struct ResolvedCrossChainOrder {
address user;
uint256 originChainId;
uint32 openDeadline;
uint32 fillDeadline;
bytes32 orderId;
Input[] minReceived;
Output[] maxSpent;
Output[] receivers;
FillInstruction[] fillInstructions;
}
interface IOriginSettler {
event Open(bytes32 indexed orderId, ResolvedCrossChainOrder resolvedOrder);
/// @notice Opens an on-chain order. The caller is the user (msg.sender).
function open(OnchainCrossChainOrder calldata order) external;
/// @notice Opens a gas-less order signed by user. Permissionless relayer.
function openFor(
GaslessCrossChainOrder calldata order,
bytes calldata signature,
bytes calldata originFillerData
) external;
/// @notice View resolved-order shape WITHOUT mutating state.
function resolve(OnchainCrossChainOrder calldata order)
external
view
returns (ResolvedCrossChainOrder memory);
function resolveFor(GaslessCrossChainOrder calldata order, bytes calldata originFillerData)
external
view
returns (ResolvedCrossChainOrder memory);
}
interface IDestinationSettler {
/// @notice Solver completes the user's intent on the destination chain.
/// @param orderId Hash uniquely identifying the order.
/// @param originData Opaque blob set by the originSettler.
/// @param fillerData Optional solver-supplied data.
function fill(bytes32 orderId, bytes calldata originData, bytes calldata fillerData) external;
}