Event signature · Token standards

Withdrawal (unwrap) event signature and topic0

The topic0 of the Withdrawal (unwrap) event is 0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, the keccak-256 hash of Withdrawal(address,uint256); 1 of its 2 arguments is indexed. Wrapped ETH unwrapped back to ETH.

Anatomy of a Withdrawal (unwrap) log

Topics

  • topic00x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65keccak256("Withdrawal(address,uint256)")
  • topic1src (address)indexed: filterable

Data

  • datawad (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
srcaddresstopic1
waduint256data

Solidity declaration

event Withdrawal(address indexed src, uint256 wad);

Canonical signature

Withdrawal(address,uint256)

topic0

0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65

Ready-made alerts

Get an alert on Withdrawal

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 Withdrawal

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

Code

Read Withdrawal logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Wrapped Ether (WETH), 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: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  event: parseAbiItem("event Withdrawal(address indexed src, uint256 wad)"),
  fromBlock: "latest",
})

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

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event Withdrawal(address indexed src, uint256 wad)"])

const logs = await provider.getLogs({
  address: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  topics: [iface.getEvent("Withdrawal")!.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": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "topics": [
        "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event Withdrawal(address indexed src, uint256 wad);

// inside a function:
emit Withdrawal(src, wad);
Example

An example Withdrawal 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("Withdrawal(address,uint256)")0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65
  • topic1src0x0000000000000000000000001111111111111111111111111111111111111111
  • data0x00000000000000000000000000000000000000000000000000000000000007d0
Decoded with the ABI
  • srcaddress · indexed0x1111111111111111111111111111111111111111
  • waduint2562000
FAQ

Frequently asked questions

What is the topic0 of the Withdrawal (unwrap) event?

0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65: the keccak-256 hash of Withdrawal(address,uint256).

Which Withdrawal (unwrap) arguments are indexed?

src is indexed and sit in the log's topics; wad is in the data.

How do I get an alert when a contract emits Withdrawal (unwrap)?

Open one of the ready-made rules on this page, or add any contract and pick Withdrawal (unwrap) 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.