Events
The AsseteraECS event catalog: what each event means, its indexed fields, and the meta-transaction actor model.
AsseteraECS emits explicit lifecycle events for every order and offer transition, so a correct
read model can be built purely from events; the view functions are for point-in-time
reconciliation. acceptOffer emits both acceptance and settlement events in the same transaction.
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, and is maintained as
INDEXER_EVENT_SCHEMA.md
in the public contracts repo.
The rename from AsseteraExchange to AsseteraECS does not change any event. Selectors and topic0
hashes derive from the event signature, never from the contract name, so an existing indexer keeps
decoding historic logs unchanged.
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 both filled amounts, both fee amounts, collector, and settlement currency. |
OrderPartiallyFilled | fillOrder (partial fill) | id, maker, taker | Order stays open; carries both filled amounts, the new remaining quantity, both fee amounts, collector, and settlement currency. |
OrderCancelled | cancelOrder | id, maker | Maker self-cancel; carries the total amount returned, including any unconsumed fee escrow. |
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 the total amount 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 and is followed by OfferSettled in the same transaction. |
OfferSettled | acceptOffer | id, by | Atomic settlement; carries gross leg amounts, both fee amounts, the collector, and settlement currency. |
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. |
The former on-chain blacklist has been removed. There is no setBlacklisted function or
BlacklistUpdated event in the current contract. 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. OrderCancelled,OrderForceCancelled,OfferCancelled,OfferForceCancelled, and thesweep*events return escrow without a fill or offer settlement; include them in every balance-reconciliation job.
Event signatures have changed across contract versions as fee and refund fields were added. Always
subscribe using the ABI published for the deployment, and branch decoding on topics[0] when
backfilling across an upgrade.