Events
The AsseteraExchange event catalog: what each event means, its indexed fields, and the meta-transaction actor model.
AsseteraExchange emits one primary lifecycle event per order or offer per call, so a correct
read model can be built purely from events; the view functions are only for point-in-time
reconciliation. The tables below are the reference catalog. The machine-readable schema (canonical
signatures, topic0 hashes, and custom-error selectors) is published with each deployment
alongside the ABI and addresses.
The actor model: read identity from the event
Because the contract uses ERC-2771 meta-transactions, a relayed call's outer msg.sender /
tx.origin is the trusted Forwarder, not the user. The contract resolves the real actor with
_msgSender() before emitting, so the address inside each event (maker, taker, account,
by, operator, proposedBy) is already correct.
Never key user identity off the transaction's from field when the forwarder is in play. Always
use the address embedded in the event. isTrustedForwarder(address) / trustedForwarder() let an
indexer detect and flag relayed transactions.
Order events
| Event | Emitted by | Indexed fields | Notes |
|---|---|---|---|
OrderPlaced | placeOrder, placeOrderWithPermit | id, maker | New order; carries sell/buy legs and expireTs. |
OrderFilled | fillOrder (full fill) | id, maker, taker | Remaining quantity reached 0; carries filled amounts, both fee amounts, feeCollector. |
OrderPartiallyFilled | fillOrder (partial fill) | id, maker, taker | Order stays open; 5th field is the new remainingQuantity, not the buy amount. |
OrderSettled | settle | buyId, sellId, operator | Two complementary orders settled together; both fee legs and collectors. |
OrderCancelled | cancelOrder, cancelOrderSelf | id, maker | No data fields; disambiguate the two paths via a matching KycConsumed. |
OrderRefunded | refund | id, maker, operator | Operator returns remaining escrow; carries a reason string. |
OrderForceCancelled | cancelOrderForUser | id, maker, admin | Admin exit; recipient (non-indexed) may differ from maker. |
OrderExpired | sweepExpired | id, maker | One per swept id in a batch; carries remainingQuantity returned. |
Offer events
| Event | Emitted by | Indexed fields | Notes |
|---|---|---|---|
OfferMade | makeOffer | id, maker, taker | Targeted offer opened; carries both token legs, expireTs, and fee terms. |
OfferReplaced | replaceOffer | id, by | Counter-proposal; by becomes the new proposedBy. Fee terms unchanged. |
OfferAccepted | acceptOffer | id, by | Accepting party; carries the agreed terms. |
OfferSettled | settleOffer | id, operator | Received amounts are net of fee; carries fee amount and collector. |
OfferCancelled | cancelOffer | id, by | Terms at cancellation; only the current proposer's side was escrowed. |
OfferForceCancelled | cancelOfferForUser | id, maker, admin | Admin exit; both recipient fields present even if only one leg moved. |
OfferExpired | sweepExpiredOffers | id, proposedBy | One per swept id; carries amountReturned. |
Compliance and admin events
| Event | Emitted by | Indexed fields | Notes |
|---|---|---|---|
KycConsumed | any KYC-gated action | account, action, orderId | Attestation-consumed audit trail; emitted only when compliance is required for that action. orderId is 0 for Place / MakeOffer. |
ComplianceRequiredSet | setComplianceRequired | action | Per-action KYC gating toggle. |
CollectorAllowed | setAllowedCollector | collector | Fee-collector allowlist change. |
BlacklistUpdated | setBlacklisted | hashedAccount | hashedAccount is keccak256(account), pseudonymized, not reversible. |
Roadmap: the on-chain blacklist (setBlacklisted / BlacklistUpdated) is slated for removal
in the production baseline: a frozen user is one the backend simply declines to sign for, so the
on-chain mapping is redundant for a MiFID venue. KycConsumed is emitted only when
complianceRequired is true for that action; its absence means gating was disabled for the
action, not that verification was skipped.
Inherited OpenZeppelin events also appear: Upgraded (UUPS), Paused / Unpaused, and
RoleGranted / RoleRevoked. The role constant values needed to decode the last two are published
with the deployment artifacts.
Indexing notes
- Orders and offers are 1-indexed;
totalOrders()/totalOffers()give the high-water mark. - Use
(chain_id, tx_hash, log_index)as the idempotency key; sweep events can appear many times per transaction. OrderRefunded,OrderForceCancelled, and thesweep*events are the only ways escrow leaves the contract without a matching fill or settlement; include them in any balance-reconciliation job.
Two events (OfferMade, OfferSettled) have fee-enriched signatures whose topic0 differs
from an older pre-fee ABI. Always subscribe to the current topic0 values from the ABI published
with the deployment, and branch decoding on topics[0] when backfilling across an upgrade.