aere-contracts/contracts/interop/AereOutboundDeliveryRecorder.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

52 lines
2.2 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import {IAereMessageHandlerV2} from "./AereOutboundVerifierV2.sol";
/// @title AereOutboundDeliveryRecorder
/// @notice A minimal, permanent delivery target for `AereOutboundVerifierV2`: it
/// records every message the verifier delivers so the outbound loop can be
/// demonstrated (and audited) end-to-end on chain.
///
/// @dev Deliberately trivial and permissionless: no owner, no funds, no
/// authorisation. It records what it is told and nothing else.
///
/// IT DOES NOT AUTHENTICATE THE CALLER — anyone can call
/// `handleAereMessage` directly and record an arbitrary entry. That is
/// intentional for a recorder: it is a passive log, and treating its
/// contents as proven would be a mistake. The trust-minimised guarantee
/// lives in `AereOutboundVerifierV2` (SP1 proof + immutable validator-set
/// anchor + exactly-once replay guard), NOT here.
///
/// A REAL application handler MUST gate on `msg.sender == <the verifier>`.
/// This contract is the demonstration sink, so it is left open rather than
/// pretending to a security property it does not have.
contract AereOutboundDeliveryRecorder {
struct Delivery {
uint256 srcChainId;
address sender;
address caller;
bytes payload;
}
/// @notice Every delivery ever recorded, in order.
Delivery[] public deliveries;
event MessageRecorded(uint256 indexed srcChainId, address indexed sender, address indexed caller, bytes payload);
/// @notice Called by `AereOutboundVerifierV2` once per proven, unused message.
function handleAereMessage(uint256 srcChainId, address sender, bytes calldata payload) external {
deliveries.push(Delivery({srcChainId: srcChainId, sender: sender, caller: msg.sender, payload: payload}));
emit MessageRecorded(srcChainId, sender, msg.sender, payload);
}
function deliveryCount() external view returns (uint256) {
return deliveries.length;
}
/// @notice The payload of delivery `i` (the array getter omits dynamic bytes).
function payloadAt(uint256 i) external view returns (bytes memory) {
return deliveries[i].payload;
}
}