How to Implement a Minimum Token Holding Period for DAO Voting
A minimum token holding period (also called a voting delay or holding requirement) is a governance rule that prevents tokens received just before a vote from being used to participate. You implement it by modifying your DAO’s voting contract to check the block timestamp or block number at which a voter acquired their tokens, then comparing it to the current vote’s start time. This document explains the practical steps and trade-offs.
Why use a minimum holding period
Without a holding period, an attacker can borrow tokens, vote on a malicious proposal, and return the tokens - all within a single block or a few blocks. A holding period reduces this risk by requiring tokens to be held for a set duration (e.g., 7 days) before they confer voting power. It also discourages short-term manipulation and encourages long-aligned governance participation.
Implementation Approaches
There are two common methods: using a snapshot-based approach or a continuous voting power check. Both rely on the same core logic.
1. Snapshot-Based Approach
Most DAOs use a snapshot (a record of token balances at a specific past block) to determine voting power. To add a holding period, you extend this snapshot to also record the block at which each holder acquired their tokens.
Step-by-step:
-
Deploy a token contract that tracks balance changes with block numbers Use a token that records the block number of each transfer or mint event. The OpenZeppelin
ERC20Votesextension already tracks delegation and voting power, but it does not natively record acquisition blocks. You can modify it to store a mapping:address => uint256for the block when the address first received tokens above a threshold. -
Define the holding period In the governance contract, add a parameter (e.g.,
minimumHoldingBlocksorminimumHoldingSeconds). For on-chain votes, block numbers are more reliable than timestamps because timestamps can be manipulated slightly by miners. For off-chain voting (e.g., Snapshot), use timestamps. -
Check holding duration at vote cast time In the
castVotefunction (or equivalent), retrieve the voter’s acquisition block from the token contract. IfcurrentBlock - acquisitionBlock < minimumHoldingBlocks, reject the vote. -
Handle edge cases
- New token holders: If a user just received tokens and has no recorded acquisition block, set it to the current block. They will be ineligible until the holding period passes.
- Multiple acquisitions: Use the earliest acquisition block for the voter, not the most recent. This prevents resetting the clock every time they receive more tokens.
- Delegation: If voting power is delegated, the holding period should apply to the delegate’s token acquisition, not the delegator’s. Check the delegate’s acquisition block.
2. continuous voting power check
Instead of a snapshot, some DAOs check voting power at each block. This is less common but can be implemented by having the governance contract query the token’s balance and acquisition history every time a vote is cast.
Method:
- Use a token that exposes getAcquisitionBlock(address) for each holder.
- In the governance contract, call this function and compare it to the current block.
- This method is gas-intensive and may be impractical for large DAOs.
Practical Considerations
Where to Store the Acquisition Data
- In the token contract itself (recommended). This keeps governance logic clean and the data accessible for other uses (e.g., airdrops).
- In a separate registry contract. Useful if you cannot modify the token contract, but adds complexity and one more trust assumption.
Compatibility with existing tools
- OpenZeppelin Governor: You can override the
_getVotesfunction to add a holding period check. This is the simplest path if you already use OpenZeppelin. - Snapshot: Off-chain polling via Snapshot cannot enforce on-chain holding periods. You must either use a Snapshot strategy that checks acquisition blocks (custom development) or move votes on-chain.
- Tally: Tally reads on-chain governance data. If your holding period is enforced in the contract, Tally will reflect it automatically.
Security and attack vectors
- Flash loans: A holding period blocks flash loan attacks completely, because tokens are borrowed and returned within one transaction.
- Sybil attacks: Holding periods do not prevent an attacker who already holds tokens from splitting them across many wallets. Combine with a minimum token balance requirement (already covered on this site under “Proposal Threshold Minimum Token Requirement”).
- Governance takeover via token accumulation: A holding period only delays, not prevents, a whale from accumulating tokens over time. Use other measures like quadratic voting or conviction voting (see related articles).
Trade-offs
| Benefit | Drawback |
|---|---|
| Reduces short-term vote buying and manipulation | Excludes legitimate new token holders from early participation |
| Encourages long-term alignment | Requires additional development and gas costs for tracking acquisition blocks |
| Compatible with existing on-chain governance frameworks | Off-chain tools (Snapshot) need custom strategies |
Testing and Deployment
- On a testnet, deploy the modified token and governance contract. Verify that:
- A user who acquires tokens and immediately tries to vote is rejected.
- After the holding period passes, the same user can vote.
- Delegated voting power respects the delegate’s acquisition block.
-
The contract handles token transfers correctly (acquisition block updates only for the recipient, not the sender).
-
Set the holding period as a governance parameter (e.g., 40320 blocks, roughly 7 days on Ethereum mainnet at 15-second block times). Make it adjustable via a future proposal to respond to changing conditions.
-
Communicate the change to the community well in advance. Token holders who acquired tokens shortly before the change may become temporarily ineligible. Provide a grace period if possible.
A minimum token holding period is a straightforward defense against governance attacks that exploit token mobility. It adds complexity but significantly raises the cost of short-term manipulation. Combine it with other protections like quorum requirements and timelocks (covered elsewhere on this site) for robust DAO governance.
Not financial advice. teslaai2023.site publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.