Skip to Content
WebhooksContract Events

Contract Events

Contract Event webhooks (CONTRACT_EVENT) deliver logs emitted by a selected smart contract. A log matches when its emitting contract and event signature match the webhook’s selector.

Select a contract and events

The dashboard currently supports one emitting contract per Contract Events webhook. Its event selector can contain:

  • ABI event fragments for matching and decoding.
  • Raw topic0 hashes for matching without decoding.
  • Neither, to receive every log emitted by that contract, including anonymous events.

ABI and raw topic hashes can be combined in the same selector. A raw hash that duplicates an ABI event signature is automatically deduplicated.

ABI event fragments

Paste event entries from a compiler artifact or verified contract ABI. Spectrum validates and canonicalizes them, calculates topic0, and decodes matched arguments into args.

{ "type": "event", "name": "Swap", "inputs": [ { "name": "sender", "type": "address", "indexed": true }, { "name": "recipient", "type": "address", "indexed": true }, { "name": "amount0", "type": "int256" }, { "name": "amount1", "type": "int256" } ] }

Anonymous events cannot be selected by signature because they have no topic0; use an all-events selector instead.

Raw topic hashes

topic0 is the first log topic for a non-anonymous event: the Keccak-256 hash of its canonical signature, such as Transfer(address,address,uint256). A raw hash is useful for an unverified contract or when you only need to identify the event.

Without an ABI, Spectrum delivers the original topics and data, but cannot produce an event name or decoded args. Topics 1–3 contain indexed argument values; non-indexed values remain ABI-encoded in data.

Indexed argument filters

When a selector contains exactly one ABI event and no raw hashes, it can narrow matches by indexed argument name. Multiple values for one argument are OR; different arguments are AND.

{ "indexed": { "sender": ["0x1111111111111111111111111111111111111111"], "recipient": [ "0x2222222222222222222222222222222222222222", "0x3333333333333333333333333333333333333333" ] } }

Dynamic indexed values such as strings, bytes, arrays, and tuples exist on-chain only as a hash. Filter them using the raw 32-byte topic hash.

Decoded output

Decoded logs include event and args alongside the raw log fields:

{ "contract": "0x1111111111111111111111111111111111111111", "topic0": "0x...", "event": "Swap", "topics": ["0x...", "0x...", "0x..."], "data": "0x...", "txHash": "0x...", "txIndex": 4, "logIndex": 12, "args": { "sender": "0x2222222222222222222222222222222222222222", "recipient": "0x3333333333333333333333333333333333333333", "amount0": "-5000", "amount1": "4000" } }

Addresses are lowercase, integers are decimal strings, bytes are 0x-prefixed hex, arrays are JSON arrays, and tuples are objects. Unnamed inputs use arg0, arg1, and so on. If a matching emission is malformed, Spectrum preserves the raw log and adds decodeError rather than silently dropping it.

Filter options

OptionEffect
Include transactionAdds transaction details such as from, to, value, and gas.
Include receiptAdds receipt details when available, including status, gas used, and effective gas price.
Decoded events onlyRejects raw-hash and all-events selectors so every configured match has an ABI decoder.
Omit raw log dataRemoves topics and data from successfully decoded entries; undecoded entries retain them.

Contract Event deliveries use event.logs[] instead of the Address Activity event.activity[] array. They retain the same block envelope, retry, idempotency, and reorg behavior described in Delivery & Retries.