Event signature · Governance

ProposalCreated event signature and topic0

The topic0 of the ProposalCreated event is 0x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0, the keccak-256 hash of ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string); none of its arguments are indexed. New proposal opened on a Governor / Compound-style DAO.

Anatomy of a ProposalCreated log

Topics

  • topic00x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0keccak256("ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)")

Data

  • dataproposalId (uint256), proposer (address), targets (address[]), values (uint256[]), signatures (string[]), calldatas (bytes[]), voteStart (uint256), voteEnd (uint256), description (string)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
proposalIduint256data
proposeraddressdata
targetsaddress[]data
valuesuint256[]data
signaturesstring[]data
calldatasbytes[]data
voteStartuint256data
voteEnduint256data
descriptionstringdata

Solidity declaration

event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 voteStart, uint256 voteEnd, string description);

Canonical signature

ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)

topic0

0x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0

Ready-made alerts

Get an alert on ProposalCreated

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 ProposalCreated

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

Code

Read ProposalCreated logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Uniswap Governor Bravo, 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: "0x408ed6354d4973f66138c91495f2f2fcbd8724c3",
  event: parseAbiItem("event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 voteStart, uint256 voteEnd, string description)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { proposalId, proposer, targets, values, signatures, calldatas, voteStart, voteEnd, description }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 voteStart, uint256 voteEnd, string description)"])

const logs = await provider.getLogs({
  address: "0x408ed6354d4973f66138c91495f2f2fcbd8724c3",
  topics: [iface.getEvent("ProposalCreated")!.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": "0x408ed6354d4973f66138c91495f2f2fcbd8724c3",
      "topics": [
        "0x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 voteStart, uint256 voteEnd, string description);

// inside a function:
emit ProposalCreated(proposalId, proposer, targets, values, signatures, calldatas, voteStart, voteEnd, description);
Example

An example ProposalCreated 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("ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)")0x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0
  • data0x00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000022222222222222222222222222222222222222220000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000001b580000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000333333333333333333333333333333333333333300000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000076578616d706c6500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002abcd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076578616d706c6500000000000000000000000000000000000000000000000000
Decoded with the ABI
  • proposalIduint2561000
  • proposeraddress0x2222222222222222222222222222222222222222
  • targetsaddress[][0x3333333333333333333333333333333333333333]
  • valuesuint256[][4000]
  • signaturesstring[][example]
  • calldatasbytes[][0xabcd]
  • voteStartuint2567000
  • voteEnduint2568000
  • descriptionstringexample
FAQ

Frequently asked questions

What is the topic0 of the ProposalCreated event?

0x7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e0: the keccak-256 hash of ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string).

Which ProposalCreated arguments are indexed?

None: proposalId, proposer, targets, values, signatures, calldatas, voteStart, voteEnd, description 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 ProposalCreated?

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