Event signature · Proxies and ownership

AdminChanged (proxy) event signature and topic0

The topic0 of the AdminChanged (proxy) event is 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f, the keccak-256 hash of AdminChanged(address,address); none of its arguments are indexed. Proxy admin handed to a new address (EIP-1967).

Anatomy of a AdminChanged (proxy) log

Topics

  • topic00x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798fkeccak256("AdminChanged(address,address)")

Data

  • datapreviousAdmin (address), newAdmin (address)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
previousAdminaddressdata
newAdminaddressdata

Solidity declaration

event AdminChanged(address previousAdmin, address newAdmin);

Canonical signature

AdminChanged(address,address)

topic0

0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f

Ready-made alerts

Get an alert on AdminChanged

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

Who emits it

Contracts we list that emit AdminChanged

Any other contract with the same signature emits a log with the same topic0.

Code

Read AdminChanged 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.

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: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  event: parseAbiItem("event AdminChanged(address previousAdmin, address newAdmin)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { previousAdmin, newAdmin }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event AdminChanged(address previousAdmin, address newAdmin)"])

const logs = await provider.getLogs({
  address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  topics: [iface.getEvent("AdminChanged")!.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": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "topics": [
        "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event AdminChanged(address previousAdmin, address newAdmin);

// inside a function:
emit AdminChanged(previousAdmin, newAdmin);
Example

An example AdminChanged 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("AdminChanged(address,address)")0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f
  • data0x00000000000000000000000011111111111111111111111111111111111111110000000000000000000000002222222222222222222222222222222222222222
Decoded with the ABI
  • previousAdminaddress0x1111111111111111111111111111111111111111
  • newAdminaddress0x2222222222222222222222222222222222222222
FAQ

Frequently asked questions

What is the topic0 of the AdminChanged (proxy) event?

0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f: the keccak-256 hash of AdminChanged(address,address).

Which AdminChanged (proxy) arguments are indexed?

None: previousAdmin, newAdmin are ABI-encoded in the log's data, so a log can only be filtered by address and topic0.

How do I get an alert when a contract emits AdminChanged (proxy)?

Open one of the ready-made rules on this page, or add any contract and pick AdminChanged (proxy) from the event list. Conditions can be set on its 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.