ERC20 weighted voting clarification and examples

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.

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 module in a way that _getVotes applies a multiplier to the votes. You would use your variant of the contract in place of GovernorVotes.

do you can please explain more about this.

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.

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 ?

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

1 Like