AsseteraAssetera Docs
Smart contracts

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

EventEmitted byIndexed fieldsNotes
OrderPlacedplaceOrder, placeOrderWithPermitid, makerNew order; carries sell/buy legs and expireTs.
OrderFilledfillOrder (full fill)id, maker, takerRemaining quantity reached 0; carries both filled amounts, both fee amounts, collector, and settlement currency.
OrderPartiallyFilledfillOrder (partial fill)id, maker, takerOrder stays open; carries both filled amounts, the new remaining quantity, both fee amounts, collector, and settlement currency.
OrderCancelledcancelOrderid, makerMaker self-cancel; carries the total amount returned, including any unconsumed fee escrow.
OrderForceCancelledcancelOrderForUserid, maker, adminAdmin exit; recipient (non-indexed) may differ from maker.
OrderExpiredsweepExpiredid, makerOne per swept id in a batch; carries the total amount returned.

Offer events

EventEmitted byIndexed fieldsNotes
OfferMademakeOfferid, maker, takerTargeted offer opened; carries both token legs, expireTs, and fee terms.
OfferReplacedreplaceOfferid, byCounter-proposal; by becomes the new proposedBy. Fee terms unchanged.
OfferAcceptedacceptOfferid, byAccepting party; carries the agreed terms and is followed by OfferSettled in the same transaction.
OfferSettledacceptOfferid, byAtomic settlement; carries gross leg amounts, both fee amounts, the collector, and settlement currency.
OfferCancelledcancelOfferid, byTerms at cancellation; only the current proposer's side was escrowed.
OfferForceCancelledcancelOfferForUserid, maker, adminAdmin exit; both recipient fields present even if only one leg moved.
OfferExpiredsweepExpiredOffersid, proposedByOne per swept id; carries amountReturned.

Compliance and admin events

EventEmitted byIndexed fieldsNotes
KycConsumedany KYC-gated actionaccount, action, orderIdAttestation-consumed audit trail; emitted only when compliance is required for that action. orderId is 0 for Place / MakeOffer.
ComplianceRequiredSetsetComplianceRequiredactionPer-action KYC gating toggle.
CollectorAllowedsetAllowedCollectorcollectorFee-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 the sweep* 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.

On this page