@maci-protocol/website 0.0.0-ci.00107eb
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 +21 -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/2025-08-18-maci-aragon-plugin.md +107 -0
- package/blog/2025-09-05-maci-coordinator-service.md +167 -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 +219 -0
- package/package.json +66 -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 +109 -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 +115 -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 +155 -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 +82 -0
- package/versioned_docs/version-v3.x/core-concepts/polls.md +105 -0
- package/versioned_docs/version-v3.x/core-concepts/spec.md +817 -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 +191 -0
- package/versioned_docs/version-v3.x/guides/integrating.md +137 -0
- package/versioned_docs/version-v3.x/guides/sdk.md +121 -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 +190 -0
- package/versioned_docs/version-v3.x/guides/troubleshooting.md +206 -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 +326 -0
- package/versioned_docs/version-v3.x/resources.md +34 -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/costs.md +725 -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 +69 -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 +24 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/installation.md +15 -0
- package/versioned_docs/version-v3.x/technical-references/coordinator-service/usage.md +64 -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 +52 -0
- package/versioned_docs/version-v3.x/technical-references/zk-snark-circuits/processMessages.md +170 -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,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Deployed MACI Smart Contracts
|
|
3
|
+
description: Deployed MACI Smart Contracts
|
|
4
|
+
sidebar_label: Deployed MACI Smart Contracts
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
There are a number of MACI's smart contracts which can be re-used by different deployments. These are the following:
|
|
9
|
+
|
|
10
|
+
- [VerifyingKeysRegistry](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/VerifyingKeysRegistry.sol)
|
|
11
|
+
- [PoseidonHashers](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/crypto/Hasher.sol)
|
|
12
|
+
- [PollFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/PollFactory.sol)
|
|
13
|
+
- [MessageProcessorFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/MessageProcessorFactory.sol)
|
|
14
|
+
- [TallyFactory](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/TallyFactory.sol)
|
|
15
|
+
- [Verifier](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/crypto/Verifier.sol)
|
|
16
|
+
- [FreeForAllPolicy](https://github.com/privacy-scaling-explorations/excubiae/tree/main/packages/contracts/contracts/extensions/freeForAll)
|
|
17
|
+
- [ConstantInitialVoiceCreditProxy](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/initialVoiceCreditProxy/ConstantInitialVoiceCreditProxy.sol) - if you are happy to work with a fixed amount of credits
|
|
18
|
+
|
|
19
|
+
VkRegistries can be re-used by different protocols to share the same set of verifying keys. Please be advised that you should be verifying that those verifying keys are the ones that have undergone a trusted setup ceremony.
|
|
20
|
+
|
|
21
|
+
In order to verify you will need the following:
|
|
22
|
+
|
|
23
|
+
- configure the cli (`cd cli && cp .env.example .env` and set the correct env vars)
|
|
24
|
+
- download the keys (`pnpm download-zkeys:ceremony` from the monorepo root)
|
|
25
|
+
- run checkVerifyingKeys with the cli (see below)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd cli && node build/ts/index.js checkVerifyingKeys -q false -vk 0x74569d524a193daC0D3Df17B9E207C916174745b -s 6 -i 2 -m 9 -v 3 -b 2 -p ./zkeys/MessageProcessorQv_6-9-2-3/MessageProcessorQv_6-9-2-3.zkey -t ./zkeys/VoteTallyQv_6-2-3/tallyVotes_6-2-3.zkey
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
:::info
|
|
32
|
+
You should change the -vk parameter to the VerifyingKeysRegistry address for the chain you are deploying to. Also you might need to modify the parameters based on the circuit configuration. Please refer to the [circuits page](/docs/technical-references/zk-snark-circuits/setup) for more information. Also you can add `-uq false` if you want to check non quadratic voting keys.
|
|
33
|
+
:::
|
|
34
|
+
|
|
35
|
+
## Contract Addresses
|
|
36
|
+
|
|
37
|
+
### Arbitrum Sepolia
|
|
38
|
+
|
|
39
|
+
| Contract | Address |
|
|
40
|
+
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| ConstantInitialVoiceCreditProxy (99 Credits) | [0x41a29A58A63A998c9Edde6883Bcec2d89835a8e9](https://sepolia.arbiscan.io/address/0x41a29A58A63A998c9Edde6883Bcec2d89835a8e9) |
|
|
42
|
+
| Verifier | [0xB400794f463d90ce5f462A43d8E6f9155656d02d](https://sepolia.arbiscan.io/address/0xB400794f463d90ce5f462A43d8E6f9155656d02d) |
|
|
43
|
+
| PoseidonT3 | [0xa0e0aC07c211D329ebA2D6ec552F4dC1B230A89A](https://sepolia.arbiscan.io/address/0xa0e0aC07c211D329ebA2D6ec552F4dC1B230A89A) |
|
|
44
|
+
| PoseidonT4 | [0x4f02c99df5731C8C69f6baa62Aa4C9f99C529CE2](https://sepolia.arbiscan.io/address/0x0CC8B7Aed7d79a8B948636242706265548D0B10a) |
|
|
45
|
+
| PoseidonT5 | [0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968](https://sepolia.arbiscan.io/address/0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968) |
|
|
46
|
+
| PoseidonT6 | [0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E](https://sepolia.arbiscan.io/address/0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E) |
|
|
47
|
+
|
|
48
|
+
### Arbitrum Mainnet
|
|
49
|
+
|
|
50
|
+
| Contract | Address |
|
|
51
|
+
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| ConstantInitialVoiceCreditProxy (200 Credits) | [0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856](https://arbiscan.io/address/0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856) |
|
|
53
|
+
| Verifier | [0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27](https://arbiscan.io/address/0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27) |
|
|
54
|
+
| PoseidonT3 | [0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4](https://arbiscan.io/address/0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4) |
|
|
55
|
+
| PoseidonT4 | [0x8778dA47eF619f56341fE95514e95fa0FF3B77C6](https://arbiscan.io/address/0x8778dA47eF619f56341fE95514e95fa0FF3B77C6) |
|
|
56
|
+
| PoseidonT5 | [0x43B519FF023757508311518AC41B5fA1CfD57181](https://arbiscan.io/address/0x43B519FF023757508311518AC41B5fA1CfD57181) |
|
|
57
|
+
| PoseidonT6 | [0xb123798B1b21082100D289BeA24bFF0F8dfcbEe1](https://arbiscan.io/address/0xb123798B1b21082100D289BeA24bFF0F8dfcbEe1) |
|
|
58
|
+
|
|
59
|
+
### Optimism
|
|
60
|
+
|
|
61
|
+
| Contract | Address |
|
|
62
|
+
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| ConstantInitialVoiceCreditProxy (200 Credits) | [0x83dD551541C580e338206f1f677835D427C92dE2](https://optimistic.etherscan.io/address/0x83dD551541C580e338206f1f677835D427C92dE2) |
|
|
64
|
+
| Verifier | [0x88C2c6A7535463962A34757FE63cc4F296381aba](https://optimistic.etherscan.io/address/0x88C2c6A7535463962A34757FE63cc4F296381aba) |
|
|
65
|
+
| PoseidonT3 | [0xF8E637e5c9EC3A8d8fa8843A6dF833348E1F1E66](https://optimistic.etherscan.io/address/0xF8E637e5c9EC3A8d8fa8843A6dF833348E1F1E66) |
|
|
66
|
+
| PoseidonT4 | [0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274](https://optimistic.etherscan.io/address/0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274) |
|
|
67
|
+
| PoseidonT5 | [0xD2F6c828606Ad8e985008Cd825012f269B50CD58](https://optimistic.etherscan.io/address/0xD2F6c828606Ad8e985008Cd825012f269B50CD58) |
|
|
68
|
+
| PoseidonT6 | [0x982530673Ce9e5Efa02438c694d48327Aa4fB592](https://optimistic.etherscan.io/address/0x982530673Ce9e5Efa02438c694d48327Aa4fB592) |
|
|
69
|
+
|
|
70
|
+
### Optimism Sepolia
|
|
71
|
+
|
|
72
|
+
| Contract | Address |
|
|
73
|
+
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
74
|
+
| ConstantInitialVoiceCreditProxy (99 Credits) | [0x4473aC3e68ad78D67757336ABaAa2Dced08cfcdF](https://sepolia-optimism.etherscan.io/address/0x4473aC3e68ad78D67757336ABaAa2Dced08cfcdF) |
|
|
75
|
+
| Verifier | [0xB1abb44291ff487f96636758b07Ccd9881f64c9A](https://sepolia-optimism.etherscan.io/address/0xB1abb44291ff487f96636758b07Ccd9881f64c9A) |
|
|
76
|
+
| PoseidonT3 | [0x07490eba00dc4ACA6721D052Fa4C5002Aa077233](https://sepolia-optimism.etherscan.io/address/0x07490eba00dc4ACA6721D052Fa4C5002Aa077233) |
|
|
77
|
+
| PoseidonT4 | [0xbb0e724CE02e5E7eDd31e632dc6e59F229a1126d](https://sepolia-optimism.etherscan.io/address/0xbb0e724CE02e5E7eDd31e632dc6e59F229a1126d) |
|
|
78
|
+
| PoseidonT5 | [0xE0398F7DFAC494c530F6404AfEaC8669ABeD2679](https://sepolia-optimism.etherscan.io/address/0xE0398F7DFAC494c530F6404AfEaC8669ABeD2679) |
|
|
79
|
+
| PoseidonT6 | [0xfD77833F10a29c76A6a0ede235Eb651D744d0E2F](https://sepolia-optimism.etherscan.io/address/0xfD77833F10a29c76A6a0ede235Eb651D744d0E2F) |
|
|
80
|
+
|
|
81
|
+
### Scroll Sepolia
|
|
82
|
+
|
|
83
|
+
| Contract | Address |
|
|
84
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| ConstantInitialVoiceCreditProxy (99 Credits) | [0xB486cce9B4507A67Db147B0802D5673774C8D278](https://sepolia.scrollscan.com/address/0xB486cce9B4507A67Db147B0802D5673774C8D278) |
|
|
86
|
+
| Verifier | [0xD5C41106db85EDd0298279AcFCE5A722060cc5f9](https://sepolia.scrollscan.com/address/0xD5C41106db85EDd0298279AcFCE5A722060cc5f9) |
|
|
87
|
+
| PoseidonT3 | [0x88C2c6A7535463962A34757FE63cc4F296381aba](https://sepolia.scrollscan.com/address/0x88C2c6A7535463962A34757FE63cc4F296381aba) |
|
|
88
|
+
| PoseidonT4 | [0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274](https://sepolia.scrollscan.com/address/0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274) |
|
|
89
|
+
| PoseidonT5 | [0xE0398F7DFAC494c530F6404AfEaC8669ABeD2679](https://sepolia.scrollscan.com/address/0xE0398F7DFAC494c530F6404AfEaC8669ABeD2679) |
|
|
90
|
+
| PoseidonT6 | [0xD2F6c828606Ad8e985008Cd825012f269B50CD58](https://sepolia.scrollscan.com/address/0xD2F6c828606Ad8e985008Cd825012f269B50CD58) |
|
|
91
|
+
|
|
92
|
+
### Base
|
|
93
|
+
|
|
94
|
+
| Contract | Address |
|
|
95
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| ConstantInitialVoiceCreditProxy (200 Credits) | [0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856](https://basescan.org/address/0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856) |
|
|
97
|
+
| Verifier | [0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27](https://basescan.org/address/0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27) |
|
|
98
|
+
| PoseidonT3 | [0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4](https://basescan.org/address/0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4) |
|
|
99
|
+
| PoseidonT4 | [0x8778dA47eF619f56341fE95514e95fa0FF3B77C6](https://basescan.org/address/0x8778dA47eF619f56341fE95514e95fa0FF3B77C6) |
|
|
100
|
+
| PoseidonT5 | [0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968](https://basescan.org/address/0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968) |
|
|
101
|
+
| PoseidonT6 | [0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E](https://basescan.org/address/0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E) |
|
|
102
|
+
|
|
103
|
+
### Base Sepolia
|
|
104
|
+
|
|
105
|
+
| Contract | Address |
|
|
106
|
+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| ConstantInitialVoiceCreditProxy (99 Credits) | [0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856](https://sepolia.basescan.org/address/0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856) |
|
|
108
|
+
| Verifier | [0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27](https://sepolia.basescan.org/address/0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27) |
|
|
109
|
+
| PoseidonT3 | [0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4](https://sepolia.basescan.org/address/0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4) |
|
|
110
|
+
| PoseidonT4 | [0x8778dA47eF619f56341fE95514e95fa0FF3B77C6](https://sepolia.basescan.org/address/0x8778dA47eF619f56341fE95514e95fa0FF3B77C6) |
|
|
111
|
+
| PoseidonT5 | [0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968](https://sepolia.basescan.org/address/0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968) |
|
|
112
|
+
| PoseidonT6 | [0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E](https://sepolia.basescan.org/address/0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E) |
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Supported Networks
|
|
3
|
+
description: Supported Networks
|
|
4
|
+
sidebar_label: Supported Networks
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
:::info
|
|
9
|
+
|
|
10
|
+
Testing was done using MACI v2, we expect similar results with v3.
|
|
11
|
+
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
MACI has been tested on the following EVM networks:
|
|
15
|
+
|
|
16
|
+
- Optimism
|
|
17
|
+
- Optimism Sepolia
|
|
18
|
+
- Arbitrum
|
|
19
|
+
- Arbitrum Sepolia
|
|
20
|
+
- Base
|
|
21
|
+
- Base Sepolia
|
|
22
|
+
- Gnosis
|
|
23
|
+
- Gnosis Chiado
|
|
24
|
+
- Polygon
|
|
25
|
+
- Polygon Amoy
|
|
26
|
+
- Scroll
|
|
27
|
+
- Scroll Sepolia
|
|
28
|
+
- Linea
|
|
29
|
+
- Linea Sepolia
|
|
30
|
+
- Zksync Era
|
|
31
|
+
- Zksync Sepolia
|
|
32
|
+
- Polygon Zkevm
|
|
33
|
+
- Polygon Cardona Zkevm
|
|
34
|
+
|
|
35
|
+
We recommend using either Optimism, Arbitrum or Base. Please open an issue/PR if you intend to use other EVM networks and would like to contribute to this record of deployed and verified contracts as well as benchmarks, that would be greatly appreciated.
|
|
36
|
+
|
|
37
|
+
## Limitations
|
|
38
|
+
|
|
39
|
+
For better UX, MACI clients should be sending votes (messages) in batches. Depending on the number of vote options available, larger batch might be sent. Below you can find the largest batch you can send for each network and how much gas it consumes:
|
|
40
|
+
|
|
41
|
+
| Network | Max Batch Size | Gas used | Price (based on Ether price at the time ~$2595) |
|
|
42
|
+
| ---------------- | -------------- | -------- | ----------------------------------------------- |
|
|
43
|
+
| Optimism | 89 | 28167603 | 0.000036061732019822 ETH ($0.09) |
|
|
44
|
+
| Optimism Sepolia | 89 | 28163331 | 0.005651520470449442 ETH ($10.46) |
|
|
45
|
+
| Arbitrum | 98 | 31017545 | 0.00031017545 ETH ($0.80) |
|
|
46
|
+
| Arbitrum Sepolia | 98 | 31115404 | 0.0031115404 ETH ($8.06) |
|
|
47
|
+
| Base | 89 | 28165467 | 0.000591851649982612 ETH ($1.54) |
|
|
48
|
+
| Base Sepolia | 89 | 28190232 | 0.002072926785842714 ETH ($5.18) |
|
|
49
|
+
| Gnosis | 50 | 15921153 | 0.0000124615 ETH ($0.03) |
|
|
50
|
+
| Gnosis Chiado | 50 | 15921753 | 0.0000188313 ETH ($0.05) |
|
|
51
|
+
| Polygon | 85 | 26915773 | 0.0002193417259598 ETH ($0.54) |
|
|
52
|
+
| Polygon Amoy | 89 | 28192368 | 0.00017069180975304 ETH ($0.43) |
|
|
53
|
+
| Scroll | 62 | 19447318 | 0.000233368 ETH ($0.61) |
|
|
54
|
+
| Scroll Sepolia | 62 | 19447318 | 0.000233368 ETH ($0.61) |
|
|
55
|
+
| Linea | 14 | 4438205 | 0.00005325846 ETH ($0.1382) |
|
|
56
|
+
| Linea Sepolia | 14 | 4438205 | 0.00005325846 ETH ($0.1382) |
|
|
57
|
+
| Zksync Era | 2 | 24000690 | 0.00028801 ETH ($0.75) |
|
|
58
|
+
| Zksync Sepolia | 2 | 24000690 | 0.00028801 ETH ($0.75) |
|
|
59
|
+
| Polygon Zkevm | 6 | 1917872 | 0.00006904 ETH ($0.18) |
|
|
60
|
+
| Polygon Cardona | 6 | 1917872 | 0.00006904 ETH ($0.18) |
|
|
61
|
+
|
|
62
|
+
## Test yourself
|
|
63
|
+
|
|
64
|
+
To test MACI on a network, whether it's one of the ones listed above, or a new one, you can use the `benchmark` hardhat task:
|
|
65
|
+
|
|
66
|
+
1. Ensure you have copied `.env.example` to `.env` and set the correct values for the network you want to test on.
|
|
67
|
+
2. Configure your `deploy-config.json` - ensure `messageTreeDepth` is set to at least 3 (supporting 5 \*\* 3 votes)
|
|
68
|
+
3. Ensure you have copied the `default-deployed-contracts.json` to `deployed-contracts.json` to avoid deploying unnecessary contracts again.
|
|
69
|
+
4. Run the `benchmark` task: `pnpm benchmark:$NETWORK`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"label": "Coordinator Service",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"link": {
|
|
5
|
+
"type": "generated-index",
|
|
6
|
+
"description": "The Coordinator Service is a backend service that aims to automate MACI-related operations, such as contracts deployment, proof generation and poll finalisation."
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: The Coordinator Service is a service that allows to automate MACI coordinator tasks.
|
|
4
|
+
sidebar_label: Introduction
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coordinator Service
|
|
9
|
+
|
|
10
|
+
Welcome to the Coordinator Service technical reference. This guide describes how the Coordinator Service works, its workflow, and how to interact with it. For more technical code documentation regarding API endpoints and data transfer objects, please refer to the [API documentation](https://coordinator.maci.vote/api).
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
A MACI coordinator is responsible for running voting processes. In quadratic funding rounds or authority election rounds, the coordinator is the entity that defines who can vote, which projects or candidates are eligible for funding, and the duration of the voting round.
|
|
15
|
+
|
|
16
|
+
First of all, the coordinator needs to deploy the MACI smart contracts with the desired configuration: gatekeeper policy, which defines who can sign up as a voter; the state Merkle tree depth which defines the maximum number of voters; and the voting mode which defines how votes will be counted (more info in [Poll types](https://maci.pse.dev/docs/core-concepts/poll-types#quadratic-voting)).
|
|
17
|
+
|
|
18
|
+
After deploying the MACI contracts, the coordinator can deploy a poll (which represents a voting process). To deploy the poll, the coordinator needs to specify: the gatekeeper policy, which defines who can join the poll as a voter; the start and end dates of the poll; the number of options to vote for; the maximum number of votes per voter; and the voting mode.
|
|
19
|
+
|
|
20
|
+
The coordinator will then wait until the poll ends, after which they will need to finalize the poll. This involves processing all published messages, extracting the votes, tallying them, and submitting the results on-chain.
|
|
21
|
+
|
|
22
|
+
## Conclusion
|
|
23
|
+
|
|
24
|
+
In the following documents, we will go through the details of setting up the Coordinator Service and how to interact with it to perform the tasks described above.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation and setup
|
|
3
|
+
description: Learn how to install and setup the Coordinator Service.
|
|
4
|
+
sidebar_label: Installation
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
There are two ways to run the coordinator service: building it from source or using Docker. Both methods require you to clone the MACI repository and move to the project root directory.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
git clone https://github.com/privacy-scaling-explorations/maci
|
|
12
|
+
cd maci
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You need to check the latest [README.md](https://github.com/privacy-ethereum/maci/tree/main/apps/coordinator) instructions in the coordinator service app for detailed information about requirements and steps to install, build, and run the service.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Usage
|
|
3
|
+
description: Learn how to interact with a running MACI coordinator service instance.
|
|
4
|
+
sidebar_label: Usage
|
|
5
|
+
sidebar_position: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
After setting up and running the MACI coordinator service, you can interact with it through its RESTful API. The service provides various endpoints for deployment and finalization of polls. Please refer to the API documentation at [https://coordinator.maci.vote/api](https://coordinator.maci.vote/api) for the exact request format and required parameters for all endpoint calls described below.
|
|
9
|
+
|
|
10
|
+
# Authentication
|
|
11
|
+
|
|
12
|
+
The coordinator service uses a custom signature authentication mechanism to guard the deploy endpoints. To interact with these endpoints, you need to:
|
|
13
|
+
|
|
14
|
+
1. Make sure you have run the command to set up and generate the RSA keypair, as described in the instructions section.
|
|
15
|
+
|
|
16
|
+
2. Ensure that your Ethereum public key is set in the `.env` file under the `COORDINATOR_ADDRESSES` variable.
|
|
17
|
+
|
|
18
|
+
3. Get the RSA public key from the coordinator service with [https://coordinator.maci.vote/v1/proof/publicKey](https://coordinator.maci.vote/v1/proof/publicKey).
|
|
19
|
+
|
|
20
|
+
4. Sign a message such as "authenticate-me" using the coordinator's Ethereum private key.
|
|
21
|
+
|
|
22
|
+
5. Encrypt both the message (also called digest) and its signature using the RSA public key. For example, you can use RSA public-key encryption in the format:
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
const payload: string = "signature:digest";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then encrypt this payload using the coordinator’s RSA public key.
|
|
29
|
+
|
|
30
|
+
# Deploy MACI
|
|
31
|
+
|
|
32
|
+
To deploy the set of MACI smart contracts, you need to call the endpoint [https://coordinator.maci.vote/v1/deploy/maci](https://coordinator.maci.vote/v1/deploy/maci) with a POST request. The request body should include the necessary parameters for the deployment, such as the gatekeeper policy, state tree depth, and voting mode.
|
|
33
|
+
|
|
34
|
+
# Deploy Poll
|
|
35
|
+
|
|
36
|
+
To deploy a new poll to an existing MACI instance, you need to call the endpoint [https://coordinator.maci.vote/v1/deploy/poll](https://coordinator.maci.vote/v1/deploy/poll) with a POST request. The request body should include the necessary parameters for the poll deployment, such as the gatekeeper policy, start and end dates, number of options, and voting mode.
|
|
37
|
+
|
|
38
|
+
# Deploy Subgraph
|
|
39
|
+
|
|
40
|
+
To deploy a subgraph for a MACI instance and its corresponding polls, you need to call the endpoint [https://coordinator.maci.vote/v1/subgraph/deploy](https://coordinator.maci.vote/v1/subgraph/deploy) with a POST request. The request body should include the necessary parameters for the subgraph deployment, such as the MACI contract address and the subgraph name.
|
|
41
|
+
|
|
42
|
+
# Finalize Poll
|
|
43
|
+
|
|
44
|
+
To finalize a poll, you need to follow a series of steps that involve processing messages, merging state trees, generating proofs, and submitting the final tally on-chain. The Coordinator Service provides endpoints for each of these steps.
|
|
45
|
+
|
|
46
|
+
## Merge
|
|
47
|
+
|
|
48
|
+
To merge the published messages and create the required state tree, you need to call the endpoint [https://coordinator.maci.vote/v1/proof/merge](https://coordinator.maci.vote/v1/proof/merge) with a POST request. The request body should include the necessary parameters for the merge operation, such as the MACI contract address and the poll ID.
|
|
49
|
+
|
|
50
|
+
## Generate
|
|
51
|
+
|
|
52
|
+
Once the Merkle trees are ready, you can generate the zk-SNARK proof for the final tally by calling the endpoint [https://coordinator.maci.vote/v1/proof/generate](https://coordinator.maci.vote/v1/proof/generate) with a POST request. The request body should include the necessary parameters for the proof generation, such as the MACI contract address and the poll ID.
|
|
53
|
+
|
|
54
|
+
## Submit
|
|
55
|
+
|
|
56
|
+
After generating the proof, you can submit the final tally on-chain by calling the endpoint [https://coordinator.maci.vote/v1/proof/submit](https://coordinator.maci.vote/v1/proof/submit) with a POST request. The request body should include the necessary parameters for the submission, such as the MACI contract address, poll ID, and the generated proof.
|
|
57
|
+
|
|
58
|
+
# Schedule Poll
|
|
59
|
+
|
|
60
|
+
After deploying a poll, you can schedule it to be finalized automatically after it ends. Make sure to set the MACI coordinator private key in the `.env` file. To do so, you need to call the endpoint [https://coordinator.maci.vote/v1/schedule/poll](https://coordinator.maci.vote/v1/schedule/poll) with a POST request. The request body should include the necessary parameters for scheduling the poll, such as the MACI contract address and the poll ID.
|
|
61
|
+
|
|
62
|
+
# Health
|
|
63
|
+
|
|
64
|
+
To check that the env variables are set correctly and the service is running, you can call the health endpoint [https://coordinator.maci.vote/v1/health](https://coordinator.maci.vote/v1/health) with a GET request. This endpoint will return a status message indicating the rapidsnark access, redis database connection, zkeys access, and the MACI coordinator address with its funds in each MACI-compatible network.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: The Offchain Relayer is a service that allows users to vote on MACI polls free of charge.
|
|
4
|
+
sidebar_label: Introduction
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Coordinator Service
|
|
9
|
+
|
|
10
|
+
Welcome to the Offchain Relayer technical reference. Here you will find the technical details of the Offchain Relayer: how to set it up and and how to use it.
|
|
11
|
+
|
|
12
|
+
## Flow Diagram
|
|
13
|
+
|
|
14
|
+
Below is a high-level diagram illustrating the flow of the Relayer Service:
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
## High-Level Overview of the Relayer:
|
|
19
|
+
|
|
20
|
+
### Functionality
|
|
21
|
+
|
|
22
|
+
The Relayer serves as an intermediary between users and the MACI system. It performs the following tasks:
|
|
23
|
+
|
|
24
|
+
- Allows users to send messages without having to pay gas fees by processing these messages off-chain.
|
|
25
|
+
- Receives user messages.
|
|
26
|
+
- Prepare messages batches and upload it to IPFS
|
|
27
|
+
- Submits the message hashes to the Poll contract with IPFS hash of the batch.
|
|
28
|
+
|
|
29
|
+
This process ensures that user actions are recorded on-chain without compromising their privacy.
|
|
30
|
+
|
|
31
|
+
### Privacy Preservation
|
|
32
|
+
|
|
33
|
+
By verifying the zero-knowledge proofs, the Relayer ensures that only authorized users can send messages.
|
|
34
|
+
Users must know the pre-image to a state leaf in the poll state tree.
|
|
35
|
+
|
|
36
|
+
### Decentralization and Trust
|
|
37
|
+
|
|
38
|
+
It's recommended that the coordinator only runs this service for now. That is because if the service malfunctions and batch hashes are pushed on chain without the messages actually being stored on ipfs, then polls can't be finalized.
|
|
39
|
+
|
|
40
|
+
### Integration with MACI Components
|
|
41
|
+
|
|
42
|
+
The Relayer interacts with other components of the MACI system, such as the **Coordinator** and the on-chain smart contracts:
|
|
43
|
+
|
|
44
|
+
- The **Coordinator** fetches all the messages stored in IPFS and uses them as regular on-chain messages.
|
|
45
|
+
- This ensures that user messages are properly processed and recorded, contributing to the overall functionality and security of the voting protocol.
|
|
46
|
+
|
|
47
|
+
### Additional Information
|
|
48
|
+
|
|
49
|
+
For more details, you can read the following post on EthResearch:
|
|
50
|
+
|
|
51
|
+
[MACI with Mostly Off-Chain Happy Path](https://ethresear.ch/t/maci-with-mostly-off-chain-happy-path/19527)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation and setup
|
|
3
|
+
description: Learn how to install and setup the Offchain Relayer service.
|
|
4
|
+
sidebar_label: Setup
|
|
5
|
+
sidebar_position: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
Make sure you have the following tools installed on your system:
|
|
11
|
+
|
|
12
|
+
- **Docker**: [Install Docker](https://www.docker.com/products/docker-desktop)
|
|
13
|
+
- **Docker Compose**: [Install Docker Compose](https://docs.docker.com/compose/install/)
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
Follow these steps to run the MACI Relayer service using Docker.
|
|
18
|
+
|
|
19
|
+
### 1. Clone the Repository
|
|
20
|
+
|
|
21
|
+
First, clone the repository to your local machine.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/privacy-scaling-explorations/maci
|
|
25
|
+
cd maci
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 2. Configure Environment Variables
|
|
29
|
+
|
|
30
|
+
The `.env` file contains sensitive configuration values that will be injected into the Docker containers at runtime. To set them up:
|
|
31
|
+
|
|
32
|
+
1. Copy the `.env.example` file to `.env`.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cp .env.example .env
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Edit the `.env` file and configure the variables.
|
|
39
|
+
|
|
40
|
+
## 3. Build and Run the Docker Containers
|
|
41
|
+
|
|
42
|
+
Now that your environment is set up, it's time to build and run the Docker containers.
|
|
43
|
+
|
|
44
|
+
Run the following command from the root directory of your project:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
docker-compose up --build
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This command does the following:
|
|
51
|
+
|
|
52
|
+
- Builds the Docker images based on the Dockerfile and `docker-compose.yml` files.
|
|
53
|
+
- Starts the service container (the MACI relayer application) and the mongodb container.
|
|
54
|
+
|
|
55
|
+
The MACI Relayer service will be available on port 3000 by default (you can modify this in the `.env` file).
|
|
56
|
+
|
|
57
|
+
## 4. Access the Service
|
|
58
|
+
|
|
59
|
+
Once the containers are up and running, you can access the relayer service at:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
http://localhost:3000
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Additionally, the Swagger UI documentation for the Relayer service API can be accessed at:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
http://localhost:3000/api
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You can interact with the API through the Swagger interface, which provides a convenient way to test endpoints and view the API methods.
|
|
72
|
+
|
|
73
|
+
## 5. Check Logs
|
|
74
|
+
|
|
75
|
+
To view the logs from the containers and troubleshoot any issues, run:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
docker-compose logs
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This will display logs from both the service (relayer) and mongodb containers.
|
|
82
|
+
|
|
83
|
+
## 6. Stop the Services
|
|
84
|
+
|
|
85
|
+
To stop the containers and remove the containers (but keep the volumes), use the following command:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
docker-compose down
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This will stop and remove the containers but retain the volumes (like MongoDB data). To also remove the volumes, run:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
docker-compose down --volumes
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 7. MongoDB Persistence
|
|
98
|
+
|
|
99
|
+
MongoDB data is persisted using Docker volumes (`mongodb-data`). Even if you remove and recreate the MongoDB container, the data will persist.
|
|
100
|
+
|
|
101
|
+
This ensures that any data stored in the MongoDB database is not lost even if the container is restarted or removed.
|
|
102
|
+
|
|
103
|
+
If you'd like to remove the persisted data as well, you can remove the volume by running:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
docker volume rm your-repo_mongodb-data
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This will delete the volume, along with all the data stored in MongoDB.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MACI Smart Contract
|
|
3
|
+
description: MACI main smart contract
|
|
4
|
+
sidebar_label: MACI
|
|
5
|
+
sidebar_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
:::info
|
|
9
|
+
Code location: [MACI.sol](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/MACI.sol)
|
|
10
|
+
:::
|
|
11
|
+
|
|
12
|
+
`MACI.sol` is the core contract of the project, as it provides the base layer for user signups and Polls to be created.
|
|
13
|
+
|
|
14
|
+
The constructor shown below accepts several arguments:
|
|
15
|
+
|
|
16
|
+
- `PollFactory` address
|
|
17
|
+
- `MessageProcessorFactory` address
|
|
18
|
+
- `TallyFactory` address
|
|
19
|
+
- `IBasePolicy` address
|
|
20
|
+
- `InitialVoiceCreditProxy` address
|
|
21
|
+
- The depth of the state tree
|
|
22
|
+
|
|
23
|
+
```solidity
|
|
24
|
+
constructor(
|
|
25
|
+
IPollFactory _pollFactory,
|
|
26
|
+
IMessageProcessorFactory _messageProcessorFactory,
|
|
27
|
+
ITallyFactory _tallyFactory,
|
|
28
|
+
IBasePolicy _signUpPolicy,
|
|
29
|
+
uint8 _stateTreeDepth,
|
|
30
|
+
uint256[5] memory _emptyBallotRoots
|
|
31
|
+
) payable {
|
|
32
|
+
// initialize and insert the blank leaf
|
|
33
|
+
InternalLeanIMT._insert(leanIMTData, PAD_KEY_HASH);
|
|
34
|
+
stateRootsOnSignUp.push(PAD_KEY_HASH);
|
|
35
|
+
|
|
36
|
+
pollFactory = _pollFactory;
|
|
37
|
+
messageProcessorFactory = _messageProcessorFactory;
|
|
38
|
+
tallyFactory = _tallyFactory;
|
|
39
|
+
signUpPolicy = _signUpPolicy;
|
|
40
|
+
stateTreeDepth = _stateTreeDepth;
|
|
41
|
+
maxSignups = uint256(STATE_TREE_ARITY) ** uint256(_stateTreeDepth);
|
|
42
|
+
emptyBallotRoots = _emptyBallotRoots;
|
|
43
|
+
|
|
44
|
+
// Verify linked poseidon libraries
|
|
45
|
+
if (hash2([uint256(1), uint256(1)]) == 0) revert PoseidonHashLibrariesNotLinked();
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Upon deployment, the contract will initialize the state tree, and insert the blank leaf hash.
|
|
50
|
+
|
|
51
|
+
After this, all of the parameters will be stored to state, and then the contract will perform a simple sanity check to ensure that the Poseidon hash libraries were linked successfully.
|
|
52
|
+
|
|
53
|
+
## SignUp
|
|
54
|
+
|
|
55
|
+
Next, we have the `signUp` function, which allows users to `signUp`, as long as they pass the conditions set in the `signUpPolicy` contract. This contract can use any mean necessary to gatekeep access to MACI's polls. For instance, only wallets with a specific ERC721 token can be allowed to sign up.
|
|
56
|
+
|
|
57
|
+
This function does the following:
|
|
58
|
+
|
|
59
|
+
- checks that the maximum number of signups has not been reached. Given a tree depth of 10, this will be $2 ** 10 - 1$.
|
|
60
|
+
- checks that the provided public key is a valid baby-jubjub point
|
|
61
|
+
- registers the user using the sign up policy contract. It is important that whichever policy is used, this reverts if a user tries to sign up twice or the conditions are not met (i.e returning false is not enough)
|
|
62
|
+
- hashes the public key and inserts it into the state tree.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
function signUp(PublicKey memory _publicKey, bytes memory _signUpPolicyData) public virtual {
|
|
66
|
+
// ensure we do not have more signups than what the circuits support
|
|
67
|
+
if (leanIMTData.size >= maxSignups) revert TooManySignups();
|
|
68
|
+
|
|
69
|
+
// ensure that the public key is on the baby jubjub curve
|
|
70
|
+
if (!CurveBabyJubJub.isOnCurve(_publicKey.x, _publicKey.y)) {
|
|
71
|
+
revert InvalidPubKey();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Register the user via the sign-up policy. This function should
|
|
75
|
+
// throw if the user has already registered or if ineligible to do so.
|
|
76
|
+
signUpPolicy.register(msg.sender, _signUpPolicyData);
|
|
77
|
+
|
|
78
|
+
// Hash the public key and insert it into the tree.
|
|
79
|
+
uint256 pubKeyHash = hashLeftRight(_publicKey.x, _publicKey.y);
|
|
80
|
+
uint256 stateRoot = InternalLeanIMT._insert(leanIMTData, pubKeyHash);
|
|
81
|
+
|
|
82
|
+
// Store the current state tree root in the array
|
|
83
|
+
stateRootsOnSignUp.push(stateRoot);
|
|
84
|
+
|
|
85
|
+
emit SignUp(leanIMTData.size - 1, block.timestamp, _publicKey.x, _publicKey.y);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## DeployPoll
|
|
90
|
+
|
|
91
|
+
Once everything has been setup, polls can be deployed using the `deployPoll` function. Polls can be deployed concurrently, as each deployment has its own separate set of contracts and state.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
function deployPoll(DeployPollArgs calldata args) public virtual returns (PollContracts memory) {
|
|
95
|
+
// cache the poll to a local variable so we can increment it
|
|
96
|
+
uint256 pollId = nextPollId;
|
|
97
|
+
|
|
98
|
+
// Increment the poll ID for the next poll
|
|
99
|
+
// 2 ** 256 polls available
|
|
100
|
+
unchecked {
|
|
101
|
+
nextPollId++;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// check coordinator key is a valid point on the curve
|
|
105
|
+
if (!CurveBabyJubJub.isOnCurve(args.coordinatorPubKey.x, args.coordinatorPubKey.y)) {
|
|
106
|
+
revert InvalidPubKey();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
ExtContracts memory extContracts = ExtContracts({
|
|
110
|
+
maci: IMACI(address(this)),
|
|
111
|
+
verifier: IVerifier(args.verifier),
|
|
112
|
+
vkRegistry: IVkRegistry(args.vkRegistry),
|
|
113
|
+
policy: IsignUpPolicy(args.policy),
|
|
114
|
+
initialVoiceCreditProxy: IInitialVoiceCreditProxy(args.initialVoiceCreditProxy)
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
IPollFactory.DeployPollArgs memory deployPollArgs = IPollFactory.DeployPollArgs({
|
|
118
|
+
startDate: args.startDate,
|
|
119
|
+
endDate: args.endDate,
|
|
120
|
+
treeDepths: args.treeDepths,
|
|
121
|
+
messageBatchSize: args.messageBatchSize,
|
|
122
|
+
coordinatorPubKey: args.coordinatorPubKey,
|
|
123
|
+
extContracts: extContracts,
|
|
124
|
+
emptyBallotRoot: emptyBallotRoots[args.treeDepths.voteOptionTreeDepth - 1],
|
|
125
|
+
pollId: pollId,
|
|
126
|
+
relayers: args.relayers,
|
|
127
|
+
voteOptions: args.voteOptions
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
address p = pollFactory.deploy(deployPollArgs);
|
|
131
|
+
address mp = messageProcessorFactory.deploy(args.verifier, args.vkRegistry, p, msg.sender, args.mode);
|
|
132
|
+
address tally = tallyFactory.deploy(args.verifier, args.vkRegistry, p, mp, msg.sender, args.mode);
|
|
133
|
+
|
|
134
|
+
// store the addresses in a struct so they can be returned
|
|
135
|
+
PollContracts memory pollAddr = PollContracts({ poll: p, messageProcessor: mp, tally: tally });
|
|
136
|
+
|
|
137
|
+
polls[pollId] = pollAddr;
|
|
138
|
+
|
|
139
|
+
emit DeployPoll(pollId, args.coordinatorPubKey.x, args.coordinatorPubKey.y, args.mode);
|
|
140
|
+
|
|
141
|
+
return pollAddr;
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Polls require the following information:
|
|
146
|
+
|
|
147
|
+
- `duration`: the duration of the poll
|
|
148
|
+
- `treeDepths`: the depth of the state tree, message tree, and vote option tree
|
|
149
|
+
- `coordinatorPubKey`: the public key of the poll's coordinator
|
|
150
|
+
- `verifier`: the address of the zk-SNARK verifier contract
|
|
151
|
+
- `vkRegistry`: the address of the vk registry contract
|
|
152
|
+
- `mode`: the mode of the poll, to set whether it supports quadratic voting, non quadratic voting, full credits voting
|
|
153
|
+
- `signUpPolicy`: the address of the sign up policy contract
|
|
154
|
+
- `initialVoiceCreditProxy`: the address of the initial voice credit proxy contract
|
|
155
|
+
- `relayers`: the addresses of the relayers for the poll (if offchain voting is enabled)
|
|
156
|
+
- `voteOptions`: the number of vote options for the poll
|
|
157
|
+
|
|
158
|
+
:::info
|
|
159
|
+
Please be advised that the number of signups in the MACI contract (number of leaves in the merkle tree holding MACI's state) considers the initial zero leaf as one signup. For this reason, when accounting for the real users signed up to MACI, you should subtract one from the value returned from the `totalSignups` function.
|
|
160
|
+
:::
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MessageProcessor Smart Contract
|
|
3
|
+
description: MessageProcessor smart contract
|
|
4
|
+
sidebar_label: MessageProcessor
|
|
5
|
+
sidebar_position: 4
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
:::info
|
|
9
|
+
Code location: [MessageProcessor.sol](https://github.com/privacy-scaling-explorations/maci/blob/main/packages/contracts/contracts/MessageProcessor.sol)
|
|
10
|
+
:::
|
|
11
|
+
|
|
12
|
+
This contract is used to prepare parameters for the zk-SNARK circuits as well as for verifying proofs. It should be deployed alongside a `Poll`.
|
|
13
|
+
It will process messages in batches, and after all batches have been processed, the `sbCommitment` can then be used for the `Tally` contract verification steps.
|