@auryn and I were discussing the contibutor’s UI in Figma, and this came up:
There are four possible states here:
- No funds contributed, no projects in cart
- No funds contributed, projects in cart
- Funds contributed, no projects in cart
- Funds contributed, projects in cart
In 1 and 3, there is no need to show sliders because funds haven’t been contributed and/or there are no projects to display a slider on.
In 2 and 4, we should display the sliders, whether or not the user has already deposited funds to the round or sent the message containing their vote.If the user hasn’t contributed any funds to the round yet (2), then the “fund” button should trigger a transaction that sends funds to the round and submits their message.
If the user has contributed funds already(4), then the “fund” button should just send a new message to replace their old message.
If the user is in state (4) but allocates more funding than they have deposited, then the “fund” button should trigger a transaction to deposit the additional funds and send the updated message.
In this post I want to address some of these points in more detail.
If the user hasn’t contributed any funds to the round yet (2), then the “fund” button should trigger a transaction that sends funds to the round and submits their message.
There are three stages in MACI lifecycle:
-
Sign-up period. It starts immediately after the deployment of MACI contract. During the sign-up period voters should call
signUp()
method, which will register their public key and calculate the amount of voice credits they have (the amount of voice credits can not be changed later). Users can’t submit messages during this period. -
Voting period. It starts immediately after the sign-up period. During that period users (or someone on their behalf) can submit messages to MACI by calling the
publishMessage()
method. Sign-ups are not allowed anymore during this period. - Processing period. It starts immediately after the voting period and lasts until the coordinator completes all the necessary operations.
As we can see, the sign-up and voting periods don’t overlap, so it’s not possible to sign up and submit message at the same time, unless we store the message somewhere and submit it later on behalf of a user (but we should avoid it, as it could require a lot of gas). This means that users will be probably required to interact with our system at least twice: when they contribute money (during the sign-up period) and when they vote (during the voting period).
Deploying the MACI at the end of the round doesn’t help, but adds even more friction, as users will need to interact with our system three times (again, unless we sign up and publish messages on behalf of a user):
- During the funding period, when they just contribute the amount they want.
- During the signup period, after the instantiation of MACI.
- During the voting period.
If the user is in state (4) but allocates more funding than they have deposited, then the “fund” button should trigger a transaction to deposit the additional funds and send the updated message.
It’s not possible to add voice credits once the user has been signed up. We can introduce the “funding period”, during which users will be able to deposit additional funds (we don’t actually need to instantiate MACI at the end of the round to do that), but that would require an additional interaction with our system, as I showed in a previous paragraph.