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

Feat(frontend): signup flow #4

Closed
3 tasks done
kittybest opened this issue Jan 26, 2024 · 2 comments
Closed
3 tasks done

Feat(frontend): signup flow #4

kittybest opened this issue Jan 26, 2024 · 2 comments
Assignees

Comments

@kittybest
Copy link
Contributor

kittybest commented Jan 26, 2024

As a user, I want to be able to sign up w/ MACI so that I can vote

Requirements

  • add ability to connect wallet (this is already provided by EasyRetroPGF)
  • generate MACI key for user
  • execute MACI signUp function (this should pass relevant data to EAS gatekeeper)

Notes

EAS attestation

Currently the app relies on the approval schema to validate if somone can vote. We should update this to use the badgeholder schema

When a user connects their wallet, we should query EAS to confirm if the address is an OP badgeholder or not

  • If yes, we should allow them to sign up
  • If not, we should disable the ability to sign up or vote (and display that in the UI)
    • For this, maybe it's as simple as disabling the "sign up" button & saying "You must be a badgeholder to sign up"

Note: EasyRetroPGF may already do this check (after they use SIWE to connect?), so let's check out the code & confirm before implementing ourselves

MACI key generation

Once a user connects their wallet & we've confirmed they're an OP badgeholder (by querying the EAS attestation), we should generate a MACI keypair for them so they can sign up

Let's generate the MACI key deterministically, so it's attached to their ETH address (so same implementation as clr.fund). This way, we can completely abstract the MACI keypair away from the user. They don't even need to know it exists. As long as they can connect their wallet & prove ownership of the ETH address, they should be able to generate their MACI private key to sign any messages.

Signup flow

This is a new flow to the EasyRetroPGF app... so I'm thinking this simplest/easiest implementation is this...

Once wallet is connected, allow users to add projects to their ballot (so same UX as current app)

In their ballot view, instead of allowing users to submit ballot, first prompt them to sign up:

Image 2024-01-29 at 13 13 44

So basically: change the text of the button (to "Sign up") & change the tx this triggers - this should call the signup function from the MACI contract. Once this tx is submitted & succeeds, then we should change the text back to "Submit ballot".

@samajammin samajammin added this to MACI Jan 29, 2024
@samajammin samajammin moved this to Todo in MACI Jan 29, 2024
@samajammin samajammin moved this from Todo to Backlog in MACI Jan 29, 2024
@samajammin samajammin mentioned this issue Jan 29, 2024
6 tasks
@kittybest
Copy link
Contributor Author

Image 2024-01-29 at 13 13 44

So basically: change the text of the button (to "Sign up") & change the tx this triggers - this should call the signup function from the MACI contract. Once this tx is submitted & succeeds, then we should change the text back to "Submit ballot".

Question: so we still allow them to add projects to ballot even if they haven't signed up? I suppose they won't see that page until they already signed up.

@samajammin
Copy link
Member

@github-project-automation github-project-automation bot moved this from In Progress to Done in MACI Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants