Sub topic 6
Governance Tokens: Voting Rights as a Token
Assume you understand wallets, smart contracts, and basic Solidity. You should also know that an ERC-20 token is a fungible token standard: every unit has the same value and can be transferred between addresses.
A governance token gives holders a way to influence decisions about a protocol. The token does not automatically make its holder an owner. Its power comes from the governance system that reads token balances and applies voting rules.
What governance tokens control
A protocol might use a governance token to decide:
- Which parameters to change, such as a lending interest rate
- How treasury funds should be spent
- Which contracts or applications the protocol should support
- Whether to upgrade a contract
- Which addresses can perform privileged actions
Governance tokens usually represent voting power rather than a direct claim on revenue or assets. The token's economic value may come from expected influence, future protocol changes, access to governance, or demand from users who want to participate.
| Governance element | Purpose |
|---|---|
| Proposal | Describes a change voters can approve or reject |
| Voting power | Measures how much influence an address has |
| Quorum | Minimum participation required for a valid vote |
| Timelock | Delay between approval and execution |
| Executor | Contract or account that carries out the approved action |
Token-weighted voting
The simplest design gives one vote for each governance token. An address holding 10,000 tokens has ten times the voting power of an address holding 1,000 tokens.
This design is easy to understand, but it creates plutocracy risk. Plutocracy is rule by people with the most wealth. A small group can control proposals if it owns most of the supply.
Many systems use a voting snapshot. A snapshot records voting power at a particular block. The proposal then uses that recorded value instead of the voter's current balance. This prevents a participant from borrowing tokens after the vote starts and using them to influence the result.
A quorum adds another condition. For example, a proposal might need both a majority of participating votes and votes representing at least 10 percent of the total supply.
Delegation and checkpoints
Delegation lets a holder assign voting power to another address. The tokens do not move. Only the right to vote moves.
A holder may delegate to a trusted person, an elected representative, or the holder's own address. In systems based on OpenZeppelin's ERC20Votes extension, a holder often must explicitly delegate to themselves before their balance counts as voting power.
The token contract records vote checkpoints. A checkpoint stores an address's voting power at a particular block. Transfers and delegation update these records. Governance can then ask how much voting power an address had when a proposal was created.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Votes} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
import {Nonces} from "@openzeppelin/contracts/utils/Nonces.sol";
contract GovToken is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("Gov Token", "GOV") ERC20Permit("Gov Token") {
_mint(msg.sender, 1_000_000 * 10 ** decimals());
}
function _update(address from, address to, uint256 value)
internal
override(ERC20, ERC20Votes)
{
super._update(from, to, value);
}
function nonces(address owner)
public
view
override(ERC20Permit, Nonces)
returns (uint256)
{
return super.nonces(owner);
}
}The contract creates one million tokens and gives them to the deployer. It has no supply expansion function. That limits dilution from later minting, but it does not make governance fair. The initial holder could still control every vote unless the tokens are distributed or delegated broadly.
Failure modes and review questions
Governance can fail even when the token contract works correctly.
- Voter apathy can leave a small active group in control.
- A whale can buy or borrow enough voting power to pass a proposal.
- Delegates can vote against their principals' interests.
- A compromised governance contract can execute a malicious action.
- An upgrade proposal can replace the governance logic itself.
- A short or missing timelock can leave users no time to react.
When reviewing a governance token, ask who initially received the supply, whether voting power is transferable, how snapshots work, what quorum means, and whether approved actions pass through a timelock. Also check whether an administrator can bypass governance.
Exercise
A proposal uses a snapshot at block 100. An address holds 500 tokens at block 100, borrows 5,000 tokens at block 101, and votes at block 102. How much voting power should the snapshot-based system count?
Show answer
It should count 500 tokens, assuming the address had delegated those tokens appropriately at the snapshot. The later borrowing does not change voting power recorded at block 100.