# ERC20 weighted voting clarification and examples

**URL:** <https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543>\
**Category:** Contracts\
**Tags:** erc20\
**Created:** [June 10, 2022, 5:08pm UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543 "2022-06-10T17:08:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![itspavan](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@itspavan](https://forum.openzeppelin.com/u/itspavan)\
**Post date:** [June 10, 2022, 5:08pm UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/1 "2022-06-10T17:08:07Z")

</div>

Please know that I recently started working on web3 and I might be way off. Please oblige any non-technicality. Appreciate any help and directions to a blog post or examples anywhere possible.

#### Question

So, experimenting with the given example ERC20 token from the wizard and on the governance page. I have delegated and tried voting. The question I have is

- After each vote is casted, the vote power of the account is still the same. For eg: getVotes(account) is 10eth, after casting 1 vote for a proposal getVotes(account) still shows 10eth. Is this the correct behavior and if yes, can someone explain why this is the way it is? and if not, what am I missing in this?
- The next question I have is that, I'm trying to assign weights to every account, so that each vote cast is not the same, for eg: account 1 casts a vote their vote is only worth 0.1 during counting, account 2 casts 1 vote which is worth 0.5 only during counting. How would I go about adding this in the contracts?

Any help is appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [June 10, 2022, 10:51pm UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/2 "2022-06-10T22:51:32Z")

</div>

Voting power isn't "spent" by voting, so `getVotes` will return the same number until the tokens are transferred or undelegated. That said, an account will be able to use that voting power only once for a given proposal.

What does the weight depend on? I think your best option might be to make a variant of the [`GovernorVotes`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/429b2242d8e7dedec5e69e7e2065d33e0fc76dc4/contracts/governance/extensions/GovernorVotes.sol) module in a way that `_getVotes` applies a multiplier to the votes. You would use your variant of the contract in place of `GovernorVotes`.

---

<div class="post-metadata">

**Author:** ![Saeed\_Alipoor](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/saeed_alipoor/32/4307_2.png) [@Saeed\_Alipoor](https://forum.openzeppelin.com/u/Saeed_Alipoor)\
**Post date:** [June 11, 2022, 9:29am UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/3 "2022-06-11T09:29:28Z")

</div>

> [@frangio](#):
>
> until the tokens are transferred or undelegated. That said, an account will be able to use that voting power only once for a given proposal.

do you can please explain more about this.

---

<div class="post-metadata">

**Author:** ![itspavan](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@itspavan](https://forum.openzeppelin.com/u/itspavan)\
**Post date:** [June 11, 2022, 1:37pm UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/4 "2022-06-11T13:37:33Z")

</div>

Thanks for the early response. I think I understand what you mean and the `GovernorVotes` should work (I’ll give that a try). I had a follow up question about spending the voting power. If the vote is not spent after voting how would one go about implementing something like quadratic voting?

Thanks again.

---

<div class="post-metadata">

**Author:** ![Saeed\_Alipoor](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/saeed_alipoor/32/4307_2.png) [@Saeed\_Alipoor](https://forum.openzeppelin.com/u/Saeed_Alipoor)\
**Post date:** [June 11, 2022, 2:09pm UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/5 "2022-06-11T14:09:45Z")

</div>

only once for a given proposal. but how i can make conditions , to make sure user can't use voting power for another proposal ?

i can buy 10 GOV tokens , and with this 10 GOV tokens, vote for multiple proposals , yes ?

---

<div class="post-metadata">

**Author:** ![itspavan](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@itspavan](https://forum.openzeppelin.com/u/itspavan)\
**Post date:** [June 13, 2022, 1:22am UTC](https://forum.openzeppelin.com/t/erc20-weighted-voting-clarification-and-examples/29543/6 "2022-06-13T01:22:35Z")

</div>

Yes, that is correct. You could buy 10 GOV tokens and vote for multiple proposals. But, cannot vote twice for the same proposal.
