@maci-protocol/website 0.0.0-ci.1e276ed
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,61 @@
|
|
|
1
|
+
# TopupCredit
|
|
2
|
+
|
|
3
|
+
A contract representing a token used to topup a MACI's voter
|
|
4
|
+
credits
|
|
5
|
+
|
|
6
|
+
### DECIMALS
|
|
7
|
+
|
|
8
|
+
```solidity
|
|
9
|
+
uint8 DECIMALS
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### MAXIMUM_AIRDROP_AMOUNT
|
|
13
|
+
|
|
14
|
+
```solidity
|
|
15
|
+
uint256 MAXIMUM_AIRDROP_AMOUNT
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### ExceedLimit
|
|
19
|
+
|
|
20
|
+
```solidity
|
|
21
|
+
error ExceedLimit()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
custom errors
|
|
25
|
+
|
|
26
|
+
### constructor
|
|
27
|
+
|
|
28
|
+
```solidity
|
|
29
|
+
constructor() public payable
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
create a new TopupCredit token
|
|
33
|
+
|
|
34
|
+
### airdropTo
|
|
35
|
+
|
|
36
|
+
```solidity
|
|
37
|
+
function airdropTo(address account, uint256 amount) public
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
mint tokens to an account
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
| Name | Type | Description |
|
|
45
|
+
| ------- | ------- | ----------------------------- |
|
|
46
|
+
| account | address | the account to mint tokens to |
|
|
47
|
+
| amount | uint256 | the amount of tokens to mint |
|
|
48
|
+
|
|
49
|
+
### airdrop
|
|
50
|
+
|
|
51
|
+
```solidity
|
|
52
|
+
function airdrop(uint256 amount) public
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
mint tokens to the contract owner
|
|
56
|
+
|
|
57
|
+
#### Parameters
|
|
58
|
+
|
|
59
|
+
| Name | Type | Description |
|
|
60
|
+
| ------ | ------- | ---------------------------- |
|
|
61
|
+
| amount | uint256 | the amount of tokens to mint |
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# VkRegistry
|
|
2
|
+
|
|
3
|
+
Stores verifying keys for the circuits.
|
|
4
|
+
Each circuit has a signature which is its compile-time constants represented
|
|
5
|
+
as a uint256.
|
|
6
|
+
|
|
7
|
+
### processVks
|
|
8
|
+
|
|
9
|
+
```solidity
|
|
10
|
+
mapping(uint256 => struct SnarkCommon.VerifyingKey) processVks
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### processVkSet
|
|
14
|
+
|
|
15
|
+
```solidity
|
|
16
|
+
mapping(uint256 => bool) processVkSet
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### tallyVks
|
|
20
|
+
|
|
21
|
+
```solidity
|
|
22
|
+
mapping(uint256 => struct SnarkCommon.VerifyingKey) tallyVks
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### tallyVkSet
|
|
26
|
+
|
|
27
|
+
```solidity
|
|
28
|
+
mapping(uint256 => bool) tallyVkSet
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### subsidyVks
|
|
32
|
+
|
|
33
|
+
```solidity
|
|
34
|
+
mapping(uint256 => struct SnarkCommon.VerifyingKey) subsidyVks
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### subsidyVkSet
|
|
38
|
+
|
|
39
|
+
```solidity
|
|
40
|
+
mapping(uint256 => bool) subsidyVkSet
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### ProcessVkSet
|
|
44
|
+
|
|
45
|
+
```solidity
|
|
46
|
+
event ProcessVkSet(uint256 _sig)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### TallyVkSet
|
|
50
|
+
|
|
51
|
+
```solidity
|
|
52
|
+
event TallyVkSet(uint256 _sig)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### SubsidyVkSet
|
|
56
|
+
|
|
57
|
+
```solidity
|
|
58
|
+
event SubsidyVkSet(uint256 _sig)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### ProcessVkAlreadySet
|
|
62
|
+
|
|
63
|
+
```solidity
|
|
64
|
+
error ProcessVkAlreadySet()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### TallyVkAlreadySet
|
|
68
|
+
|
|
69
|
+
```solidity
|
|
70
|
+
error TallyVkAlreadySet()
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### SubsidyVkAlreadySet
|
|
74
|
+
|
|
75
|
+
```solidity
|
|
76
|
+
error SubsidyVkAlreadySet()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### ProcessVkNotSet
|
|
80
|
+
|
|
81
|
+
```solidity
|
|
82
|
+
error ProcessVkNotSet()
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### TallyVkNotSet
|
|
86
|
+
|
|
87
|
+
```solidity
|
|
88
|
+
error TallyVkNotSet()
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### SubsidyVkNotSet
|
|
92
|
+
|
|
93
|
+
```solidity
|
|
94
|
+
error SubsidyVkNotSet()
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### constructor
|
|
98
|
+
|
|
99
|
+
```solidity
|
|
100
|
+
constructor() public payable
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Create a new instance of the VkRegistry contract
|
|
104
|
+
|
|
105
|
+
### isProcessVkSet
|
|
106
|
+
|
|
107
|
+
```solidity
|
|
108
|
+
function isProcessVkSet(uint256 _sig) public view returns (bool isSet)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Check if the process verifying key is set
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
| Name | Type | Description |
|
|
116
|
+
| ----- | ------- | ------------- |
|
|
117
|
+
| \_sig | uint256 | The signature |
|
|
118
|
+
|
|
119
|
+
#### Return Values
|
|
120
|
+
|
|
121
|
+
| Name | Type | Description |
|
|
122
|
+
| ----- | ---- | -------------------------------- |
|
|
123
|
+
| isSet | bool | whether the verifying key is set |
|
|
124
|
+
|
|
125
|
+
### isTallyVkSet
|
|
126
|
+
|
|
127
|
+
```solidity
|
|
128
|
+
function isTallyVkSet(uint256 _sig) public view returns (bool isSet)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Check if the tally verifying key is set
|
|
132
|
+
|
|
133
|
+
#### Parameters
|
|
134
|
+
|
|
135
|
+
| Name | Type | Description |
|
|
136
|
+
| ----- | ------- | ------------- |
|
|
137
|
+
| \_sig | uint256 | The signature |
|
|
138
|
+
|
|
139
|
+
#### Return Values
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description |
|
|
142
|
+
| ----- | ---- | -------------------------------- |
|
|
143
|
+
| isSet | bool | whether the verifying key is set |
|
|
144
|
+
|
|
145
|
+
### isSubsidyVkSet
|
|
146
|
+
|
|
147
|
+
```solidity
|
|
148
|
+
function isSubsidyVkSet(uint256 _sig) public view returns (bool isSet)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Check if the subsidy verifying key is set
|
|
152
|
+
|
|
153
|
+
#### Parameters
|
|
154
|
+
|
|
155
|
+
| Name | Type | Description |
|
|
156
|
+
| ----- | ------- | ------------- |
|
|
157
|
+
| \_sig | uint256 | The signature |
|
|
158
|
+
|
|
159
|
+
#### Return Values
|
|
160
|
+
|
|
161
|
+
| Name | Type | Description |
|
|
162
|
+
| ----- | ---- | -------------------------------- |
|
|
163
|
+
| isSet | bool | whether the verifying key is set |
|
|
164
|
+
|
|
165
|
+
### genProcessVkSig
|
|
166
|
+
|
|
167
|
+
```solidity
|
|
168
|
+
function genProcessVkSig(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize) public pure returns (uint256 sig)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
generate the signature for the process verifying key
|
|
172
|
+
|
|
173
|
+
#### Parameters
|
|
174
|
+
|
|
175
|
+
| Name | Type | Description |
|
|
176
|
+
| --------------------- | ------- | -------------------------- |
|
|
177
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
178
|
+
| \_messageTreeDepth | uint256 | The message tree depth |
|
|
179
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
180
|
+
| \_messageBatchSize | uint256 | The message batch size |
|
|
181
|
+
|
|
182
|
+
### genTallyVkSig
|
|
183
|
+
|
|
184
|
+
```solidity
|
|
185
|
+
function genTallyVkSig(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public pure returns (uint256 sig)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
generate the signature for the tally verifying key
|
|
189
|
+
|
|
190
|
+
#### Parameters
|
|
191
|
+
|
|
192
|
+
| Name | Type | Description |
|
|
193
|
+
| --------------------- | ------- | --------------------------------- |
|
|
194
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
195
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
196
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
197
|
+
|
|
198
|
+
#### Return Values
|
|
199
|
+
|
|
200
|
+
| Name | Type | Description |
|
|
201
|
+
| ---- | ------- | ------------- |
|
|
202
|
+
| sig | uint256 | The signature |
|
|
203
|
+
|
|
204
|
+
### genSubsidyVkSig
|
|
205
|
+
|
|
206
|
+
```solidity
|
|
207
|
+
function genSubsidyVkSig(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public pure returns (uint256 sig)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
generate the signature for the subsidy verifying key
|
|
211
|
+
|
|
212
|
+
#### Parameters
|
|
213
|
+
|
|
214
|
+
| Name | Type | Description |
|
|
215
|
+
| --------------------- | ------- | --------------------------------- |
|
|
216
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
217
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
218
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
219
|
+
|
|
220
|
+
#### Return Values
|
|
221
|
+
|
|
222
|
+
| Name | Type | Description |
|
|
223
|
+
| ---- | ------- | ------------- |
|
|
224
|
+
| sig | uint256 | The signature |
|
|
225
|
+
|
|
226
|
+
### setVerifyingKeys
|
|
227
|
+
|
|
228
|
+
```solidity
|
|
229
|
+
function setVerifyingKeys(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize, struct SnarkCommon.VerifyingKey _processVk, struct SnarkCommon.VerifyingKey _tallyVk) public
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Set the process and tally verifying keys for a certain combination
|
|
233
|
+
of parameters
|
|
234
|
+
|
|
235
|
+
#### Parameters
|
|
236
|
+
|
|
237
|
+
| Name | Type | Description |
|
|
238
|
+
| --------------------- | ------------------------------- | --------------------------------- |
|
|
239
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
240
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
241
|
+
| \_messageTreeDepth | uint256 | The message tree depth |
|
|
242
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
243
|
+
| \_messageBatchSize | uint256 | The message batch size |
|
|
244
|
+
| \_processVk | struct SnarkCommon.VerifyingKey | The process verifying key |
|
|
245
|
+
| \_tallyVk | struct SnarkCommon.VerifyingKey | The tally verifying key |
|
|
246
|
+
|
|
247
|
+
### setSubsidyKeys
|
|
248
|
+
|
|
249
|
+
```solidity
|
|
250
|
+
function setSubsidyKeys(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth, struct SnarkCommon.VerifyingKey _subsidyVk) public
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Set the process verifying key for a certain combination
|
|
254
|
+
of parameters
|
|
255
|
+
|
|
256
|
+
#### Parameters
|
|
257
|
+
|
|
258
|
+
| Name | Type | Description |
|
|
259
|
+
| --------------------- | ------------------------------- | --------------------------------- |
|
|
260
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
261
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
262
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
263
|
+
| \_subsidyVk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
264
|
+
|
|
265
|
+
### hasProcessVk
|
|
266
|
+
|
|
267
|
+
```solidity
|
|
268
|
+
function hasProcessVk(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize) public view returns (bool isSet)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Check if the process verifying key is set
|
|
272
|
+
|
|
273
|
+
#### Parameters
|
|
274
|
+
|
|
275
|
+
| Name | Type | Description |
|
|
276
|
+
| --------------------- | ------- | -------------------------- |
|
|
277
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
278
|
+
| \_messageTreeDepth | uint256 | The message tree depth |
|
|
279
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
280
|
+
| \_messageBatchSize | uint256 | The message batch size |
|
|
281
|
+
|
|
282
|
+
#### Return Values
|
|
283
|
+
|
|
284
|
+
| Name | Type | Description |
|
|
285
|
+
| ----- | ---- | -------------------------------- |
|
|
286
|
+
| isSet | bool | whether the verifying key is set |
|
|
287
|
+
|
|
288
|
+
### getProcessVkBySig
|
|
289
|
+
|
|
290
|
+
```solidity
|
|
291
|
+
function getProcessVkBySig(uint256 _sig) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Get the process verifying key by signature
|
|
295
|
+
|
|
296
|
+
#### Parameters
|
|
297
|
+
|
|
298
|
+
| Name | Type | Description |
|
|
299
|
+
| ----- | ------- | ------------- |
|
|
300
|
+
| \_sig | uint256 | The signature |
|
|
301
|
+
|
|
302
|
+
#### Return Values
|
|
303
|
+
|
|
304
|
+
| Name | Type | Description |
|
|
305
|
+
| ---- | ------------------------------- | ----------------- |
|
|
306
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
307
|
+
|
|
308
|
+
### getProcessVk
|
|
309
|
+
|
|
310
|
+
```solidity
|
|
311
|
+
function getProcessVk(uint256 _stateTreeDepth, uint256 _messageTreeDepth, uint256 _voteOptionTreeDepth, uint256 _messageBatchSize) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Get the process verifying key
|
|
315
|
+
|
|
316
|
+
#### Parameters
|
|
317
|
+
|
|
318
|
+
| Name | Type | Description |
|
|
319
|
+
| --------------------- | ------- | -------------------------- |
|
|
320
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
321
|
+
| \_messageTreeDepth | uint256 | The message tree depth |
|
|
322
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
323
|
+
| \_messageBatchSize | uint256 | The message batch size |
|
|
324
|
+
|
|
325
|
+
#### Return Values
|
|
326
|
+
|
|
327
|
+
| Name | Type | Description |
|
|
328
|
+
| ---- | ------------------------------- | ----------------- |
|
|
329
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
330
|
+
|
|
331
|
+
### hasTallyVk
|
|
332
|
+
|
|
333
|
+
```solidity
|
|
334
|
+
function hasTallyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public view returns (bool isSet)
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Check if the tally verifying key is set
|
|
338
|
+
|
|
339
|
+
#### Parameters
|
|
340
|
+
|
|
341
|
+
| Name | Type | Description |
|
|
342
|
+
| --------------------- | ------- | --------------------------------- |
|
|
343
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
344
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
345
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
346
|
+
|
|
347
|
+
#### Return Values
|
|
348
|
+
|
|
349
|
+
| Name | Type | Description |
|
|
350
|
+
| ----- | ---- | -------------------------------- |
|
|
351
|
+
| isSet | bool | whether the verifying key is set |
|
|
352
|
+
|
|
353
|
+
### getTallyVkBySig
|
|
354
|
+
|
|
355
|
+
```solidity
|
|
356
|
+
function getTallyVkBySig(uint256 _sig) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Get the tally verifying key by signature
|
|
360
|
+
|
|
361
|
+
#### Parameters
|
|
362
|
+
|
|
363
|
+
| Name | Type | Description |
|
|
364
|
+
| ----- | ------- | ------------- |
|
|
365
|
+
| \_sig | uint256 | The signature |
|
|
366
|
+
|
|
367
|
+
#### Return Values
|
|
368
|
+
|
|
369
|
+
| Name | Type | Description |
|
|
370
|
+
| ---- | ------------------------------- | ----------------- |
|
|
371
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
372
|
+
|
|
373
|
+
### getTallyVk
|
|
374
|
+
|
|
375
|
+
```solidity
|
|
376
|
+
function getTallyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Get the tally verifying key
|
|
380
|
+
|
|
381
|
+
#### Parameters
|
|
382
|
+
|
|
383
|
+
| Name | Type | Description |
|
|
384
|
+
| --------------------- | ------- | --------------------------------- |
|
|
385
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
386
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
387
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
388
|
+
|
|
389
|
+
#### Return Values
|
|
390
|
+
|
|
391
|
+
| Name | Type | Description |
|
|
392
|
+
| ---- | ------------------------------- | ----------------- |
|
|
393
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
394
|
+
|
|
395
|
+
### hasSubsidyVk
|
|
396
|
+
|
|
397
|
+
```solidity
|
|
398
|
+
function hasSubsidyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public view returns (bool isSet)
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Check if the subsidy verifying key is set
|
|
402
|
+
|
|
403
|
+
#### Parameters
|
|
404
|
+
|
|
405
|
+
| Name | Type | Description |
|
|
406
|
+
| --------------------- | ------- | --------------------------------- |
|
|
407
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
408
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
409
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
410
|
+
|
|
411
|
+
#### Return Values
|
|
412
|
+
|
|
413
|
+
| Name | Type | Description |
|
|
414
|
+
| ----- | ---- | -------------------------------- |
|
|
415
|
+
| isSet | bool | whether the verifying key is set |
|
|
416
|
+
|
|
417
|
+
### getSubsidyVkBySig
|
|
418
|
+
|
|
419
|
+
```solidity
|
|
420
|
+
function getSubsidyVkBySig(uint256 _sig) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Get the subsidy verifying key by signature
|
|
424
|
+
|
|
425
|
+
#### Parameters
|
|
426
|
+
|
|
427
|
+
| Name | Type | Description |
|
|
428
|
+
| ----- | ------- | ------------- |
|
|
429
|
+
| \_sig | uint256 | The signature |
|
|
430
|
+
|
|
431
|
+
#### Return Values
|
|
432
|
+
|
|
433
|
+
| Name | Type | Description |
|
|
434
|
+
| ---- | ------------------------------- | ----------------- |
|
|
435
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
436
|
+
|
|
437
|
+
### getSubsidyVk
|
|
438
|
+
|
|
439
|
+
```solidity
|
|
440
|
+
function getSubsidyVk(uint256 _stateTreeDepth, uint256 _intStateTreeDepth, uint256 _voteOptionTreeDepth) public view returns (struct SnarkCommon.VerifyingKey vk)
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Get the subsidy verifying key
|
|
444
|
+
|
|
445
|
+
#### Parameters
|
|
446
|
+
|
|
447
|
+
| Name | Type | Description |
|
|
448
|
+
| --------------------- | ------- | --------------------------------- |
|
|
449
|
+
| \_stateTreeDepth | uint256 | The state tree depth |
|
|
450
|
+
| \_intStateTreeDepth | uint256 | The intermediate state tree depth |
|
|
451
|
+
| \_voteOptionTreeDepth | uint256 | The vote option tree depth |
|
|
452
|
+
|
|
453
|
+
#### Return Values
|
|
454
|
+
|
|
455
|
+
| Name | Type | Description |
|
|
456
|
+
| ---- | ------------------------------- | ----------------- |
|
|
457
|
+
| vk | struct SnarkCommon.VerifyingKey | The verifying key |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# HasherBenchmarks
|
|
2
|
+
|
|
3
|
+
A contract used to benchmark the poseidon hash function
|
|
4
|
+
|
|
5
|
+
### hash5Benchmark
|
|
6
|
+
|
|
7
|
+
```solidity
|
|
8
|
+
function hash5Benchmark(uint256[5] array) public pure returns (uint256 result)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Benchmark the poseidon hash function with 5 inputs
|
|
12
|
+
|
|
13
|
+
#### Parameters
|
|
14
|
+
|
|
15
|
+
| Name | Type | Description |
|
|
16
|
+
| ----- | ---------- | --------------------------- |
|
|
17
|
+
| array | uint256[5] | The array of inputs to hash |
|
|
18
|
+
|
|
19
|
+
#### Return Values
|
|
20
|
+
|
|
21
|
+
| Name | Type | Description |
|
|
22
|
+
| ------ | ------- | ---------------------- |
|
|
23
|
+
| result | uint256 | The hash of the inputs |
|
|
24
|
+
|
|
25
|
+
### hashLeftRightBenchmark
|
|
26
|
+
|
|
27
|
+
```solidity
|
|
28
|
+
function hashLeftRightBenchmark(uint256 _left, uint256 _right) public pure returns (uint256 result)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Benchmark the poseidon hash function with 2 inputs
|
|
32
|
+
|
|
33
|
+
#### Parameters
|
|
34
|
+
|
|
35
|
+
| Name | Type | Description |
|
|
36
|
+
| ------- | ------- | ----------------------- |
|
|
37
|
+
| \_left | uint256 | The left input to hash |
|
|
38
|
+
| \_right | uint256 | The right input to hash |
|
|
39
|
+
|
|
40
|
+
#### Return Values
|
|
41
|
+
|
|
42
|
+
| Name | Type | Description |
|
|
43
|
+
| ------ | ------- | -------------------------- |
|
|
44
|
+
| result | uint256 | The hash of the two inputs |
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Hasher
|
|
2
|
+
|
|
3
|
+
A SHA256 hash function for any number of input elements, and Poseidon hash
|
|
4
|
+
functions for 2, 3, 4, 5, and 12 input elements.
|
|
5
|
+
|
|
6
|
+
### sha256Hash
|
|
7
|
+
|
|
8
|
+
```solidity
|
|
9
|
+
function sha256Hash(uint256[] array) public pure returns (uint256 result)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Computes the SHA256 hash of an array of uint256 elements.
|
|
13
|
+
|
|
14
|
+
#### Parameters
|
|
15
|
+
|
|
16
|
+
| Name | Type | Description |
|
|
17
|
+
| ----- | --------- | ------------------------------ |
|
|
18
|
+
| array | uint256[] | The array of uint256 elements. |
|
|
19
|
+
|
|
20
|
+
#### Return Values
|
|
21
|
+
|
|
22
|
+
| Name | Type | Description |
|
|
23
|
+
| ------ | ------- | ----------------------------- |
|
|
24
|
+
| result | uint256 | The SHA256 hash of the array. |
|
|
25
|
+
|
|
26
|
+
### hash2
|
|
27
|
+
|
|
28
|
+
```solidity
|
|
29
|
+
function hash2(uint256[2] array) public pure returns (uint256 result)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Computes the Poseidon hash of two uint256 elements.
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Name | Type | Description |
|
|
37
|
+
| ----- | ---------- | --------------------------------- |
|
|
38
|
+
| array | uint256[2] | An array of two uint256 elements. |
|
|
39
|
+
|
|
40
|
+
#### Return Values
|
|
41
|
+
|
|
42
|
+
| Name | Type | Description |
|
|
43
|
+
| ------ | ------- | -------------------------------------- |
|
|
44
|
+
| result | uint256 | The Poseidon hash of the two elements. |
|
|
45
|
+
|
|
46
|
+
### hash3
|
|
47
|
+
|
|
48
|
+
```solidity
|
|
49
|
+
function hash3(uint256[3] array) public pure returns (uint256 result)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Computes the Poseidon hash of three uint256 elements.
|
|
53
|
+
|
|
54
|
+
#### Parameters
|
|
55
|
+
|
|
56
|
+
| Name | Type | Description |
|
|
57
|
+
| ----- | ---------- | ----------------------------------- |
|
|
58
|
+
| array | uint256[3] | An array of three uint256 elements. |
|
|
59
|
+
|
|
60
|
+
#### Return Values
|
|
61
|
+
|
|
62
|
+
| Name | Type | Description |
|
|
63
|
+
| ------ | ------- | ---------------------------------------- |
|
|
64
|
+
| result | uint256 | The Poseidon hash of the three elements. |
|
|
65
|
+
|
|
66
|
+
### hash4
|
|
67
|
+
|
|
68
|
+
```solidity
|
|
69
|
+
function hash4(uint256[4] array) public pure returns (uint256 result)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Computes the Poseidon hash of four uint256 elements.
|
|
73
|
+
|
|
74
|
+
#### Parameters
|
|
75
|
+
|
|
76
|
+
| Name | Type | Description |
|
|
77
|
+
| ----- | ---------- | ---------------------------------- |
|
|
78
|
+
| array | uint256[4] | An array of four uint256 elements. |
|
|
79
|
+
|
|
80
|
+
#### Return Values
|
|
81
|
+
|
|
82
|
+
| Name | Type | Description |
|
|
83
|
+
| ------ | ------- | --------------------------------------- |
|
|
84
|
+
| result | uint256 | The Poseidon hash of the four elements. |
|
|
85
|
+
|
|
86
|
+
### hash5
|
|
87
|
+
|
|
88
|
+
```solidity
|
|
89
|
+
function hash5(uint256[5] array) public pure returns (uint256 result)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Computes the Poseidon hash of five uint256 elements.
|
|
93
|
+
|
|
94
|
+
#### Parameters
|
|
95
|
+
|
|
96
|
+
| Name | Type | Description |
|
|
97
|
+
| ----- | ---------- | ---------------------------------- |
|
|
98
|
+
| array | uint256[5] | An array of five uint256 elements. |
|
|
99
|
+
|
|
100
|
+
#### Return Values
|
|
101
|
+
|
|
102
|
+
| Name | Type | Description |
|
|
103
|
+
| ------ | ------- | --------------------------------------- |
|
|
104
|
+
| result | uint256 | The Poseidon hash of the five elements. |
|
|
105
|
+
|
|
106
|
+
### hashLeftRight
|
|
107
|
+
|
|
108
|
+
```solidity
|
|
109
|
+
function hashLeftRight(uint256 left, uint256 right) public pure returns (uint256 result)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Computes the Poseidon hash of two uint256 elements.
|
|
113
|
+
|
|
114
|
+
#### Parameters
|
|
115
|
+
|
|
116
|
+
| Name | Type | Description |
|
|
117
|
+
| ----- | ------- | --------------------------- |
|
|
118
|
+
| left | uint256 | the first element to hash. |
|
|
119
|
+
| right | uint256 | the second element to hash. |
|
|
120
|
+
|
|
121
|
+
#### Return Values
|
|
122
|
+
|
|
123
|
+
| Name | Type | Description |
|
|
124
|
+
| ------ | ------- | -------------------------------------- |
|
|
125
|
+
| result | uint256 | The Poseidon hash of the two elements. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# MockVerifier
|
|
2
|
+
|
|
3
|
+
a MockVerifier to be used for testing
|
|
4
|
+
|
|
5
|
+
### verify
|
|
6
|
+
|
|
7
|
+
```solidity
|
|
8
|
+
function verify(uint256[8], struct SnarkCommon.VerifyingKey, uint256) public pure returns (bool result)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Verify a zk-SNARK proof (test only return always true)
|
|
12
|
+
|
|
13
|
+
#### Return Values
|
|
14
|
+
|
|
15
|
+
| Name | Type | Description |
|
|
16
|
+
| ------ | ---- | ------------------------------------------------------------- |
|
|
17
|
+
| result | bool | Whether the proof is valid given the verifying key and public |
|