@maci-protocol/website 0.0.0-ci.2653bc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +157 -0
- package/CHANGELOG.md +566 -0
- package/LICENSE +22 -0
- package/README.md +58 -0
- package/babel.config.js +3 -0
- package/blog/2021-10-12-maci-v1.md +100 -0
- package/blog/2022-09-22-maci-v1-technical-introduction.md +180 -0
- package/blog/2023-01-18-maci-v1.1.1.md +121 -0
- package/blog/2024-01-18-roadmap.md +106 -0
- package/blog/2024-02-28-maci-v1.2.0.md +121 -0
- package/blog/2024-04-10-roadmap-q2.md +96 -0
- package/blog/2024-05-08-ethdam.md +169 -0
- package/blog/2024-05-22-the-origins-of-maci.md +38 -0
- package/blog/2024-05-28-upcoming-grants.md +85 -0
- package/blog/2024-06-17-understanding-maci.md +63 -0
- package/blog/2024-06-21-deciphering-maci.md +48 -0
- package/blog/2024-06-28-revolusioning-public-goods-funding.md +32 -0
- package/blog/2024-07-23-q2-review.md +72 -0
- package/blog/2024-07-30-roadmap-q3.md +61 -0
- package/blog/2024-08-10-maci-v2.md +102 -0
- package/blog/2024-08-29-anonymous-poll-joining.md +47 -0
- package/blog/2024-10-29-q3-review.md +63 -0
- package/blog/2024-11-20-maci-platform.md +93 -0
- package/blog/2024-12-01-maci-getting-started.md +294 -0
- package/blog/2025-03-21-roadmap-2025.md +112 -0
- package/blog/assets/MACI_Bob_SignUp_1.png +0 -0
- package/blog/assets/MACI_Bob_SignUp_2.png +0 -0
- package/blog/assets/MACI_Complex_Message.png +0 -0
- package/blog/assets/MACI_Contracts.png +0 -0
- package/blog/assets/MACI_Sign_Up.png +0 -0
- package/blog/assets/MACI_Simple_Message.png +0 -0
- package/blog/assets/MACI_Verifier_1.png +0 -0
- package/blog/authors.yml +5 -0
- package/docusaurus.config.ts +213 -0
- package/package.json +65 -0
- package/src/components/ActionCard/index.tsx +30 -0
- package/src/components/ActionCard/styles.module.css +96 -0
- package/src/components/HomepageFeatures/index.tsx +91 -0
- package/src/components/HomepageFeatures/styles.module.css +17 -0
- package/src/components/ProjectCard/index.tsx +74 -0
- package/src/components/ProjectCard/styles.module.css +77 -0
- package/src/components/ProjectList/index.tsx +218 -0
- package/src/components/ProjectList/styles.module.css +180 -0
- package/src/content/projects.json +294 -0
- package/src/css/card.module.css +130 -0
- package/src/css/custom.css +91 -0
- package/src/icons/IconDiscord.tsx +16 -0
- package/src/icons/IconGithub.tsx +16 -0
- package/src/icons/IconWebsite.tsx +16 -0
- package/src/pages/blogs.tsx +58 -0
- package/src/pages/index.module.css +152 -0
- package/src/pages/index.tsx +66 -0
- package/src/pages/projects.tsx +44 -0
- package/src/pages/roadmap.md +150 -0
- package/src/pages/typedoc.tsx +11 -0
- package/src/plugins/blog-plugin/index.ts +86 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/scripts/setupSolidityDocs.ts +67 -0
- package/src/scripts/setupTypedoc.ts +112 -0
- package/src/scripts/utils.ts +115 -0
- package/src/utils/getProjectsByFilter.ts +40 -0
- package/static/.nojekyll +0 -0
- package/static/audit_reports/20210922_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/202220930_Hashcloak_audit_report.pdf +0 -0
- package/static/audit_reports/20240223_PSE_Audit_audit_report.pdf +0 -0
- package/static/audit_reports/20240731_PSE_Audit_audit_report.pdf +0 -0
- package/static/fonts/DM_Sans.woff2 +0 -0
- package/static/fonts/Share_Tech_Mono.woff2 +0 -0
- package/static/img/box.png +0 -0
- package/static/img/box_dark.png +0 -0
- package/static/img/chain.png +0 -0
- package/static/img/chain_dark.png +0 -0
- package/static/img/chart.png +0 -0
- package/static/img/chart_dark.png +0 -0
- package/static/img/circuits/MACI-Circuits.excalidraw +39652 -0
- package/static/img/circuits/calculateTotal.svg +21 -0
- package/static/img/circuits/ecdh.svg +21 -0
- package/static/img/circuits/messageToCommand.svg +21 -0
- package/static/img/circuits/messageValidator.svg +21 -0
- package/static/img/circuits/poseidonHasher13.svg +21 -0
- package/static/img/circuits/privToPubkey.svg +21 -0
- package/static/img/circuits/processMessages.svg +21 -0
- package/static/img/circuits/processMessagesInputHasher.svg +21 -0
- package/static/img/circuits/processMessages_2_0.svg +21 -0
- package/static/img/circuits/processOne.svg +21 -0
- package/static/img/circuits/processTopup.svg +21 -0
- package/static/img/circuits/processingAfterPollEnds.svg +21 -0
- package/static/img/circuits/quinBatchLeavesExists.svg +21 -0
- package/static/img/circuits/quinCheckRoot.svg +21 -0
- package/static/img/circuits/quinGeneratePathIndices.svg +21 -0
- package/static/img/circuits/quinSelector.svg +21 -0
- package/static/img/circuits/resultsCommitmentVerifier.svg +21 -0
- package/static/img/circuits/splicer.svg +21 -0
- package/static/img/circuits/tallyInputHasher.svg +21 -0
- package/static/img/circuits/tallyVotes.svg +21 -0
- package/static/img/circuits/unpackElement.svg +21 -0
- package/static/img/circuits/verifySignature.svg +21 -0
- package/static/img/completingAPoll.svg +4 -0
- package/static/img/contracts.svg +16 -0
- package/static/img/coordinatorComponents.svg +21 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/generateProofs.svg +4 -0
- package/static/img/hero.svg +9 -0
- package/static/img/maci-card.png +0 -0
- package/static/img/maci-rpgf-design.jpg +0 -0
- package/static/img/messageProcessingLocal.svg +21 -0
- package/static/img/offlineProcessing.svg +21 -0
- package/static/img/pse-logo-round.png +0 -0
- package/static/img/relayer-diagram.png +0 -0
- package/static/img/tallyCommitments.svg +4 -0
- package/static/img/voteTallyingLocal.svg +21 -0
- package/tsconfig.json +34 -0
- package/versioned_docs/version-v0.x/circuits.md +22 -0
- package/versioned_docs/version-v0.x/contract.md +186 -0
- package/versioned_docs/version-v0.x/faq.md +67 -0
- package/versioned_docs/version-v0.x/introduction.md +119 -0
- package/versioned_docs/version-v0.x/quadratic-vote-tallying-circuit.md +138 -0
- package/versioned_docs/version-v0.x/state-root-transition-circuit.md +230 -0
- package/versioned_docs/version-v1.2/audit.md +160 -0
- package/versioned_docs/version-v1.2/ci-pipeline.md +38 -0
- package/versioned_docs/version-v1.2/circuits.md +508 -0
- package/versioned_docs/version-v1.2/cli.md +689 -0
- package/versioned_docs/version-v1.2/contracts.md +445 -0
- package/versioned_docs/version-v1.2/contributing/code-of-conduct.md +91 -0
- package/versioned_docs/version-v1.2/contributing/contributing.md +129 -0
- package/versioned_docs/version-v1.2/coordinator-processing.md +46 -0
- package/versioned_docs/version-v1.2/deployment.md +122 -0
- package/versioned_docs/version-v1.2/installation.md +175 -0
- package/versioned_docs/version-v1.2/integrating.md +200 -0
- package/versioned_docs/version-v1.2/introduction.md +94 -0
- package/versioned_docs/version-v1.2/key-change.md +182 -0
- package/versioned_docs/version-v1.2/overview.md +47 -0
- package/versioned_docs/version-v1.2/poll-types.md +68 -0
- package/versioned_docs/version-v1.2/primitives.md +216 -0
- package/versioned_docs/version-v1.2/project-ideas.md +14 -0
- package/versioned_docs/version-v1.2/purpose.md +62 -0
- package/versioned_docs/version-v1.2/solidity-docs/MACI.md +345 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessor.md +266 -0
- package/versioned_docs/version-v1.2/solidity-docs/MessageProcessorFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/Poll.md +381 -0
- package/versioned_docs/version-v1.2/solidity-docs/PollFactory.md +50 -0
- package/versioned_docs/version-v1.2/solidity-docs/SignUpToken.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Subsidy.md +218 -0
- package/versioned_docs/version-v1.2/solidity-docs/SubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/Tally.md +311 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQv.md +296 -0
- package/versioned_docs/version-v1.2/solidity-docs/TallyNonQvFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/TopupCredit.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/VkRegistry.md +457 -0
- package/versioned_docs/version-v1.2/solidity-docs/benchmarks/HasherBenchmarks.md +44 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Hasher.md +125 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/IVerifier.md +11 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/MockVerifier.md +17 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Pairing.md +85 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT3.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT4.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT5.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/PoseidonT6.md +9 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkCommon.md +16 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/SnarkConstants.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/crypto/Verifier.md +61 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/EASGatekeeper.md +121 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/FreeForAllSignUpGatekeeper.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpGatekeeper.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/SignUpTokenGatekeeper.md +93 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperBase.md +79 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperMultiple.md +48 -0
- package/versioned_docs/version-v1.2/solidity-docs/gatekeepers/hatsGatekeepers/HatsGatekeeperSingle.md +42 -0
- package/versioned_docs/version-v1.2/solidity-docs/index.md +4 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/initialVoiceCreditProxy/InitialVoiceCreditProxy.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IEAS.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IHats.md +103 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMPFactory.md +26 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IMessageProcessor.md +31 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPoll.md +217 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IPollFactory.md +29 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallyFactory.md +28 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/ITallySubsidyFactory.md +27 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVerifier.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/interfaces/IVkRegistry.md +70 -0
- package/versioned_docs/version-v1.2/solidity-docs/mocks/MockHatsProtocol.md +133 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueue.md +464 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary.md +60 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueBinaryMaci.md +34 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary.md +75 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinary0.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryBlankSl.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/AccQueueQuinaryMaci.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/trees/EmptyBallotRoots.md +13 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/CommonUtilities.md +25 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/DomainObjs.md +40 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Params.md +36 -0
- package/versioned_docs/version-v1.2/solidity-docs/utilities/Utilities.md +79 -0
- package/versioned_docs/version-v1.2/spec.md +944 -0
- package/versioned_docs/version-v1.2/testing-in-detail.md +209 -0
- package/versioned_docs/version-v1.2/testing.md +472 -0
- package/versioned_docs/version-v1.2/topup.md +43 -0
- package/versioned_docs/version-v1.2/troubleshooting.md +51 -0
- package/versioned_docs/version-v1.2/trusted-setup.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/cli/index.md +15 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/AirdropArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployPollArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/DeployedContracts.md +130 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenLocalStateArgs.md +168 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/GenProofsArgs.md +388 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IGenKeypairArgs.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/IRegisteredUserArgs.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeMessagesArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/MergeSignupsArgs.md +76 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PollContracts.md +53 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/ProveOnChainArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/PublishArgs.md +154 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SignupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/SubsidyData.md +73 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TallyData.md +166 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/TopupArgs.md +89 -0
- package/versioned_docs/version-v1.2/typedoc/cli/interfaces/VerifyArgs.md +128 -0
- package/versioned_docs/version-v1.2/typedoc/cli/modules.md +556 -0
- package/versioned_docs/version-v1.2/typedoc/core/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/MaciState.md +295 -0
- package/versioned_docs/version-v1.2/typedoc/core/classes/Poll.md +1098 -0
- package/versioned_docs/version-v1.2/typedoc/core/index.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/BatchSizes.md +50 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IJsonMaciState.md +77 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/IProcessMessagesCircuitInputs.md +242 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ISubsidyCircuitInputs.md +198 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/ITallyCircuitInputs.md +231 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/MaxValues.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/core/interfaces/TreeDepths.md +63 -0
- package/versioned_docs/version-v1.2/typedoc/core/modules.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/AccQueue.md +770 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G1Point.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/G2Point.md +140 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/classes/IncrementalQuinTree.md +470 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/index.md +44 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Keypair.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/PoseidonFuncs.md +115 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Queue.md +33 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/interfaces/Signature.md +37 -0
- package/versioned_docs/version-v1.2/typedoc/crypto/modules.md +913 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/.nojekyll +1 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Ballot.md +274 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Keypair.md +181 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/Message.md +244 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PCommand.md +409 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PrivKey.md +206 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/PubKey.md +289 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/StateLeaf.md +340 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/TCommand.md +200 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/classes/VerifyingKey.md +240 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/index.md +81 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/ICommand.md +104 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG1ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IG2ContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonBallot.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonCommand.md +32 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonKeyPair.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonPCommand.md +111 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonStateLeaf.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IJsonTCommand.md +67 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IMessageContractParams.md +31 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeaf.md +39 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IStateLeafContractParams.md +42 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkContractParams.md +64 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/IVkObjectParams.md +108 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/Proof.md +46 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/interfaces/VoteOptionTreeLeaf.md +24 -0
- package/versioned_docs/version-v1.2/typedoc/domainobjs/modules.md +110 -0
- package/versioned_docs/version-v1.2/typedoc/index.md +4 -0
- package/versioned_docs/version-v1.2/versioning.md +94 -0
- package/versioned_docs/version-v1.2/workflow.md +142 -0
- package/versioned_docs/version-v2.x/case-studies.md +35 -0
- package/versioned_docs/version-v2.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v2.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v2.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v2.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v2.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v2.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v2.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v2.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v2.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v2.x/core-concepts/merkle-trees.md +23 -0
- package/versioned_docs/version-v2.x/core-concepts/poll-types.md +106 -0
- package/versioned_docs/version-v2.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v2.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v2.x/core-concepts/workflow.md +142 -0
- package/versioned_docs/version-v2.x/getting-started.md +313 -0
- package/versioned_docs/version-v2.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/compile-circuits.md +163 -0
- package/versioned_docs/version-v2.x/guides/frontend.md +99 -0
- package/versioned_docs/version-v2.x/guides/integrating.md +73 -0
- package/versioned_docs/version-v2.x/guides/maciWrapper.md +173 -0
- package/versioned_docs/version-v2.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v2.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v2.x/guides/testing/testing-in-detail.md +203 -0
- package/versioned_docs/version-v2.x/guides/testing/testing.md +163 -0
- package/versioned_docs/version-v2.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v2.x/introduction.md +146 -0
- package/versioned_docs/version-v2.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v2.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v2.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v2.x/resources.md +33 -0
- package/versioned_docs/version-v2.x/security/_category_.json +4 -0
- package/versioned_docs/version-v2.x/security/audit.md +167 -0
- package/versioned_docs/version-v2.x/security/trusted-setup.md +166 -0
- package/versioned_docs/version-v2.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v2.x/supported-networks/deployed-contracts.md +1108 -0
- package/versioned_docs/version-v2.x/supported-networks/supported-networks.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/AccQueue.md +21 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Gatekeepers.md +40 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MACI.md +152 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Params.md +32 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Poll.md +104 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/PollFactory.md +43 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/Tally.md +45 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VkRegistry.md +57 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v2.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v2.x/technical-references/technical-references.md +47 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/typescript-code/cli.md +699 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/processMessages.md +107 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/setup.md +101 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v2.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +37 -0
- package/versioned_docs/version-v2.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v2.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v2.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v2.x/use-cases/public-goods.md +65 -0
- package/versioned_docs/version-v3.x/case-studies.md +35 -0
- package/versioned_docs/version-v3.x/contributing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/contributing/code-of-conduct.md +92 -0
- package/versioned_docs/version-v3.x/contributing/contributing.md +149 -0
- package/versioned_docs/version-v3.x/contributing/project-ideas.md +78 -0
- package/versioned_docs/version-v3.x/core-concepts/_category_.json +4 -0
- package/versioned_docs/version-v3.x/core-concepts/ballot.md +19 -0
- package/versioned_docs/version-v3.x/core-concepts/coordinator-processing.md +46 -0
- package/versioned_docs/version-v3.x/core-concepts/coordinator-service.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/hashing-and-encryption.md +45 -0
- package/versioned_docs/version-v3.x/core-concepts/key-change.md +179 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-keys.md +84 -0
- package/versioned_docs/version-v3.x/core-concepts/maci-messages.md +44 -0
- package/versioned_docs/version-v3.x/core-concepts/merkle-trees.md +16 -0
- package/versioned_docs/version-v3.x/core-concepts/offchain-voting.md +14 -0
- package/versioned_docs/version-v3.x/core-concepts/poll-types.md +58 -0
- package/versioned_docs/version-v3.x/core-concepts/polls.md +81 -0
- package/versioned_docs/version-v3.x/core-concepts/spec.md +883 -0
- package/versioned_docs/version-v3.x/core-concepts/state-leaf.md +42 -0
- package/versioned_docs/version-v3.x/core-concepts/workflow.md +149 -0
- package/versioned_docs/version-v3.x/guides/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/compile-circuits.md +175 -0
- package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
- package/versioned_docs/version-v3.x/guides/subgraph.md +79 -0
- package/versioned_docs/version-v3.x/guides/testing/_category_.json +4 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-in-detail.md +191 -0
- package/versioned_docs/version-v3.x/guides/testing/testing-introduction.md +158 -0
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +161 -0
- package/versioned_docs/version-v3.x/introduction.md +153 -0
- package/versioned_docs/version-v3.x/processes/_category_.json +4 -0
- package/versioned_docs/version-v3.x/processes/ci-pipeline.md +38 -0
- package/versioned_docs/version-v3.x/processes/versioning.md +94 -0
- package/versioned_docs/version-v3.x/quick-start.md +318 -0
- package/versioned_docs/version-v3.x/resources.md +33 -0
- package/versioned_docs/version-v3.x/security/_category_.json +4 -0
- package/versioned_docs/version-v3.x/security/audit.md +167 -0
- package/versioned_docs/version-v3.x/security/trusted-setup.md +172 -0
- package/versioned_docs/version-v3.x/supported-networks/_category_.json +4 -0
- package/versioned_docs/version-v3.x/supported-networks/deployed-contracts.md +112 -0
- package/versioned_docs/version-v3.x/supported-networks/supported-networks.md +53 -0
- package/versioned_docs/version-v3.x/technical-references/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/index.md +10 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/index.md +51 -0
- package/versioned_docs/version-v3.x/technical-references/offchain-relayer/installation.md +109 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MACI.md +160 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/MessageProcessor.md +13 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Params.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Policies.md +39 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Poll.md +170 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/PollFactory.md +33 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/Tally.md +43 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VkRegistry.md +62 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/VoiceCreditProxy.md +18 -0
- package/versioned_docs/version-v3.x/technical-references/smart-contracts/_category_.json +8 -0
- package/versioned_docs/version-v3.x/technical-references/technical-references.md +48 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/_category_.json +4 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/joinPoll.md +53 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +106 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/setup.md +96 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/tallyVotes.md +79 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/utilities.md +131 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/zk-snark-circuits.md +42 -0
- package/versioned_docs/version-v3.x/use-cases/_category_.json +4 -0
- package/versioned_docs/version-v3.x/use-cases/governance.md +18 -0
- package/versioned_docs/version-v3.x/use-cases/polling.md +10 -0
- package/versioned_docs/version-v3.x/use-cases/public-goods.md +65 -0
- package/versioned_sidebars/version-v0.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v1.2-sidebars.json +8 -0
- package/versioned_sidebars/version-v2.x-sidebars.json +8 -0
- package/versioned_sidebars/version-v3.x-sidebars.json +8 -0
- package/versions.json +1 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# MACI
|
|
2
|
+
|
|
3
|
+
A contract which allows users to sign up, and deploy new polls
|
|
4
|
+
|
|
5
|
+
### stateTreeDepth
|
|
6
|
+
|
|
7
|
+
```solidity
|
|
8
|
+
uint8 stateTreeDepth
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The state tree depth is fixed. As such it should be as large as feasible
|
|
12
|
+
so that there can be as many users as possible. i.e. 5 \*\* 10 = 9765625
|
|
13
|
+
this should also match the parameter of the circom circuits.
|
|
14
|
+
|
|
15
|
+
### STATE_TREE_SUBDEPTH
|
|
16
|
+
|
|
17
|
+
```solidity
|
|
18
|
+
uint8 STATE_TREE_SUBDEPTH
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
IMPORTANT: remember to change the ballot tree depth
|
|
22
|
+
in contracts/ts/genEmptyBallotRootsContract.ts file
|
|
23
|
+
if we change the state tree depth!
|
|
24
|
+
|
|
25
|
+
### TREE_ARITY
|
|
26
|
+
|
|
27
|
+
```solidity
|
|
28
|
+
uint8 TREE_ARITY
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### BLANK_STATE_LEAF_HASH
|
|
32
|
+
|
|
33
|
+
```solidity
|
|
34
|
+
uint256 BLANK_STATE_LEAF_HASH
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The hash of a blank state leaf
|
|
38
|
+
|
|
39
|
+
### nextPollId
|
|
40
|
+
|
|
41
|
+
```solidity
|
|
42
|
+
uint256 nextPollId
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Each poll has an incrementing ID
|
|
46
|
+
|
|
47
|
+
### polls
|
|
48
|
+
|
|
49
|
+
```solidity
|
|
50
|
+
mapping(uint256 => address) polls
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
A mapping of poll IDs to Poll contracts.
|
|
54
|
+
|
|
55
|
+
### subtreesMerged
|
|
56
|
+
|
|
57
|
+
```solidity
|
|
58
|
+
bool subtreesMerged
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Whether the subtrees have been merged (can merge root before new signup)
|
|
62
|
+
|
|
63
|
+
### numSignUps
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
uint256 numSignUps
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The number of signups
|
|
70
|
+
|
|
71
|
+
### topupCredit
|
|
72
|
+
|
|
73
|
+
```solidity
|
|
74
|
+
contract TopupCredit topupCredit
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
ERC20 contract that hold topup credits
|
|
78
|
+
|
|
79
|
+
### pollFactory
|
|
80
|
+
|
|
81
|
+
```solidity
|
|
82
|
+
contract IPollFactory pollFactory
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Factory contract that deploy a Poll contract
|
|
86
|
+
|
|
87
|
+
### messageProcessorFactory
|
|
88
|
+
|
|
89
|
+
```solidity
|
|
90
|
+
contract IMessageProcessorFactory messageProcessorFactory
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Factory contract that deploy a MessageProcessor contract
|
|
94
|
+
|
|
95
|
+
### tallyFactory
|
|
96
|
+
|
|
97
|
+
```solidity
|
|
98
|
+
contract ITallySubsidyFactory tallyFactory
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Factory contract that deploy a Tally contract
|
|
102
|
+
|
|
103
|
+
### subsidyFactory
|
|
104
|
+
|
|
105
|
+
```solidity
|
|
106
|
+
contract ITallySubsidyFactory subsidyFactory
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Factory contract that deploy a Subsidy contract
|
|
110
|
+
|
|
111
|
+
### stateAq
|
|
112
|
+
|
|
113
|
+
```solidity
|
|
114
|
+
contract AccQueue stateAq
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The state AccQueue. Represents a mapping between each user's public key
|
|
118
|
+
and their voice credit balance.
|
|
119
|
+
|
|
120
|
+
### signUpGatekeeper
|
|
121
|
+
|
|
122
|
+
```solidity
|
|
123
|
+
contract SignUpGatekeeper signUpGatekeeper
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Address of the SignUpGatekeeper, a contract which determines whether a
|
|
127
|
+
user may sign up to vote
|
|
128
|
+
|
|
129
|
+
### initialVoiceCreditProxy
|
|
130
|
+
|
|
131
|
+
```solidity
|
|
132
|
+
contract InitialVoiceCreditProxy initialVoiceCreditProxy
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The contract which provides the values of the initial voice credit
|
|
136
|
+
balance per user
|
|
137
|
+
|
|
138
|
+
### PollContracts
|
|
139
|
+
|
|
140
|
+
```solidity
|
|
141
|
+
struct PollContracts {
|
|
142
|
+
address poll;
|
|
143
|
+
address messageProcessor;
|
|
144
|
+
address tally;
|
|
145
|
+
address subsidy;
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### SignUp
|
|
150
|
+
|
|
151
|
+
```solidity
|
|
152
|
+
event SignUp(uint256 _stateIndex, uint256 _userPubKeyX, uint256 _userPubKeyY, uint256 _voiceCreditBalance, uint256 _timestamp)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### DeployPoll
|
|
156
|
+
|
|
157
|
+
```solidity
|
|
158
|
+
event DeployPoll(uint256 _pollId, uint256 _coordinatorPubKeyX, uint256 _coordinatorPubKeyY, struct MACI.PollContracts pollAddr)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### onlyPoll
|
|
162
|
+
|
|
163
|
+
```solidity
|
|
164
|
+
modifier onlyPoll(uint256 _pollId)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Only allow a Poll contract to call the modified function.
|
|
168
|
+
|
|
169
|
+
### CallerMustBePoll
|
|
170
|
+
|
|
171
|
+
```solidity
|
|
172
|
+
error CallerMustBePoll(address _caller)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
custom errors
|
|
176
|
+
|
|
177
|
+
### PoseidonHashLibrariesNotLinked
|
|
178
|
+
|
|
179
|
+
```solidity
|
|
180
|
+
error PoseidonHashLibrariesNotLinked()
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### TooManySignups
|
|
184
|
+
|
|
185
|
+
```solidity
|
|
186
|
+
error TooManySignups()
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### MaciPubKeyLargerThanSnarkFieldSize
|
|
190
|
+
|
|
191
|
+
```solidity
|
|
192
|
+
error MaciPubKeyLargerThanSnarkFieldSize()
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### PreviousPollNotCompleted
|
|
196
|
+
|
|
197
|
+
```solidity
|
|
198
|
+
error PreviousPollNotCompleted(uint256 pollId)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### PollDoesNotExist
|
|
202
|
+
|
|
203
|
+
```solidity
|
|
204
|
+
error PollDoesNotExist(uint256 pollId)
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### SignupTemporaryBlocked
|
|
208
|
+
|
|
209
|
+
```solidity
|
|
210
|
+
error SignupTemporaryBlocked()
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### constructor
|
|
214
|
+
|
|
215
|
+
```solidity
|
|
216
|
+
constructor(contract IPollFactory _pollFactory, contract IMessageProcessorFactory _messageProcessorFactory, contract ITallySubsidyFactory _tallyFactory, contract ITallySubsidyFactory _subsidyFactory, contract SignUpGatekeeper _signUpGatekeeper, contract InitialVoiceCreditProxy _initialVoiceCreditProxy, contract TopupCredit _topupCredit, uint8 _stateTreeDepth) public payable
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Create a new instance of the MACI contract.
|
|
220
|
+
|
|
221
|
+
#### Parameters
|
|
222
|
+
|
|
223
|
+
| Name | Type | Description |
|
|
224
|
+
| ------------------------- | --------------------------------- | ------------------------------------ |
|
|
225
|
+
| \_pollFactory | contract IPollFactory | The PollFactory contract |
|
|
226
|
+
| \_messageProcessorFactory | contract IMessageProcessorFactory | The MessageProcessorFactory contract |
|
|
227
|
+
| \_tallyFactory | contract ITallySubsidyFactory | The TallyFactory contract |
|
|
228
|
+
| \_subsidyFactory | contract ITallySubsidyFactory | The SubsidyFactory contract |
|
|
229
|
+
| \_signUpGatekeeper | contract SignUpGatekeeper | The SignUpGatekeeper contract |
|
|
230
|
+
| \_initialVoiceCreditProxy | contract InitialVoiceCreditProxy | The InitialVoiceCreditProxy contract |
|
|
231
|
+
| \_topupCredit | contract TopupCredit | The TopupCredit contract |
|
|
232
|
+
| \_stateTreeDepth | uint8 | The depth of the state tree |
|
|
233
|
+
|
|
234
|
+
### signUp
|
|
235
|
+
|
|
236
|
+
```solidity
|
|
237
|
+
function signUp(struct DomainObjs.PubKey _pubKey, bytes _signUpGatekeeperData, bytes _initialVoiceCreditProxyData) public virtual
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Allows any eligible user sign up. The sign-up gatekeeper should prevent
|
|
241
|
+
double sign-ups or ineligible users from doing so. This function will
|
|
242
|
+
only succeed if the sign-up deadline has not passed. It also enqueues a
|
|
243
|
+
fresh state leaf into the state AccQueue.
|
|
244
|
+
|
|
245
|
+
#### Parameters
|
|
246
|
+
|
|
247
|
+
| Name | Type | Description |
|
|
248
|
+
| ----------------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
249
|
+
| \_pubKey | struct DomainObjs.PubKey | The user's desired public key. |
|
|
250
|
+
| \_signUpGatekeeperData | bytes | Data to pass to the sign-up gatekeeper's register() function. For instance, the POAPGatekeeper or SignUpTokenGatekeeper requires this value to be the ABI-encoded token ID. |
|
|
251
|
+
| \_initialVoiceCreditProxyData | bytes | Data to pass to the InitialVoiceCreditProxy, which allows it to determine how many voice credits this user should have. |
|
|
252
|
+
|
|
253
|
+
### deployPoll
|
|
254
|
+
|
|
255
|
+
```solidity
|
|
256
|
+
function deployPoll(uint256 _duration, struct Params.TreeDepths _treeDepths, struct DomainObjs.PubKey _coordinatorPubKey, address _verifier, address _vkRegistry, bool useSubsidy) public virtual returns (struct MACI.PollContracts pollAddr)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Deploy a new Poll contract.
|
|
260
|
+
|
|
261
|
+
#### Parameters
|
|
262
|
+
|
|
263
|
+
| Name | Type | Description |
|
|
264
|
+
| ------------------- | ------------------------ | ----------------------------------------------- |
|
|
265
|
+
| \_duration | uint256 | How long should the Poll last for |
|
|
266
|
+
| \_treeDepths | struct Params.TreeDepths | The depth of the Merkle trees |
|
|
267
|
+
| \_coordinatorPubKey | struct DomainObjs.PubKey | The coordinator's public key |
|
|
268
|
+
| \_verifier | address | The Verifier Contract |
|
|
269
|
+
| \_vkRegistry | address | The VkRegistry Contract |
|
|
270
|
+
| useSubsidy | bool | If true, the Poll will use the Subsidy contract |
|
|
271
|
+
|
|
272
|
+
#### Return Values
|
|
273
|
+
|
|
274
|
+
| Name | Type | Description |
|
|
275
|
+
| -------- | ------------------------- | --------------------------- |
|
|
276
|
+
| pollAddr | struct MACI.PollContracts | a new Poll contract address |
|
|
277
|
+
|
|
278
|
+
### mergeStateAqSubRoots
|
|
279
|
+
|
|
280
|
+
```solidity
|
|
281
|
+
function mergeStateAqSubRoots(uint256 _numSrQueueOps, uint256 _pollId) public
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Allow Poll contracts to merge the state subroots
|
|
285
|
+
|
|
286
|
+
#### Parameters
|
|
287
|
+
|
|
288
|
+
| Name | Type | Description |
|
|
289
|
+
| --------------- | ------- | ------------------------- |
|
|
290
|
+
| \_numSrQueueOps | uint256 | Number of operations |
|
|
291
|
+
| \_pollId | uint256 | The ID of the active Poll |
|
|
292
|
+
|
|
293
|
+
### mergeStateAq
|
|
294
|
+
|
|
295
|
+
```solidity
|
|
296
|
+
function mergeStateAq(uint256 _pollId) public returns (uint256 root)
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Allow Poll contracts to merge the state root
|
|
300
|
+
|
|
301
|
+
#### Parameters
|
|
302
|
+
|
|
303
|
+
| Name | Type | Description |
|
|
304
|
+
| -------- | ------- | ------------------ |
|
|
305
|
+
| \_pollId | uint256 | The active Poll ID |
|
|
306
|
+
|
|
307
|
+
#### Return Values
|
|
308
|
+
|
|
309
|
+
| Name | Type | Description |
|
|
310
|
+
| ---- | ------- | -------------------------- |
|
|
311
|
+
| root | uint256 | The calculated Merkle root |
|
|
312
|
+
|
|
313
|
+
### getStateAqRoot
|
|
314
|
+
|
|
315
|
+
```solidity
|
|
316
|
+
function getStateAqRoot() public view returns (uint256 root)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Return the main root of the StateAq contract
|
|
320
|
+
|
|
321
|
+
#### Return Values
|
|
322
|
+
|
|
323
|
+
| Name | Type | Description |
|
|
324
|
+
| ---- | ------- | --------------- |
|
|
325
|
+
| root | uint256 | The Merkle root |
|
|
326
|
+
|
|
327
|
+
### getPoll
|
|
328
|
+
|
|
329
|
+
```solidity
|
|
330
|
+
function getPoll(uint256 _pollId) public view returns (address poll)
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Get the Poll details
|
|
334
|
+
|
|
335
|
+
#### Parameters
|
|
336
|
+
|
|
337
|
+
| Name | Type | Description |
|
|
338
|
+
| -------- | ------- | -------------------------------------- |
|
|
339
|
+
| \_pollId | uint256 | The identifier of the Poll to retrieve |
|
|
340
|
+
|
|
341
|
+
#### Return Values
|
|
342
|
+
|
|
343
|
+
| Name | Type | Description |
|
|
344
|
+
| ---- | ------- | ------------------------ |
|
|
345
|
+
| poll | address | The Poll contract object |
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# MessageProcessor
|
|
2
|
+
|
|
3
|
+
_MessageProcessor is used to process messages published by signup users.
|
|
4
|
+
It will process message by batch due to large size of messages.
|
|
5
|
+
After it finishes processing, the sbCommitment will be used for Tally and Subsidy contracts._
|
|
6
|
+
|
|
7
|
+
### NoMoreMessages
|
|
8
|
+
|
|
9
|
+
```solidity
|
|
10
|
+
error NoMoreMessages()
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
custom errors
|
|
14
|
+
|
|
15
|
+
### StateAqNotMerged
|
|
16
|
+
|
|
17
|
+
```solidity
|
|
18
|
+
error StateAqNotMerged()
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### MessageAqNotMerged
|
|
22
|
+
|
|
23
|
+
```solidity
|
|
24
|
+
error MessageAqNotMerged()
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### InvalidProcessMessageProof
|
|
28
|
+
|
|
29
|
+
```solidity
|
|
30
|
+
error InvalidProcessMessageProof()
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### VkNotSet
|
|
34
|
+
|
|
35
|
+
```solidity
|
|
36
|
+
error VkNotSet()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### MaxVoteOptionsTooLarge
|
|
40
|
+
|
|
41
|
+
```solidity
|
|
42
|
+
error MaxVoteOptionsTooLarge()
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### NumSignUpsTooLarge
|
|
46
|
+
|
|
47
|
+
```solidity
|
|
48
|
+
error NumSignUpsTooLarge()
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### CurrentMessageBatchIndexTooLarge
|
|
52
|
+
|
|
53
|
+
```solidity
|
|
54
|
+
error CurrentMessageBatchIndexTooLarge()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### BatchEndIndexTooLarge
|
|
58
|
+
|
|
59
|
+
```solidity
|
|
60
|
+
error BatchEndIndexTooLarge()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### TREE_ARITY
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
uint256 TREE_ARITY
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### processingComplete
|
|
70
|
+
|
|
71
|
+
```solidity
|
|
72
|
+
bool processingComplete
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Get the result of whether there are unprocessed messages left
|
|
76
|
+
|
|
77
|
+
#### Return Values
|
|
78
|
+
|
|
79
|
+
| Name | Type | Description |
|
|
80
|
+
| ---- | ---- | ----------- |
|
|
81
|
+
|
|
82
|
+
### numBatchesProcessed
|
|
83
|
+
|
|
84
|
+
```solidity
|
|
85
|
+
uint256 numBatchesProcessed
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The number of batches processed
|
|
89
|
+
|
|
90
|
+
### currentMessageBatchIndex
|
|
91
|
+
|
|
92
|
+
```solidity
|
|
93
|
+
uint256 currentMessageBatchIndex
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The current message batch index. When the coordinator runs
|
|
97
|
+
processMessages(), this action relates to messages
|
|
98
|
+
currentMessageBatchIndex to currentMessageBatchIndex + messageBatchSize.
|
|
99
|
+
|
|
100
|
+
### sbCommitment
|
|
101
|
+
|
|
102
|
+
```solidity
|
|
103
|
+
uint256 sbCommitment
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Get the commitment to the state and ballot roots
|
|
107
|
+
|
|
108
|
+
#### Return Values
|
|
109
|
+
|
|
110
|
+
| Name | Type | Description |
|
|
111
|
+
| ---- | ---- | ----------- |
|
|
112
|
+
|
|
113
|
+
### poll
|
|
114
|
+
|
|
115
|
+
```solidity
|
|
116
|
+
contract IPoll poll
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### verifier
|
|
120
|
+
|
|
121
|
+
```solidity
|
|
122
|
+
contract IVerifier verifier
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### vkRegistry
|
|
126
|
+
|
|
127
|
+
```solidity
|
|
128
|
+
contract IVkRegistry vkRegistry
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### constructor
|
|
132
|
+
|
|
133
|
+
```solidity
|
|
134
|
+
constructor(address _verifier, address _vkRegistry, address _poll) public payable
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Create a new instance
|
|
138
|
+
|
|
139
|
+
#### Parameters
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description |
|
|
142
|
+
| ------------ | ------- | ------------------------------- |
|
|
143
|
+
| \_verifier | address | The Verifier contract address |
|
|
144
|
+
| \_vkRegistry | address | The VkRegistry contract address |
|
|
145
|
+
| \_poll | address | The Poll contract address |
|
|
146
|
+
|
|
147
|
+
### processMessages
|
|
148
|
+
|
|
149
|
+
```solidity
|
|
150
|
+
function processMessages(uint256 _newSbCommitment, uint256[8] _proof) external
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Update the Poll's currentSbCommitment if the proof is valid.
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
| Name | Type | Description |
|
|
158
|
+
| ----------------- | ---------- | ------------------------------------------------------------------------------ |
|
|
159
|
+
| \_newSbCommitment | uint256 | The new state root and ballot root commitment after all messages are processed |
|
|
160
|
+
| \_proof | uint256[8] | The zk-SNARK proof |
|
|
161
|
+
|
|
162
|
+
### verifyProcessProof
|
|
163
|
+
|
|
164
|
+
```solidity
|
|
165
|
+
function verifyProcessProof(uint256 _currentMessageBatchIndex, uint256 _messageRoot, uint256 _currentSbCommitment, uint256 _newSbCommitment, uint8 _messageTreeSubDepth, uint8 _messageTreeDepth, uint8 _voteOptionTreeDepth, uint256[8] _proof) internal view returns (bool isValid)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Verify the proof for processMessage
|
|
169
|
+
|
|
170
|
+
_used to update the sbCommitment_
|
|
171
|
+
|
|
172
|
+
#### Parameters
|
|
173
|
+
|
|
174
|
+
| Name | Type | Description |
|
|
175
|
+
| -------------------------- | ---------- | ------------------------------------------------------- |
|
|
176
|
+
| \_currentMessageBatchIndex | uint256 | The batch index of current message batch |
|
|
177
|
+
| \_messageRoot | uint256 | The message tree root |
|
|
178
|
+
| \_currentSbCommitment | uint256 | The current sbCommitment (state and ballot) |
|
|
179
|
+
| \_newSbCommitment | uint256 | The new sbCommitment after we update this message batch |
|
|
180
|
+
| \_messageTreeSubDepth | uint8 | The message tree subdepth |
|
|
181
|
+
| \_messageTreeDepth | uint8 | The message tree depth |
|
|
182
|
+
| \_voteOptionTreeDepth | uint8 | The vote option tree depth |
|
|
183
|
+
| \_proof | uint256[8] | The zk-SNARK proof |
|
|
184
|
+
|
|
185
|
+
#### Return Values
|
|
186
|
+
|
|
187
|
+
| Name | Type | Description |
|
|
188
|
+
| ------- | ---- | -------------------------- |
|
|
189
|
+
| isValid | bool | Whether the proof is valid |
|
|
190
|
+
|
|
191
|
+
### genProcessMessagesPublicInputHash
|
|
192
|
+
|
|
193
|
+
```solidity
|
|
194
|
+
function genProcessMessagesPublicInputHash(uint256 _currentMessageBatchIndex, uint256 _messageRoot, uint256 _numSignUps, uint256 _numMessages, uint256 _currentSbCommitment, uint256 _newSbCommitment, uint8 _messageTreeSubDepth, uint8 _voteOptionTreeDepth) public view returns (uint256 inputHash)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Returns the SHA256 hash of the packed values (see
|
|
198
|
+
genProcessMessagesPackedVals), the hash of the coordinator's public key,
|
|
199
|
+
the message root, and the commitment to the current state root and
|
|
200
|
+
ballot root. By passing the SHA256 hash of these values to the circuit
|
|
201
|
+
as a single public input and the preimage as private inputs, we reduce
|
|
202
|
+
its verification gas cost though the number of constraints will be
|
|
203
|
+
higher and proving time will be longer.
|
|
204
|
+
|
|
205
|
+
#### Parameters
|
|
206
|
+
|
|
207
|
+
| Name | Type | Description |
|
|
208
|
+
| -------------------------- | ------- | ------------------------------------------------------- |
|
|
209
|
+
| \_currentMessageBatchIndex | uint256 | The batch index of current message batch |
|
|
210
|
+
| \_messageRoot | uint256 | |
|
|
211
|
+
| \_numSignUps | uint256 | The number of users that signup |
|
|
212
|
+
| \_numMessages | uint256 | The number of messages |
|
|
213
|
+
| \_currentSbCommitment | uint256 | The current sbCommitment (state and ballot root) |
|
|
214
|
+
| \_newSbCommitment | uint256 | The new sbCommitment after we update this message batch |
|
|
215
|
+
| \_messageTreeSubDepth | uint8 | The message tree subdepth |
|
|
216
|
+
| \_voteOptionTreeDepth | uint8 | |
|
|
217
|
+
|
|
218
|
+
#### Return Values
|
|
219
|
+
|
|
220
|
+
| Name | Type | Description |
|
|
221
|
+
| --------- | ------- | -------------------------------------------- |
|
|
222
|
+
| inputHash | uint256 | Returns the SHA256 hash of the packed values |
|
|
223
|
+
|
|
224
|
+
### genProcessMessagesPackedVals
|
|
225
|
+
|
|
226
|
+
```solidity
|
|
227
|
+
function genProcessMessagesPackedVals(uint256 _currentMessageBatchIndex, uint256 _numSignUps, uint256 _numMessages, uint8 _messageTreeSubDepth, uint8 _voteOptionTreeDepth) public pure returns (uint256 result)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
One of the inputs to the ProcessMessages circuit is a 250-bit
|
|
231
|
+
representation of four 50-bit values. This function generates this
|
|
232
|
+
250-bit value, which consists of the maximum number of vote options, the
|
|
233
|
+
number of signups, the current message batch index, and the end index of
|
|
234
|
+
the current batch.
|
|
235
|
+
|
|
236
|
+
#### Parameters
|
|
237
|
+
|
|
238
|
+
| Name | Type | Description |
|
|
239
|
+
| -------------------------- | ------- | ------------------------------------ |
|
|
240
|
+
| \_currentMessageBatchIndex | uint256 | batch index of current message batch |
|
|
241
|
+
| \_numSignUps | uint256 | number of users that signup |
|
|
242
|
+
| \_numMessages | uint256 | number of messages |
|
|
243
|
+
| \_messageTreeSubDepth | uint8 | message tree subdepth |
|
|
244
|
+
| \_voteOptionTreeDepth | uint8 | vote option tree depth |
|
|
245
|
+
|
|
246
|
+
#### Return Values
|
|
247
|
+
|
|
248
|
+
| Name | Type | Description |
|
|
249
|
+
| ------ | ------- | ---------------- |
|
|
250
|
+
| result | uint256 | The packed value |
|
|
251
|
+
|
|
252
|
+
### updateMessageProcessingData
|
|
253
|
+
|
|
254
|
+
```solidity
|
|
255
|
+
function updateMessageProcessingData(uint256 _newSbCommitment, uint256 _currentMessageBatchIndex, bool _processingComplete) internal
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
update message processing state variables
|
|
259
|
+
|
|
260
|
+
#### Parameters
|
|
261
|
+
|
|
262
|
+
| Name | Type | Description |
|
|
263
|
+
| -------------------------- | ------- | ------------------------------------------------------- |
|
|
264
|
+
| \_newSbCommitment | uint256 | sbCommitment to be updated |
|
|
265
|
+
| \_currentMessageBatchIndex | uint256 | currentMessageBatchIndex to be updated |
|
|
266
|
+
| \_processingComplete | bool | update flag that indicate processing is finished or not |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# MessageProcessorFactory
|
|
2
|
+
|
|
3
|
+
A factory contract which deploys MessageProcessor contracts.
|
|
4
|
+
|
|
5
|
+
### deploy
|
|
6
|
+
|
|
7
|
+
```solidity
|
|
8
|
+
function deploy(address _verifier, address _vkRegistry, address _poll, address _owner) public returns (address messageProcessorAddr)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Deploy a new MessageProcessor contract and return the address.
|
|
12
|
+
|
|
13
|
+
#### Parameters
|
|
14
|
+
|
|
15
|
+
| Name | Type | Description |
|
|
16
|
+
| ------------ | ------- | -------------------------------------- |
|
|
17
|
+
| \_verifier | address | Verifier contract |
|
|
18
|
+
| \_vkRegistry | address | VkRegistry contract |
|
|
19
|
+
| \_poll | address | Poll contract |
|
|
20
|
+
| \_owner | address | Owner of the MessageProcessor contract |
|
|
21
|
+
|
|
22
|
+
#### Return Values
|
|
23
|
+
|
|
24
|
+
| Name | Type | Description |
|
|
25
|
+
| -------------------- | ------- | -------------------------------------- |
|
|
26
|
+
| messageProcessorAddr | address | The deployed MessageProcessor contract |
|