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(maci-signup): implement signup with MACI and EAS #14

Closed
wants to merge 1 commit into from

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Jan 30, 2024

Related to #4

This is a WIP (draft only for now)

Implement Signup with MACI and EAS

  • add button (to move to ballot page)
  • add maci related config
  • add signup function
    • get address
    • get signer
    • get schema
    • get attestation
    • create maci keypair
    • save keypair to local storage
    • signup
    • store state index to local storage

@@ -112,6 +112,8 @@ NEXT_PUBLIC_METADATA_SCHEMA=0xd00c966351896bd3dc37d22017bf1ef23165f859d7546a2aba
NEXT_PUBLIC_EAS_CONTRACT_ADDRESS=0x4200000000000000000000000000000000000021
NEXT_PUBLIC_EAS_SCHEMA_REGISTRY_ADDRESS=0x4200000000000000000000000000000000000020

# The address of a deployed MACI instance
NEXT_MACI_ADDRESS=""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be added to env.js?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary, but recommended, because it can verify if it's configured correctly before running the app via a Zod schema. For example:

NEXT_PUBLIC_ADMIN_ADDRESSES: z.string().startsWith("0x"),

Comment on lines +34 to +35
const schema = eas.schemas.badgeholder;
const attester = eas.schemas.badgeholderAttester;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Badgeholder is the same as voter.
To verify if an address is an approved voter, you can use:

const { data: isApproved } = useApprovedVoter(address);

// and on server-side
const isApproved = await fetchApprovedVoter(address);

@samajammin
Copy link
Member

I imagine this can be closed out @0xmad @kittybest ?

@0xmad 0xmad closed this Mar 5, 2024
@0xmad 0xmad deleted the feat/maci-signup branch March 5, 2024 17:18
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

Successfully merging this pull request may close these issues.

4 participants