Event signature · Token standards

TransferSingle event signature and topic0

The topic0 of the TransferSingle event is 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62, the keccak-256 hash of TransferSingle(address,address,address,uint256,uint256); 3 of its 5 arguments are indexed. Single ERC-1155 token transferred.

Anatomy of a TransferSingle log

Topics

  • topic00xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62keccak256("TransferSingle(address,address,address,uint256,uint256)")
  • topic1operator (address)indexed: filterable
  • topic2from (address)indexed: filterable
  • topic3to (address)indexed: filterable

Data

  • dataid (uint256), value (uint256)ABI-encoded, decoded with the ABI
Parameters

Arguments and where they sit in the log

Indexed arguments travel as topics and can be filtered cheaply; the others are ABI-encoded together in the data.

NameTypeIn the log
operatoraddresstopic1
fromaddresstopic2
toaddresstopic3
iduint256data
valueuint256data

Solidity declaration

event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

Canonical signature

TransferSingle(address,address,address,uint256,uint256)

topic0

0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62

Ready-made alerts

Get an alert on TransferSingle

Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.

Code

Read TransferSingle logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. Put in the address of the contract you read.

viem
import { createPublicClient, http, parseAbiItem } from "viem"
import { mainnet } from "viem/chains"

const client = createPublicClient({ chain: mainnet, transport: http() })

const logs = await client.getLogs({
  address: "0xYourContractAddress",
  event: parseAbiItem("event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { operator, from, to, id, value }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)"])

const logs = await provider.getLogs({
  address: "0xYourContractAddress",
  topics: [iface.getEvent("TransferSingle")!.topicHash],
})

for (const log of logs) console.log(iface.parseLog(log)?.args)
JSON-RPC (eth_getLogs)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    {
      "address": "0xYourContractAddress",
      "topics": [
        "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

// inside a function:
emit TransferSingle(operator, from, to, id, value);
Example

An example TransferSingle log, encoded and decoded

Placeholder values, not a real transaction: how each argument is stored in the topics and the data, and what decoding gives back.

Encoded (as the node returns it)
  • topic0keccak256("TransferSingle(address,address,address,uint256,uint256)")0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
  • topic1operator0x0000000000000000000000001111111111111111111111111111111111111111
  • topic2from0x0000000000000000000000002222222222222222222222222222222222222222
  • topic3to0x0000000000000000000000003333333333333333333333333333333333333333
  • data0x0000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000001388
Decoded with the ABI
  • operatoraddress · indexed0x1111111111111111111111111111111111111111
  • fromaddress · indexed0x2222222222222222222222222222222222222222
  • toaddress · indexed0x3333333333333333333333333333333333333333
  • iduint2564000
  • valueuint2565000
FAQ

Frequently asked questions

What is the topic0 of the TransferSingle event?

0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62: the keccak-256 hash of TransferSingle(address,address,address,uint256,uint256).

Which TransferSingle arguments are indexed?

operator, from, to are indexed and sit in the log's topics; id, value are in the data.

How do I get an alert when a contract emits TransferSingle?

Open one of the ready-made rules on this page, or add any contract and pick TransferSingle from the event list. Conditions can be set on indexed and non-indexed arguments, and each alert names the contract and links to the transaction.

Keep exploring

More event signatures and tools

Know the moment a contract emits it

The Beta plan is free: one wallet and one contract, no credit card.