TransferBatch event signature and topic0
The topic0 of the TransferBatch event is 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb, the keccak-256 hash of TransferBatch(address,address,address,uint256[],uint256[]); 3 of its 5 arguments are indexed. Batch of ERC-1155 tokens transferred.
Topics
- topic00x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fbkeccak256("TransferBatch(address,address,address,uint256[],uint256[])")
- topic1operator (address)indexed: filterable
- topic2from (address)indexed: filterable
- topic3to (address)indexed: filterable
Data
- dataids (uint256[]), values (uint256[])ABI-encoded, decoded with the ABI
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.
| Name | Type | In the log |
|---|---|---|
| operator | address | topic1 |
| from | address | topic2 |
| to | address | topic3 |
| ids | uint256[] | data |
| values | uint256[] | data |
Solidity declaration
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
Canonical signature
TransferBatch(address,address,address,uint256[],uint256[])
topic0
0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb
Get an alert on TransferBatch
Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.
Read TransferBatch 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.
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 TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)"),
fromBlock: "latest",
})
for (const log of logs) console.log(log.args) // { operator, from, to, ids, values }import { Interface, JsonRpcProvider } from "ethers"
const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)"])
const logs = await provider.getLogs({
address: "0xYourContractAddress",
topics: [iface.getEvent("TransferBatch")!.topicHash],
})
for (const log of logs) console.log(iface.parseLog(log)?.args){
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"address": "0xYourContractAddress",
"topics": [
"0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb"
],
"fromBlock": "latest"
}
]
}event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
// inside a function:
emit TransferBatch(operator, from, to, ids, values);An example TransferBatch 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.
- topic0keccak256("TransferBatch(address,address,address,uint256[],uint256[])")0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb
- topic1operator0x0000000000000000000000001111111111111111111111111111111111111111
- topic2from0x0000000000000000000000002222222222222222222222222222222222222222
- topic3to0x0000000000000000000000003333333333333333333333333333333333333333
- data0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000fa000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000001388
- operatoraddress · indexed0x1111111111111111111111111111111111111111
- fromaddress · indexed0x2222222222222222222222222222222222222222
- toaddress · indexed0x3333333333333333333333333333333333333333
- idsuint256[][4000]
- valuesuint256[][5000]
Frequently asked questions
What is the topic0 of the TransferBatch event?
0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb: the keccak-256 hash of TransferBatch(address,address,address,uint256[],uint256[]).
Which TransferBatch arguments are indexed?
operator, from, to are indexed and sit in the log's topics; ids, values are in the data.
How do I get an alert when a contract emits TransferBatch?
Open one of the ready-made rules on this page, or add any contract and pick TransferBatch 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.
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.