Interact to..
Access Events & Logs

Events & Logs

Events are signals that are emitted from smart contracts. Every event is logged, immutable and accessable using a blockchain node only. Smart contracts can not access events themself.

Client-Applications can either listen to events and act accordingly or use logged events to access historical data.

The example uses a public contract and paginates thru the results.


Source Code

The VTHO contract's source code is available on GitHub: (opens in a new tab)

Contract address

The public VTHO contract is used. Address is identical on Test and MainNet.



Definition of the event Transfer that is emitted on every VTHO Transfer.

    "anonymous": false,
    "inputs": [
            "indexed": true,
            "name": "_from",
            "type": "address"
            "indexed": true,
            "name": "_to",
            "type": "address"
            "indexed": false,
            "name": "_value",
            "type": "uint256"
    "name": "Transfer",
    "type": "event"

Event definition

event Transfer(address indexed _from, address indexed _to, uint256 _value);

Connex Example using Account Visitor

const event = connex.thor.account(CONTRACT_ADDRESS).event(ABI);
const logs = await event
  .filter([{ _to: address }])
  .apply(0, 20);

Connex Example using Thor Filter

import { abi } from "thor-devkit";
const coder = new abi.Event(ABI)
const topics = TransferCoder.encode({ _to: address });
const events = await connex.thor
  .filter("event", [
      address: CONTRACT_ADDRESS,
      topic0: topicsFrom[0] || undefined,
      topic1: topicsFrom[1] || undefined,
      topic2: topicsFrom[2] || undefined,
      topic3: topicsFrom[3] || undefined,
      topic4: topicsFrom[4] || undefined
  .apply(0, 20);
const logs = => {
  return {
    decoded: coder.decode(, event.topics)


  1. React, Connex (opens in a new tab)
  2. React, Connex, connex.thor.filter (opens in a new tab)