You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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().
The text was updated successfully, but these errors were encountered:
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 linkstateIndex
tovoiceCreditBalance
. So the off-chain computation can get the voice credit balance by state index.Downsides
setVoiceCredits()
at Poll.sol.setVoiceCredits()
with the eth signer which is the same as the one used to callsignUp()
.The text was updated successfully, but these errors were encountered: