Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems of designing voice credit #4

Open
johnson86tw opened this issue Apr 19, 2022 · 1 comment
Open

Problems of designing voice credit #4

johnson86tw opened this issue Apr 19, 2022 · 1 comment

Comments

@johnson86tw
Copy link
Owner

johnson86tw commented Apr 19, 2022

The main problem is that the user’s voice credit balance is reset to the same number for each new poll. Because users get voice credits in the sign up process, the sign up state will not change when MACI deploys a new poll. So there is no room for us to change the voice credit balance in each different poll. If we want to change it, currently we have to deploy another maci contract every time for the next poll.

Case 1: Allow the owner set the initial voice credit balance before each round of poll.

In this case, If the owner wants to change the voice credit balance, the owner should deploy another maci contract for the next poll. Otherwise, voters can get voice credit in poll id 1 as the number in the last poll.

See https://github.com/chnejohnson/quadratic-voting-contracts/blob/main/contracts/voiceCredit/AdjustableVoiceCredit.sol for the implementation intention.

Case 2: Allow a specific ERC20 token to be capable of converting into a number of voice credits.

In this case, If we want to bind an ERC20 token to voice credit, we can only use poll id 0 and should deploy another maci contract for the next poll. Otherwise, voters can get voice credit in poll id 1 as the number in the last poll but without any payment.

See https://github.com/chnejohnson/quadratic-voting-contracts/blob/main/contracts/voiceCredit/TradableVoiceCredit.sol for the implementation intention.

Proposed Solution

Following is my rough solution for the above problem:
johnson86tw/maci@92f0ac9

The idea is to move the getVoiceCredits function from MACI to Poll, and add a mapping to link stateIndex to voiceCreditBalance. So the off-chain computation can get the voice credit balance by state index.

Downsides

  • Add a new step: users have to sign up at MACI.sol and call setVoiceCredits() at Poll.sol.
  • Users have to call setVoiceCredits() with the eth signer which is the same as the one used to call signUp().
@daodesigner
Copy link

looks good with the exception of johnson86tw/maci@92f0ac9 , top ups require some changes to circuits Cory is working on privacy-scaling-explorations/maci#411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants