OwnershipTransferred event signature and topic0
The topic0 of the OwnershipTransferred event is 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0, the keccak-256 hash of OwnershipTransferred(address,address); 2 of its 2 arguments are indexed. Contract ownership handed to a new owner.
Topics
- topic00x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0keccak256("OwnershipTransferred(address,address)")
- topic1previousOwner (address)indexed: filterable
- topic2newOwner (address)indexed: filterable
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 |
|---|---|---|
| previousOwner | address | topic1 |
| newOwner | address | topic2 |
Solidity declaration
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Canonical signature
OwnershipTransferred(address,address)
topic0
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0
Get an alert on OwnershipTransferred
Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.
Contracts we list that emit OwnershipTransferred
Any other contract with the same signature emits a log with the same topic0.
Read OwnershipTransferred logs in code
The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is ENS names (.eth registrar), 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: "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
event: parseAbiItem("event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)"),
fromBlock: "latest",
})
for (const log of logs) console.log(log.args) // { previousOwner, newOwner }import { Interface, JsonRpcProvider } from "ethers"
const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)"])
const logs = await provider.getLogs({
address: "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
topics: [iface.getEvent("OwnershipTransferred")!.topicHash],
})
for (const log of logs) console.log(iface.parseLog(log)?.args){
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"
],
"fromBlock": "latest"
}
]
}event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// inside a function:
emit OwnershipTransferred(previousOwner, newOwner);An example OwnershipTransferred 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("OwnershipTransferred(address,address)")0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0
- topic1previousOwner0x0000000000000000000000001111111111111111111111111111111111111111
- topic2newOwner0x0000000000000000000000002222222222222222222222222222222222222222
- data0x
- previousOwneraddress · indexed0x1111111111111111111111111111111111111111
- newOwneraddress · indexed0x2222222222222222222222222222222222222222
Frequently asked questions
What is the topic0 of the OwnershipTransferred event?
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0: the keccak-256 hash of OwnershipTransferred(address,address).
Which OwnershipTransferred arguments are indexed?
previousOwner, newOwner are indexed and sit in the log's topics.
How do I get an alert when a contract emits OwnershipTransferred?
Open one of the ready-made rules on this page, or add any contract and pick OwnershipTransferred 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.