Token-weighted governance, often called one-token-one-vote, is a foundational mechanism in decentralized autonomous organizations (DAOs). In this system, a user's voting power is calculated based on the quantity of a specific governance token they hold, such as UNI for Uniswap or COMP for Compound. This creates a direct financial stake in the protocol's decisions, aligning voter incentives with the network's long-term health. The model is implemented via smart contracts that tally votes and execute proposals based on predefined rules.
How to Structure Voting Power Based on Token Holdings
Introduction to Token-Weighted Governance
Token-weighted governance is the dominant model for decentralized decision-making, where voting power is directly proportional to a user's token holdings.
The core implementation involves a governance smart contract that allows token holders to create proposals and cast votes. A common pattern, used by protocols like OpenZeppelin's Governor, includes a token contract that implements an ERC20Votes extension. This extension provides a snapshot mechanism to record token balances at a specific block, preventing manipulation through token transfers during active voting periods. Votes are typically cast by calling a castVote function, where the weight of the vote equals the voter's token balance from the snapshot.
Here is a simplified Solidity example demonstrating the vote weight logic:
solidityfunction castVote(uint256 proposalId, uint8 support) external returns (uint256) { uint256 voteWeight = _getVotes(msg.sender, proposalSnapshot(proposalId)); _castVote(proposalId, msg.sender, support, voteWeight); return voteWeight; }
The _getVotes function queries the voter's historical balance, ensuring fairness. Proposals pass or fail based on whether the total for votes meet a quorum (minimum participation) and a majority threshold.
While simple, this model has significant trade-offs. It can lead to voter apathy where small holders feel their votes don't matter, and it risks centralization if token distribution is uneven. Many DAOs mitigate this with delegation, where users can delegate their voting power to representatives without transferring tokens. For example, a user with 100 AAVE tokens can delegate them to a knowledgeable community member, who then wields that combined voting power.
Effective governance requires careful parameter design. Key parameters include: proposal threshold (minimum tokens to submit a proposal), voting delay (time between proposal submission and start of voting), voting period (duration votes can be cast), and quorum (minimum total voting power required for a valid result). Optimism's governance uses a 0.25% quorum of its OP token supply, while Arbitrum initially set its proposal threshold at 1 million ARB.
Token-weighted governance is a practical starting point for decentralized coordination, but it's often part of a larger ecosystem. Many protocols combine it with multisig councils for emergency operations, temperature checks via snapshot votes off-chain, and conviction voting for budget allocation. Understanding this model is essential for participating in or designing the next generation of decentralized organizations.
How to Structure Voting Power Based on Token Holdings
Token-weighted voting is a foundational governance mechanism for DAOs and DeFi protocols. This guide covers the core concepts and implementation patterns for linking voting power to token ownership.
Token-based voting power is a straightforward model where a user's influence in governance is directly proportional to their token holdings. The most common implementation is one-token-one-vote (1T1V), where each governance token grants one vote. This model is used by major protocols like Uniswap and Compound. The primary advantage is its simplicity and Sybil-resistance, as acquiring more voting power requires acquiring more tokens, which has a direct economic cost. However, it can lead to plutocracy, where large token holders (whales) dominate decision-making.
To implement basic token-weighted voting, you typically interact with a governance smart contract's vote function. The contract checks the caller's token balance at a specific block (often via a snapshot) to determine their voting power. Here's a simplified Solidity concept:
solidityfunction vote(uint proposalId, bool support) external { uint256 votingPower = token.balanceOfAt(msg.sender, snapshotBlock); require(votingPower > 0, "No tokens"); // Record vote weighted by votingPower }
Key considerations include deciding on a vote locking mechanism (e.g., requiring tokens to be staked) and whether to use a snapshot of balances to prevent manipulation during the voting period.
More advanced structures move beyond simple balance checks. Vote-escrowed models (veTokens), pioneered by Curve Finance, tie voting power to the duration tokens are locked. Users lock tokens for a chosen time, receiving veTokens non-transferable NFTs that decay linearly over time. This aligns long-term protocol health with voter incentives. Another pattern is delegated voting, where token holders can delegate their voting power to other addresses (often experts or representatives) without transferring custody, as seen in Compound and ENS.
When designing your system, critical parameters must be defined. These include the voting period (e.g., 3-7 days), quorum requirements (minimum total voting power needed for a valid outcome), and vote thresholds (e.g., simple majority or supermajority). Security is paramount: use OpenZeppelin's governance libraries for battle-tested logic, protect against flash loan attacks by using historical snapshots, and clearly separate the token contract from the governance contract for upgradeability.
For developers, the main tools are the smart contract standards themselves. The ERC-20 standard is the base for the governance token. The ERC-5805 (EIP-6372) and ERC-712 standards are emerging for vote delegation and signature-based voting. Always audit your contracts and consider using existing frameworks like OpenZeppelin Governor which provides modular components for proposals, voting, and timelocks, significantly reducing risk and development time.
Linear Voting: 1 Token = 1 Vote
Linear voting is a foundational governance model where a user's voting power is directly proportional to their token holdings. This guide explains its implementation, trade-offs, and security considerations.
In a linear voting system, each governance token represents one vote. A user holding 100 tokens has 100 votes, while a user with 10 tokens has 10 votes. This simple, predictable model is used by major protocols like Uniswap and Compound. It aligns voting power directly with economic stake, based on the principle that those with more skin in the game should have greater influence over protocol upgrades, treasury allocations, and parameter changes.
Implementing linear voting requires a secure, on-chain snapshot of token balances at a specific block. A common approach is to use a snapshot of token holdings at the proposal creation block to prevent manipulation. The core logic is straightforward: the contract checks the voter's token balance and assigns one vote per token unit. Here's a simplified Solidity example:
solidityfunction castVote(uint proposalId, uint8 support) external { uint256 votingPower = token.balanceOf(msg.sender); require(votingPower > 0, "No tokens to vote with"); // Record the vote weighted by balance _recordVote(proposalId, msg.sender, support, votingPower); }
The primary advantage of this model is its simplicity and transparency, making it easy for participants to understand their influence. However, it has significant drawbacks. It can lead to voter apathy among small holders who feel their votes are insignificant, and it centralizes power with large token holders (whales), potentially enabling governance attacks. This creates a trade-off between capital efficiency and decentralized decision-making.
To mitigate whale dominance, many protocols combine linear voting with additional mechanisms. A common enhancement is a timelock on executed proposals, giving the community time to react to malicious governance actions. Others implement a quorum requirement, ensuring a minimum percentage of the total token supply must participate for a vote to be valid. These layers help balance the raw power dynamics of the 1-token-1-vote rule.
When designing a linear voting system, key parameters must be defined: the voting period (e.g., 3-7 days), proposal threshold (minimum tokens required to submit a proposal), and quorum (minimum participation required). Forks of Compound's Governor Bravo contract, which formalized these parameters, are widely used as a starting point, providing a battle-tested foundation for on-chain governance.
Linear voting remains the standard for many DAOs due to its straightforward implementation. For builders, the decision often comes down to whether the simplicity and capital alignment of this model outweigh the risks of centralization for their specific community and protocol goals.
Quadratic Voting: Reducing Whale Dominance
Quadratic voting is a governance mechanism designed to reduce the influence of large token holders by making voting power proportional to the square root of tokens committed.
In traditional token-weighted voting, a user with 10,000 tokens has 100 times the voting power of a user with 100 tokens. This linear model often leads to whale dominance, where a few large holders can dictate governance outcomes. Quadratic voting (QV) addresses this by making the cost of votes increase quadratically. The formula is simple: to cast n votes on a proposal, a user must pay n² tokens. This means buying 10 votes costs 100 credits, while buying 100 votes costs 10,000 credits, making large-scale influence exponentially more expensive.
The core mechanism relies on calculating voting power as the square root of the committed capital. If a user locks 100 GOV tokens into a voting contract, their voting power is sqrt(100) = 10 votes. A whale locking 10,000 tokens only gets sqrt(10000) = 100 votes, which is only 10 times the power, not 100 times. This mathematical curve significantly flattens the power distribution. Major implementations of this concept include Gitcoin Grants for public goods funding and projects like Radicle and Element DAO for on-chain governance.
Implementing QV requires careful smart contract design to handle the square root calculation and credit system. A basic Solidity snippet for calculating voting power might look like this:
solidityfunction calculateVotes(uint256 tokensCommitted) public pure returns (uint256) { // Uses the Babylonian method for integer square root return sqrt(tokensCommitted); }
The contract must also manage a credit system where users spend governance tokens to receive voting credits, which are then squared to determine the token cost. This ensures the quadratic relationship is enforced on-chain.
Despite its benefits, QV introduces unique challenges. The cost of voting can be high for deeply engaged participants, potentially discouraging participation. There is also a significant risk of Sybil attacks, where a whale splits their holdings across many addresses to game the square root calculation. Mitigations include identity verification (like BrightID) or using a cost function that adds a per-address fee. Furthermore, the complexity of the mechanism can be a barrier to understanding for average token holders.
Quadratic voting is most effective for decisions where measuring the intensity of preference is more important than simple majority rule. It excels in budgeting scenarios, like a DAO allocating a treasury grant across multiple projects, as it allows the community to signal how strongly they support each option. When designing a governance system, the choice between linear and quadratic voting hinges on the desired trade-off between capital efficiency and egalitarian representation.
Time-Locked Voting: The veToken Model
The veToken model aligns long-term incentives by granting voting power proportional to the amount and duration of token lock-up.
The veToken (vote-escrowed token) model is a governance mechanism designed to combat short-term speculation and align voter incentives with a protocol's long-term health. Pioneered by Curve Finance, it replaces the "one token, one vote" system. Instead, a user's voting power is determined by two factors: the quantity of governance tokens they lock and the duration of that lock. This creates a direct correlation between a participant's commitment to the protocol and their influence over its future.
The core mechanism is straightforward. A user deposits their base governance token (e.g., CRV) into a smart contract to mint a non-transferable veToken (e.g., veCRV). The voting power granted is calculated as: voting_power = locked_amount * lock_time. A four-year lock grants 1 veTOKEN per TOKEN locked, while a one-year lock grants only 0.25 veTOKEN. This time-based multiplier incentivizes longer commitments. The locked tokens are illiquid and cannot be traded or transferred until the lock expires, at which point the veTokens are burned.
This model has significant implications for protocol governance and tokenomics. It reduces the circulating supply of the base token, applying deflationary pressure. More importantly, it ensures that the most influential voters are those most invested in the protocol's multi-year success. Major protocols like Curve, Balancer (veBAL), and Frax Finance (veFXS) use this model to govern critical parameters such as liquidity pool incentives (gauge weights), fee distribution, and treasury allocations, making voter decisions directly impact revenue streams.
For developers, implementing a veToken system requires careful smart contract design. The core contract must manage lock creation, power decay, and expiration. A typical structure involves a Lock struct storing a user's amount and unlock timestamp. Voting power should be calculated on-chain in a view function, often decreasing linearly as the unlock time approaches. Security is paramount, as these contracts hold significant value; audits and time-lock mechanisms for administrative functions are essential.
Here is a simplified conceptual example of a veToken calculation in a Solidity view function:
solidityfunction getVotingPower(address user) public view returns (uint256) { Lock memory userLock = locks[user]; if (block.timestamp >= userLock.unlockTime) return 0; uint256 timeLeft = userLock.unlockTime - block.timestamp; uint256 maxLockTime = 4 * 365 days; // 4 years // Linear decay: power = amount * (timeLeft / maxLockTime) return (userLock.amount * timeLeft) / maxLockTime; }
This function demonstrates the linear decay of voting power over the lock's duration.
The primary critique of the veModel is its potential to create governance centralization among large, long-term lockers ("whales"). However, its success in aligning incentives for critical DeFi infrastructure has made it a standard template. When designing a governance system, consider if your protocol's success depends on long-term strategic decisions. If so, the veToken model provides a robust framework to ensure those deciding the future have the most skin in the game.
Voting Model Comparison
Comparison of common token-based voting models for on-chain governance, detailing their core mechanisms, trade-offs, and implementation complexity.
| Governance Feature | Linear Voting | Quadratic Voting | Conviction Voting |
|---|---|---|---|
Power Calculation | 1 Token = 1 Vote | √(Tokens) = Voting Power | Voting Power ∝ (Tokens × Time Locked) |
Whale Resistance | |||
Voter Participation Incentive | Direct yield or fee share | ||
Implementation Complexity | Low | Medium | High |
Gas Cost per Vote | $2-5 | $5-15 | $10-30 (initial lock) |
Vote Delegation Support | |||
Common Use Case | Token upgrades, treasury spend | Grant funding, parameter tuning | Continuous funding, ecosystem grants |
Implementation Considerations and Code
This guide details the practical implementation of token-based voting systems, covering contract architecture, power calculations, and security patterns.
The core of a token-weighted voting system is the vote power calculation. The simplest model is a 1:1 ratio, where one token equals one vote. However, more sophisticated systems use time-weighted or quadratic voting formulas. For a 1:1 system, the calculation in Solidity is straightforward: votePower = balanceOf(voter). For quadratic voting, the power is the square root of the token balance, which can be implemented using a library like OpenZeppelin's Math.sqrt() function to mitigate precision loss and gas costs. The key is to perform this calculation at the time of vote casting, not delegation, to ensure real-time accuracy.
Managing state efficiently is critical for gas optimization. A common pattern is to store a Vote struct containing the voter's address, the proposal ID, and the voting power amount. Avoid storing the raw token balance; instead, calculate and store the derived voting power. Use a mapping like mapping(uint256 proposalId => mapping(address voter => Vote)) public votes for O(1) lookups. For snapshot-based voting, you must integrate an oracle or use the block.number to record a snapshot ID, then calculate voting power based on token balances at that historical block using a system like OpenZeppelin's Snapshot.
Security considerations are paramount. The primary risk is double voting. Prevent this by ensuring a voter can only cast one vote per proposal, enforced by checking the state mapping. Another risk is vote manipulation via flash loans, where an attacker borrows tokens to gain temporary voting power. Mitigate this by using a snapshot taken before the proposal voting period begins, or by implementing a timelock on delegated votes. Always use the Checks-Effects-Interactions pattern and consider reentrancy guards when external calls are involved in the voting flow, especially if votes trigger fund transfers or other state changes.
Resources and Further Reading
These resources cover proven approaches to structuring voting power based on token holdings, from simple linear models to time-weighted and delegated systems used by major DAOs.
Frequently Asked Questions
Common technical questions about implementing and managing token-based voting power in on-chain governance systems.
Token-weighted voting assigns power linearly: 1 token equals 1 vote. Quadratic voting (QV) uses a square root function: voting power = sqrt(token amount). This reduces the influence of large holders. For example, with 100 tokens you get 10 votes (sqrt(100)), while 10,000 tokens yields 100 votes, not 10,000.
QV is implemented in contracts like those from OpenZeppelin Governor, using a _getVotes override. The core formula in Solidity is:
solidityfunction _getVotes(address account, uint256 timepoint) internal view override returns (uint256) { return sqrt(token.balanceOf(account)); }
This design aims to promote more egalitarian outcomes but requires careful sybil-resistance measures.
Conclusion and Next Steps
This guide has covered the core patterns for structuring voting power based on token holdings, from simple linear models to advanced delegation and time-locking mechanisms.
Implementing a robust token-weighted voting system requires careful consideration of your governance goals. The basic balanceOf approach is suitable for simple DAOs, while quadratic voting (sqrt) can mitigate whale dominance for more equitable outcomes. For long-term alignment, consider implementing vote-escrow models like those used by Curve Finance or veTokenomics, where voting power is derived from the duration tokens are locked. Each model has trade-offs in complexity, security, and voter participation that must align with your protocol's needs.
Your next steps should involve rigorous testing and simulation. Use a framework like Foundry or Hardhat to write comprehensive tests for edge cases: zero balances, delegate transfers mid-vote, and potential rounding errors. For mainnet deployment, consider using audited, standard implementations from libraries like OpenZeppelin Governor which provides a modular system for vote weighting, quorum, and timelocks. Always start with a timelock executor for treasury actions to prevent sudden, malicious proposals from executing.
To explore these concepts further, review the source code for leading governance systems. Study Compound's Governor Bravo, Uniswap's governance contracts, and Curve's veCRV implementation. For ongoing research, follow discussions in the Governance Research Forum and the Ethereum Magicians community. The field of on-chain governance is rapidly evolving with new models like Holographic Consensus and Conviction Voting emerging to address scalability and voter apathy.