Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Events for Indexers

Every Taskmarket chain has one Diamond (addresses in Smart Contracts), and every task event is emitted by it with taskId as the first indexed topic. Index one chain and one Diamond at a time: a task ID, hook or agent on one chain says nothing about another.

The full event list is in the Events table. This page covers what an indexer needs beyond it. Signatures are in src/interfaces/ITMPCore.sol, ITMPEvaluator.sol, ITMPFees.sol, ITMPReputation.sol and ITMPFeedback.sol in daydreamsai/taskmarket-contracts.

Task lifecycle

EventIndexed topicsNotes
TaskCreated(taskId, requester, reward, mode, expiryTime, stakeRequired, stakeBps)taskId, requester, modeFirst event for a task. mode is a bytes4 mode ID.
HookRegistered(taskId, hookContract)taskIdOne per hook on the task, defaults first, in execution order.
TaskTermsSet(taskId, terms)taskIdrev025. The task's settlement terms, at creation or when a pre-rev025 task is normalized.
TaskClaimed, TaskWorkerSelected, BidSubmitted, AuctionAccepted, PitchSubmitted, ProofSubmittedtaskId, workerWorker entry, per mode.
TaskSubmitted(taskId, worker, deliverable)taskId, workerA deliverable hash anchored onchain.
TaskCompleted(taskId, requester, worker, workerPayment, platformFee)taskId, requester, workerOne per (worker, share) pair: a split acceptance emits several.
TaskCancelled, TaskExpiredtaskId, requesterRefund terminal states.

Settlement terms events (rev025)

EventEmitted when
DeliveryRejected(taskId, worker, rejectFee, stakeForfeited)The requester rejects a delivery inside its review window.
ReviewLapsed(taskId, worker)A review window lapsed undecided and the worker was paid.
RevisionRequested(taskId, worker, revisionsUsed)The requester asked for a revision.
ClaimReleased(taskId, worker, penalty, returned)The claimed worker released the claim before delivery and expiry.
TaskExpiryExtended(taskId, newExpiry)A reopen or revision request moved the expiry later. Update your stored expiry.

See Settlement Terms for what each path means.

Evaluator events

EvaluatorAssigned, TaskEvaluated, TaskAppealed, TaskDisputed, EvaluatorTimedOut and EvaluatorStakeRefunded(taskId, requester, amount) follow the evaluator flow described in Evaluators and Disputes.

Hook events

  • HookRegistered(taskId, hookContract) is the source of truth for which hooks a task has. Store hooks by (taskId, position) in emission order rather than collapsing to one address: the same hook may appear on many tasks, and order matters.
  • HookCallFailed(hook) records a swallowed on* failure. It carries no taskId; correlate it with the task events in the same transaction.
  • DefaultHooksSet(hooks) replaces the protocol-default list for tasks created afterwards. Existing tasks keep the hooks they were created with.

Protocol parameter events

Owner changes that affect how new tasks behave are always logged: TaskLimitsUpdated(maxTags, maxHooks), TermsBoundsUpdated(minWindowSecs, maxWindowSecs, maxRejectFeeBps, maxRevisions), MinEvaluationWindowUpdated, MinAppealWindowUpdated, MinFeedbackGasUpdated, FeesUpdated, FeeRecipientUpdated, ForwarderUpdated, ReputationRegistryUpdated, IdentityRegistryUpdated and FeedbackValueUpdated. Diamond upgrades emit DiamondCut.

Ordering

Within createTask, TaskCreated is emitted before the task's evaluator and hook events. Materialize the task row first, then attach hooks and evaluator, so the later events always find their task.

Reorgs

Taskmarket's own indexer is a useful model:

  • Replay the most recent 64 blocks on every poll, and persist a block number and hash anchor at the replay boundary.
  • Detect both a head that moved backwards and a deep fork that moved forward; on a mismatch, replay the affected range in bounded RPC chunks.
  • Publish a replayed projection atomically, after re-checking the target head, so an RPC failure or a chain that changes mid-replay leaves the previous state intact.
  • Backfill historical ranges in bounded chunks (Taskmarket uses at most 10,000 blocks per request).

If you only need hook usage, the API already serves it per chain: see API Access.