Event signature · Lending

Withdraw (Aave V3) event signature and topic0

The topic0 of the Withdraw (Aave V3) event is 0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7, the keccak-256 hash of Withdraw(address,address,address,uint256); 3 of its 4 arguments are indexed. Assets withdrawn from an Aave V3-style money market.

Anatomy of a Withdraw (Aave V3) log

Topics

  • topic00x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7keccak256("Withdraw(address,address,address,uint256)")
  • topic1reserve (address)indexed: filterable
  • topic2user (address)indexed: filterable
  • topic3to (address)indexed: filterable

Data

  • dataamount (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
reserveaddresstopic1
useraddresstopic2
toaddresstopic3
amountuint256data

Solidity declaration

event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);

Canonical signature

Withdraw(address,address,address,uint256)

topic0

0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7

Ready-made alerts

Get an alert on Withdraw

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 Withdraw

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

Code

Read Withdraw logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Aave V3 Core Pool, 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: "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2",
  event: parseAbiItem("event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { reserve, user, to, amount }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount)"])

const logs = await provider.getLogs({
  address: "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2",
  topics: [iface.getEvent("Withdraw")!.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": "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2",
      "topics": [
        "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);

// inside a function:
emit Withdraw(reserve, user, to, amount);
Example

An example Withdraw 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("Withdraw(address,address,address,uint256)")0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7
  • topic1reserve0x0000000000000000000000001111111111111111111111111111111111111111
  • topic2user0x0000000000000000000000002222222222222222222222222222222222222222
  • topic3to0x0000000000000000000000003333333333333333333333333333333333333333
  • data0x0000000000000000000000000000000000000000000000000000000000000fa0
Decoded with the ABI
  • reserveaddress · indexed0x1111111111111111111111111111111111111111
  • useraddress · indexed0x2222222222222222222222222222222222222222
  • toaddress · indexed0x3333333333333333333333333333333333333333
  • amountuint2564000
FAQ

Frequently asked questions

What is the topic0 of the Withdraw (Aave V3) event?

0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7: the keccak-256 hash of Withdraw(address,address,address,uint256).

Which Withdraw (Aave V3) arguments are indexed?

reserve, user, to are indexed and sit in the log's topics; amount is in the data.

How do I get an alert when a contract emits Withdraw (Aave V3)?

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