compute-quorum-from-voting-supply
Use when checking whether a proposal will reach quorum or explaining a Defeated result that seemed to pass. Computes quorum from governor parameters and vote tallies, not from a guessed percentage.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 80
- Forks
- 17
01 前言 Front Matter
- name
- compute-quorum-from-voting-supply
- description
- Use when checking whether a proposal will reach quorum or explaining a Defeated result that seemed to pass. Computes quorum from governor parameters and vote tallies, not from a guessed percentage.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md359 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Compute quorum from voting supply
A proposal fails either because it did not reach quorum or because against outvoted for — two different failures with two different fixes. Compute both from the governor's own numbers.
Procedure
- Read the quorum formulation. OpenZeppelin governor exposes:
cast call $GOV "quorum(uint256)(uint256)" $BLOCK --rpc-url $RPCand the numerator/denominator that produced it:cast call $GOV "quorumNumerator()(uint256)" --rpc-url $RPCcast call $GOV "quorumDenominator()(uint256)" --rpc-url $RPC - Note that OZ quorum is a fraction of total supply (or
getPastTotalSupply(block)at the snapshot block), not of votes cast. A 4% numerator on a 1e9 supply is a 40,000,000 token floor. - Read the tally:
cast call $GOV "proposalVotes(uint256)(uint256,uint256,uint256)" $ID --rpc-url $RPCwhich returns (againstVotes, forVotes, abstainVotes). - Apply the governor's own rules, which differ by version:
- OZ
_quorumReached:forVotes + abstainVotes >= quorum. - Compound Bravo: quorum counts
forVotes + abstainVotes(abstain can carry quorum without a majority). - OZ
_voteSucceeded:forVotes > againstVotes(strict).
- OZ
- Worked example: supply 1e9, numerator 4, so quorum = 40,000,000. Tally for=30,000,000, abstain=5,000,000, against=2,000,000. Quorum is NOT reached (35M < 40M), so the proposal is Defeated despite for>against.
- Recompute at the snapshot block used by
quorum, since supply moves:cast call $TOKEN "getPastTotalSupply(uint256)(uint256)" $SNAPSHOT --rpc-url $RPC
Pitfalls
- Assuming quorum is a percentage of votes cast; in most governors it is a percentage of total supply, so low turnout fails even with unanimous support.
- Reading
totalSupply()now instead ofgetPastTotalSupply(snapshotBlock); a mint or burn between the vote and the check changes the answer. - Counting abstain as support in sentiment summaries when the governor only counts it toward quorum, not toward
for > against. - Mixing Bravo and OpenZeppelin formulas — they agree on quorum but Bravo's
quorumVotes()is a fixed value read once, while OZ recomputes per snapshot block. - Treating Defeated as a rejection by voters when the cause was a quorum shortfall.
Verification
cast call $GOV "proposalVotes(uint256)(uint256,uint256,uint256)" $ID --rpc-url $RPC
# for+abstain >= quorum AND for>against => the proposal should read Succeeded
Print the quorum number, the tally, and the two boolean tests; if a Defeated proposal passes both, the snapshot block used is the suspect.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.