@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,34 @@
|
|
|
1
|
+
# AccQueueBinaryMaci
|
|
2
|
+
|
|
3
|
+
This contract extends AccQueueBinary and MerkleBinaryMaci
|
|
4
|
+
|
|
5
|
+
_This contract is used for creating a
|
|
6
|
+
Merkle tree with binary (2 leaves per node) structure_
|
|
7
|
+
|
|
8
|
+
### constructor
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
constructor(uint256 _subDepth) public
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Constructor for creating AccQueueBinaryMaci contract
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
| Name | Type | Description |
|
|
19
|
+
| ---------- | ------- | ------------------------- |
|
|
20
|
+
| \_subDepth | uint256 | The depth of each subtree |
|
|
21
|
+
|
|
22
|
+
### getZero
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
function getZero(uint256 _level) internal view returns (uint256 zero)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Returns the zero leaf at a specified level
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| ------- | ------- | ------------------------------------------ |
|
|
34
|
+
| \_level | uint256 | The level at which to return the zero leaf |
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# AccQueueQuinary
|
|
2
|
+
|
|
3
|
+
This contract defines a Merkle tree where each leaf insertion only updates a
|
|
4
|
+
subtree. To obtain the main tree root, the contract owner must merge the
|
|
5
|
+
subtrees together. Merging subtrees requires at least 2 operations:
|
|
6
|
+
mergeSubRoots(), and merge(). To get around the gas limit,
|
|
7
|
+
the mergeSubRoots() can be performed in multiple transactions.
|
|
8
|
+
|
|
9
|
+
_This contract is for a quinary tree (5 leaves per node)_
|
|
10
|
+
|
|
11
|
+
### constructor
|
|
12
|
+
|
|
13
|
+
```solidity
|
|
14
|
+
constructor(uint256 _subDepth) internal
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Create a new AccQueueQuinary instance
|
|
18
|
+
|
|
19
|
+
### hashLevel
|
|
20
|
+
|
|
21
|
+
```solidity
|
|
22
|
+
function hashLevel(uint256 _level, uint256 _leaf) internal returns (uint256 hashed)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Hash the contents of the specified level and the specified leaf.
|
|
26
|
+
|
|
27
|
+
_it also frees up storage slots to refund gas._
|
|
28
|
+
|
|
29
|
+
#### Parameters
|
|
30
|
+
|
|
31
|
+
| Name | Type | Description |
|
|
32
|
+
| ------- | ------- | -------------------------------- |
|
|
33
|
+
| \_level | uint256 | The level to hash. |
|
|
34
|
+
| \_leaf | uint256 | The leaf include with the level. |
|
|
35
|
+
|
|
36
|
+
#### Return Values
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description |
|
|
39
|
+
| ------ | ------- | ------------------------------- |
|
|
40
|
+
| hashed | uint256 | The hash of the level and leaf. |
|
|
41
|
+
|
|
42
|
+
### hashLevelLeaf
|
|
43
|
+
|
|
44
|
+
```solidity
|
|
45
|
+
function hashLevelLeaf(uint256 _level, uint256 _leaf) public view returns (uint256 hashed)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Hash the contents of the specified level and the specified leaf.
|
|
49
|
+
|
|
50
|
+
#### Parameters
|
|
51
|
+
|
|
52
|
+
| Name | Type | Description |
|
|
53
|
+
| ------- | ------- | -------------------------------- |
|
|
54
|
+
| \_level | uint256 | The level to hash. |
|
|
55
|
+
| \_leaf | uint256 | The leaf include with the level. |
|
|
56
|
+
|
|
57
|
+
#### Return Values
|
|
58
|
+
|
|
59
|
+
| Name | Type | Description |
|
|
60
|
+
| ------ | ------- | ------------------------------- |
|
|
61
|
+
| hashed | uint256 | The hash of the level and leaf. |
|
|
62
|
+
|
|
63
|
+
### \_fill
|
|
64
|
+
|
|
65
|
+
```solidity
|
|
66
|
+
function _fill(uint256 _level) internal
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
An internal function which fills a subtree
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
| Name | Type | Description |
|
|
74
|
+
| ------- | ------- | -------------------------------------- |
|
|
75
|
+
| \_level | uint256 | The level at which to fill the subtree |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AccQueueQuinary0
|
|
2
|
+
|
|
3
|
+
This contract extends AccQueueQuinary and MerkleQuinary0
|
|
4
|
+
|
|
5
|
+
_This contract is used for creating a
|
|
6
|
+
Merkle tree with quinary (5 leaves per node) structure_
|
|
7
|
+
|
|
8
|
+
### constructor
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
constructor(uint256 _subDepth) public
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Constructor for creating AccQueueQuinary0 contract
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
| Name | Type | Description |
|
|
19
|
+
| ---------- | ------- | ------------------------- |
|
|
20
|
+
| \_subDepth | uint256 | The depth of each subtree |
|
|
21
|
+
|
|
22
|
+
### getZero
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
function getZero(uint256 _level) internal view returns (uint256 zero)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Returns the zero leaf at a specified level
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| ------- | ------- | ------------------------------------------ |
|
|
34
|
+
| \_level | uint256 | The level at which to return the zero leaf |
|
|
35
|
+
|
|
36
|
+
#### Return Values
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description |
|
|
39
|
+
| ---- | ------- | ------------------------------------ |
|
|
40
|
+
| zero | uint256 | The zero leaf at the specified level |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AccQueueQuinaryBlankSl
|
|
2
|
+
|
|
3
|
+
This contract extends AccQueueQuinary and MerkleQuinaryBlankSl
|
|
4
|
+
|
|
5
|
+
_This contract is used for creating a
|
|
6
|
+
Merkle tree with quinary (5 leaves per node) structure_
|
|
7
|
+
|
|
8
|
+
### constructor
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
constructor(uint256 _subDepth) public
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Constructor for creating AccQueueQuinaryBlankSl contract
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
| Name | Type | Description |
|
|
19
|
+
| ---------- | ------- | ------------------------- |
|
|
20
|
+
| \_subDepth | uint256 | The depth of each subtree |
|
|
21
|
+
|
|
22
|
+
### getZero
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
function getZero(uint256 _level) internal view returns (uint256 zero)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Returns the zero leaf at a specified level
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| ------- | ------- | ------------------------------------------ |
|
|
34
|
+
| \_level | uint256 | The level at which to return the zero leaf |
|
|
35
|
+
|
|
36
|
+
#### Return Values
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description |
|
|
39
|
+
| ---- | ------- | ------------------------------------ |
|
|
40
|
+
| zero | uint256 | The zero leaf at the specified level |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AccQueueQuinaryMaci
|
|
2
|
+
|
|
3
|
+
This contract extends AccQueueQuinary and MerkleQuinaryMaci
|
|
4
|
+
|
|
5
|
+
_This contract is used for creating a
|
|
6
|
+
Merkle tree with quinary (5 leaves per node) structure_
|
|
7
|
+
|
|
8
|
+
### constructor
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
constructor(uint256 _subDepth) public
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Constructor for creating AccQueueQuinaryMaci contract
|
|
15
|
+
|
|
16
|
+
#### Parameters
|
|
17
|
+
|
|
18
|
+
| Name | Type | Description |
|
|
19
|
+
| ---------- | ------- | ------------------------- |
|
|
20
|
+
| \_subDepth | uint256 | The depth of each subtree |
|
|
21
|
+
|
|
22
|
+
### getZero
|
|
23
|
+
|
|
24
|
+
```solidity
|
|
25
|
+
function getZero(uint256 _level) internal view returns (uint256 zero)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Returns the zero leaf at a specified level
|
|
29
|
+
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
| ------- | ------- | ------------------------------------------ |
|
|
34
|
+
| \_level | uint256 | The level at which to return the zero leaf |
|
|
35
|
+
|
|
36
|
+
#### Return Values
|
|
37
|
+
|
|
38
|
+
| Name | Type | Description |
|
|
39
|
+
| ---- | ------- | ------------------------------------ |
|
|
40
|
+
| zero | uint256 | The zero leaf at the specified level |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# CommonUtilities
|
|
2
|
+
|
|
3
|
+
A contract that holds common utilities
|
|
4
|
+
which are to be used by multiple contracts
|
|
5
|
+
namely Subsidy, Tally and MessageProcessor
|
|
6
|
+
|
|
7
|
+
### VotingPeriodNotPassed
|
|
8
|
+
|
|
9
|
+
```solidity
|
|
10
|
+
error VotingPeriodNotPassed()
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### \_votingPeriodOver
|
|
14
|
+
|
|
15
|
+
```solidity
|
|
16
|
+
function _votingPeriodOver(contract IPoll _poll) internal view
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
common function for MessageProcessor, Tally and Subsidy
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
| Name | Type | Description |
|
|
24
|
+
| ------ | -------------- | ---------------------- |
|
|
25
|
+
| \_poll | contract IPoll | the poll to be checked |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# DomainObjs
|
|
2
|
+
|
|
3
|
+
An utility contract that holds
|
|
4
|
+
a number of domain objects and functions
|
|
5
|
+
|
|
6
|
+
### MESSAGE_DATA_LENGTH
|
|
7
|
+
|
|
8
|
+
```solidity
|
|
9
|
+
uint8 MESSAGE_DATA_LENGTH
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
the length of a MACI message
|
|
13
|
+
|
|
14
|
+
### Message
|
|
15
|
+
|
|
16
|
+
```solidity
|
|
17
|
+
struct Message {
|
|
18
|
+
uint256 msgType;
|
|
19
|
+
uint256[10] data;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### PubKey
|
|
24
|
+
|
|
25
|
+
```solidity
|
|
26
|
+
struct PubKey {
|
|
27
|
+
uint256 x;
|
|
28
|
+
uint256 y;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### StateLeaf
|
|
33
|
+
|
|
34
|
+
```solidity
|
|
35
|
+
struct StateLeaf {
|
|
36
|
+
struct DomainObjs.PubKey pubKey;
|
|
37
|
+
uint256 voiceCreditBalance;
|
|
38
|
+
uint256 timestamp;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Params
|
|
2
|
+
|
|
3
|
+
This contracts contains a number of structures
|
|
4
|
+
which are to be passed as parameters to Poll contracts.
|
|
5
|
+
This way we can reduce the number of parameters
|
|
6
|
+
and avoid a stack too deep error during compilation.
|
|
7
|
+
|
|
8
|
+
### TreeDepths
|
|
9
|
+
|
|
10
|
+
```solidity
|
|
11
|
+
struct TreeDepths {
|
|
12
|
+
uint8 intStateTreeDepth;
|
|
13
|
+
uint8 messageTreeSubDepth;
|
|
14
|
+
uint8 messageTreeDepth;
|
|
15
|
+
uint8 voteOptionTreeDepth;
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### MaxValues
|
|
20
|
+
|
|
21
|
+
```solidity
|
|
22
|
+
struct MaxValues {
|
|
23
|
+
uint256 maxMessages;
|
|
24
|
+
uint256 maxVoteOptions;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### ExtContracts
|
|
29
|
+
|
|
30
|
+
```solidity
|
|
31
|
+
struct ExtContracts {
|
|
32
|
+
contract IMACI maci;
|
|
33
|
+
contract AccQueue messageAq;
|
|
34
|
+
contract TopupCredit topupCredit;
|
|
35
|
+
}
|
|
36
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Utilities
|
|
2
|
+
|
|
3
|
+
An utility contract that can be used to:
|
|
4
|
+
|
|
5
|
+
- hash a state leaf
|
|
6
|
+
- pad and hash a MACI message
|
|
7
|
+
- hash a MACI message and an encryption public key
|
|
8
|
+
|
|
9
|
+
### InvalidMessage
|
|
10
|
+
|
|
11
|
+
```solidity
|
|
12
|
+
error InvalidMessage()
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
custom errors
|
|
16
|
+
|
|
17
|
+
### hashStateLeaf
|
|
18
|
+
|
|
19
|
+
```solidity
|
|
20
|
+
function hashStateLeaf(struct DomainObjs.StateLeaf _stateLeaf) public pure returns (uint256 ciphertext)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
An utility function used to hash a state leaf
|
|
24
|
+
|
|
25
|
+
#### Parameters
|
|
26
|
+
|
|
27
|
+
| Name | Type | Description |
|
|
28
|
+
| ----------- | --------------------------- | --------------------------- |
|
|
29
|
+
| \_stateLeaf | struct DomainObjs.StateLeaf | the state leaf to be hashed |
|
|
30
|
+
|
|
31
|
+
#### Return Values
|
|
32
|
+
|
|
33
|
+
| Name | Type | Description |
|
|
34
|
+
| ---------- | ------- | -------------------------- |
|
|
35
|
+
| ciphertext | uint256 | The hash of the state leaf |
|
|
36
|
+
|
|
37
|
+
### padAndHashMessage
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
function padAndHashMessage(uint256[2] dataToPad, uint256 msgType) public pure returns (struct DomainObjs.Message message, struct DomainObjs.PubKey padKey, uint256 msgHash)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
An utility function used to pad and hash a MACI message
|
|
44
|
+
|
|
45
|
+
#### Parameters
|
|
46
|
+
|
|
47
|
+
| Name | Type | Description |
|
|
48
|
+
| --------- | ---------- | ----------------------- |
|
|
49
|
+
| dataToPad | uint256[2] | the data to be padded |
|
|
50
|
+
| msgType | uint256 | the type of the message |
|
|
51
|
+
|
|
52
|
+
#### Return Values
|
|
53
|
+
|
|
54
|
+
| Name | Type | Description |
|
|
55
|
+
| ------- | ------------------------- | ------------------------------------------------- |
|
|
56
|
+
| message | struct DomainObjs.Message | The padded message |
|
|
57
|
+
| padKey | struct DomainObjs.PubKey | The padding public key |
|
|
58
|
+
| msgHash | uint256 | The hash of the padded message and encryption key |
|
|
59
|
+
|
|
60
|
+
### hashMessageAndEncPubKey
|
|
61
|
+
|
|
62
|
+
```solidity
|
|
63
|
+
function hashMessageAndEncPubKey(struct DomainObjs.Message _message, struct DomainObjs.PubKey _encPubKey) public pure returns (uint256 msgHash)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
An utility function used to hash a MACI message and an encryption public key
|
|
67
|
+
|
|
68
|
+
#### Parameters
|
|
69
|
+
|
|
70
|
+
| Name | Type | Description |
|
|
71
|
+
| ----------- | ------------------------- | -------------------------------------- |
|
|
72
|
+
| \_message | struct DomainObjs.Message | the message to be hashed |
|
|
73
|
+
| \_encPubKey | struct DomainObjs.PubKey | the encryption public key to be hashed |
|
|
74
|
+
|
|
75
|
+
#### Return Values
|
|
76
|
+
|
|
77
|
+
| Name | Type | Description |
|
|
78
|
+
| ------- | ------- | ----------------------------------------------------- |
|
|
79
|
+
| msgHash | uint256 | The hash of the message and the encryption public key |
|