@maci-protocol/sdk 0.0.0-ci.fd7cff6 → 0.0.0-ci.fdde0de

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 (221) hide show
  1. package/LICENSE +1 -2
  2. package/build/package.json +16 -7
  3. package/build/ts/browser/index.d.ts +6 -7
  4. package/build/ts/browser/index.d.ts.map +1 -1
  5. package/build/ts/browser/index.js +16 -20
  6. package/build/ts/browser/index.js.map +1 -1
  7. package/build/ts/browser/joinPoll.d.ts +10 -0
  8. package/build/ts/browser/joinPoll.d.ts.map +1 -0
  9. package/build/ts/browser/joinPoll.js +88 -0
  10. package/build/ts/browser/joinPoll.js.map +1 -0
  11. package/build/ts/browser/utils.d.ts +18 -0
  12. package/build/ts/browser/utils.d.ts.map +1 -0
  13. package/build/ts/browser/utils.js +37 -0
  14. package/build/ts/browser/utils.js.map +1 -0
  15. package/build/ts/deploy/index.d.ts +3 -2
  16. package/build/ts/deploy/index.d.ts.map +1 -1
  17. package/build/ts/deploy/index.js +5 -3
  18. package/build/ts/deploy/index.js.map +1 -1
  19. package/build/ts/deploy/maci.js +1 -1
  20. package/build/ts/deploy/maci.js.map +1 -1
  21. package/build/ts/deploy/poll.d.ts +1 -1
  22. package/build/ts/deploy/poll.d.ts.map +1 -1
  23. package/build/ts/deploy/poll.js +20 -13
  24. package/build/ts/deploy/poll.js.map +1 -1
  25. package/build/ts/deploy/types.d.ts +21 -8
  26. package/build/ts/deploy/types.d.ts.map +1 -1
  27. package/build/ts/deploy/utils.js +1 -1
  28. package/build/ts/deploy/utils.js.map +1 -1
  29. package/build/ts/deploy/verifyingKeysRegistry.d.ts +7 -0
  30. package/build/ts/deploy/verifyingKeysRegistry.d.ts.map +1 -0
  31. package/build/ts/deploy/verifyingKeysRegistry.js +14 -0
  32. package/build/ts/deploy/verifyingKeysRegistry.js.map +1 -0
  33. package/build/ts/index.d.ts +2 -1
  34. package/build/ts/index.d.ts.map +1 -1
  35. package/build/ts/index.js +26 -8
  36. package/build/ts/index.js.map +1 -1
  37. package/build/ts/maci/policy.d.ts +13 -1
  38. package/build/ts/maci/policy.d.ts.map +1 -1
  39. package/build/ts/maci/policy.js +41 -2
  40. package/build/ts/maci/policy.js.map +1 -1
  41. package/build/ts/maci/state.d.ts +1 -1
  42. package/build/ts/maci/state.js +11 -11
  43. package/build/ts/maci/state.js.map +1 -1
  44. package/build/ts/maci/types.d.ts +34 -2
  45. package/build/ts/maci/types.d.ts.map +1 -1
  46. package/build/ts/maci/types.js +2 -0
  47. package/build/ts/maci/types.js.map +1 -1
  48. package/build/ts/maciKeys/__tests__/keypair.test.js +7 -7
  49. package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -1
  50. package/build/ts/maciKeys/__tests__/publicKeys.test.js +7 -7
  51. package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -1
  52. package/build/ts/maciKeys/keypair.d.ts.map +1 -1
  53. package/build/ts/maciKeys/keypair.js +4 -3
  54. package/build/ts/maciKeys/keypair.js.map +1 -1
  55. package/build/ts/maciKeys/publicKeys.d.ts +2 -2
  56. package/build/ts/maciKeys/publicKeys.d.ts.map +1 -1
  57. package/build/ts/maciKeys/publicKeys.js +6 -6
  58. package/build/ts/maciKeys/publicKeys.js.map +1 -1
  59. package/build/ts/maciKeys/types.d.ts +5 -0
  60. package/build/ts/maciKeys/types.d.ts.map +1 -1
  61. package/build/ts/poll/poll.d.ts.map +1 -1
  62. package/build/ts/poll/poll.js +8 -8
  63. package/build/ts/poll/poll.js.map +1 -1
  64. package/build/ts/poll/types.d.ts +6 -7
  65. package/build/ts/poll/types.d.ts.map +1 -1
  66. package/build/ts/poll/utils.js +3 -3
  67. package/build/ts/poll/utils.js.map +1 -1
  68. package/build/ts/proof/__tests__/download.test.js +7 -4
  69. package/build/ts/proof/__tests__/download.test.js.map +1 -1
  70. package/build/ts/proof/download.d.ts +3 -3
  71. package/build/ts/proof/download.d.ts.map +1 -1
  72. package/build/ts/proof/download.js +5 -7
  73. package/build/ts/proof/download.js.map +1 -1
  74. package/build/ts/proof/generate.d.ts +2 -2
  75. package/build/ts/proof/generate.d.ts.map +1 -1
  76. package/build/ts/proof/generate.js +31 -25
  77. package/build/ts/proof/generate.js.map +1 -1
  78. package/build/ts/proof/prove.js +16 -16
  79. package/build/ts/proof/prove.js.map +1 -1
  80. package/build/ts/proof/types.d.ts +41 -15
  81. package/build/ts/proof/types.d.ts.map +1 -1
  82. package/build/ts/proof/utils.d.ts +10 -0
  83. package/build/ts/proof/utils.d.ts.map +1 -0
  84. package/build/ts/proof/utils.js +24 -0
  85. package/build/ts/proof/utils.js.map +1 -0
  86. package/build/ts/relayer/__tests__/messages.test.js +1 -1
  87. package/build/ts/relayer/__tests__/messages.test.js.map +1 -1
  88. package/build/ts/relayer/__tests__/utils.test.js +3 -3
  89. package/build/ts/relayer/__tests__/utils.test.js.map +1 -1
  90. package/build/ts/relayer/messages.js +1 -1
  91. package/build/ts/relayer/utils.js +4 -4
  92. package/build/ts/relayer/utils.js.map +1 -1
  93. package/build/ts/subgraph/index.d.ts +3 -0
  94. package/build/ts/subgraph/index.d.ts.map +1 -0
  95. package/build/ts/subgraph/index.js +18 -0
  96. package/build/ts/subgraph/index.js.map +1 -0
  97. package/build/ts/subgraph/maciSubgraph.d.ts +28 -0
  98. package/build/ts/subgraph/maciSubgraph.d.ts.map +1 -0
  99. package/build/ts/subgraph/maciSubgraph.js +62 -0
  100. package/build/ts/subgraph/maciSubgraph.js.map +1 -0
  101. package/build/ts/subgraph/types.d.ts +20 -0
  102. package/build/ts/subgraph/types.d.ts.map +1 -0
  103. package/build/ts/subgraph/types.js +3 -0
  104. package/build/ts/subgraph/types.js.map +1 -0
  105. package/build/ts/tally/commitments.d.ts.map +1 -1
  106. package/build/ts/tally/commitments.js +8 -7
  107. package/build/ts/tally/commitments.js.map +1 -1
  108. package/build/ts/tally/index.d.ts +2 -1
  109. package/build/ts/tally/index.d.ts.map +1 -1
  110. package/build/ts/tally/index.js +5 -1
  111. package/build/ts/tally/index.js.map +1 -1
  112. package/build/ts/tally/results.d.ts +20 -0
  113. package/build/ts/tally/results.d.ts.map +1 -0
  114. package/build/ts/tally/results.js +49 -0
  115. package/build/ts/tally/results.js.map +1 -0
  116. package/build/ts/tally/types.d.ts +55 -15
  117. package/build/ts/tally/types.d.ts.map +1 -1
  118. package/build/ts/tally/utils.d.ts +3 -3
  119. package/build/ts/tally/utils.d.ts.map +1 -1
  120. package/build/ts/tally/utils.js +10 -10
  121. package/build/ts/tally/utils.js.map +1 -1
  122. package/build/ts/tally/verification.d.ts +1 -1
  123. package/build/ts/tally/verification.d.ts.map +1 -1
  124. package/build/ts/tally/verification.js +10 -10
  125. package/build/ts/tally/verification.js.map +1 -1
  126. package/build/ts/trees/index.d.ts +2 -2
  127. package/build/ts/trees/index.d.ts.map +1 -1
  128. package/build/ts/trees/index.js +3 -1
  129. package/build/ts/trees/index.js.map +1 -1
  130. package/build/ts/trees/stateTree.d.ts +23 -1
  131. package/build/ts/trees/stateTree.d.ts.map +1 -1
  132. package/build/ts/trees/stateTree.js +76 -12
  133. package/build/ts/trees/stateTree.js.map +1 -1
  134. package/build/ts/trees/types.d.ts +11 -2
  135. package/build/ts/trees/types.d.ts.map +1 -1
  136. package/build/ts/user/index.d.ts +4 -2
  137. package/build/ts/user/index.d.ts.map +1 -1
  138. package/build/ts/user/index.js +14 -8
  139. package/build/ts/user/index.js.map +1 -1
  140. package/build/ts/user/joinPoll.d.ts +8 -0
  141. package/build/ts/user/joinPoll.d.ts.map +1 -0
  142. package/build/ts/user/joinPoll.js +84 -0
  143. package/build/ts/user/joinPoll.js.map +1 -0
  144. package/build/ts/user/signup.d.ts +20 -0
  145. package/build/ts/user/signup.d.ts.map +1 -0
  146. package/build/ts/user/signup.js +84 -0
  147. package/build/ts/user/signup.js.map +1 -0
  148. package/build/ts/user/types.d.ts +63 -27
  149. package/build/ts/user/types.d.ts.map +1 -1
  150. package/build/ts/user/utils.d.ts +42 -14
  151. package/build/ts/user/utils.d.ts.map +1 -1
  152. package/build/ts/user/utils.js +121 -49
  153. package/build/ts/user/utils.js.map +1 -1
  154. package/build/ts/utils/params.d.ts +1 -1
  155. package/build/ts/utils/params.d.ts.map +1 -1
  156. package/build/ts/utils/params.js +3 -3
  157. package/build/ts/utils/params.js.map +1 -1
  158. package/build/ts/utils/proofs.d.ts +2 -2
  159. package/build/ts/utils/proofs.d.ts.map +1 -1
  160. package/build/ts/utils/proofs.js +4 -4
  161. package/build/ts/utils/proofs.js.map +1 -1
  162. package/build/ts/utils/types.d.ts +2 -2
  163. package/build/ts/utils/types.d.ts.map +1 -1
  164. package/build/ts/utils/utils.d.ts +8 -0
  165. package/build/ts/utils/utils.d.ts.map +1 -1
  166. package/build/ts/utils/utils.js +14 -1
  167. package/build/ts/utils/utils.js.map +1 -1
  168. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +1 -1
  169. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -1
  170. package/build/ts/verifyingKeys/checkVerifyingKeys.js +18 -19
  171. package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -1
  172. package/build/ts/verifyingKeys/index.d.ts +2 -2
  173. package/build/ts/verifyingKeys/index.d.ts.map +1 -1
  174. package/build/ts/verifyingKeys/index.js +5 -5
  175. package/build/ts/verifyingKeys/index.js.map +1 -1
  176. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +1 -1
  177. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -1
  178. package/build/ts/verifyingKeys/setVerifyingKeys.js +46 -35
  179. package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -1
  180. package/build/ts/verifyingKeys/types.d.ts +54 -46
  181. package/build/ts/verifyingKeys/types.d.ts.map +1 -1
  182. package/build/ts/verifyingKeys/utils.d.ts +10 -10
  183. package/build/ts/verifyingKeys/utils.d.ts.map +1 -1
  184. package/build/ts/verifyingKeys/utils.js +76 -60
  185. package/build/ts/verifyingKeys/utils.js.map +1 -1
  186. package/build/ts/vote/generate.d.ts +1 -1
  187. package/build/ts/vote/generate.d.ts.map +1 -1
  188. package/build/ts/vote/generate.js +4 -4
  189. package/build/ts/vote/generate.js.map +1 -1
  190. package/build/ts/vote/index.d.ts +2 -1
  191. package/build/ts/vote/index.d.ts.map +1 -1
  192. package/build/ts/vote/index.js +4 -2
  193. package/build/ts/vote/index.js.map +1 -1
  194. package/build/ts/vote/invalidate.js +4 -4
  195. package/build/ts/vote/invalidate.js.map +1 -1
  196. package/build/ts/vote/publish.d.ts +1 -1
  197. package/build/ts/vote/publish.d.ts.map +1 -1
  198. package/build/ts/vote/publish.js +19 -19
  199. package/build/ts/vote/publish.js.map +1 -1
  200. package/build/ts/vote/submit.js +5 -5
  201. package/build/ts/vote/submit.js.map +1 -1
  202. package/build/ts/vote/types.d.ts +6 -6
  203. package/build/ts/vote/types.d.ts.map +1 -1
  204. package/build/ts/vote/utils.d.ts +2 -2
  205. package/build/ts/vote/utils.d.ts.map +1 -1
  206. package/build/ts/vote/utils.js +7 -7
  207. package/build/ts/vote/utils.js.map +1 -1
  208. package/build/tsconfig.build.tsbuildinfo +1 -1
  209. package/package.json +22 -13
  210. package/build/ts/deploy/vkRegistry.d.ts +0 -7
  211. package/build/ts/deploy/vkRegistry.d.ts.map +0 -1
  212. package/build/ts/deploy/vkRegistry.js +0 -14
  213. package/build/ts/deploy/vkRegistry.js.map +0 -1
  214. package/build/ts/proof/constants.d.ts +0 -17
  215. package/build/ts/proof/constants.d.ts.map +0 -1
  216. package/build/ts/proof/constants.js +0 -20
  217. package/build/ts/proof/constants.js.map +0 -1
  218. package/build/ts/user/user.d.ts +0 -42
  219. package/build/ts/user/user.d.ts.map +0 -1
  220. package/build/ts/user/user.js +0 -192
  221. package/build/ts/user/user.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractVkToFile = exports.extractAllVks = exports.compareVks = exports.getAllOnChainVks = exports.setVerifyingKeys = exports.checkVerifyingKeys = void 0;
3
+ exports.extractVerifyingKeyToFile = exports.extractAllVerifyingKeys = exports.compareVerifyingKeys = exports.getAllOnChainVerifyingKeys = exports.setVerifyingKeys = exports.checkVerifyingKeys = void 0;
4
4
  var checkVerifyingKeys_1 = require("./checkVerifyingKeys");
5
5
  Object.defineProperty(exports, "checkVerifyingKeys", { enumerable: true, get: function () { return checkVerifyingKeys_1.checkVerifyingKeys; } });
6
6
  var setVerifyingKeys_1 = require("./setVerifyingKeys");
7
7
  Object.defineProperty(exports, "setVerifyingKeys", { enumerable: true, get: function () { return setVerifyingKeys_1.setVerifyingKeys; } });
8
8
  var utils_1 = require("./utils");
9
- Object.defineProperty(exports, "getAllOnChainVks", { enumerable: true, get: function () { return utils_1.getAllOnChainVks; } });
10
- Object.defineProperty(exports, "compareVks", { enumerable: true, get: function () { return utils_1.compareVks; } });
11
- Object.defineProperty(exports, "extractAllVks", { enumerable: true, get: function () { return utils_1.extractAllVks; } });
12
- Object.defineProperty(exports, "extractVkToFile", { enumerable: true, get: function () { return utils_1.extractVkToFile; } });
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
13
  //# sourceMappingURL=index.js.map
@@ -1 +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,iCAAuF;AAA9E,yGAAA,gBAAgB,OAAA;AAAE,mGAAA,UAAU,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,wGAAA,eAAe,OAAA"}
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"}
@@ -3,5 +3,5 @@ import type { ISetVerifyingKeysArgs } from "./types";
3
3
  * Set the verifying keys on the contract
4
4
  * @param args - The arguments for the setVerifyingKeys function
5
5
  */
6
- export declare const setVerifyingKeys: ({ pollJoiningVk, pollJoinedVk, processMessagesVk, tallyVotesVk, stateTreeDepth, intStateTreeDepth, voteOptionTreeDepth, messageBatchSize, vkRegistryAddress, signer, mode, }: ISetVerifyingKeysArgs) => Promise<void>;
6
+ export declare const setVerifyingKeys: ({ pollJoiningVerifyingKey, pollJoinedVerifyingKey, processMessagesVerifyingKey, tallyVotesVerifyingKey, stateTreeDepth, pollStateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, verifyingKeysRegistryAddress, signer, mode, }: ISetVerifyingKeysArgs) => Promise<void>;
7
7
  //# sourceMappingURL=setVerifyingKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setVerifyingKeys.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/setVerifyingKeys.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMrD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAU,8KAYpC,qBAAqB,KAAG,OAAO,CAAC,IAAI,CAwFtC,CAAC"}
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"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setVerifyingKeys = void 0;
4
- const contracts_1 = require("@maci-protocol/contracts");
4
+ const typechain_types_1 = require("@maci-protocol/contracts/typechain-types");
5
5
  const core_1 = require("@maci-protocol/core");
6
6
  const utils_1 = require("../utils");
7
7
  const utils_2 = require("./utils");
@@ -9,64 +9,75 @@ const utils_2 = require("./utils");
9
9
  * Set the verifying keys on the contract
10
10
  * @param args - The arguments for the setVerifyingKeys function
11
11
  */
12
- const setVerifyingKeys = async ({ pollJoiningVk, pollJoinedVk, processMessagesVk, tallyVotesVk, stateTreeDepth, intStateTreeDepth, voteOptionTreeDepth, messageBatchSize, vkRegistryAddress, signer, mode, }) => {
12
+ const setVerifyingKeys = async ({ pollJoiningVerifyingKey, pollJoinedVerifyingKey, processMessagesVerifyingKey, tallyVotesVerifyingKey, stateTreeDepth, pollStateTreeDepth, tallyProcessingStateTreeDepth, voteOptionTreeDepth, messageBatchSize, verifyingKeysRegistryAddress, signer, mode, }) => {
13
13
  // validate args
14
- if (stateTreeDepth < 1 || intStateTreeDepth < 1 || voteOptionTreeDepth < 1 || messageBatchSize < 1) {
14
+ if (stateTreeDepth < 1 || tallyProcessingStateTreeDepth < 1 || voteOptionTreeDepth < 1 || messageBatchSize < 1) {
15
15
  throw new Error("Invalid depth or batch size parameters");
16
16
  }
17
- if (stateTreeDepth < intStateTreeDepth) {
17
+ if (stateTreeDepth < tallyProcessingStateTreeDepth) {
18
18
  throw new Error("Invalid state tree depth or intermediate state tree depth");
19
19
  }
20
- const vkRegistryContractExists = await (0, utils_1.contractExists)(signer.provider, vkRegistryAddress);
20
+ const isContractExists = await (0, utils_1.contractExists)(signer.provider, verifyingKeysRegistryAddress);
21
21
  // ensure we have a contract deployed at the provided address
22
- if (!vkRegistryContractExists) {
23
- throw new Error(`A VkRegistry contract is not deployed at ${vkRegistryAddress}`);
22
+ if (!isContractExists) {
23
+ throw new Error(`A VerifyingKeysRegistry contract is not deployed at ${verifyingKeysRegistryAddress}`);
24
24
  }
25
- // connect to VkRegistry contract
26
- const vkRegistryContract = contracts_1.VkRegistry__factory.connect(vkRegistryAddress, signer);
27
- // check if the poll vk was already set
28
- const pollJoiningVkSig = (0, core_1.genPollJoiningVkSig)(stateTreeDepth);
29
- if (await vkRegistryContract.isPollJoiningVkSet(pollJoiningVkSig)) {
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
30
  throw new Error("This poll verifying key is already set in the contract");
31
31
  }
32
- // check if the poll vk was already set
33
- const pollJoinedVkSig = (0, core_1.genPollJoinedVkSig)(stateTreeDepth);
34
- if (await vkRegistryContract.isPollJoinedVkSet(pollJoinedVkSig)) {
32
+ // check if the poll verifyingKey was already set
33
+ const pollJoinedVerifyingKeySignature = (0, core_1.generatePollJoinedVerifyingKeySignature)(stateTreeDepth);
34
+ if (await verifyingKeysRegistryContract.isPollJoinedVerifyingKeySet(pollJoinedVerifyingKeySignature)) {
35
35
  throw new Error("This poll verifying key is already set in the contract");
36
36
  }
37
- // check if the process messages vk was already set
38
- const processVkSig = (0, core_1.genProcessVkSig)(stateTreeDepth, voteOptionTreeDepth, messageBatchSize);
39
- if (await vkRegistryContract.isProcessVkSet(processVkSig, contracts_1.EMode.QV)) {
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
40
  throw new Error("This process verifying key is already set in the contract");
41
41
  }
42
- // do the same for the tally votes vk
43
- const tallyVkSig = (0, core_1.genTallyVkSig)(stateTreeDepth, intStateTreeDepth, voteOptionTreeDepth);
44
- if (await vkRegistryContract.isTallyVkSet(tallyVkSig, mode)) {
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
45
  throw new Error("This tally verifying key is already set in the contract");
46
46
  }
47
47
  // set them onchain
48
- const tx = await vkRegistryContract.setVerifyingKeysBatch(stateTreeDepth, intStateTreeDepth, voteOptionTreeDepth, messageBatchSize, [mode], pollJoiningVk.asContractParam(), pollJoinedVk.asContractParam(), [processMessagesVk.asContractParam()], [tallyVotesVk.asContractParam()]);
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
+ });
49
60
  const receipt = await tx.wait();
50
61
  if (receipt?.status !== 1) {
51
62
  throw new Error("Set verifying keys transaction failed");
52
63
  }
53
- const [pollJoiningVkOnChain, pollJoinedVkOnChain, processVkOnChain, tallyVkOnChain] = await Promise.all([
54
- vkRegistryContract.getPollJoiningVk(stateTreeDepth),
55
- vkRegistryContract.getPollJoinedVk(stateTreeDepth),
56
- vkRegistryContract.getProcessVk(stateTreeDepth, voteOptionTreeDepth, messageBatchSize, mode),
57
- vkRegistryContract.getTallyVk(stateTreeDepth, intStateTreeDepth, voteOptionTreeDepth, mode),
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),
58
69
  ]);
59
- if (!(0, utils_2.compareVks)(pollJoiningVkOnChain, pollJoiningVk)) {
60
- throw new Error("pollJoiningVk mismatch");
70
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoiningVerifyingKeyOnChain, pollJoiningVerifyingKey)) {
71
+ throw new Error("pollJoiningVerifyingKey mismatch");
61
72
  }
62
- if (!(0, utils_2.compareVks)(pollJoinedVkOnChain, pollJoinedVk)) {
63
- throw new Error("pollJoinedVk mismatch");
73
+ if (!(0, utils_2.compareVerifyingKeys)(pollJoinedVerifyingKeyOnChain, pollJoinedVerifyingKey)) {
74
+ throw new Error("pollJoinedVerifyingKey mismatch");
64
75
  }
65
- if (!(0, utils_2.compareVks)(processVkOnChain, processMessagesVk)) {
66
- throw new Error("processVk mismatch");
76
+ if (!(0, utils_2.compareVerifyingKeys)(processVerifyingKeyOnChain, processMessagesVerifyingKey)) {
77
+ throw new Error("processVerifyingKey mismatch");
67
78
  }
68
- if (!(0, utils_2.compareVks)(tallyVkOnChain, tallyVotesVk)) {
69
- throw new Error("tallyVk mismatch");
79
+ if (!(0, utils_2.compareVerifyingKeys)(tallyVerifyingKeyOnChain, tallyVotesVerifyingKey)) {
80
+ throw new Error("tallyVerifyingKey mismatch");
70
81
  }
71
82
  };
72
83
  exports.setVerifyingKeys = setVerifyingKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"setVerifyingKeys.js","sourceRoot":"","sources":["../../../ts/verifyingKeys/setVerifyingKeys.ts"],"names":[],"mappings":";;;AAAA,wDAAgH;AAChH,8CAA8G;AAI9G,oCAA0C;AAE1C,mCAAqC;AAErC;;;GAGG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,IAAI,GACkB,EAAiB,EAAE;IACzC,gBAAgB;IAChB,IAAI,cAAc,GAAG,CAAC,IAAI,iBAAiB,GAAG,CAAC,IAAI,mBAAmB,GAAG,CAAC,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;QACnG,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,cAAc,GAAG,iBAAiB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,wBAAwB,GAAG,MAAM,IAAA,sBAAc,EAAC,MAAM,CAAC,QAAS,EAAE,iBAAiB,CAAC,CAAC;IAC3F,6DAA6D;IAC7D,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,4CAA4C,iBAAiB,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,iCAAiC;IACjC,MAAM,kBAAkB,GAAG,+BAAiB,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,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AAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CACJ,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACzB,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpB,6BAA6B,CAAC,0BAA0B,CAAC,cAAc,CAAC;QACxE,6BAA6B,CAAC,yBAAyB,CAAC,cAAc,CAAC;QACvE,6BAA6B,CAAC,sBAAsB,CAAC,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,CAAC;QACjH,6BAA6B,CAAC,oBAAoB,CAChD,cAAc,EACd,6BAA6B,EAC7B,mBAAmB,EACnB,IAAI,CACL;KACF,CAAC,CAAC;IAEH,IAAI,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,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,IAAA,4BAAoB,EAAC,0BAA0B,EAAE,2BAA2B,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,CAAC,IAAA,4BAAoB,EAAC,wBAAwB,EAAE,sBAAsB,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC;AAxHW,QAAA,gBAAgB,oBAwH3B"}
@@ -1,14 +1,14 @@
1
1
  import type { EMode } from "@maci-protocol/contracts";
2
- import type { IVkContractParams, VerifyingKey } from "@maci-protocol/domainobjs";
2
+ import type { IVerifyingKeyContractParams, VerifyingKey } from "@maci-protocol/domainobjs";
3
3
  import type { Signer } from "ethers";
4
4
  /**
5
- * Arguments for the getAllVks function
5
+ * Arguments for the getAllVerifyingKeys function
6
6
  */
7
- export interface IGetAllVksArgs {
7
+ export interface IGetAllVerifyingKeysArgs {
8
8
  /**
9
- * The address of the VkRegistry contract
9
+ * The address of the VerifyingKeysRegistry contract
10
10
  */
11
- vkRegistryAddress: string;
11
+ verifyingKeysRegistryAddress: string;
12
12
  /**
13
13
  * The signer to use for the contract calls
14
14
  */
@@ -28,7 +28,7 @@ export interface IGetAllVksArgs {
28
28
  /**
29
29
  * The depth of the ballot tree
30
30
  */
31
- intStateTreeDepth: number;
31
+ tallyProcessingStateTreeDepth: number;
32
32
  /**
33
33
  * The mode to use for the contract calls
34
34
  */
@@ -37,28 +37,28 @@ export interface IGetAllVksArgs {
37
37
  /**
38
38
  * MACI's verifying keys
39
39
  */
40
- export interface IMaciVerifyingKeys {
40
+ export interface IMaciVerifyingKeysOnchain {
41
41
  /**
42
42
  * The verifying key for the poll joining circuit
43
43
  */
44
- pollJoiningVkOnChain: IVkContractParams;
44
+ pollJoiningVerifyingKeyOnChain: IVerifyingKeyContractParams;
45
45
  /**
46
46
  * The verifying key for the poll joined circuit
47
47
  */
48
- pollJoinedVkOnChain: IVkContractParams;
48
+ pollJoinedVerifyingKeyOnChain: IVerifyingKeyContractParams;
49
49
  /**
50
50
  * The verifying key for the process messages circuit
51
51
  */
52
- processVkOnChain: IVkContractParams;
52
+ processVerifyingKeyOnChain: IVerifyingKeyContractParams;
53
53
  /**
54
54
  * The verifying key for the tally votes circuit
55
55
  */
56
- tallyVkOnChain: IVkContractParams;
56
+ tallyVerifyingKeyOnChain: IVerifyingKeyContractParams;
57
57
  }
58
58
  /**
59
- * Arguments for the extractAllVks function
59
+ * Arguments for the extractAllVerifyingKeys function
60
60
  */
61
- export interface IExtractAllVksArgs {
61
+ export interface IExtractAllVerifyingKeysArgs {
62
62
  /**
63
63
  * The path to the poll joining zkey
64
64
  */
@@ -70,61 +70,65 @@ export interface IExtractAllVksArgs {
70
70
  /**
71
71
  * The path to the process messages zkey
72
72
  */
73
- processMessagesZkeyPath?: string;
73
+ messageProcessorZkeyPath?: string;
74
74
  /**
75
75
  * The path to the tally votes zkey
76
76
  */
77
- tallyVotesZkeyPath?: string;
77
+ voteTallyZkeyPath?: string;
78
78
  }
79
79
  /**
80
80
  * Maci verifying keys
81
81
  */
82
- export interface IMaciVks {
82
+ export interface IMaciVerifyingKeys {
83
83
  /**
84
84
  * The poll joining verifying key
85
85
  */
86
- pollJoiningVk?: VerifyingKey;
86
+ pollJoiningVerifyingKey?: VerifyingKey;
87
87
  /**
88
88
  * The poll joined verifying key
89
89
  */
90
- pollJoinedVk?: VerifyingKey;
90
+ pollJoinedVerifyingKey?: VerifyingKey;
91
91
  /**
92
92
  * The message processing verifying key
93
93
  */
94
- processVk?: VerifyingKey;
94
+ processVerifyingKey?: VerifyingKey;
95
95
  /**
96
96
  * The tally verifying key
97
97
  */
98
- tallyVk?: VerifyingKey;
98
+ tallyVerifyingKey?: VerifyingKey;
99
99
  }
100
100
  /**
101
101
  * The arguments for the setVerifyingKeys function
102
102
  */
103
103
  export interface ISetVerifyingKeysArgs {
104
104
  /**
105
- * The polll joining Vk object
105
+ * The polll joining verifying key object
106
106
  */
107
- pollJoiningVk: VerifyingKey;
107
+ pollJoiningVerifyingKey: VerifyingKey;
108
108
  /**
109
- * The poll joined Vk object
109
+ * The poll joined verifying key object
110
110
  */
111
- pollJoinedVk: VerifyingKey;
111
+ pollJoinedVerifyingKey: VerifyingKey;
112
112
  /**
113
- * The process messages Vk object
113
+ * The process messages verifying key object
114
114
  */
115
- processMessagesVk: VerifyingKey;
115
+ processMessagesVerifyingKey: VerifyingKey;
116
116
  /**
117
- * The tally votes Vk object
117
+ * The tally votes verifying key object
118
118
  */
119
- tallyVotesVk: VerifyingKey;
119
+ tallyVotesVerifyingKey: VerifyingKey;
120
120
  /**
121
121
  * The state tree depth
122
122
  */
123
123
  stateTreeDepth: number;
124
+ /**
125
+ * The poll state tree depth
126
+ */
127
+ pollStateTreeDepth: number;
124
128
  /**
125
129
  * The intermediate state tree depth (ballot tree)
126
130
  */
127
- intStateTreeDepth: number;
131
+ tallyProcessingStateTreeDepth: number;
128
132
  /**
129
133
  * The vote option tree depth
130
134
  */
@@ -134,9 +138,9 @@ export interface ISetVerifyingKeysArgs {
134
138
  */
135
139
  messageBatchSize: number;
136
140
  /**
137
- * The VkRegistry contract address
141
+ * The VerifyingKeysRegistry contract address
138
142
  */
139
- vkRegistryAddress: string;
143
+ verifyingKeysRegistryAddress: string;
140
144
  /**
141
145
  * The signer
142
146
  */
@@ -157,7 +161,7 @@ export interface ICheckVerifyingKeysArgs {
157
161
  /**
158
162
  * The depth of the state subtree
159
163
  */
160
- intStateTreeDepth: number;
164
+ tallyProcessingStateTreeDepth: number;
161
165
  /**
162
166
  * The depth of the vote option tree
163
167
  */
@@ -177,28 +181,28 @@ export interface ICheckVerifyingKeysArgs {
177
181
  /**
178
182
  * The path to the process messages zkey
179
183
  */
180
- processMessagesZkeyPath: string;
184
+ messageProcessorZkeyPath: string;
181
185
  /**
182
186
  * The path to the tally votes zkey
183
187
  */
184
- tallyVotesZkeyPath: string;
188
+ voteTallyZkeyPath: string;
185
189
  /**
186
190
  * A signer object
187
191
  */
188
192
  signer: Signer;
189
193
  /**
190
- * The address of the VkRegistry contract
194
+ * The address of the VerifyingKeysRegistry contract
191
195
  */
192
- vkRegistry: string;
196
+ verifyingKeysRegistry: string;
193
197
  /**
194
- * Whether to use quadratic voting or not
198
+ * Voting mode
195
199
  */
196
- useQuadraticVoting?: boolean;
200
+ mode?: EMode;
197
201
  }
198
202
  /**
199
- * Interface for the arguments to the extractVkToFile command
203
+ * Interface for the arguments to the extractVerifyingKeyToFile command
200
204
  */
201
- export interface IExtractVkToFileArgs {
205
+ export interface IExtractVerifyingKeyToFileArgs {
202
206
  /**
203
207
  * File path for poll joining zkey
204
208
  */
@@ -210,21 +214,25 @@ export interface IExtractVkToFileArgs {
210
214
  /**
211
215
  * File path for processMessagesQv zkey
212
216
  */
213
- processMessagesZkeyPathQv: string;
217
+ messageProcessorZkeyPathQv: string;
214
218
  /**
215
219
  * File path for tallyVotesQv zkey
216
220
  */
217
- tallyVotesZkeyPathQv: string;
221
+ voteTallyZkeyPathQv: string;
218
222
  /**
219
223
  * File path for processMessagesNonQv zkey
220
224
  */
221
- processMessagesZkeyPathNonQv: string;
225
+ messageProcessorZkeyPathNonQv: string;
226
+ /**
227
+ * File path for MessageProcessor zkey
228
+ */
229
+ messageProcessorZkeyPathFull: string;
222
230
  /**
223
- * File path for tallyVotes zkey
231
+ * File path for VoteTally zkey
224
232
  */
225
- tallyVotesZkeyPathNonQv: string;
233
+ voteTallyZkeyPathNonQv: string;
226
234
  /**
227
- * Output file path of extracted vkeys
235
+ * Output file path of extracted verifying keys
228
236
  */
229
237
  outputFilePath: string;
230
238
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,kB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AAM,CAAC;IAE/B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -1,29 +1,29 @@
1
- import { IVkContractParams, VerifyingKey } from "@maci-protocol/domainobjs";
2
- import type { IGetAllVksArgs, IExtractAllVksArgs, IMaciVks, IMaciVerifyingKeys, IExtractVkToFileArgs } from "./types";
1
+ import { type IVerifyingKeyContractParams, VerifyingKey } from "@maci-protocol/domainobjs";
2
+ import type { IGetAllVerifyingKeysArgs, IExtractAllVerifyingKeysArgs, IMaciVerifyingKeys, IMaciVerifyingKeysOnchain, IExtractVerifyingKeyToFileArgs } from "./types";
3
3
  /**
4
4
  * Get all the verifying keys from the contract
5
- * @param args - The arguments for the getAllVks function
5
+ * @param args - The arguments for the getAllVerifyingKeys function
6
6
  * @returns The verifying keys
7
7
  */
8
- export declare const getAllOnChainVks: ({ vkRegistryAddress, signer, stateTreeDepth, voteOptionTreeDepth, messageBatchSize, intStateTreeDepth, mode, }: IGetAllVksArgs) => Promise<IMaciVerifyingKeys>;
8
+ export declare const getAllOnChainVerifyingKeys: ({ verifyingKeysRegistryAddress, signer, stateTreeDepth, voteOptionTreeDepth, messageBatchSize, tallyProcessingStateTreeDepth, mode, }: IGetAllVerifyingKeysArgs) => Promise<IMaciVerifyingKeysOnchain>;
9
9
  /**
10
10
  * Compare two verifying keys
11
- * @param vkOnChain - the verifying key on chain
12
- * @param vk - the local verifying key
11
+ * @param verifyingKeyOnChain - the verifying key on chain
12
+ * @param verifyingKey - the local verifying key
13
13
  * @returns whether they are equal or not
14
14
  */
15
- export declare const compareVks: (vkOnChain: VerifyingKey | IVkContractParams, vk?: VerifyingKey | IVkContractParams) => boolean;
15
+ export declare const compareVerifyingKeys: (verifyingKeyOnChain: VerifyingKey | IVerifyingKeyContractParams, verifyingKey?: VerifyingKey | IVerifyingKeyContractParams) => boolean;
16
16
  /**
17
17
  * Extract all the verifying keys
18
- * @param args - The arguments for the extractAllVks function
18
+ * @param args - The arguments for the extractAllVerifyingKeys function
19
19
  * @returns The verifying keys
20
20
  */
21
- export declare const extractAllVks: ({ pollJoiningZkeyPath, pollJoinedZkeyPath, processMessagesZkeyPath, tallyVotesZkeyPath, }: IExtractAllVksArgs) => Promise<IMaciVks>;
21
+ export declare const extractAllVerifyingKeys: ({ pollJoiningZkeyPath, pollJoinedZkeyPath, messageProcessorZkeyPath, voteTallyZkeyPath, }: IExtractAllVerifyingKeysArgs) => Promise<IMaciVerifyingKeys>;
22
22
  /**
23
23
  * Command to confirm that the verifying keys in the contract match the local ones
24
24
  * @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
25
25
  * @param args The arguments for the checkVerifyingKeys command
26
26
  * @returns Whether the verifying keys match or not
27
27
  */
28
- export declare const extractVkToFile: ({ processMessagesZkeyPathQv, tallyVotesZkeyPathQv, processMessagesZkeyPathNonQv, pollJoinedZkeyPath, pollJoiningZkeyPath, tallyVotesZkeyPathNonQv, outputFilePath, }: IExtractVkToFileArgs) => Promise<void>;
28
+ export declare const extractVerifyingKeyToFile: ({ messageProcessorZkeyPathQv, voteTallyZkeyPathQv, messageProcessorZkeyPathNonQv, messageProcessorZkeyPathFull, pollJoinedZkeyPath, pollJoiningZkeyPath, voteTallyZkeyPathNonQv, outputFilePath, }: IExtractVerifyingKeyToFileArgs) => Promise<void>;
29
29
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/verifyingKeys/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI5E,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEtH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAU,gHAQpC,cAAc,KAAG,OAAO,CAA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