Last updated
Was this helpful?
Last updated
Was this helpful?
If you are deploying a token that might govern a DAO in the future, include voting methods. It's easy and safe to add them up front. It's much harder to upgrade or wrap the token to add them later.
Deploy your token with . That means providing voting methods, getVotes
and getPastVotes
. Governors can call those voting methods when counting votes on proposals.
is a canonical implementation of EIP-5805. – or a custom Governor contract – uses the extension to calculate voting power.
, the leading DAO smart contact setup.
Open Zeppelin's ERC20Votes extension is safe and self-contained. It has been audited and is currently deployed in thousands of token contracts.
The main tradeoff is gas usage. Fortunately, users can make that decision themselves.
Users can choose to activate their voting power by calling delegate
. When an account is delegated, transfers
will also update voting power. That update uses extra gas. Users who do a lot of transfers can always undelegate their tokens to save gas by delegating to the zero address.
Include ERC20Votes to future-proof a token for onchain governance