@maci-protocol/sdk 0.0.0-ci.01622be

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.
Files changed (314) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/LICENSE +21 -0
  3. package/README.md +12 -0
  4. package/build/package.json +65 -0
  5. package/build/ts/browser/index.d.ts +13 -0
  6. package/build/ts/browser/index.d.ts.map +1 -0
  7. package/build/ts/browser/index.js +38 -0
  8. package/build/ts/browser/index.js.map +1 -0
  9. package/build/ts/browser/joinPoll.d.ts +10 -0
  10. package/build/ts/browser/joinPoll.d.ts.map +1 -0
  11. package/build/ts/browser/joinPoll.js +88 -0
  12. package/build/ts/browser/joinPoll.js.map +1 -0
  13. package/build/ts/browser/utils.d.ts +18 -0
  14. package/build/ts/browser/utils.d.ts.map +1 -0
  15. package/build/ts/browser/utils.js +37 -0
  16. package/build/ts/browser/utils.js.map +1 -0
  17. package/build/ts/deploy/index.d.ts +6 -0
  18. package/build/ts/deploy/index.d.ts.map +1 -0
  19. package/build/ts/deploy/index.js +12 -0
  20. package/build/ts/deploy/index.js.map +1 -0
  21. package/build/ts/deploy/maci.d.ts +8 -0
  22. package/build/ts/deploy/maci.d.ts.map +1 -0
  23. package/build/ts/deploy/maci.js +87 -0
  24. package/build/ts/deploy/maci.js.map +1 -0
  25. package/build/ts/deploy/poll.d.ts +8 -0
  26. package/build/ts/deploy/poll.d.ts.map +1 -0
  27. package/build/ts/deploy/poll.js +114 -0
  28. package/build/ts/deploy/poll.js.map +1 -0
  29. package/build/ts/deploy/types.d.ts +217 -0
  30. package/build/ts/deploy/types.d.ts.map +1 -0
  31. package/build/ts/deploy/types.js +3 -0
  32. package/build/ts/deploy/types.js.map +1 -0
  33. package/build/ts/deploy/utils.d.ts +11 -0
  34. package/build/ts/deploy/utils.d.ts.map +1 -0
  35. package/build/ts/deploy/utils.js +22 -0
  36. package/build/ts/deploy/utils.js.map +1 -0
  37. package/build/ts/deploy/verifyingKeysRegistry.d.ts +7 -0
  38. package/build/ts/deploy/verifyingKeysRegistry.d.ts.map +1 -0
  39. package/build/ts/deploy/verifyingKeysRegistry.js +14 -0
  40. package/build/ts/deploy/verifyingKeysRegistry.js.map +1 -0
  41. package/build/ts/index.d.ts +16 -0
  42. package/build/ts/index.d.ts.map +1 -0
  43. package/build/ts/index.js +86 -0
  44. package/build/ts/index.js.map +1 -0
  45. package/build/ts/maci/index.d.ts +6 -0
  46. package/build/ts/maci/index.d.ts.map +1 -0
  47. package/build/ts/maci/index.js +17 -0
  48. package/build/ts/maci/index.js.map +1 -0
  49. package/build/ts/maci/merge.d.ts +9 -0
  50. package/build/ts/maci/merge.d.ts.map +1 -0
  51. package/build/ts/maci/merge.js +29 -0
  52. package/build/ts/maci/merge.js.map +1 -0
  53. package/build/ts/maci/policy.d.ts +53 -0
  54. package/build/ts/maci/policy.d.ts.map +1 -0
  55. package/build/ts/maci/policy.js +166 -0
  56. package/build/ts/maci/policy.js.map +1 -0
  57. package/build/ts/maci/state.d.ts +8 -0
  58. package/build/ts/maci/state.d.ts.map +1 -0
  59. package/build/ts/maci/state.js +82 -0
  60. package/build/ts/maci/state.js.map +1 -0
  61. package/build/ts/maci/types.d.ts +208 -0
  62. package/build/ts/maci/types.d.ts.map +1 -0
  63. package/build/ts/maci/types.js +20 -0
  64. package/build/ts/maci/types.js.map +1 -0
  65. package/build/ts/maciKeys/__tests__/keypair.test.d.ts +2 -0
  66. package/build/ts/maciKeys/__tests__/keypair.test.d.ts.map +1 -0
  67. package/build/ts/maciKeys/__tests__/keypair.test.js +24 -0
  68. package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -0
  69. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts +2 -0
  70. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts.map +1 -0
  71. package/build/ts/maciKeys/__tests__/publicKeys.test.js +22 -0
  72. package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -0
  73. package/build/ts/maciKeys/index.d.ts +4 -0
  74. package/build/ts/maciKeys/index.d.ts.map +1 -0
  75. package/build/ts/maciKeys/index.js +8 -0
  76. package/build/ts/maciKeys/index.js.map +1 -0
  77. package/build/ts/maciKeys/keypair.d.ts +9 -0
  78. package/build/ts/maciKeys/keypair.d.ts.map +1 -0
  79. package/build/ts/maciKeys/keypair.js +20 -0
  80. package/build/ts/maciKeys/keypair.js.map +1 -0
  81. package/build/ts/maciKeys/publicKeys.d.ts +8 -0
  82. package/build/ts/maciKeys/publicKeys.d.ts.map +1 -0
  83. package/build/ts/maciKeys/publicKeys.js +23 -0
  84. package/build/ts/maciKeys/publicKeys.js.map +1 -0
  85. package/build/ts/maciKeys/types.d.ts +23 -0
  86. package/build/ts/maciKeys/types.d.ts.map +1 -0
  87. package/build/ts/maciKeys/types.js +3 -0
  88. package/build/ts/maciKeys/types.js.map +1 -0
  89. package/build/ts/poll/index.d.ts +4 -0
  90. package/build/ts/poll/index.d.ts.map +1 -0
  91. package/build/ts/poll/index.js +9 -0
  92. package/build/ts/poll/index.js.map +1 -0
  93. package/build/ts/poll/poll.d.ts +14 -0
  94. package/build/ts/poll/poll.d.ts.map +1 -0
  95. package/build/ts/poll/poll.js +62 -0
  96. package/build/ts/poll/poll.js.map +1 -0
  97. package/build/ts/poll/types.d.ts +151 -0
  98. package/build/ts/poll/types.d.ts.map +1 -0
  99. package/build/ts/poll/types.js +3 -0
  100. package/build/ts/poll/types.js.map +1 -0
  101. package/build/ts/poll/utils.d.ts +9 -0
  102. package/build/ts/poll/utils.d.ts.map +1 -0
  103. package/build/ts/poll/utils.js +43 -0
  104. package/build/ts/poll/utils.js.map +1 -0
  105. package/build/ts/proof/__tests__/download.test.d.ts +2 -0
  106. package/build/ts/proof/__tests__/download.test.d.ts.map +1 -0
  107. package/build/ts/proof/__tests__/download.test.js +53 -0
  108. package/build/ts/proof/__tests__/download.test.js.map +1 -0
  109. package/build/ts/proof/download.d.ts +9 -0
  110. package/build/ts/proof/download.d.ts.map +1 -0
  111. package/build/ts/proof/download.js +47 -0
  112. package/build/ts/proof/download.js.map +1 -0
  113. package/build/ts/proof/generate.d.ts +8 -0
  114. package/build/ts/proof/generate.d.ts.map +1 -0
  115. package/build/ts/proof/generate.js +127 -0
  116. package/build/ts/proof/generate.js.map +1 -0
  117. package/build/ts/proof/index.d.ts +4 -0
  118. package/build/ts/proof/index.d.ts.map +1 -0
  119. package/build/ts/proof/index.js +8 -0
  120. package/build/ts/proof/index.js.map +1 -0
  121. package/build/ts/proof/prove.d.ts +8 -0
  122. package/build/ts/proof/prove.d.ts.map +1 -0
  123. package/build/ts/proof/prove.js +81 -0
  124. package/build/ts/proof/prove.js.map +1 -0
  125. package/build/ts/proof/types.d.ts +201 -0
  126. package/build/ts/proof/types.d.ts.map +1 -0
  127. package/build/ts/proof/types.js +3 -0
  128. package/build/ts/proof/types.js.map +1 -0
  129. package/build/ts/proof/utils.d.ts +10 -0
  130. package/build/ts/proof/utils.d.ts.map +1 -0
  131. package/build/ts/proof/utils.js +24 -0
  132. package/build/ts/proof/utils.js.map +1 -0
  133. package/build/ts/relayer/__tests__/messages.test.d.ts +2 -0
  134. package/build/ts/relayer/__tests__/messages.test.d.ts.map +1 -0
  135. package/build/ts/relayer/__tests__/messages.test.js +76 -0
  136. package/build/ts/relayer/__tests__/messages.test.js.map +1 -0
  137. package/build/ts/relayer/__tests__/utils.test.d.ts +2 -0
  138. package/build/ts/relayer/__tests__/utils.test.d.ts.map +1 -0
  139. package/build/ts/relayer/__tests__/utils.test.js +73 -0
  140. package/build/ts/relayer/__tests__/utils.test.js.map +1 -0
  141. package/build/ts/relayer/index.d.ts +3 -0
  142. package/build/ts/relayer/index.d.ts.map +1 -0
  143. package/build/ts/relayer/index.js +8 -0
  144. package/build/ts/relayer/index.js.map +1 -0
  145. package/build/ts/relayer/messages.d.ts +23 -0
  146. package/build/ts/relayer/messages.d.ts.map +1 -0
  147. package/build/ts/relayer/messages.js +66 -0
  148. package/build/ts/relayer/messages.js.map +1 -0
  149. package/build/ts/relayer/types.d.ts +168 -0
  150. package/build/ts/relayer/types.d.ts.map +1 -0
  151. package/build/ts/relayer/types.js +3 -0
  152. package/build/ts/relayer/types.js.map +1 -0
  153. package/build/ts/relayer/utils.d.ts +12 -0
  154. package/build/ts/relayer/utils.d.ts.map +1 -0
  155. package/build/ts/relayer/utils.js +37 -0
  156. package/build/ts/relayer/utils.js.map +1 -0
  157. package/build/ts/tally/commitments.d.ts +9 -0
  158. package/build/ts/tally/commitments.d.ts.map +1 -0
  159. package/build/ts/tally/commitments.js +43 -0
  160. package/build/ts/tally/commitments.js.map +1 -0
  161. package/build/ts/tally/index.d.ts +5 -0
  162. package/build/ts/tally/index.d.ts.map +1 -0
  163. package/build/ts/tally/index.js +11 -0
  164. package/build/ts/tally/index.js.map +1 -0
  165. package/build/ts/tally/results.d.ts +14 -0
  166. package/build/ts/tally/results.d.ts.map +1 -0
  167. package/build/ts/tally/results.js +44 -0
  168. package/build/ts/tally/results.js.map +1 -0
  169. package/build/ts/tally/types.d.ts +206 -0
  170. package/build/ts/tally/types.d.ts.map +1 -0
  171. package/build/ts/tally/types.js +3 -0
  172. package/build/ts/tally/types.js.map +1 -0
  173. package/build/ts/tally/utils.d.ts +24 -0
  174. package/build/ts/tally/utils.d.ts.map +1 -0
  175. package/build/ts/tally/utils.js +50 -0
  176. package/build/ts/tally/utils.js.map +1 -0
  177. package/build/ts/tally/verification.d.ts +7 -0
  178. package/build/ts/tally/verification.d.ts.map +1 -0
  179. package/build/ts/tally/verification.js +62 -0
  180. package/build/ts/tally/verification.js.map +1 -0
  181. package/build/ts/trees/index.d.ts +3 -0
  182. package/build/ts/trees/index.d.ts.map +1 -0
  183. package/build/ts/trees/index.js +7 -0
  184. package/build/ts/trees/index.js.map +1 -0
  185. package/build/ts/trees/stateTree.d.ts +27 -0
  186. package/build/ts/trees/stateTree.d.ts.map +1 -0
  187. package/build/ts/trees/stateTree.js +104 -0
  188. package/build/ts/trees/stateTree.js.map +1 -0
  189. package/build/ts/trees/types.d.ts +55 -0
  190. package/build/ts/trees/types.d.ts.map +1 -0
  191. package/build/ts/trees/types.js +3 -0
  192. package/build/ts/trees/types.js.map +1 -0
  193. package/build/ts/user/index.d.ts +5 -0
  194. package/build/ts/user/index.d.ts.map +1 -0
  195. package/build/ts/user/index.js +17 -0
  196. package/build/ts/user/index.js.map +1 -0
  197. package/build/ts/user/joinPoll.d.ts +8 -0
  198. package/build/ts/user/joinPoll.d.ts.map +1 -0
  199. package/build/ts/user/joinPoll.js +84 -0
  200. package/build/ts/user/joinPoll.js.map +1 -0
  201. package/build/ts/user/signup.d.ts +20 -0
  202. package/build/ts/user/signup.d.ts.map +1 -0
  203. package/build/ts/user/signup.js +79 -0
  204. package/build/ts/user/signup.js.map +1 -0
  205. package/build/ts/user/types.d.ts +464 -0
  206. package/build/ts/user/types.d.ts.map +1 -0
  207. package/build/ts/user/types.js +3 -0
  208. package/build/ts/user/types.js.map +1 -0
  209. package/build/ts/user/utils.d.ts +80 -0
  210. package/build/ts/user/utils.d.ts.map +1 -0
  211. package/build/ts/user/utils.js +253 -0
  212. package/build/ts/user/utils.js.map +1 -0
  213. package/build/ts/utils/cid.d.ts +23 -0
  214. package/build/ts/utils/cid.d.ts.map +1 -0
  215. package/build/ts/utils/cid.js +72 -0
  216. package/build/ts/utils/cid.js.map +1 -0
  217. package/build/ts/utils/constants.d.ts +2 -0
  218. package/build/ts/utils/constants.d.ts.map +1 -0
  219. package/build/ts/utils/constants.js +5 -0
  220. package/build/ts/utils/constants.js.map +1 -0
  221. package/build/ts/utils/contracts.d.ts +15 -0
  222. package/build/ts/utils/contracts.d.ts.map +1 -0
  223. package/build/ts/utils/contracts.js +26 -0
  224. package/build/ts/utils/contracts.js.map +1 -0
  225. package/build/ts/utils/files.d.ts +9 -0
  226. package/build/ts/utils/files.d.ts.map +1 -0
  227. package/build/ts/utils/files.js +20 -0
  228. package/build/ts/utils/files.js.map +1 -0
  229. package/build/ts/utils/formatting.d.ts +8 -0
  230. package/build/ts/utils/formatting.d.ts.map +1 -0
  231. package/build/ts/utils/formatting.js +11 -0
  232. package/build/ts/utils/formatting.js.map +1 -0
  233. package/build/ts/utils/fundWallet.d.ts +7 -0
  234. package/build/ts/utils/fundWallet.d.ts.map +1 -0
  235. package/build/ts/utils/fundWallet.js +20 -0
  236. package/build/ts/utils/fundWallet.js.map +1 -0
  237. package/build/ts/utils/index.d.ts +12 -0
  238. package/build/ts/utils/index.d.ts.map +1 -0
  239. package/build/ts/utils/index.js +28 -0
  240. package/build/ts/utils/index.js.map +1 -0
  241. package/build/ts/utils/params.d.ts +7 -0
  242. package/build/ts/utils/params.d.ts.map +1 -0
  243. package/build/ts/utils/params.js +19 -0
  244. package/build/ts/utils/params.js.map +1 -0
  245. package/build/ts/utils/proofs.d.ts +13 -0
  246. package/build/ts/utils/proofs.d.ts.map +1 -0
  247. package/build/ts/utils/proofs.js +41 -0
  248. package/build/ts/utils/proofs.js.map +1 -0
  249. package/build/ts/utils/timeTravel.d.ts +7 -0
  250. package/build/ts/utils/timeTravel.d.ts.map +1 -0
  251. package/build/ts/utils/timeTravel.js +14 -0
  252. package/build/ts/utils/timeTravel.js.map +1 -0
  253. package/build/ts/utils/trees.d.ts +13 -0
  254. package/build/ts/utils/trees.d.ts.map +1 -0
  255. package/build/ts/utils/trees.js +30 -0
  256. package/build/ts/utils/trees.js.map +1 -0
  257. package/build/ts/utils/types.d.ts +71 -0
  258. package/build/ts/utils/types.d.ts.map +1 -0
  259. package/build/ts/utils/types.js +3 -0
  260. package/build/ts/utils/types.js.map +1 -0
  261. package/build/ts/utils/utils.d.ts +24 -0
  262. package/build/ts/utils/utils.d.ts.map +1 -0
  263. package/build/ts/utils/utils.js +49 -0
  264. package/build/ts/utils/utils.js.map +1 -0
  265. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +10 -0
  266. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -0
  267. package/build/ts/verifyingKeys/checkVerifyingKeys.js +66 -0
  268. package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -0
  269. package/build/ts/verifyingKeys/index.d.ts +5 -0
  270. package/build/ts/verifyingKeys/index.d.ts.map +1 -0
  271. package/build/ts/verifyingKeys/index.js +13 -0
  272. package/build/ts/verifyingKeys/index.js.map +1 -0
  273. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +7 -0
  274. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -0
  275. package/build/ts/verifyingKeys/setVerifyingKeys.js +84 -0
  276. package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -0
  277. package/build/ts/verifyingKeys/types.d.ts +235 -0
  278. package/build/ts/verifyingKeys/types.d.ts.map +1 -0
  279. package/build/ts/verifyingKeys/types.js +3 -0
  280. package/build/ts/verifyingKeys/types.js.map +1 -0
  281. package/build/ts/verifyingKeys/utils.d.ts +29 -0
  282. package/build/ts/verifyingKeys/utils.d.ts.map +1 -0
  283. package/build/ts/verifyingKeys/utils.js +116 -0
  284. package/build/ts/verifyingKeys/utils.js.map +1 -0
  285. package/build/ts/vote/generate.d.ts +8 -0
  286. package/build/ts/vote/generate.d.ts.map +1 -0
  287. package/build/ts/vote/generate.js +46 -0
  288. package/build/ts/vote/generate.js.map +1 -0
  289. package/build/ts/vote/index.d.ts +6 -0
  290. package/build/ts/vote/index.d.ts.map +1 -0
  291. package/build/ts/vote/index.js +15 -0
  292. package/build/ts/vote/index.js.map +1 -0
  293. package/build/ts/vote/invalidate.d.ts +13 -0
  294. package/build/ts/vote/invalidate.d.ts.map +1 -0
  295. package/build/ts/vote/invalidate.js +44 -0
  296. package/build/ts/vote/invalidate.js.map +1 -0
  297. package/build/ts/vote/publish.d.ts +14 -0
  298. package/build/ts/vote/publish.d.ts.map +1 -0
  299. package/build/ts/vote/publish.js +88 -0
  300. package/build/ts/vote/publish.js.map +1 -0
  301. package/build/ts/vote/submit.d.ts +13 -0
  302. package/build/ts/vote/submit.d.ts.map +1 -0
  303. package/build/ts/vote/submit.js +36 -0
  304. package/build/ts/vote/submit.js.map +1 -0
  305. package/build/ts/vote/types.d.ts +238 -0
  306. package/build/ts/vote/types.d.ts.map +1 -0
  307. package/build/ts/vote/types.js +3 -0
  308. package/build/ts/vote/types.js.map +1 -0
  309. package/build/ts/vote/utils.d.ts +16 -0
  310. package/build/ts/vote/utils.d.ts.map +1 -0
  311. package/build/ts/vote/utils.js +26 -0
  312. package/build/ts/vote/utils.js.map +1 -0
  313. package/build/tsconfig.build.tsbuildinfo +1 -0
  314. package/package.json +66 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../../ts/utils/params.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,EAC7B,cAAc,EACd,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,GACD,EAAW,EAAE;IAC5B,gBAAgB;IAChB,IAAI,cAAc,GAAG,CAAC,IAAI,6BAA6B,GAAG,CAAC,IAAI,mBAAmB,GAAG,CAAC,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;QAC/G,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,cAAc,GAAG,6BAA6B,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB"}
@@ -0,0 +1,13 @@
1
+ import type { TCircuitInputs } from "./types";
2
+ /**
3
+ * Generate and verify poll proof
4
+ * @param inputs - the inputs to the circuit
5
+ * @param zkeyPath - the path to the zkey
6
+ * @param useWasm - whether we want to use the wasm witness or not
7
+ * @param rapidsnarkExePath - the path to the rapidnsark binary
8
+ * @param witnessExePath - the path to the compiled witness binary
9
+ * @param wasmPath - the path to the wasm witness
10
+ * @returns proof - an array of strings
11
+ */
12
+ export declare const generateAndVerifyProof: (inputs: TCircuitInputs, zkeyPath: string, useWasm: boolean | undefined, rapidsnarkExePath: string | undefined, witnessExePath: string | undefined, wasmPath: string | undefined) => Promise<string[]>;
13
+ //# sourceMappingURL=proofs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proofs.d.ts","sourceRoot":"","sources":["../../../ts/utils/proofs.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,cAAc,EACtB,UAAU,MAAM,EAChB,SAAS,OAAO,GAAG,SAAS,EAC5B,mBAAmB,MAAM,GAAG,SAAS,EACrC,gBAAgB,MAAM,GAAG,SAAS,EAClC,UAAU,MAAM,GAAG,SAAS,KAC3B,OAAO,CAAC,MAAM,EAAE,CA4BlB,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateAndVerifyProof = void 0;
4
+ const contracts_1 = require("@maci-protocol/contracts");
5
+ /**
6
+ * Generate and verify poll proof
7
+ * @param inputs - the inputs to the circuit
8
+ * @param zkeyPath - the path to the zkey
9
+ * @param useWasm - whether we want to use the wasm witness or not
10
+ * @param rapidsnarkExePath - the path to the rapidnsark binary
11
+ * @param witnessExePath - the path to the compiled witness binary
12
+ * @param wasmPath - the path to the wasm witness
13
+ * @returns proof - an array of strings
14
+ */
15
+ const generateAndVerifyProof = async (inputs, zkeyPath, useWasm, rapidsnarkExePath, witnessExePath, wasmPath) => {
16
+ let r;
17
+ const verifyingKey = await (0, contracts_1.extractVerifyingKey)(zkeyPath);
18
+ if (useWasm === true || useWasm === undefined) {
19
+ r = await (0, contracts_1.generateProofSnarkjs)({
20
+ inputs,
21
+ zkeyPath,
22
+ wasmPath,
23
+ });
24
+ }
25
+ else {
26
+ r = await (0, contracts_1.generateProofRapidSnark)({
27
+ inputs,
28
+ zkeyPath,
29
+ rapidsnarkExePath,
30
+ witnessExePath,
31
+ });
32
+ }
33
+ // verify it
34
+ const isValid = await (0, contracts_1.verifyProof)(r.publicSignals, r.proof, verifyingKey);
35
+ if (!isValid) {
36
+ throw new Error("Generated an invalid proof");
37
+ }
38
+ return (0, contracts_1.formatProofForVerifierContract)(r.proof);
39
+ };
40
+ exports.generateAndVerifyProof = generateAndVerifyProof;
41
+ //# sourceMappingURL=proofs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proofs.js","sourceRoot":"","sources":["../../../ts/utils/proofs.ts"],"names":[],"mappings":";;;AAAA,wDAOkC;AAIlC;;;;;;;;;GASG;AACI,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EACtB,QAAgB,EAChB,OAA4B,EAC5B,iBAAqC,EACrC,cAAkC,EAClC,QAA4B,EACT,EAAE;IACrB,IAAI,CAAkB,CAAC;IAEvB,MAAM,YAAY,GAAG,MAAM,IAAA,+BAAmB,EAAC,QAAQ,CAAC,CAAC;IAEzD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,CAAC,GAAG,MAAM,IAAA,gCAAoB,EAAC;YAC7B,MAAM;YACN,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,CAAC,GAAG,MAAM,IAAA,mCAAuB,EAAC;YAChC,MAAM;YACN,QAAQ;YACR,iBAAiB;YACjB,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,YAAY;IACZ,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAW,EAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAE1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,IAAA,0CAA8B,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC;AAnCW,QAAA,sBAAsB,0BAmCjC"}
@@ -0,0 +1,7 @@
1
+ import type { ITimeTravelArgs } from "./types";
2
+ /**
3
+ * Utility to travel in time when using a local blockchain
4
+ * @param args time travel args
5
+ */
6
+ export declare const timeTravel: ({ seconds, signer }: ITimeTravelArgs) => Promise<void>;
7
+ //# sourceMappingURL=timeTravel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeTravel.d.ts","sourceRoot":"","sources":["../../../ts/utils/timeTravel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAU,qBAAqB,eAAe,KAAG,OAAO,CAAC,IAAI,CAInF,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timeTravel = void 0;
4
+ /**
5
+ * Utility to travel in time when using a local blockchain
6
+ * @param args time travel args
7
+ */
8
+ const timeTravel = async ({ seconds, signer }) => {
9
+ // send the instructions to the provider
10
+ await signer.provider.send("evm_increaseTime", [Number(seconds)]);
11
+ await signer.provider.send("evm_mine", []);
12
+ };
13
+ exports.timeTravel = timeTravel;
14
+ //# sourceMappingURL=timeTravel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeTravel.js","sourceRoot":"","sources":["../../../ts/utils/timeTravel.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACI,MAAM,UAAU,GAAG,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAmB,EAAiB,EAAE;IACtF,wCAAwC;IACxC,MAAO,MAAM,CAAC,QAA4B,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvF,MAAO,MAAM,CAAC,QAA4B,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC;AAJW,QAAA,UAAU,cAIrB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Utility to calculate the depth of a binary tree
3
+ * @param maxLeaves - the number of leaves in the tree
4
+ * @returns the depth of the tree
5
+ */
6
+ export declare const calculateBinaryTreeDepthFromMaxLeaves: (maxLeaves: number) => number;
7
+ /**
8
+ * Utility to calculate the depth of a quin tree
9
+ * @param maxLeaves the number of leaves in the tree
10
+ * @returns the depth of the tree
11
+ */
12
+ export declare const calculateQuinTreeDepthFromMaxLeaves: (maxLeaves: number) => number;
13
+ //# sourceMappingURL=trees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trees.d.ts","sourceRoot":"","sources":["../../../ts/utils/trees.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,GAAI,WAAW,MAAM,KAAG,MAQzE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAAI,WAAW,MAAM,KAAG,MAQvE,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateQuinTreeDepthFromMaxLeaves = exports.calculateBinaryTreeDepthFromMaxLeaves = void 0;
4
+ /**
5
+ * Utility to calculate the depth of a binary tree
6
+ * @param maxLeaves - the number of leaves in the tree
7
+ * @returns the depth of the tree
8
+ */
9
+ const calculateBinaryTreeDepthFromMaxLeaves = (maxLeaves) => {
10
+ let result = 0;
11
+ while (2 ** result < maxLeaves) {
12
+ result += 1;
13
+ }
14
+ return result;
15
+ };
16
+ exports.calculateBinaryTreeDepthFromMaxLeaves = calculateBinaryTreeDepthFromMaxLeaves;
17
+ /**
18
+ * Utility to calculate the depth of a quin tree
19
+ * @param maxLeaves the number of leaves in the tree
20
+ * @returns the depth of the tree
21
+ */
22
+ const calculateQuinTreeDepthFromMaxLeaves = (maxLeaves) => {
23
+ let result = 0;
24
+ while (5 ** result < maxLeaves) {
25
+ result += 1;
26
+ }
27
+ return result;
28
+ };
29
+ exports.calculateQuinTreeDepthFromMaxLeaves = calculateQuinTreeDepthFromMaxLeaves;
30
+ //# sourceMappingURL=trees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trees.js","sourceRoot":"","sources":["../../../ts/utils/trees.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,qCAAqC,GAAG,CAAC,SAAiB,EAAU,EAAE;IACjF,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO,CAAC,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,qCAAqC,yCAQhD;AAEF;;;;GAIG;AACI,MAAM,mCAAmC,GAAG,CAAC,SAAiB,EAAU,EAAE;IAC/E,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,OAAO,CAAC,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,mCAAmC,uCAQ9C"}
@@ -0,0 +1,71 @@
1
+ import type { BigNumberish, Signer } from "ethers";
2
+ /**
3
+ * A circuit inputs for the circom circuit
4
+ */
5
+ export type TCircuitInputs = Record<string, string | bigint | bigint[] | bigint[][] | string[] | bigint[][][]>;
6
+ /**
7
+ * Circuit parameters
8
+ */
9
+ export interface ICircuitParams {
10
+ /**
11
+ * The state tree depth
12
+ */
13
+ stateTreeDepth: number;
14
+ /**
15
+ * The intermediate state tree depth (ballot tree)
16
+ */
17
+ tallyProcessingStateTreeDepth: number;
18
+ /**
19
+ * The vote option tree depth
20
+ */
21
+ voteOptionTreeDepth: number;
22
+ /**
23
+ * The message batch size
24
+ */
25
+ messageBatchSize: number;
26
+ }
27
+ /**
28
+ * Interface that represents Verification key
29
+ */
30
+ export interface ISnarkJSVerificationKey {
31
+ protocol: BigNumberish;
32
+ curve: BigNumberish;
33
+ nPublic: BigNumberish;
34
+ vk_alpha_1: BigNumberish[];
35
+ vk_beta_2: BigNumberish[][];
36
+ vk_gamma_2: BigNumberish[][];
37
+ vk_delta_2: BigNumberish[][];
38
+ vk_alphabeta_12: BigNumberish[][][];
39
+ IC: BigNumberish[][];
40
+ }
41
+ /**
42
+ * Interface for the arguments to the TimeTravel command
43
+ */
44
+ export interface ITimeTravelArgs {
45
+ /**
46
+ * The number of seconds to time travel
47
+ */
48
+ seconds: number;
49
+ /**
50
+ * A signer object
51
+ */
52
+ signer: Signer;
53
+ }
54
+ /**
55
+ * Interface for the arguments to the FundWallet command
56
+ */
57
+ export interface IFundWalletArgs {
58
+ /**
59
+ * The amount to fund
60
+ */
61
+ amount: number;
62
+ /**
63
+ * The address of the wallet to fund
64
+ */
65
+ address: string;
66
+ /**
67
+ * A signer object
68
+ */
69
+ signer: Signer;
70
+ }
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAE/G;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,SAAS,EAAE,YAAY,EAAE,EAAE,CAAC;IAC5B,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7B,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7B,eAAe,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACpC,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/utils/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Check if we are running on an arm chip
3
+ * @returns whether we are running on an arm chip
4
+ */
5
+ export declare const isArm: () => boolean;
6
+ /**
7
+ * Remove a file
8
+ * @param filepath - the path to the file
9
+ */
10
+ export declare const unlinkFile: (filepath: string) => Promise<void>;
11
+ /**
12
+ * Pause the thread for n milliseconds
13
+ * @param ms - the amount of time to sleep in milliseconds
14
+ */
15
+ export declare const sleep: (ms: number) => Promise<void>;
16
+ declare global {
17
+ interface ITerminatable {
18
+ terminate: () => Promise<unknown>;
19
+ }
20
+ var curve_bn128: ITerminatable | undefined;
21
+ var curve_bls12381: ITerminatable | undefined;
22
+ }
23
+ export declare const cleanThreads: () => Promise<void>;
24
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/utils/utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,KAAK,QAAO,OAAoC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAM/D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAU,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAIpD,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa;QACrB,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;KACnC;IAGD,IAAI,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;IAG3C,IAAI,cAAc,EAAE,aAAa,GAAG,SAAS,CAAC;CAC/C;AAMD,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAUjD,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cleanThreads = exports.sleep = exports.unlinkFile = exports.isArm = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const os_1 = __importDefault(require("os"));
9
+ /**
10
+ * Check if we are running on an arm chip
11
+ * @returns whether we are running on an arm chip
12
+ */
13
+ const isArm = () => os_1.default.arch().includes("arm");
14
+ exports.isArm = isArm;
15
+ /**
16
+ * Remove a file
17
+ * @param filepath - the path to the file
18
+ */
19
+ const unlinkFile = async (filepath) => {
20
+ const isFileExists = fs_1.default.existsSync(filepath);
21
+ if (isFileExists) {
22
+ await fs_1.default.promises.unlink(filepath);
23
+ }
24
+ };
25
+ exports.unlinkFile = unlinkFile;
26
+ /**
27
+ * Pause the thread for n milliseconds
28
+ * @param ms - the amount of time to sleep in milliseconds
29
+ */
30
+ const sleep = async (ms) => {
31
+ await new Promise((resolve) => {
32
+ setTimeout(resolve, ms);
33
+ });
34
+ };
35
+ exports.sleep = sleep;
36
+ /*
37
+ * https://github.com/iden3/snarkjs/issues/152
38
+ * Need to cleanup the threads to avoid stalling
39
+ */
40
+ const cleanThreads = async () => {
41
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
42
+ if (!globalThis) {
43
+ return;
44
+ }
45
+ const curves = ["curve_bn128", "curve_bls12381"];
46
+ await Promise.all(curves.map((curve) => globalThis[curve]?.terminate()).filter(Boolean));
47
+ };
48
+ exports.cleanThreads = cleanThreads;
49
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/utils/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,4CAAoB;AAEpB;;;GAGG;AACI,MAAM,KAAK,GAAG,GAAY,EAAE,CAAC,YAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAAjD,QAAA,KAAK,SAA4C;AAE9D;;;GAGG;AACI,MAAM,UAAU,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAClE,MAAM,YAAY,GAAG,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAE7C,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEF;;;GAGG;AACI,MAAM,KAAK,GAAG,KAAK,EAAE,EAAU,EAAiB,EAAE;IACvD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC5B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,KAAK,SAIhB;AAcF;;;GAGG;AACI,MAAM,YAAY,GAAG,KAAK,IAAmB,EAAE;IACpD,uEAAuE;IACvE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IACjD,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAyC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAC1G,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
@@ -0,0 +1,10 @@
1
+ import type { ICheckVerifyingKeysArgs } from "./types";
2
+ /**
3
+ * Command to confirm that the verifying keys in the contract match the
4
+ * local ones
5
+ * @note see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
6
+ * @param CheckVerifyingKeysArgs - The arguments for the checkVerifyingKeys command
7
+ * @returns Whether the verifying keys match or not
8
+ */
9
+ export declare const checkVerifyingKeys: ({ stateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, processMessagesZkeyPath, tallyVotesZkeyPath, pollJoiningZkeyPath, pollJoinedZkeyPath, verifyingKeysRegistry, signer, mode, }: ICheckVerifyingKeysArgs) => Promise<boolean>;
10
+ //# sourceMappingURL=checkVerifyingKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkVerifyingKeys.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/checkVerifyingKeys.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAMvD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAU,sNAYtC,uBAAuB,KAAG,OAAO,CAAC,OAAO,CAiE3C,CAAC"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.checkVerifyingKeys = void 0;
7
+ const contracts_1 = require("@maci-protocol/contracts");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const utils_1 = require("../utils");
10
+ const utils_2 = require("./utils");
11
+ /**
12
+ * Command to confirm that the verifying keys in the contract match the
13
+ * local ones
14
+ * @note see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing
15
+ * @param CheckVerifyingKeysArgs - The arguments for the checkVerifyingKeys command
16
+ * @returns Whether the verifying keys match or not
17
+ */
18
+ const checkVerifyingKeys = async ({ stateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, processMessagesZkeyPath, tallyVotesZkeyPath, pollJoiningZkeyPath, pollJoinedZkeyPath, verifyingKeysRegistry, signer, mode = contracts_1.EMode.QV, }) => {
19
+ if (!verifyingKeysRegistry) {
20
+ throw new Error("Please provide a VerifyingKeysRegistry contract address");
21
+ }
22
+ const isVerifyingKeyExists = await (0, utils_1.contractExists)(signer.provider, verifyingKeysRegistry);
23
+ if (!isVerifyingKeyExists) {
24
+ throw new Error("The VerifyingKeysRegistry contract does not exist");
25
+ }
26
+ // we need to ensure that the zkey files exist
27
+ const isProcessMessagesZkeyPathExists = fs_1.default.existsSync(processMessagesZkeyPath);
28
+ if (!isProcessMessagesZkeyPathExists) {
29
+ throw new Error("The provided Process messages zkey does not exist");
30
+ }
31
+ const isTallyVotesZkeyPathExists = fs_1.default.existsSync(tallyVotesZkeyPath);
32
+ if (!isTallyVotesZkeyPathExists) {
33
+ throw new Error("The provided Tally votes zkey does not exist");
34
+ }
35
+ // extract the verification keys from the zkey files
36
+ const { pollJoiningVerifyingKey, pollJoinedVerifyingKey, processVerifyingKey, tallyVerifyingKey } = await (0, utils_2.extractAllVerifyingKeys)({
37
+ processMessagesZkeyPath,
38
+ tallyVotesZkeyPath,
39
+ pollJoiningZkeyPath,
40
+ pollJoinedZkeyPath,
41
+ });
42
+ const { pollJoiningVerifyingKeyOnChain, pollJoinedVerifyingKeyOnChain, processVerifyingKeyOnChain, tallyVerifyingKeyOnChain, } = await (0, utils_2.getAllOnChainVerifyingKeys)({
43
+ verifyingKeysRegistryAddress: verifyingKeysRegistry,
44
+ signer,
45
+ stateTreeDepth,
46
+ voteOptionTreeDepth,
47
+ messageBatchSize,
48
+ tallyProcessingStateTreeDepth,
49
+ mode,
50
+ });
51
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoiningVerifyingKeyOnChain, pollJoiningVerifyingKey)) {
52
+ throw new Error("Poll verifying keys do not match");
53
+ }
54
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoinedVerifyingKeyOnChain, pollJoinedVerifyingKey)) {
55
+ throw new Error("Poll verifying keys do not match");
56
+ }
57
+ if (!(0, utils_2.compareVerifyingKeys)(processVerifyingKeyOnChain, processVerifyingKey)) {
58
+ throw new Error("Process verifying keys do not match");
59
+ }
60
+ if (!(0, utils_2.compareVerifyingKeys)(tallyVerifyingKeyOnChain, tallyVerifyingKey)) {
61
+ throw new Error("Tally verifying keys do not match");
62
+ }
63
+ return true;
64
+ };
65
+ exports.checkVerifyingKeys = checkVerifyingKeys;
66
+ //# sourceMappingURL=checkVerifyingKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkVerifyingKeys.js","sourceRoot":"","sources":["../../../ts/verifyingKeys/checkVerifyingKeys.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAiD;AAEjD,4CAAoB;AAIpB,oCAA0C;AAE1C,mCAAoG;AAEpG;;;;;;GAMG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,cAAc,EACd,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,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,CAAC,IAAA,4BAAoB,EAAC,8BAA8B,EAAE,uBAAuB,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,IAAA,4BAAoB,EAAC,6BAA6B,EAAE,sBAAsB,CAAC,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,IAAA,4BAAoB,EAAC,0BAA0B,EAAE,mBAAmB,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,CAAC,IAAA,4BAAoB,EAAC,wBAAwB,EAAE,iBAAiB,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA7EW,QAAA,kBAAkB,sBA6E7B"}
@@ -0,0 +1,5 @@
1
+ export { checkVerifyingKeys } from "./checkVerifyingKeys";
2
+ export { setVerifyingKeys } from "./setVerifyingKeys";
3
+ export { getAllOnChainVerifyingKeys, compareVerifyingKeys, extractAllVerifyingKeys, extractVerifyingKeyToFile, } from "./utils";
4
+ export type { IGetAllVerifyingKeysArgs, IMaciVerifyingKeysOnchain, IExtractAllVerifyingKeysArgs, IMaciVerifyingKeys, ISetVerifyingKeysArgs, ICheckVerifyingKeysArgs, } from "./types";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractVerifyingKeyToFile = exports.extractAllVerifyingKeys = exports.compareVerifyingKeys = exports.getAllOnChainVerifyingKeys = exports.setVerifyingKeys = exports.checkVerifyingKeys = void 0;
4
+ var checkVerifyingKeys_1 = require("./checkVerifyingKeys");
5
+ Object.defineProperty(exports, "checkVerifyingKeys", { enumerable: true, get: function () { return checkVerifyingKeys_1.checkVerifyingKeys; } });
6
+ var setVerifyingKeys_1 = require("./setVerifyingKeys");
7
+ Object.defineProperty(exports, "setVerifyingKeys", { enumerable: true, get: function () { return setVerifyingKeys_1.setVerifyingKeys; } });
8
+ var utils_1 = require("./utils");
9
+ Object.defineProperty(exports, "getAllOnChainVerifyingKeys", { enumerable: true, get: function () { return utils_1.getAllOnChainVerifyingKeys; } });
10
+ Object.defineProperty(exports, "compareVerifyingKeys", { enumerable: true, get: function () { return utils_1.compareVerifyingKeys; } });
11
+ Object.defineProperty(exports, "extractAllVerifyingKeys", { enumerable: true, get: function () { return utils_1.extractAllVerifyingKeys; } });
12
+ Object.defineProperty(exports, "extractVerifyingKeyToFile", { enumerable: true, get: function () { return utils_1.extractVerifyingKeyToFile; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/verifyingKeys/index.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,iCAKiB;AAJf,mHAAA,0BAA0B,OAAA;AAC1B,6GAAA,oBAAoB,OAAA;AACpB,gHAAA,uBAAuB,OAAA;AACvB,kHAAA,yBAAyB,OAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ISetVerifyingKeysArgs } from "./types";
2
+ /**
3
+ * Set the verifying keys on the contract
4
+ * @param args - The arguments for the setVerifyingKeys function
5
+ */
6
+ export declare const setVerifyingKeys: ({ pollJoiningVerifyingKey, pollJoinedVerifyingKey, processMessagesVerifyingKey, tallyVotesVerifyingKey, stateTreeDepth, pollStateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, verifyingKeysRegistryAddress, signer, mode, }: ISetVerifyingKeysArgs) => Promise<void>;
7
+ //# sourceMappingURL=setVerifyingKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVerifyingKeys.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/setVerifyingKeys.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMrD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAU,iQAapC,qBAAqB,KAAG,OAAO,CAAC,IAAI,CA2GtC,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setVerifyingKeys = void 0;
4
+ const typechain_types_1 = require("@maci-protocol/contracts/typechain-types");
5
+ const core_1 = require("@maci-protocol/core");
6
+ const utils_1 = require("../utils");
7
+ const utils_2 = require("./utils");
8
+ /**
9
+ * Set the verifying keys on the contract
10
+ * @param args - The arguments for the setVerifyingKeys function
11
+ */
12
+ const setVerifyingKeys = async ({ pollJoiningVerifyingKey, pollJoinedVerifyingKey, processMessagesVerifyingKey, tallyVotesVerifyingKey, stateTreeDepth, pollStateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, verifyingKeysRegistryAddress, signer, mode, }) => {
13
+ // validate args
14
+ if (stateTreeDepth < 1 || tallyProcessingStateTreeDepth < 1 || voteOptionTreeDepth < 1 || messageBatchSize < 1) {
15
+ throw new Error("Invalid depth or batch size parameters");
16
+ }
17
+ if (stateTreeDepth < tallyProcessingStateTreeDepth) {
18
+ throw new Error("Invalid state tree depth or intermediate state tree depth");
19
+ }
20
+ const isContractExists = await (0, utils_1.contractExists)(signer.provider, verifyingKeysRegistryAddress);
21
+ // ensure we have a contract deployed at the provided address
22
+ if (!isContractExists) {
23
+ throw new Error(`A VerifyingKeysRegistry contract is not deployed at ${verifyingKeysRegistryAddress}`);
24
+ }
25
+ // connect to VerifyingKeysRegistry contract
26
+ const verifyingKeysRegistryContract = typechain_types_1.VerifyingKeysRegistry__factory.connect(verifyingKeysRegistryAddress, signer);
27
+ // check if the poll verifyingKey was already set
28
+ const pollJoiningVerifyingKeySignature = (0, core_1.generatePollJoiningVerifyingKeySignature)(stateTreeDepth);
29
+ if (await verifyingKeysRegistryContract.isPollJoiningVerifyingKeySet(pollJoiningVerifyingKeySignature)) {
30
+ throw new Error("This poll verifying key is already set in the contract");
31
+ }
32
+ // check if the poll verifyingKey was already set
33
+ const pollJoinedVerifyingKeySignature = (0, core_1.generatePollJoinedVerifyingKeySignature)(stateTreeDepth);
34
+ if (await verifyingKeysRegistryContract.isPollJoinedVerifyingKeySet(pollJoinedVerifyingKeySignature)) {
35
+ throw new Error("This poll verifying key is already set in the contract");
36
+ }
37
+ // check if the process messages verifyingKey was already set
38
+ const processVerifyingKeySignature = (0, core_1.generateProcessVerifyingKeySignature)(stateTreeDepth, voteOptionTreeDepth, messageBatchSize);
39
+ if (await verifyingKeysRegistryContract.isProcessVerifyingKeySet(processVerifyingKeySignature, mode)) {
40
+ throw new Error("This process verifying key is already set in the contract");
41
+ }
42
+ // do the same for the tally votes verifyingKey
43
+ const tallyVerifyingKeySignature = (0, core_1.generateTallyVerifyingKeySignature)(stateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth);
44
+ if (await verifyingKeysRegistryContract.isTallyVerifyingKeySet(tallyVerifyingKeySignature, mode)) {
45
+ throw new Error("This tally verifying key is already set in the contract");
46
+ }
47
+ // set them onchain
48
+ const tx = await verifyingKeysRegistryContract.setVerifyingKeysBatch({
49
+ stateTreeDepth,
50
+ pollStateTreeDepth,
51
+ tallyProcessingStateTreeDepth,
52
+ voteOptionTreeDepth,
53
+ messageBatchSize,
54
+ modes: [mode],
55
+ pollJoiningVerifyingKey: pollJoiningVerifyingKey.asContractParam(),
56
+ pollJoinedVerifyingKey: pollJoinedVerifyingKey.asContractParam(),
57
+ processVerifyingKeys: [processMessagesVerifyingKey.asContractParam()],
58
+ tallyVerifyingKeys: [tallyVotesVerifyingKey.asContractParam()],
59
+ });
60
+ const receipt = await tx.wait();
61
+ if (receipt?.status !== 1) {
62
+ throw new Error("Set verifying keys transaction failed");
63
+ }
64
+ const [pollJoiningVerifyingKeyOnChain, pollJoinedVerifyingKeyOnChain, processVerifyingKeyOnChain, tallyVerifyingKeyOnChain,] = await Promise.all([
65
+ verifyingKeysRegistryContract.getPollJoiningVerifyingKey(stateTreeDepth),
66
+ verifyingKeysRegistryContract.getPollJoinedVerifyingKey(stateTreeDepth),
67
+ verifyingKeysRegistryContract.getProcessVerifyingKey(stateTreeDepth, voteOptionTreeDepth, messageBatchSize, mode),
68
+ verifyingKeysRegistryContract.getTallyVerifyingKey(stateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, mode),
69
+ ]);
70
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoiningVerifyingKeyOnChain, pollJoiningVerifyingKey)) {
71
+ throw new Error("pollJoiningVerifyingKey mismatch");
72
+ }
73
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoinedVerifyingKeyOnChain, pollJoinedVerifyingKey)) {
74
+ throw new Error("pollJoinedVerifyingKey mismatch");
75
+ }
76
+ if (!(0, utils_2.compareVerifyingKeys)(processVerifyingKeyOnChain, processMessagesVerifyingKey)) {
77
+ throw new Error("processVerifyingKey mismatch");
78
+ }
79
+ if (!(0, utils_2.compareVerifyingKeys)(tallyVerifyingKeyOnChain, tallyVotesVerifyingKey)) {
80
+ throw new Error("tallyVerifyingKey mismatch");
81
+ }
82
+ };
83
+ exports.setVerifyingKeys = setVerifyingKeys;
84
+ //# sourceMappingURL=setVerifyingKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVerifyingKeys.js","sourceRoot":"","sources":["../../../ts/verifyingKeys/setVerifyingKeys.ts"],"names":[],"mappings":";;;AACA,8EAA0H;AAC1H,8CAK6B;AAI7B,oCAA0C;AAE1C,mCAA+C;AAE/C;;;GAGG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,MAAM,EACN,IAAI,GACkB,EAAiB,EAAE;IACzC,gBAAgB;IAChB,IAAI,cAAc,GAAG,CAAC,IAAI,6BAA6B,GAAG,CAAC,IAAI,mBAAmB,GAAG,CAAC,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;QAC/G,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,cAAc,GAAG,6BAA6B,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,IAAA,sBAAc,EAAC,MAAM,CAAC,QAAS,EAAE,4BAA4B,CAAC,CAAC;IAC9F,6DAA6D;IAC7D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,uDAAuD,4BAA4B,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,4CAA4C;IAC5C,MAAM,6BAA6B,GAAG,gDAA4B,CAAC,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAEjH,iDAAiD;IACjD,MAAM,gCAAgC,GAAG,IAAA,+CAAwC,EAA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