VoteCastWithParams event signature and topic0
The topic0 of the VoteCastWithParams event is 0xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712, the keccak-256 hash of VoteCastWithParams(address,uint256,uint8,uint256,string,bytes); 1 of its 6 arguments is indexed. Governance vote carrying extra ballot params (Governor).
Topics
- topic00xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712keccak256("VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)")
- topic1voter (address)indexed: filterable
Data
- dataproposalId (uint256), support (uint8), weight (uint256), reason (string), params (bytes)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 |
|---|---|---|
| voter | address | topic1 |
| proposalId | uint256 | data |
| support | uint8 | data |
| weight | uint256 | data |
| reason | string | data |
| params | bytes | data |
Solidity declaration
event VoteCastWithParams(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason, bytes params);
Canonical signature
VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)
topic0
0xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712
Get an alert on VoteCastWithParams
Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.
Contracts we list that emit VoteCastWithParams
Any other contract with the same signature emits a log with the same topic0.
Read VoteCastWithParams logs in code
The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Compound Governor, 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: "0x309a862bbc1a00e45506cb8a802d1ff10004c8c0",
event: parseAbiItem("event VoteCastWithParams(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason, bytes params)"),
fromBlock: "latest",
})
for (const log of logs) console.log(log.args) // { voter, proposalId, support, weight, reason, params }import { Interface, JsonRpcProvider } from "ethers"
const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event VoteCastWithParams(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason, bytes params)"])
const logs = await provider.getLogs({
address: "0x309a862bbc1a00e45506cb8a802d1ff10004c8c0",
topics: [iface.getEvent("VoteCastWithParams")!.topicHash],
})
for (const log of logs) console.log(iface.parseLog(log)?.args){
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"address": "0x309a862bbc1a00e45506cb8a802d1ff10004c8c0",
"topics": [
"0xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712"
],
"fromBlock": "latest"
}
]
}event VoteCastWithParams(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason, bytes params);
// inside a function:
emit VoteCastWithParams(voter, proposalId, support, weight, reason, params);An example VoteCastWithParams 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("VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)")0xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712
- topic1voter0x0000000000000000000000001111111111111111111111111111111111111111
- data0x00000000000000000000000000000000000000000000000000000000000007d000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000fa000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000076578616d706c65000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002abcd000000000000000000000000000000000000000000000000000000000000
- voteraddress · indexed0x1111111111111111111111111111111111111111
- proposalIduint2562000
- supportuint83
- weightuint2564000
- reasonstringexample
- paramsbytes0xabcd
Frequently asked questions
What is the topic0 of the VoteCastWithParams event?
0xe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712: the keccak-256 hash of VoteCastWithParams(address,uint256,uint8,uint256,string,bytes).
Which VoteCastWithParams arguments are indexed?
voter is indexed and sit in the log's topics; proposalId, support, weight, reason, params are in the data.
How do I get an alert when a contract emits VoteCastWithParams?
Open one of the ready-made rules on this page, or add any contract and pick VoteCastWithParams 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.