Transfer event signature and topic0
The topic0 of the Transfer event is 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef, the keccak-256 hash of Transfer(address,address,uint256); 2 of its 3 arguments are indexed. Token moved between accounts.
Topics
- topic00xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efkeccak256("Transfer(address,address,uint256)")
- topic1from (address)indexed: filterable
- topic2to (address)indexed: filterable
Data
- datavalue (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 |
|---|---|---|
| from | address | topic1 |
| to | address | topic2 |
| value | uint256 | data |
Solidity declaration
event Transfer(address indexed from, address indexed to, uint256 value);
Canonical signature
Transfer(address,address,uint256)
topic0
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Get an alert on Transfer
Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.
Contracts we list that emit Transfer
Any other contract with the same signature emits a log with the same topic0.
And 19 more contracts in the app's directory.
Read Transfer logs in code
The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is USD Coin (USDC), a contract we list that emits it.
import { createPublicClient, http, parseAbiItem } from "viem"
import { mainnet } from "viem/chains"
const client = createPublicClient({ chain: mainnet, transport: http() })
const logs = await client.getLogs({
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
event: parseAbiItem("event Transfer(address indexed from, address indexed to, uint256 value)"),
fromBlock: "latest",
})
for (const log of logs) console.log(log.args) // { from, to, value }import { Interface, JsonRpcProvider } from "ethers"
const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event Transfer(address indexed from, address indexed to, uint256 value)"])
const logs = await provider.getLogs({
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
topics: [iface.getEvent("Transfer")!.topicHash],
})
for (const log of logs) console.log(iface.parseLog(log)?.args){
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
],
"fromBlock": "latest"
}
]
}event Transfer(address indexed from, address indexed to, uint256 value);
// inside a function:
emit Transfer(from, to, value);An example Transfer 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("Transfer(address,address,uint256)")0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
- topic1from0x0000000000000000000000001111111111111111111111111111111111111111
- topic2to0x0000000000000000000000002222222222222222222222222222222222222222
- data0x0000000000000000000000000000000000000000000000000000000000000bb8
- fromaddress · indexed0x1111111111111111111111111111111111111111
- toaddress · indexed0x2222222222222222222222222222222222222222
- valueuint2563000
Frequently asked questions
What is the topic0 of the Transfer event?
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef: the keccak-256 hash of Transfer(address,address,uint256).
Which Transfer arguments are indexed?
from, to are indexed and sit in the log's topics; value is in the data.
Do ERC-20 and ERC-721 Transfer events have the same topic0?
Yes. The signature is the same, so the hash is too. ERC-721 also indexes the third argument (the token id), so its logs carry four topics and an empty data field, where ERC-20 logs carry three topics and the amount in the data.
How do I get an alert when a contract emits Transfer?
Open one of the ready-made rules on this page, or add any contract and pick Transfer 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.