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: voice credits per poll #1967

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Dec 12, 2024

Description

Add custom credits per each poll

Related issue(s)

fix #1854

Confirmation

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
maci-website ✅ Ready (Inspect) Visit Preview Jan 7, 2025 10:33am

@ctrlc03 ctrlc03 changed the title Feat/voice credits per poll feat: voice credits per poll Dec 12, 2024
@ctrlc03 ctrlc03 self-assigned this Dec 12, 2024
packages/contracts/contracts/MACI.sol Fixed Show fixed Hide fixed
packages/contracts/contracts/MACI.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/MACI.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/MACI.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/Poll.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/Poll.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/Poll.sol Dismissed Show dismissed Hide dismissed
@ctrlc03 ctrlc03 force-pushed the feat/voice-credits-per-poll branch from 3e2ac79 to 73dcbaa Compare December 12, 2024 21:02
packages/contracts/contracts/MACI.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/MACI.sol Dismissed Show dismissed Hide dismissed
packages/contracts/contracts/Poll.sol Dismissed Show dismissed Hide dismissed
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

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

@ctrlc03 thanks, just some questions and minor suggestions

packages/cli/deploy-config.json Outdated Show resolved Hide resolved
packages/cli/ts/utils/interfaces.ts Outdated Show resolved Hide resolved
@@ -10,3 +10,5 @@ export const SNARK_FIELD_SIZE = r;
export const NOTHING_UP_MY_SLEEVE = BigInt(keccak256(toUtf8Bytes("Maci"))) % SNARK_FIELD_SIZE;

assert(NOTHING_UP_MY_SLEEVE === BigInt("8370432830353022751713833565135785980866757267633941821328460903436894336785"));

export const PAD_KEY_HASH = BigInt("1309255631273308531193241901289907343161346846555918942743921933037802809814");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we use exactly this value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is the poseidon hash of the the PAD_KEY (https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/SnarkConstants.sol#L12) - it's the same key that was part of the blank state leaf, and now because we only need to store the key at the maci state tree, we can directly use this value as init value for the tree

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

noticed the last two lines of this comment are not accurate (https://github.com/privacy-scaling-explorations/maci/blob/dev/packages/contracts/contracts/crypto/SnarkConstants.sol#L18-L19), that hash starting 67 refers to the hash of the blank state leaf

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

Successfully merging this pull request may close these issues.

Custom voice credit proxy per poll
2 participants