@maci-protocol/coordinator 0.0.0-ci.5209133

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 (257) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +22 -0
  3. package/README.md +42 -0
  4. package/build/hardhat.config.cjs +31 -0
  5. package/build/hardhat.config.cjs.map +1 -0
  6. package/build/hardhat.config.d.cts +24 -0
  7. package/build/hardhat.config.d.cts.map +1 -0
  8. package/build/scripts/generateKeypair.d.ts +2 -0
  9. package/build/scripts/generateKeypair.d.ts.map +1 -0
  10. package/build/scripts/generateKeypair.js +25 -0
  11. package/build/scripts/generateKeypair.js.map +1 -0
  12. package/build/scripts/generateMaciKeyPair.d.ts +2 -0
  13. package/build/scripts/generateMaciKeyPair.d.ts.map +1 -0
  14. package/build/scripts/generateMaciKeyPair.js +3 -0
  15. package/build/scripts/generateMaciKeyPair.js.map +1 -0
  16. package/build/scripts/getAuthHeader.d.ts +2 -0
  17. package/build/scripts/getAuthHeader.d.ts.map +1 -0
  18. package/build/scripts/getAuthHeader.js +31 -0
  19. package/build/scripts/getAuthHeader.js.map +1 -0
  20. package/build/tests/constants.d.ts +8 -0
  21. package/build/tests/constants.d.ts.map +1 -0
  22. package/build/tests/constants.js +10 -0
  23. package/build/tests/constants.js.map +1 -0
  24. package/build/tests/e2e.aa.test.d.ts +2 -0
  25. package/build/tests/e2e.aa.test.d.ts.map +1 -0
  26. package/build/tests/e2e.aa.test.js +103 -0
  27. package/build/tests/e2e.aa.test.js.map +1 -0
  28. package/build/tests/e2e.deploy.test.d.ts +2 -0
  29. package/build/tests/e2e.deploy.test.d.ts.map +1 -0
  30. package/build/tests/e2e.deploy.test.js +234 -0
  31. package/build/tests/e2e.deploy.test.js.map +1 -0
  32. package/build/tests/utils.d.ts +14 -0
  33. package/build/tests/utils.d.ts.map +1 -0
  34. package/build/tests/utils.js +44 -0
  35. package/build/tests/utils.js.map +1 -0
  36. package/build/ts/app.module.d.ts +3 -0
  37. package/build/ts/app.module.d.ts.map +1 -0
  38. package/build/ts/app.module.js +36 -0
  39. package/build/ts/app.module.js.map +1 -0
  40. package/build/ts/auth/AccountSignatureGuard.service.d.ts +44 -0
  41. package/build/ts/auth/AccountSignatureGuard.service.d.ts.map +1 -0
  42. package/build/ts/auth/AccountSignatureGuard.service.js +96 -0
  43. package/build/ts/auth/AccountSignatureGuard.service.js.map +1 -0
  44. package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts +2 -0
  45. package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts.map +1 -0
  46. package/build/ts/auth/__tests__/AccountSignatureGuard.test.js +113 -0
  47. package/build/ts/auth/__tests__/AccountSignatureGuard.test.js.map +1 -0
  48. package/build/ts/common/__tests__/common.test.d.ts +2 -0
  49. package/build/ts/common/__tests__/common.test.d.ts.map +1 -0
  50. package/build/ts/common/__tests__/common.test.js +79 -0
  51. package/build/ts/common/__tests__/common.test.js.map +1 -0
  52. package/build/ts/common/accountAbstraction.d.ts +55 -0
  53. package/build/ts/common/accountAbstraction.d.ts.map +1 -0
  54. package/build/ts/common/accountAbstraction.js +110 -0
  55. package/build/ts/common/accountAbstraction.js.map +1 -0
  56. package/build/ts/common/errors.d.ts +33 -0
  57. package/build/ts/common/errors.d.ts.map +1 -0
  58. package/build/ts/common/errors.js +34 -0
  59. package/build/ts/common/errors.js.map +1 -0
  60. package/build/ts/common/index.d.ts +4 -0
  61. package/build/ts/common/index.d.ts.map +1 -0
  62. package/build/ts/common/index.js +4 -0
  63. package/build/ts/common/index.js.map +1 -0
  64. package/build/ts/common/networks.d.ts +29 -0
  65. package/build/ts/common/networks.d.ts.map +1 -0
  66. package/build/ts/common/networks.js +70 -0
  67. package/build/ts/common/networks.js.map +1 -0
  68. package/build/ts/common/types.d.ts +9 -0
  69. package/build/ts/common/types.d.ts.map +1 -0
  70. package/build/ts/common/types.js +2 -0
  71. package/build/ts/common/types.js.map +1 -0
  72. package/build/ts/crypto/__tests__/crypto.service.test.d.ts +2 -0
  73. package/build/ts/crypto/__tests__/crypto.service.test.d.ts.map +1 -0
  74. package/build/ts/crypto/__tests__/crypto.service.test.js +26 -0
  75. package/build/ts/crypto/__tests__/crypto.service.test.js.map +1 -0
  76. package/build/ts/crypto/crypto.module.d.ts +3 -0
  77. package/build/ts/crypto/crypto.module.d.ts.map +1 -0
  78. package/build/ts/crypto/crypto.module.js +18 -0
  79. package/build/ts/crypto/crypto.module.js.map +1 -0
  80. package/build/ts/crypto/crypto.service.d.ts +31 -0
  81. package/build/ts/crypto/crypto.service.d.ts.map +1 -0
  82. package/build/ts/crypto/crypto.service.js +68 -0
  83. package/build/ts/crypto/crypto.service.js.map +1 -0
  84. package/build/ts/deployer/__tests__/deployer.controller.test.d.ts +2 -0
  85. package/build/ts/deployer/__tests__/deployer.controller.test.d.ts.map +1 -0
  86. package/build/ts/deployer/__tests__/deployer.controller.test.js +84 -0
  87. package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -0
  88. package/build/ts/deployer/__tests__/deployer.service.test.d.ts +2 -0
  89. package/build/ts/deployer/__tests__/deployer.service.test.d.ts.map +1 -0
  90. package/build/ts/deployer/__tests__/deployer.service.test.js +425 -0
  91. package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -0
  92. package/build/ts/deployer/__tests__/utils.d.ts +36 -0
  93. package/build/ts/deployer/__tests__/utils.d.ts.map +1 -0
  94. package/build/ts/deployer/__tests__/utils.js +96 -0
  95. package/build/ts/deployer/__tests__/utils.js.map +1 -0
  96. package/build/ts/deployer/constants.d.ts +13 -0
  97. package/build/ts/deployer/constants.d.ts.map +1 -0
  98. package/build/ts/deployer/constants.js +13 -0
  99. package/build/ts/deployer/constants.js.map +1 -0
  100. package/build/ts/deployer/deployer.controller.d.ts +34 -0
  101. package/build/ts/deployer/deployer.controller.d.ts.map +1 -0
  102. package/build/ts/deployer/deployer.controller.js +89 -0
  103. package/build/ts/deployer/deployer.controller.js.map +1 -0
  104. package/build/ts/deployer/deployer.module.d.ts +3 -0
  105. package/build/ts/deployer/deployer.module.d.ts.map +1 -0
  106. package/build/ts/deployer/deployer.module.js +23 -0
  107. package/build/ts/deployer/deployer.module.js.map +1 -0
  108. package/build/ts/deployer/deployer.service.d.ts +112 -0
  109. package/build/ts/deployer/deployer.service.d.ts.map +1 -0
  110. package/build/ts/deployer/deployer.service.js +628 -0
  111. package/build/ts/deployer/deployer.service.js.map +1 -0
  112. package/build/ts/deployer/dto.d.ts +46 -0
  113. package/build/ts/deployer/dto.d.ts.map +1 -0
  114. package/build/ts/deployer/dto.js +117 -0
  115. package/build/ts/deployer/dto.js.map +1 -0
  116. package/build/ts/deployer/types.d.ts +306 -0
  117. package/build/ts/deployer/types.d.ts.map +1 -0
  118. package/build/ts/deployer/types.js +2 -0
  119. package/build/ts/deployer/types.js.map +1 -0
  120. package/build/ts/deployer/utils.d.ts +8 -0
  121. package/build/ts/deployer/utils.d.ts.map +1 -0
  122. package/build/ts/deployer/utils.js +9 -0
  123. package/build/ts/deployer/utils.js.map +1 -0
  124. package/build/ts/file/__tests__/file.service.test.d.ts +2 -0
  125. package/build/ts/file/__tests__/file.service.test.d.ts.map +1 -0
  126. package/build/ts/file/__tests__/file.service.test.js +76 -0
  127. package/build/ts/file/__tests__/file.service.test.js.map +1 -0
  128. package/build/ts/file/file.module.d.ts +3 -0
  129. package/build/ts/file/file.module.d.ts.map +1 -0
  130. package/build/ts/file/file.module.js +18 -0
  131. package/build/ts/file/file.module.js.map +1 -0
  132. package/build/ts/file/file.service.d.ts +62 -0
  133. package/build/ts/file/file.service.d.ts.map +1 -0
  134. package/build/ts/file/file.service.js +115 -0
  135. package/build/ts/file/file.service.js.map +1 -0
  136. package/build/ts/file/types.d.ts +36 -0
  137. package/build/ts/file/types.d.ts.map +1 -0
  138. package/build/ts/file/types.js +2 -0
  139. package/build/ts/file/types.js.map +1 -0
  140. package/build/ts/jest/setup.d.ts +8 -0
  141. package/build/ts/jest/setup.d.ts.map +1 -0
  142. package/build/ts/jest/setup.js +2 -0
  143. package/build/ts/jest/setup.js.map +1 -0
  144. package/build/ts/jest/transform.d.ts +8 -0
  145. package/build/ts/jest/transform.d.ts.map +1 -0
  146. package/build/ts/jest/transform.js +10 -0
  147. package/build/ts/jest/transform.js.map +1 -0
  148. package/build/ts/main.d.ts +2 -0
  149. package/build/ts/main.d.ts.map +1 -0
  150. package/build/ts/main.js +46 -0
  151. package/build/ts/main.js.map +1 -0
  152. package/build/ts/proof/__tests__/proof.controller.test.d.ts +2 -0
  153. package/build/ts/proof/__tests__/proof.controller.test.d.ts.map +1 -0
  154. package/build/ts/proof/__tests__/proof.controller.test.js +89 -0
  155. package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -0
  156. package/build/ts/proof/__tests__/proof.gateway.test.d.ts +2 -0
  157. package/build/ts/proof/__tests__/proof.gateway.test.d.ts.map +1 -0
  158. package/build/ts/proof/__tests__/proof.gateway.test.js +61 -0
  159. package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -0
  160. package/build/ts/proof/__tests__/proof.service.test.d.ts +2 -0
  161. package/build/ts/proof/__tests__/proof.service.test.d.ts.map +1 -0
  162. package/build/ts/proof/__tests__/proof.service.test.js +128 -0
  163. package/build/ts/proof/__tests__/proof.service.test.js.map +1 -0
  164. package/build/ts/proof/dto.d.ts +73 -0
  165. package/build/ts/proof/dto.d.ts.map +1 -0
  166. package/build/ts/proof/dto.js +255 -0
  167. package/build/ts/proof/dto.js.map +1 -0
  168. package/build/ts/proof/proof.controller.d.ts +46 -0
  169. package/build/ts/proof/proof.controller.d.ts.map +1 -0
  170. package/build/ts/proof/proof.controller.js +135 -0
  171. package/build/ts/proof/proof.controller.js.map +1 -0
  172. package/build/ts/proof/proof.gateway.d.ts +35 -0
  173. package/build/ts/proof/proof.gateway.d.ts.map +1 -0
  174. package/build/ts/proof/proof.gateway.js +93 -0
  175. package/build/ts/proof/proof.gateway.js.map +1 -0
  176. package/build/ts/proof/proof.module.d.ts +3 -0
  177. package/build/ts/proof/proof.module.d.ts.map +1 -0
  178. package/build/ts/proof/proof.module.js +24 -0
  179. package/build/ts/proof/proof.module.js.map +1 -0
  180. package/build/ts/proof/proof.service.d.ts +54 -0
  181. package/build/ts/proof/proof.service.d.ts.map +1 -0
  182. package/build/ts/proof/proof.service.js +246 -0
  183. package/build/ts/proof/proof.service.js.map +1 -0
  184. package/build/ts/proof/types.d.ts +140 -0
  185. package/build/ts/proof/types.d.ts.map +1 -0
  186. package/build/ts/proof/types.js +11 -0
  187. package/build/ts/proof/types.js.map +1 -0
  188. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts +2 -0
  189. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts.map +1 -0
  190. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +44 -0
  191. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -0
  192. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts +2 -0
  193. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts.map +1 -0
  194. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +61 -0
  195. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -0
  196. package/build/ts/sessionKeys/__tests__/utils.d.ts +25 -0
  197. package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -0
  198. package/build/ts/sessionKeys/__tests__/utils.js +64 -0
  199. package/build/ts/sessionKeys/__tests__/utils.js.map +1 -0
  200. package/build/ts/sessionKeys/dto.d.ts +11 -0
  201. package/build/ts/sessionKeys/dto.d.ts.map +1 -0
  202. package/build/ts/sessionKeys/dto.js +29 -0
  203. package/build/ts/sessionKeys/dto.js.map +1 -0
  204. package/build/ts/sessionKeys/sessionKeys.controller.d.ts +26 -0
  205. package/build/ts/sessionKeys/sessionKeys.controller.d.ts.map +1 -0
  206. package/build/ts/sessionKeys/sessionKeys.controller.js +74 -0
  207. package/build/ts/sessionKeys/sessionKeys.controller.js.map +1 -0
  208. package/build/ts/sessionKeys/sessionKeys.module.d.ts +3 -0
  209. package/build/ts/sessionKeys/sessionKeys.module.d.ts.map +1 -0
  210. package/build/ts/sessionKeys/sessionKeys.module.js +23 -0
  211. package/build/ts/sessionKeys/sessionKeys.module.js.map +1 -0
  212. package/build/ts/sessionKeys/sessionKeys.service.d.ts +50 -0
  213. package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -0
  214. package/build/ts/sessionKeys/sessionKeys.service.js +104 -0
  215. package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -0
  216. package/build/ts/sessionKeys/types.d.ts +11 -0
  217. package/build/ts/sessionKeys/types.d.ts.map +1 -0
  218. package/build/ts/sessionKeys/types.js +2 -0
  219. package/build/ts/sessionKeys/types.js.map +1 -0
  220. package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts +2 -0
  221. package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts.map +1 -0
  222. package/build/ts/subgraph/__tests__/subgraph.controller.test.js +50 -0
  223. package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -0
  224. package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts +2 -0
  225. package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts.map +1 -0
  226. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +83 -0
  227. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -0
  228. package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts +2 -0
  229. package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts.map +1 -0
  230. package/build/ts/subgraph/__tests__/subgraph.service.test.js +58 -0
  231. package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -0
  232. package/build/ts/subgraph/dto.d.ts +27 -0
  233. package/build/ts/subgraph/dto.d.ts.map +1 -0
  234. package/build/ts/subgraph/dto.js +83 -0
  235. package/build/ts/subgraph/dto.js.map +1 -0
  236. package/build/ts/subgraph/subgraph.controller.d.ts +24 -0
  237. package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -0
  238. package/build/ts/subgraph/subgraph.controller.js +66 -0
  239. package/build/ts/subgraph/subgraph.controller.js.map +1 -0
  240. package/build/ts/subgraph/subgraph.gateway.d.ts +35 -0
  241. package/build/ts/subgraph/subgraph.gateway.d.ts.map +1 -0
  242. package/build/ts/subgraph/subgraph.gateway.js +93 -0
  243. package/build/ts/subgraph/subgraph.gateway.js.map +1 -0
  244. package/build/ts/subgraph/subgraph.module.d.ts +3 -0
  245. package/build/ts/subgraph/subgraph.module.d.ts.map +1 -0
  246. package/build/ts/subgraph/subgraph.module.js +23 -0
  247. package/build/ts/subgraph/subgraph.module.js.map +1 -0
  248. package/build/ts/subgraph/subgraph.service.d.ts +20 -0
  249. package/build/ts/subgraph/subgraph.service.d.ts.map +1 -0
  250. package/build/ts/subgraph/subgraph.service.js +106 -0
  251. package/build/ts/subgraph/subgraph.service.js.map +1 -0
  252. package/build/ts/subgraph/types.d.ts +93 -0
  253. package/build/ts/subgraph/types.d.ts.map +1 -0
  254. package/build/ts/subgraph/types.js +24 -0
  255. package/build/ts/subgraph/types.js.map +1 -0
  256. package/build/tsconfig.build.tsbuildinfo +1 -0
  257. package/package.json +124 -0
@@ -0,0 +1,36 @@
1
+ import { IDeployMaciConfig, IDeployPollConfig, IEASPolicyArgs, IGitcoinPassportPolicyArgs, IHatsPolicyArgs, ISemaphorePolicyArgs, IZupassPolicyArgs } from "../types";
2
+ export declare const MSG_BATCH_SIZE = 20;
3
+ /**
4
+ * MACI deployment configuration for testing
5
+ */
6
+ export declare const testMaciDeploymentConfig: IDeployMaciConfig;
7
+ /**
8
+ * Poll deployment configuration for testing
9
+ */
10
+ export declare const testPollDeploymentConfig: IDeployPollConfig;
11
+ /**
12
+ *
13
+ * Policies
14
+ *
15
+ */
16
+ /**
17
+ * EAS Policy deployment configuration for testing
18
+ */
19
+ export declare const EASPolicyDeploymentConfig: IEASPolicyArgs;
20
+ /**
21
+ * Zupass Policy deployment configuration for testing
22
+ */
23
+ export declare const ZupassPolicyDeploymentConfig: IZupassPolicyArgs;
24
+ /**
25
+ * Semaphore Policy deployment configuration for testing
26
+ */
27
+ export declare const SemaphorePolicyDeploymentConfig: ISemaphorePolicyArgs;
28
+ /**
29
+ * HatsPolicy deployment configuration for testing
30
+ */
31
+ export declare const HatsPolicyDeploymentConfig: IHatsPolicyArgs;
32
+ /**
33
+ * GitcoinPassportPolicy deployment configuration for testing
34
+ */
35
+ export declare const GitcoinPassportPolicyDeploymentConfig: IGitcoinPassportPolicyArgs;
36
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../ts/deployer/__tests__/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAuBtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAkBtC,CAAC;AAEF;;;;GAIG;AACH;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAIvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,iBAK1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,oBAG7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,eAGxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC,EAAE,0BAGnD,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { Keypair } from "@maci-protocol/domainobjs";
2
+ import { EPolicies, EInitialVoiceCreditProxies } from "@maci-protocol/sdk";
3
+ export const MSG_BATCH_SIZE = 20;
4
+ /**
5
+ * MACI deployment configuration for testing
6
+ */
7
+ export const testMaciDeploymentConfig = {
8
+ policy: {
9
+ type: EPolicies.FreeForAll,
10
+ },
11
+ MACI: {
12
+ policy: EPolicies.FreeForAll,
13
+ stateTreeDepth: 10,
14
+ },
15
+ VkRegistry: {
16
+ args: {
17
+ stateTreeDepth: 10n,
18
+ messageBatchSize: MSG_BATCH_SIZE,
19
+ voteOptionTreeDepth: 2n,
20
+ intStateTreeDepth: 1n,
21
+ },
22
+ },
23
+ Poseidon: {
24
+ // poseidon contracts on optimism sepolia
25
+ poseidonT3: "0x07490eba00dc4ACA6721D052Fa4C5002Aa077233",
26
+ poseidonT4: "0xbb0e724CE02e5E7eDd31e632dc6e59F229a1126d",
27
+ poseidonT5: "0xE0398F7DFAC494c530F6404AfEaC8669ABeD2679",
28
+ poseidonT6: "0xfD77833F10a29c76A6a0ede235Eb651D744d0E2F",
29
+ },
30
+ };
31
+ /**
32
+ * Poll deployment configuration for testing
33
+ */
34
+ export const testPollDeploymentConfig = {
35
+ startDate: 100,
36
+ endDate: 200,
37
+ useQuadraticVoting: false,
38
+ coordinatorPubkey: new Keypair().pubKey.serialize(),
39
+ intStateTreeDepth: 1,
40
+ messageBatchSize: MSG_BATCH_SIZE,
41
+ voteOptionTreeDepth: 2,
42
+ policy: {
43
+ type: EPolicies.FreeForAll,
44
+ },
45
+ initialVoiceCreditsProxy: {
46
+ type: EInitialVoiceCreditProxies.Constant,
47
+ args: {
48
+ amount: "100",
49
+ },
50
+ },
51
+ voteOptions: 2n,
52
+ };
53
+ /**
54
+ *
55
+ * Policies
56
+ *
57
+ */
58
+ /**
59
+ * EAS Policy deployment configuration for testing
60
+ */
61
+ export const EASPolicyDeploymentConfig = {
62
+ easAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
63
+ schema: "0xe2636f31239f7948afdd9a9c477048b7fc2a089c347af60e3aa1251e5bf63e5c",
64
+ attester: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
65
+ };
66
+ /**
67
+ * Zupass Policy deployment configuration for testing
68
+ */
69
+ export const ZupassPolicyDeploymentConfig = {
70
+ signer1: "13908133709081944902758389525983124100292637002438232157513257158004852609027",
71
+ signer2: "7654374482676219729919246464135900991450848628968334062174564799457623790084",
72
+ eventId: "0",
73
+ zupassVerifier: "0x2272cdb3596617886d0F48524DA486044E0376d6",
74
+ };
75
+ /**
76
+ * Semaphore Policy deployment configuration for testing
77
+ */
78
+ export const SemaphorePolicyDeploymentConfig = {
79
+ semaphoreContract: "0x0A09FB3f63c13F1C54F2fA41AFB1e7a98cffc774",
80
+ groupId: "0",
81
+ };
82
+ /**
83
+ * HatsPolicy deployment configuration for testing
84
+ */
85
+ export const HatsPolicyDeploymentConfig = {
86
+ hatsProtocolAddress: "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137",
87
+ critrionHats: ["26960358043289970096177553829315270011263390106506980876069447401472"],
88
+ };
89
+ /**
90
+ * GitcoinPassportPolicy deployment configuration for testing
91
+ */
92
+ export const GitcoinPassportPolicyDeploymentConfig = {
93
+ decoderAddress: "0xe53C60F8069C2f0c3a84F9B3DB5cf56f3100ba56",
94
+ passingScore: "5",
95
+ };
96
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../ts/deployer/__tests__/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAY3E,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB;IACzD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS,CAAC,UAAU;KAC3B;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS,CAAC,UAAU;QAC5B,cAAc,EAAE,EAAE;KACnB;IACD,UAAU,EAAE;QACV,IA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,MAAM,0BAA0B,GAAoB;IACzD,mBAAmB,EAAE,4CAA4C;IACjE,YAAY,EAAE,CAAC,sEAAsE,CAAC;CACvF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAA+B;IAC/E,cAAc,EAAE,4CAA4C;IAC5D,YAAY,EAAE,GAAG;CAClB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The maximum gas limit for a user operation
3
+ */
4
+ export declare const MAX_GAS_LIMIT = 28000000n;
5
+ /**
6
+ * The divisor for the gas limit
7
+ */
8
+ export declare const DIVISOR = 100n;
9
+ /**
10
+ * The extra gas limit percentage
11
+ */
12
+ export declare const EXTRA_GAS_LIMIT_PERCENTAGE = 5n;
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../ts/deployer/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,OAAO,OAAO,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The maximum gas limit for a user operation
3
+ */
4
+ export const MAX_GAS_LIMIT = 28000000n;
5
+ /**
6
+ * The divisor for the gas limit
7
+ */
8
+ export const DIVISOR = 100n;
9
+ /**
10
+ * The extra gas limit percentage
11
+ */
12
+ export const EXTRA_GAS_LIMIT_PERCENTAGE = 5n;
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../ts/deployer/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { DeployerService } from "./deployer.service";
2
+ import { DeployerServiceDeployMaciDto, DeployerServiceDeployPollDto } from "./dto";
3
+ export declare class DeployerController {
4
+ private readonly deployerService;
5
+ /**
6
+ * Logger
7
+ */
8
+ private readonly logger;
9
+ /**
10
+ * Initialize DeployerController
11
+ *
12
+ * @param deployerService - deployer service
13
+ */
14
+ constructor(deployerService: DeployerService);
15
+ /**
16
+ * Deploy MACI contracts api method
17
+ *
18
+ * @param args - deploy maci dto
19
+ * @returns maci contract address
20
+ */
21
+ deployMACIContracts(args: DeployerServiceDeployMaciDto): Promise<{
22
+ address: string;
23
+ }>;
24
+ /**
25
+ * Deploy a poll
26
+ *
27
+ * @param args - deploy poll dto
28
+ * @returns the poll id
29
+ */
30
+ deployPoll(args: DeployerServiceDeployPollDto): Promise<{
31
+ pollId: string;
32
+ }>;
33
+ }
34
+ //# sourceMappingURL=deployer.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployer.controller.d.ts","sourceRoot":"","sources":["../../../ts/deployer/deployer.controller.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,OAAO,CAAC;AAEnF,qBAIa,kBAAkB;IAWjB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAV5C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAE9D;;;;OAIG;gBAC0B,eAAe,EAAE,eAAe;IAE7D;;;;;OAKG;IAMG,mBAAmB,CAAS,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAOnG;;;;;OAKG;IAMG,UAAU,CAAS,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAM1F"}
@@ -0,0 +1,89 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ var DeployerController_1;
14
+ /* eslint-disable @typescript-eslint/no-shadow */
15
+ import { Body, Controller, HttpException, HttpStatus, Logger, Post, UseGuards } from "@nestjs/common";
16
+ import { ApiBearerAuth, ApiBody, ApiResponse, ApiTags } from "@nestjs/swagger";
17
+ import { AccountSignatureGuard } from "../auth/AccountSignatureGuard.service";
18
+ import { DeployerService } from "./deployer.service";
19
+ import { DeployerServiceDeployMaciDto, DeployerServiceDeployPollDto } from "./dto";
20
+ let DeployerController = DeployerController_1 = class DeployerController {
21
+ deployerService;
22
+ /**
23
+ * Logger
24
+ */
25
+ logger = new Logger(DeployerController_1.name);
26
+ /**
27
+ * Initialize DeployerController
28
+ *
29
+ * @param deployerService - deployer service
30
+ */
31
+ constructor(deployerService) {
32
+ this.deployerService = deployerService;
33
+ }
34
+ /**
35
+ * Deploy MACI contracts api method
36
+ *
37
+ * @param args - deploy maci dto
38
+ * @returns maci contract address
39
+ */
40
+ async deployMACIContracts(args) {
41
+ return this.deployerService.deployMaci(args).catch((error) => {
42
+ this.logger.error(`Error:`, error);
43
+ throw new HttpException(error.message, HttpStatus.BAD_REQUEST);
44
+ });
45
+ }
46
+ /**
47
+ * Deploy a poll
48
+ *
49
+ * @param args - deploy poll dto
50
+ * @returns the poll id
51
+ */
52
+ async deployPoll(args) {
53
+ return this.deployerService.deployPoll(args).catch((error) => {
54
+ this.logger.error(`Error:`, error);
55
+ throw new HttpException(error.message, HttpStatus.BAD_REQUEST);
56
+ });
57
+ }
58
+ };
59
+ __decorate([
60
+ ApiBody({ type: DeployerServiceDeployMaciDto }),
61
+ ApiResponse({ status: HttpStatus.CREATED, description: "The MACI contracts were successfully deployed" }),
62
+ ApiResponse({ status: HttpStatus.FORBIDDEN, description: "Forbidden" }),
63
+ ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "BadRequest" }),
64
+ Post("maci"),
65
+ __param(0, Body()),
66
+ __metadata("design:type", Function),
67
+ __metadata("design:paramtypes", [DeployerServiceDeployMaciDto]),
68
+ __metadata("design:returntype", Promise)
69
+ ], DeployerController.prototype, "deployMACIContracts", null);
70
+ __decorate([
71
+ ApiBody({ type: DeployerServiceDeployPollDto }),
72
+ ApiResponse({ status: HttpStatus.CREATED, description: "The Poll was successfully deployed" }),
73
+ ApiResponse({ status: HttpStatus.FORBIDDEN, description: "Forbidden" }),
74
+ ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "BadRequest" }),
75
+ Post("poll"),
76
+ __param(0, Body()),
77
+ __metadata("design:type", Function),
78
+ __metadata("design:paramtypes", [DeployerServiceDeployPollDto]),
79
+ __metadata("design:returntype", Promise)
80
+ ], DeployerController.prototype, "deployPoll", null);
81
+ DeployerController = DeployerController_1 = __decorate([
82
+ ApiTags("v1/deploy"),
83
+ ApiBearerAuth(),
84
+ Controller("v1/deploy"),
85
+ UseGuards(AccountSignatureGuard),
86
+ __metadata("design:paramtypes", [DeployerService])
87
+ ], DeployerController);
88
+ export { DeployerController };
89
+ //# sourceMappingURL=deployer.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployer.controller.js","sourceRoot":"","sources":["../../../ts/deployer/deployer.controller.ts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 +1 @@
1
+ {"version":3,"file":"deployer.module.d.ts","sourceRoot":"","sources":["../../../ts/deployer/deployer.module.ts"],"names":[],"mappings":"AASA,qBAKa,cAAc;CAAG"}
@@ -0,0 +1,23 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Module } from "@nestjs/common";
8
+ import { CryptoModule } from "../crypto/crypto.module";
9
+ import { FileModule } from "../file/file.module";
10
+ import { SessionKeysModule } from "../sessionKeys/sessionKeys.module";
11
+ import { DeployerController } from "./deployer.controller";
12
+ import { DeployerService } from "./deployer.service";
13
+ let DeployerModule = class DeployerModule {
14
+ };
15
+ DeployerModule = __decorate([
16
+ Module({
17
+ imports: [FileModule, CryptoModule, SessionKeysModule],
18
+ controllers: [DeployerController],
19
+ providers: [DeployerService],
20
+ })
21
+ ], DeployerModule);
22
+ export { DeployerModule };
23
+ //# sourceMappingURL=deployer.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployer.module.js","sourceRoot":"","sources":["../../../ts/deployer/deployer.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,cAAc;IAL1B,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,iBAAiB,CAAC;QACtD,WAAW,EAAE,CAAC,kBAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,eAAe,CAAC;KAC7B,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,112 @@
1
+ import { EPolicies, EContracts, EInitialVoiceCreditProxies, EMode, type ISetVerifyingKeysArgs, VkRegistry } from "@maci-protocol/sdk";
2
+ import { Signer } from "ethers";
3
+ import { GetUserOperationReceiptReturnType } from "permissionless";
4
+ import { Abi, type Hex } from "viem";
5
+ import { ESupportedNetworks, KernelClientType, BundlerClientType, PublicClientType } from "../common";
6
+ import { FileService } from "../file/file.service";
7
+ import { SessionKeysService } from "../sessionKeys/sessionKeys.service";
8
+ import { IContractData, IDeployMaciArgs, IDeployPollArgs, IPolicyArgs, IInitialVoiceCreditProxyArgs, IVkRegistryArgs } from "./types";
9
+ /**
10
+ * DeployerService is responsible for deploying contracts.
11
+ */
12
+ export declare class DeployerService {
13
+ private readonly sessionKeysService;
14
+ private readonly fileService;
15
+ /**
16
+ * Logger
17
+ */
18
+ private readonly logger;
19
+ /**
20
+ * Contract storage instance
21
+ */
22
+ private readonly storage;
23
+ /**
24
+ * Create a new instance of DeployerService
25
+ *
26
+ * @param fileService - file service
27
+ */
28
+ constructor(sessionKeysService: SessionKeysService, fileService: FileService);
29
+ /**
30
+ * Get the policy abi and bytecode based on the policy type
31
+ * and also check if there is already an instance deployed
32
+ *
33
+ * @param policyType - the policy type
34
+ * @param network - the network
35
+ * @param args - the policy args
36
+ * @returns - the policy abi and bytecode
37
+ */
38
+ getPolicyData(policyType: EPolicies, network: ESupportedNetworks, args?: IPolicyArgs): IContractData;
39
+ /**
40
+ * Get the voice credit proxy abi and bytecode based on the voice credit proxy type
41
+ * and also check if there is already an instance deployed
42
+ *
43
+ * @param voiceCreditProxyType - the voice credit proxy type
44
+ * @param network - the network
45
+ * @param args - the voice credit proxy args
46
+ * @returns - the voice credit proxy abi and bytecode
47
+ */
48
+ getVoiceCreditProxyData(voiceCreditProxyType: EInitialVoiceCreditProxies, network: ESupportedNetworks, args: IInitialVoiceCreditProxyArgs): IContractData;
49
+ /**
50
+ * @param abi - the abi
51
+ * @param bytecode - the bytecode
52
+ * @param args - the args
53
+ * @param publicClient - the public client
54
+ * @returns - the address
55
+ */
56
+ deployAndGetAddress(kernelClient: KernelClientType, abi: Abi, bytecode: Hex, args: unknown[], bundlerClient: BundlerClientType, publicClient: PublicClientType): Promise<string | undefined>;
57
+ /**
58
+ * Deploy a contract and store the address
59
+ *
60
+ * @param contract - the contract to deploy
61
+ * @param args - the args
62
+ * @param abi - the abi
63
+ * @param bytecode - the bytecode
64
+ * @param kernelClient - the kernel client
65
+ * @param publicClient - the public client
66
+ * @param chain - the chain
67
+ * @returns - the address of the deployed contract
68
+ */
69
+ deployAndStore(contract: EContracts, args: unknown[], abi: Abi, bytecode: Hex, kernelClient: KernelClientType, bundlerClient: BundlerClientType, publicClient: PublicClientType, chain: ESupportedNetworks): Promise<Hex>;
70
+ /**
71
+ * Estimate gas, add a bit extra and send the user operation (aka. transaction)
72
+ * @param to - the to address of the user operation
73
+ * @param value - the value of the user operation
74
+ * @param abi - the abi
75
+ * @param functionName - the function name
76
+ * @param args - the args
77
+ * @param errorMessage - the error message
78
+ * @param kernelClient - the kernel client
79
+ * @param bundlerClient - the bundler client
80
+ */
81
+ estimateGasAndSend(to: Hex, value: bigint, abi: Abi, functionName: string, args: unknown[], errorMessage: string, kernelClient: KernelClientType, bundlerClient: BundlerClientType): Promise<GetUserOperationReceiptReturnType>;
82
+ /**
83
+ * Get verifying keys arguments (specially zkey paths)
84
+ * @param signer - the signer
85
+ * @param vkRegistryContract - the deployed vk registry contract
86
+ * @param vkRegistryArgs - the arguments send to the endpoint
87
+ * @param mode - use QV or NON_QV
88
+ * @returns SetVerifyingKeysArgs
89
+ */
90
+ getVerifyingKeysArgs(signer: Signer, vkRegistryContract: VkRegistry, vkRegistryArgs: IVkRegistryArgs, mode: EMode): Promise<ISetVerifyingKeysArgs>;
91
+ /**
92
+ * Deploy MACI contracts
93
+ *
94
+ * @param args - deploy maci arguments
95
+ * @param options - ws hooks
96
+ * @returns - deployed maci contract
97
+ * @returns the address of the deployed maci contract
98
+ */
99
+ deployMaci({ approval, sessionKeyAddress, chain, config }: IDeployMaciArgs): Promise<{
100
+ address: string;
101
+ }>;
102
+ /**
103
+ * Deploy a poll
104
+ *
105
+ * @param args - deploy poll dto
106
+ * @returns poll id
107
+ */
108
+ deployPoll({ approval, sessionKeyAddress, chain, config }: IDeployPollArgs): Promise<{
109
+ pollId: string;
110
+ }>;
111
+ }
112
+ //# sourceMappingURL=deployer.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployer.service.d.ts","sourceRoot":"","sources":["../../../ts/deployer/deployer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,SAAS,EAsBT,UAAU,EACV,0BAA0B,EAC1B,KAAK,EAEL,KAAK,qBAAqB,EAK1B,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAA8B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAIzD,OAAO,EAAc,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGxE,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EAEf,WAAW,EAGX,4BAA4B,EAG5B,eAAe,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