@enclave-e3/contracts 0.1.11 → 0.1.13

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/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +3 -3
  2. package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/artifacts.d.ts +3 -3
  3. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +1 -1
  4. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +3 -3
  5. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/artifacts.d.ts +4 -4
  6. package/artifacts/build-info/{solc-0_8_28-c77ac33099bb85c15f46d194dd2b735e036cb799.json → solc-0_8_28-e60a5d7c133605edcf61acdd5ba43ab44ee0928e.json} +27 -12
  7. package/artifacts/build-info/solc-0_8_28-e60a5d7c133605edcf61acdd5ba43ab44ee0928e.output.json +1 -0
  8. package/artifacts/contracts/E3RefundManager.sol/E3RefundManager.json +684 -0
  9. package/artifacts/contracts/E3RefundManager.sol/artifacts.d.ts +27 -0
  10. package/artifacts/contracts/Enclave.sol/Enclave.json +530 -182
  11. package/artifacts/contracts/Enclave.sol/artifacts.d.ts +4 -4
  12. package/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +14 -1
  13. package/artifacts/contracts/interfaces/IBondingRegistry.sol/artifacts.d.ts +2 -2
  14. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +55 -5
  15. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/artifacts.d.ts +2 -2
  16. package/artifacts/contracts/interfaces/IComputeProvider.sol/IComputeProvider.json +1 -1
  17. package/artifacts/contracts/interfaces/IComputeProvider.sol/artifacts.d.ts +1 -1
  18. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/IDecryptionVerifier.json +1 -1
  19. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/artifacts.d.ts +1 -1
  20. package/artifacts/contracts/interfaces/IE3Program.sol/IE3Program.json +19 -24
  21. package/artifacts/contracts/interfaces/IE3Program.sol/artifacts.d.ts +2 -2
  22. package/artifacts/contracts/interfaces/IE3RefundManager.sol/IE3RefundManager.json +470 -0
  23. package/artifacts/contracts/interfaces/IE3RefundManager.sol/artifacts.d.ts +27 -0
  24. package/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json +383 -128
  25. package/artifacts/contracts/interfaces/IEnclave.sol/artifacts.d.ts +2 -2
  26. package/artifacts/contracts/interfaces/ISlashVerifier.sol/ISlashVerifier.json +1 -1
  27. package/artifacts/contracts/interfaces/ISlashVerifier.sol/artifacts.d.ts +1 -1
  28. package/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +1 -1
  29. package/artifacts/contracts/interfaces/ISlashingManager.sol/artifacts.d.ts +1 -1
  30. package/artifacts/contracts/lib/ExitQueueLib.sol/ExitQueueLib.json +1 -1
  31. package/artifacts/contracts/lib/ExitQueueLib.sol/artifacts.d.ts +1 -1
  32. package/artifacts/contracts/registry/BondingRegistry.sol/BondingRegistry.json +16 -3
  33. package/artifacts/contracts/registry/BondingRegistry.sol/artifacts.d.ts +4 -4
  34. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/CiphernodeRegistryOwnable.json +91 -25
  35. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/artifacts.d.ts +6 -6
  36. package/artifacts/contracts/slashing/SlashingManager.sol/SlashingManager.json +3 -3
  37. package/artifacts/contracts/slashing/SlashingManager.sol/artifacts.d.ts +3 -3
  38. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.json +57 -7
  39. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.json +57 -7
  40. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/artifacts.d.ts +8 -8
  41. package/artifacts/contracts/test/MockComputeProvider.sol/MockComputeProvider.json +3 -3
  42. package/artifacts/contracts/test/MockComputeProvider.sol/artifacts.d.ts +3 -3
  43. package/artifacts/contracts/test/MockDecryptionVerifier.sol/MockDecryptionVerifier.json +1 -1
  44. package/artifacts/contracts/test/MockDecryptionVerifier.sol/artifacts.d.ts +1 -1
  45. package/artifacts/contracts/test/MockE3Program.sol/MockE3Program.json +21 -26
  46. package/artifacts/contracts/test/MockE3Program.sol/artifacts.d.ts +4 -4
  47. package/artifacts/contracts/test/MockSlashingVerifier.sol/MockSlashingVerifier.json +1 -1
  48. package/artifacts/contracts/test/MockSlashingVerifier.sol/artifacts.d.ts +1 -1
  49. package/artifacts/contracts/test/MockStableToken.sol/MockUSDC.json +3 -3
  50. package/artifacts/contracts/test/MockStableToken.sol/artifacts.d.ts +3 -3
  51. package/artifacts/contracts/token/EnclaveTicketToken.sol/EnclaveTicketToken.json +14 -22
  52. package/artifacts/contracts/token/EnclaveTicketToken.sol/artifacts.d.ts +4 -4
  53. package/artifacts/contracts/token/EnclaveToken.sol/EnclaveToken.json +10 -10
  54. package/artifacts/contracts/token/EnclaveToken.sol/artifacts.d.ts +4 -4
  55. package/artifacts/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier.json +89 -0
  56. package/artifacts/contracts/verifier/DkgPkVerifier.sol/CommitmentSchemeLib.json +13 -0
  57. package/artifacts/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier.json +186 -0
  58. package/artifacts/contracts/verifier/DkgPkVerifier.sol/FrLib.json +13 -0
  59. package/artifacts/contracts/verifier/DkgPkVerifier.sol/Honk.json +13 -0
  60. package/artifacts/contracts/verifier/DkgPkVerifier.sol/HonkVerificationKey.json +13 -0
  61. package/artifacts/contracts/verifier/DkgPkVerifier.sol/IVerifier.json +38 -0
  62. package/artifacts/contracts/verifier/DkgPkVerifier.sol/RelationsLib.json +13 -0
  63. package/artifacts/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib.json +400 -0
  64. package/artifacts/contracts/verifier/DkgPkVerifier.sol/artifacts.d.ts +155 -0
  65. package/artifacts/poseidon-solidity/PoseidonT3.sol/PoseidonT3.json +1 -1
  66. package/artifacts/poseidon-solidity/PoseidonT3.sol/artifacts.d.ts +1 -1
  67. package/contracts/E3RefundManager.sol +365 -0
  68. package/contracts/Enclave.sol +426 -119
  69. package/contracts/interfaces/IBondingRegistry.sol +6 -0
  70. package/contracts/interfaces/ICiphernodeRegistry.sol +29 -7
  71. package/contracts/interfaces/IE3.sol +2 -6
  72. package/contracts/interfaces/IE3Program.sol +3 -7
  73. package/contracts/interfaces/IE3RefundManager.sol +150 -0
  74. package/contracts/interfaces/IEnclave.sol +186 -64
  75. package/contracts/registry/BondingRegistry.sol +9 -0
  76. package/contracts/registry/CiphernodeRegistryOwnable.sol +89 -42
  77. package/contracts/test/MockCiphernodeRegistry.sol +20 -6
  78. package/contracts/test/MockE3Program.sol +3 -8
  79. package/contracts/verifier/DkgPkVerifier.sol +3140 -0
  80. package/dist/hardhat.config.d.ts.map +1 -1
  81. package/dist/hardhat.config.js +4 -4
  82. package/dist/ignition/modules/dkgPkVerifier.d.ts +3 -0
  83. package/dist/ignition/modules/dkgPkVerifier.d.ts.map +1 -0
  84. package/dist/ignition/modules/dkgPkVerifier.js +10 -0
  85. package/dist/ignition/modules/e3RefundManager.d.ts +3 -0
  86. package/dist/ignition/modules/e3RefundManager.d.ts.map +1 -0
  87. package/dist/ignition/modules/e3RefundManager.js +23 -0
  88. package/dist/ignition/modules/enclave.d.ts.map +1 -1
  89. package/dist/ignition/modules/enclave.js +10 -0
  90. package/dist/scripts/deployAndSave/e3RefundManager.d.ts +20 -0
  91. package/dist/scripts/deployAndSave/e3RefundManager.d.ts.map +1 -0
  92. package/dist/scripts/deployAndSave/e3RefundManager.js +55 -0
  93. package/dist/scripts/deployAndSave/enclave.d.ts +13 -1
  94. package/dist/scripts/deployAndSave/enclave.d.ts.map +1 -1
  95. package/dist/scripts/deployAndSave/enclave.js +8 -1
  96. package/dist/scripts/deployAndSave/verifiers.d.ts +29 -0
  97. package/dist/scripts/deployAndSave/verifiers.d.ts.map +1 -0
  98. package/dist/scripts/deployAndSave/verifiers.js +109 -0
  99. package/dist/scripts/deployEnclave.d.ts.map +1 -1
  100. package/dist/scripts/deployEnclave.js +36 -0
  101. package/dist/scripts/deployVerifiers.d.ts +2 -0
  102. package/dist/scripts/deployVerifiers.d.ts.map +1 -0
  103. package/dist/scripts/deployVerifiers.js +33 -0
  104. package/dist/scripts/index.d.ts +1 -0
  105. package/dist/scripts/index.d.ts.map +1 -1
  106. package/dist/scripts/index.js +1 -0
  107. package/dist/tasks/enclave.d.ts +0 -2
  108. package/dist/tasks/enclave.d.ts.map +1 -1
  109. package/dist/tasks/enclave.js +8 -72
  110. package/dist/tasks/program.d.ts +2 -0
  111. package/dist/tasks/program.d.ts.map +1 -0
  112. package/dist/tasks/program.js +55 -0
  113. package/dist/test/E3Lifecycle/E3Integration.spec.d.ts +2 -0
  114. package/dist/test/E3Lifecycle/E3Integration.spec.d.ts.map +1 -0
  115. package/dist/test/E3Lifecycle/E3Integration.spec.js +757 -0
  116. package/dist/test/Enclave.spec.js +83 -406
  117. package/dist/test/Registry/CiphernodeRegistryOwnable.spec.js +133 -59
  118. package/dist/types/contracts/E3RefundManager.d.ts +379 -0
  119. package/dist/types/contracts/E3RefundManager.d.ts.map +1 -0
  120. package/dist/types/contracts/E3RefundManager.js +24 -0
  121. package/dist/types/contracts/Enclave.d.ts +325 -73
  122. package/dist/types/contracts/Enclave.d.ts.map +1 -1
  123. package/dist/types/contracts/Enclave.js +27 -3
  124. package/dist/types/contracts/index.d.ts +3 -0
  125. package/dist/types/contracts/index.d.ts.map +1 -1
  126. package/dist/types/contracts/interfaces/IBondingRegistry.d.ts +11 -1
  127. package/dist/types/contracts/interfaces/IBondingRegistry.d.ts.map +1 -1
  128. package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts +35 -7
  129. package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts.map +1 -1
  130. package/dist/types/contracts/interfaces/ICiphernodeRegistry.js +4 -0
  131. package/dist/types/contracts/interfaces/IE3Program.d.ts +16 -18
  132. package/dist/types/contracts/interfaces/IE3Program.d.ts.map +1 -1
  133. package/dist/types/contracts/interfaces/IE3RefundManager.d.ts +238 -0
  134. package/dist/types/contracts/interfaces/IE3RefundManager.d.ts.map +1 -0
  135. package/dist/types/contracts/interfaces/IE3RefundManager.js +16 -0
  136. package/dist/types/contracts/interfaces/IEnclave.d.ts +290 -62
  137. package/dist/types/contracts/interfaces/IEnclave.d.ts.map +1 -1
  138. package/dist/types/contracts/interfaces/IEnclave.js +27 -3
  139. package/dist/types/contracts/interfaces/index.d.ts +1 -0
  140. package/dist/types/contracts/interfaces/index.d.ts.map +1 -1
  141. package/dist/types/contracts/registry/BondingRegistry.d.ts +11 -1
  142. package/dist/types/contracts/registry/BondingRegistry.d.ts.map +1 -1
  143. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts +35 -7
  144. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts.map +1 -1
  145. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.js +4 -0
  146. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts +35 -7
  147. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts.map +1 -1
  148. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.js +4 -0
  149. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts +35 -7
  150. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts.map +1 -1
  151. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.js +4 -0
  152. package/dist/types/contracts/test/MockE3Program.d.ts +16 -18
  153. package/dist/types/contracts/test/MockE3Program.d.ts.map +1 -1
  154. package/dist/types/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier.d.ts +36 -0
  155. package/dist/types/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier.d.ts.map +1 -0
  156. package/dist/types/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier.js +1 -0
  157. package/dist/types/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier.d.ts +36 -0
  158. package/dist/types/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier.d.ts.map +1 -0
  159. package/dist/types/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier.js +1 -0
  160. package/dist/types/contracts/verifier/DkgPkVerifier.sol/IVerifier.d.ts +36 -0
  161. package/dist/types/contracts/verifier/DkgPkVerifier.sol/IVerifier.d.ts.map +1 -0
  162. package/dist/types/contracts/verifier/DkgPkVerifier.sol/IVerifier.js +1 -0
  163. package/dist/types/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib.d.ts +138 -0
  164. package/dist/types/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib.d.ts.map +1 -0
  165. package/dist/types/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib.js +1 -0
  166. package/dist/types/contracts/verifier/DkgPkVerifier.sol/index.d.ts +5 -0
  167. package/dist/types/contracts/verifier/DkgPkVerifier.sol/index.d.ts.map +1 -0
  168. package/dist/types/contracts/verifier/DkgPkVerifier.sol/index.js +1 -0
  169. package/dist/types/contracts/verifier/index.d.ts +3 -0
  170. package/dist/types/contracts/verifier/index.d.ts.map +1 -0
  171. package/dist/types/contracts/verifier/index.js +1 -0
  172. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts +1 -1
  173. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts.map +1 -1
  174. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.js +1 -1
  175. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts +1 -1
  176. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts.map +1 -1
  177. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.js +1 -1
  178. package/dist/types/factories/contracts/E3RefundManager__factory.d.ts +540 -0
  179. package/dist/types/factories/contracts/E3RefundManager__factory.d.ts.map +1 -0
  180. package/dist/types/factories/contracts/E3RefundManager__factory.js +706 -0
  181. package/dist/types/factories/contracts/Enclave__factory.d.ts +412 -143
  182. package/dist/types/factories/contracts/Enclave__factory.d.ts.map +1 -1
  183. package/dist/types/factories/contracts/Enclave__factory.js +528 -180
  184. package/dist/types/factories/contracts/index.d.ts +2 -0
  185. package/dist/types/factories/contracts/index.d.ts.map +1 -1
  186. package/dist/types/factories/contracts/index.js +2 -0
  187. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts +10 -0
  188. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts.map +1 -1
  189. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.js +13 -0
  190. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts +42 -4
  191. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts.map +1 -1
  192. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.js +54 -4
  193. package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts +14 -18
  194. package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts.map +1 -1
  195. package/dist/types/factories/contracts/interfaces/IE3Program__factory.js +18 -23
  196. package/dist/types/factories/contracts/interfaces/IE3RefundManager__factory.d.ts +358 -0
  197. package/dist/types/factories/contracts/interfaces/IE3RefundManager__factory.d.ts.map +1 -0
  198. package/dist/types/factories/contracts/interfaces/IE3RefundManager__factory.js +471 -0
  199. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts +303 -103
  200. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts.map +1 -1
  201. package/dist/types/factories/contracts/interfaces/IEnclave__factory.js +382 -127
  202. package/dist/types/factories/contracts/interfaces/index.d.ts +1 -0
  203. package/dist/types/factories/contracts/interfaces/index.d.ts.map +1 -1
  204. package/dist/types/factories/contracts/interfaces/index.js +1 -0
  205. package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts +11 -1
  206. package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts.map +1 -1
  207. package/dist/types/factories/contracts/registry/BondingRegistry__factory.js +14 -1
  208. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts +62 -12
  209. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts.map +1 -1
  210. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.js +79 -13
  211. package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts +1 -1
  212. package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts.map +1 -1
  213. package/dist/types/factories/contracts/slashing/SlashingManager__factory.js +1 -1
  214. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts +43 -5
  215. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts.map +1 -1
  216. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.js +55 -5
  217. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts +43 -5
  218. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts.map +1 -1
  219. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.js +55 -5
  220. package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts +1 -1
  221. package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts.map +1 -1
  222. package/dist/types/factories/contracts/test/MockComputeProvider__factory.js +1 -1
  223. package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts +15 -19
  224. package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts.map +1 -1
  225. package/dist/types/factories/contracts/test/MockE3Program__factory.js +19 -24
  226. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts +1 -1
  227. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts.map +1 -1
  228. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.js +1 -1
  229. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts +1 -1
  230. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts.map +1 -1
  231. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.js +1 -1
  232. package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts +1 -1
  233. package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts.map +1 -1
  234. package/dist/types/factories/contracts/token/EnclaveToken__factory.js +1 -1
  235. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier__factory.d.ts +66 -0
  236. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier__factory.d.ts.map +1 -0
  237. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/BaseZKHonkVerifier__factory.js +90 -0
  238. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier__factory.d.ts +87 -0
  239. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier__factory.d.ts.map +1 -0
  240. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/DkgPkVerifier__factory.js +122 -0
  241. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/IVerifier__factory.d.ts +26 -0
  242. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/IVerifier__factory.d.ts.map +1 -0
  243. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/IVerifier__factory.js +39 -0
  244. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib__factory.d.ts +323 -0
  245. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib__factory.d.ts.map +1 -0
  246. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/ZKTranscriptLib__factory.js +422 -0
  247. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/index.d.ts +5 -0
  248. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/index.d.ts.map +1 -0
  249. package/dist/types/factories/contracts/verifier/DkgPkVerifier.sol/index.js +7 -0
  250. package/dist/types/factories/contracts/verifier/index.d.ts +2 -0
  251. package/dist/types/factories/contracts/verifier/index.d.ts.map +1 -0
  252. package/dist/types/factories/contracts/verifier/index.js +4 -0
  253. package/dist/types/index.d.ts +12 -0
  254. package/dist/types/index.d.ts.map +1 -1
  255. package/dist/types/index.js +6 -0
  256. package/package.json +17 -3
  257. package/artifacts/build-info/solc-0_8_28-c77ac33099bb85c15f46d194dd2b735e036cb799.output.json +0 -1
@@ -173,6 +173,12 @@ interface IBondingRegistry {
173
173
  */
174
174
  function isActive(address operator) external view returns (bool);
175
175
 
176
+ /**
177
+ * @notice Get the number of currently active operators
178
+ * @return Number of active operators
179
+ */
180
+ function numActiveOperators() external view returns (uint256);
181
+
176
182
  /**
177
183
  * @notice Check if operator has deregistration in progress
178
184
  * @param operator Address of the operator
@@ -5,6 +5,9 @@
5
5
  // or FITNESS FOR A PARTICULAR PURPOSE.
6
6
  pragma solidity >=0.8.27;
7
7
 
8
+ import { IEnclave } from "./IEnclave.sol";
9
+ import { IBondingRegistry } from "./IBondingRegistry.sol";
10
+
8
11
  /**
9
12
  * @title ICiphernodeRegistry
10
13
  * @notice Interface for managing ciphernode registration and committee selection
@@ -16,7 +19,7 @@ interface ICiphernodeRegistry {
16
19
  /// @param initialized Whether the round has been initialized.
17
20
  /// @param finalized Whether the round has been finalized.
18
21
  /// @param requestBlock The block number when the committee was requested.
19
- /// @param submissionDeadline The deadline for submitting tickets.
22
+ /// @param committeeDeadline The deadline for committee formation (ticket submission).
20
23
  /// @param threshold The M/N threshold for the committee ([M, N]).
21
24
  /// @param publicKey Hash of the committee's public key.
22
25
  /// @param seed The seed for the round.
@@ -24,12 +27,14 @@ interface ICiphernodeRegistry {
24
27
  /// @param committee The committee for the round.
25
28
  /// @param submitted Mapping of nodes to their submission status.
26
29
  /// @param scoreOf Mapping of nodes to their scores.
30
+ /// @param failed True if committee formation failed (threshold not met).
27
31
  struct Committee {
28
32
  bool initialized;
29
33
  bool finalized;
34
+ bool failed;
30
35
  uint256 seed;
31
36
  uint256 requestBlock;
32
- uint256 submissionDeadline;
37
+ uint256 committeeDeadline;
33
38
  bytes32 publicKey;
34
39
  uint32[2] threshold;
35
40
  address[] topNodes;
@@ -43,13 +48,13 @@ interface ICiphernodeRegistry {
43
48
  /// @param seed Random seed for score computation.
44
49
  /// @param threshold The M/N threshold for the committee.
45
50
  /// @param requestBlock Block number for snapshot validation.
46
- /// @param submissionDeadline Deadline for submitting tickets.
51
+ /// @param committeeDeadline Deadline for committee formation (ticket submission).
47
52
  event CommitteeRequested(
48
53
  uint256 indexed e3Id,
49
54
  uint256 seed,
50
55
  uint32[2] threshold,
51
56
  uint256 requestBlock,
52
- uint256 submissionDeadline
57
+ uint256 committeeDeadline
53
58
  );
54
59
 
55
60
  /// @notice This event MUST be emitted when a ticket is submitted for sortition
@@ -69,6 +74,16 @@ interface ICiphernodeRegistry {
69
74
  /// @param committee Array of selected ciphernode addresses
70
75
  event CommitteeFinalized(uint256 indexed e3Id, address[] committee);
71
76
 
77
+ /// @notice This event MUST be emitted when committee formation fails (threshold not met)
78
+ /// @param e3Id ID of the E3 computation
79
+ /// @param nodesSubmitted Number of nodes that submitted tickets
80
+ /// @param thresholdRequired Minimum number of nodes required
81
+ event CommitteeFormationFailed(
82
+ uint256 indexed e3Id,
83
+ uint256 nodesSubmitted,
84
+ uint256 thresholdRequired
85
+ );
86
+
72
87
  /// @notice This event MUST be emitted when a committee is selected for an E3.
73
88
  /// @param e3Id ID of the E3 for which the committee was selected.
74
89
  /// @param publicKey Public key of the committee.
@@ -200,12 +215,12 @@ interface ICiphernodeRegistry {
200
215
  /// @notice Sets the Enclave contract address
201
216
  /// @dev Only callable by owner
202
217
  /// @param _enclave Address of the Enclave contract
203
- function setEnclave(address _enclave) external;
218
+ function setEnclave(IEnclave _enclave) external;
204
219
 
205
220
  /// @notice Sets the bonding registry contract address
206
221
  /// @dev Only callable by owner
207
222
  /// @param _bondingRegistry Address of the bonding registry contract
208
- function setBondingRegistry(address _bondingRegistry) external;
223
+ function setBondingRegistry(IBondingRegistry _bondingRegistry) external;
209
224
 
210
225
  /// @notice This function should be called to set the submission window for the E3 sortition.
211
226
  /// @param _sortitionSubmissionWindow The submission window for the E3 sortition in seconds.
@@ -220,11 +235,18 @@ interface ICiphernodeRegistry {
220
235
  function submitTicket(uint256 e3Id, uint256 ticketNumber) external;
221
236
 
222
237
  /// @notice Finalize the committee after submission window closes
238
+ /// @dev If threshold not met, marks E3 as failed and returns false
223
239
  /// @param e3Id ID of the E3 computation
224
- function finalizeCommittee(uint256 e3Id) external;
240
+ /// @return success True if committee formed successfully, false if threshold not met
241
+ function finalizeCommittee(uint256 e3Id) external returns (bool success);
225
242
 
226
243
  /// @notice Check if submission window is still open for an E3
227
244
  /// @param e3Id ID of the E3 computation
228
245
  /// @return Whether the submission window is open
229
246
  function isOpen(uint256 e3Id) external view returns (bool);
247
+
248
+ /// @notice Get the committee deadline for an E3
249
+ /// @param e3Id ID of the E3 computation
250
+ /// @return committeeDeadline The committee deadline timestamp
251
+ function getCommitteeDeadline(uint256 e3Id) external view returns (uint256);
230
252
  }
@@ -16,9 +16,7 @@ import { IDecryptionVerifier } from "./IDecryptionVerifier.sol";
16
16
  * @param seed Random seed for committee selection and computation initialization
17
17
  * @param threshold M/N threshold for the committee (M required out of N total members)
18
18
  * @param requestBlock Block number when the E3 computation was requested
19
- * @param startWindow Start window for the computation: index 0 is minimum block, index 1 is the maximum block
20
- * @param duration Duration of the E3 computation in blocks or time units
21
- * @param expiration Timestamp when committee duties expire and computation is considered failed
19
+ * @param inputWindow When to start and stop accepting inputs from data providers
22
20
  * @param encryptionSchemeId Identifier for the encryption scheme used in this computation
23
21
  * @param e3Program Address of the E3 Program contract that validates and verifies the computation
24
22
  * @param e3ProgramParams ABI encoded computation parameters specific to the E3 program
@@ -33,9 +31,7 @@ struct E3 {
33
31
  uint256 seed;
34
32
  uint32[2] threshold;
35
33
  uint256 requestBlock;
36
- uint256[2] startWindow;
37
- uint256 duration;
38
- uint256 expiration;
34
+ uint256[2] inputWindow;
39
35
  bytes32 encryptionSchemeId;
40
36
  IE3Program e3Program;
41
37
  bytes e3ProgramParams;
@@ -40,13 +40,9 @@ interface IE3Program {
40
40
  ) external returns (bool success);
41
41
 
42
42
  /// @notice Validate and process input data for a computation
43
- /// @dev This function is called by the Enclave contract when input is published
43
+ /// @dev This function is called by data providers when they want to submit their
44
+ /// encrypted data
44
45
  /// @param e3Id ID of the E3 computation
45
- /// @param sender The account that is submitting the input
46
46
  /// @param data The input data to be validated
47
- function validateInput(
48
- uint256 e3Id,
49
- address sender,
50
- bytes memory data
51
- ) external;
47
+ function publishInput(uint256 e3Id, bytes memory data) external;
52
48
  }
@@ -0,0 +1,150 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ //
3
+ // This file is provided WITHOUT ANY WARRANTY;
4
+ // without even the implied warranty of MERCHANTABILITY
5
+ // or FITNESS FOR A PARTICULAR PURPOSE.
6
+ pragma solidity >=0.8.27;
7
+ import { IEnclave } from "./IEnclave.sol";
8
+
9
+ /**
10
+ * @title IE3RefundManager
11
+ * @notice Interface for E3 refund distribution mechanism
12
+ * @dev Handles refund calculation and claiming for failed E3s
13
+ */
14
+ interface IE3RefundManager {
15
+ ////////////////////////////////////////////////////////////
16
+ // //
17
+ // Structs //
18
+ // //
19
+ ////////////////////////////////////////////////////////////
20
+ /// @notice Work value allocation in basis points (10000 = 100%)
21
+ struct WorkValueAllocation {
22
+ uint16 committeeFormationBps;
23
+ uint16 dkgBps;
24
+ uint16 decryptionBps;
25
+ uint16 protocolBps;
26
+ }
27
+ /// @notice Refund distribution for a failed E3
28
+ struct RefundDistribution {
29
+ uint256 requesterAmount; // Amount for requester
30
+ uint256 honestNodeAmount; // Total amount for honest nodes
31
+ uint256 protocolAmount; // Amount for protocol treasury
32
+ uint256 totalSlashed; // Slashed funds added
33
+ uint256 honestNodeCount; // Number of honest nodes
34
+ bool calculated; // Whether distribution is calculated
35
+ }
36
+ ////////////////////////////////////////////////////////////
37
+ // //
38
+ // Events //
39
+ // //
40
+ ////////////////////////////////////////////////////////////
41
+ /// @notice Emitted when refund distribution is calculated
42
+ event RefundDistributionCalculated(
43
+ uint256 indexed e3Id,
44
+ uint256 requesterAmount,
45
+ uint256 honestNodeAmount,
46
+ uint256 protocolAmount,
47
+ uint256 totalSlashed
48
+ );
49
+ /// @notice Emitted when a refund is claimed
50
+ event RefundClaimed(
51
+ uint256 indexed e3Id,
52
+ address indexed claimant,
53
+ uint256 amount,
54
+ bytes32 claimType
55
+ );
56
+ /// @notice Emitted when slashed funds are routed to E3
57
+ event SlashedFundsRouted(uint256 indexed e3Id, uint256 amount);
58
+ /// @notice Emitted when work allocation is updated
59
+ event WorkAllocationUpdated(WorkValueAllocation allocation);
60
+ ////////////////////////////////////////////////////////////
61
+ // //
62
+ // Errors //
63
+ // //
64
+ ////////////////////////////////////////////////////////////
65
+ /// @notice E3 is not in failed state
66
+ error E3NotFailed(uint256 e3Id);
67
+ /// @notice Refund already claimed
68
+ error AlreadyClaimed(uint256 e3Id, address claimant);
69
+ /// @notice Not the requester
70
+ error NotRequester(uint256 e3Id, address caller);
71
+ /// @notice Not an honest node
72
+ error NotHonestNode(uint256 e3Id, address caller);
73
+ /// @notice Refund not calculated yet
74
+ error RefundNotCalculated(uint256 e3Id);
75
+ /// @notice No refund available
76
+ error NoRefundAvailable(uint256 e3Id);
77
+ /// @notice Caller not authorized
78
+ error Unauthorized();
79
+
80
+ ////////////////////////////////////////////////////////////
81
+ // //
82
+ // Functions //
83
+ // //
84
+ ////////////////////////////////////////////////////////////
85
+ /// @notice Calculate refund distribution for a failed E3
86
+ /// @param e3Id The failed E3 ID
87
+ /// @param originalPayment The original payment amount
88
+ /// @param honestNodes Array of honest node addresses
89
+ function calculateRefund(
90
+ uint256 e3Id,
91
+ uint256 originalPayment,
92
+ address[] calldata honestNodes
93
+ ) external;
94
+
95
+ /// @notice Requester claims their refund
96
+ /// @param e3Id The failed E3 ID
97
+ /// @return amount The amount claimed
98
+ function claimRequesterRefund(
99
+ uint256 e3Id
100
+ ) external returns (uint256 amount);
101
+
102
+ /// @notice Honest node claims their reward
103
+ /// @param e3Id The failed E3 ID
104
+ /// @return amount The amount claimed
105
+ function claimHonestNodeReward(
106
+ uint256 e3Id
107
+ ) external returns (uint256 amount);
108
+
109
+ /// @notice Route slashed funds to E3 refund pool
110
+ /// @param e3Id The E3 ID
111
+ /// @param amount The slashed amount
112
+ function routeSlashedFunds(uint256 e3Id, uint256 amount) external;
113
+
114
+ /// @notice Get refund distribution for an E3
115
+ /// @param e3Id The E3 ID
116
+ /// @return distribution The refund distribution
117
+ function getRefundDistribution(
118
+ uint256 e3Id
119
+ ) external view returns (RefundDistribution memory distribution);
120
+
121
+ /// @notice Check if address has claimed refund
122
+ /// @param e3Id The E3 ID
123
+ /// @param claimant The address to check
124
+ /// @return claimed Whether the address has claimed
125
+ function hasClaimed(
126
+ uint256 e3Id,
127
+ address claimant
128
+ ) external view returns (bool claimed);
129
+
130
+ /// @notice Calculate work value for a given stage
131
+ /// @param stage The stage when E3 failed
132
+ /// @return workCompletedBps Work completed in basis points
133
+ /// @return workRemainingBps Work remaining in basis points
134
+ function calculateWorkValue(
135
+ IEnclave.E3Stage stage
136
+ ) external view returns (uint16 workCompletedBps, uint16 workRemainingBps);
137
+
138
+ /// @notice Set work value allocation
139
+ /// @param allocation The new work allocation
140
+ function setWorkAllocation(
141
+ WorkValueAllocation calldata allocation
142
+ ) external;
143
+
144
+ /// @notice Get current work allocation
145
+ /// @return allocation The current work allocation
146
+ function getWorkAllocation()
147
+ external
148
+ view
149
+ returns (WorkValueAllocation memory allocation);
150
+ }
@@ -12,6 +12,63 @@ import { IDecryptionVerifier } from "./IDecryptionVerifier.sol";
12
12
  import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
13
13
 
14
14
  interface IEnclave {
15
+ ////////////////////////////////////////////////////////////
16
+ // //
17
+ // Enums //
18
+ // //
19
+ ////////////////////////////////////////////////////////////
20
+
21
+ /// @notice Lifecycle stages of an E3 computation
22
+ enum E3Stage {
23
+ None,
24
+ Requested,
25
+ CommitteeFinalized,
26
+ // Once a key is published, it is possible to then accept inputs
27
+ // as long as we are within the input deadline (start and end)
28
+ KeyPublished,
29
+ CiphertextReady,
30
+ Complete,
31
+ Failed
32
+ }
33
+
34
+ /// @notice Reasons why an E3 failed
35
+ enum FailureReason {
36
+ None,
37
+ CommitteeFormationTimeout,
38
+ InsufficientCommitteeMembers,
39
+ DKGTimeout,
40
+ DKGInvalidShares,
41
+ NoInputsReceived,
42
+ ComputeTimeout,
43
+ ComputeProviderExpired,
44
+ ComputeProviderFailed,
45
+ RequesterCancelled,
46
+ DecryptionTimeout,
47
+ DecryptionInvalidShares,
48
+ VerificationFailed
49
+ }
50
+
51
+ ////////////////////////////////////////////////////////////
52
+ // //
53
+ // Structs //
54
+ // //
55
+ ////////////////////////////////////////////////////////////
56
+
57
+ /// @notice Timeout configuration for E3 stages
58
+ struct E3TimeoutConfig {
59
+ uint256 dkgWindow;
60
+ uint256 computeWindow;
61
+ uint256 decryptionWindow;
62
+ uint256 gracePeriod;
63
+ }
64
+
65
+ /// @notice Deadlines for each E3
66
+ struct E3Deadlines {
67
+ uint256 dkgDeadline;
68
+ uint256 computeDeadline;
69
+ uint256 decryptionDeadline;
70
+ }
71
+
15
72
  ////////////////////////////////////////////////////////////
16
73
  // //
17
74
  // Events //
@@ -24,16 +81,6 @@ interface IEnclave {
24
81
  /// @param e3Program Address of the Computation module selected.
25
82
  event E3Requested(uint256 e3Id, E3 e3, IE3Program indexed e3Program);
26
83
 
27
- /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully activated.
28
- /// @param e3Id ID of the E3.
29
- /// @param expiration Timestamp when committee duties expire.
30
- /// @param committeePublicKey Hash of the public key of the committee.
31
- event E3Activated(
32
- uint256 e3Id,
33
- uint256 expiration,
34
- bytes32 committeePublicKey
35
- );
36
-
37
84
  /// @notice This event MUST be emitted when an input to an Encrypted Execution Environment (E3) is
38
85
  /// successfully published.
39
86
  /// @param e3Id ID of the E3.
@@ -106,6 +153,45 @@ interface IEnclave {
106
153
  /// @param e3ProgramParams Array of encoded encryption scheme parameters (e.g, for BFV)
107
154
  event AllowedE3ProgramsParamsSet(bytes[] e3ProgramParams);
108
155
 
156
+ /// @notice Emitted when E3RefundManager contract is set.
157
+ /// @param e3RefundManager The address of the E3RefundManager contract.
158
+ event E3RefundManagerSet(address indexed e3RefundManager);
159
+
160
+ /// @notice Emitted when a failed E3 is processed for refunds.
161
+ /// @param e3Id The ID of the failed E3.
162
+ /// @param paymentAmount The original payment amount being refunded.
163
+ /// @param honestNodeCount The number of honest nodes in the refund distribution.
164
+ event E3FailureProcessed(
165
+ uint256 indexed e3Id,
166
+ uint256 paymentAmount,
167
+ uint256 honestNodeCount
168
+ );
169
+
170
+ /// @notice Emitted when a committee is published and E3 lifecycle is updated.
171
+ /// @param e3Id The ID of the E3.
172
+ event CommitteeFormed(uint256 indexed e3Id);
173
+
174
+ /// @notice Emitted when a committee is finalized (sortition complete, DKG starting).
175
+ /// @param e3Id The ID of the E3.
176
+ event CommitteeFinalized(uint256 indexed e3Id);
177
+
178
+ /// @notice Emitted when E3 stage changes
179
+ event E3StageChanged(
180
+ uint256 indexed e3Id,
181
+ E3Stage previousStage,
182
+ E3Stage newStage
183
+ );
184
+
185
+ /// @notice Emitted when an E3 is marked as failed
186
+ event E3Failed(
187
+ uint256 indexed e3Id,
188
+ E3Stage failedAtStage,
189
+ FailureReason reason
190
+ );
191
+
192
+ /// @notice Emitted when timeout config is updated
193
+ event TimeoutConfigUpdated(E3TimeoutConfig config);
194
+
109
195
  ////////////////////////////////////////////////////////////
110
196
  // //
111
197
  // Structs //
@@ -114,16 +200,14 @@ interface IEnclave {
114
200
 
115
201
  /// @notice This struct contains the parameters to submit a request to Enclave.
116
202
  /// @param threshold The M/N threshold for the committee.
117
- /// @param startWindow The start window for the computation.
118
- /// @param duration The duration of the computation in seconds.
203
+ /// @param inputWindow When the program will start and stop accepting inputs.
119
204
  /// @param e3Program The address of the E3 Program.
120
205
  /// @param e3ProgramParams The ABI encoded computation parameters.
121
206
  /// @param computeProviderParams The ABI encoded compute provider parameters.
122
207
  /// @param customParams Arbitrary ABI-encoded application-defined parameters.
123
208
  struct E3RequestParams {
124
209
  uint32[2] threshold;
125
- uint256[2] startWindow;
126
- uint256 duration;
210
+ uint256[2] inputWindow;
127
211
  IE3Program e3Program;
128
212
  bytes e3ProgramParams;
129
213
  bytes computeProviderParams;
@@ -145,26 +229,6 @@ interface IEnclave {
145
229
  E3RequestParams calldata requestParams
146
230
  ) external returns (uint256 e3Id, E3 memory e3);
147
231
 
148
- /// @notice This function should be called to activate an Encrypted Execution Environment (E3) once it has been
149
- /// initialized and is ready for input.
150
- /// @dev This function MUST emit the E3Activated event.
151
- /// @dev This function MUST revert if the given E3 has not yet been requested.
152
- /// @dev This function MUST revert if the selected node committee has not yet published a public key.
153
- /// @param e3Id ID of the E3.
154
- /// @return success True if the E3 was successfully activated.
155
- function activate(uint256 e3Id) external returns (bool success);
156
-
157
- /// @notice This function should be called to publish input data for Encrypted Execution Environment (E3).
158
- /// @dev This function MUST revert if the E3 is not yet activated.
159
- /// @dev This function MUST emit the InputPublished event.
160
- /// @param e3Id ID of the E3.
161
- /// @param data ABI encoded input data to publish.
162
- /// @return success True if the input was successfully published.
163
- function publishInput(
164
- uint256 e3Id,
165
- bytes calldata data
166
- ) external returns (bool success);
167
-
168
232
  /// @notice This function should be called to publish output data for an Encrypted Execution Environment (E3).
169
233
  /// @dev This function MUST emit the CiphertextOutputPublished event.
170
234
  /// @param e3Id ID of the E3.
@@ -197,72 +261,51 @@ interface IEnclave {
197
261
 
198
262
  /// @notice This function should be called to set the maximum duration of requested computations.
199
263
  /// @param _maxDuration The maximum duration of a computation in seconds.
200
- /// @return success True if the max duration was successfully set.
201
- function setMaxDuration(
202
- uint256 _maxDuration
203
- ) external returns (bool success);
264
+ function setMaxDuration(uint256 _maxDuration) external;
204
265
 
205
266
  /// @notice Sets the Ciphernode Registry contract address.
206
267
  /// @dev This function MUST revert if the address is zero or the same as the current registry.
207
268
  /// @param _ciphernodeRegistry The address of the new Ciphernode Registry contract.
208
- /// @return success True if the registry was successfully set.
209
269
  function setCiphernodeRegistry(
210
270
  ICiphernodeRegistry _ciphernodeRegistry
211
- ) external returns (bool success);
271
+ ) external;
212
272
 
213
273
  /// @notice Sets the Bonding Registry contract address.
214
274
  /// @dev This function MUST revert if the address is zero or the same as the current registry.
215
275
  /// @param _bondingRegistry The address of the new Bonding Registry contract.
216
- /// @return success True if the registry was successfully set.
217
- function setBondingRegistry(
218
- IBondingRegistry _bondingRegistry
219
- ) external returns (bool success);
276
+ function setBondingRegistry(IBondingRegistry _bondingRegistry) external;
220
277
 
221
278
  /// @notice Sets the fee token used for E3 payments.
222
279
  /// @dev This function MUST revert if the address is zero or the same as the current fee token.
223
280
  /// @param _feeToken The address of the new fee token.
224
- /// @return success True if the fee token was successfully set.
225
- function setFeeToken(IERC20 _feeToken) external returns (bool success);
281
+ function setFeeToken(IERC20 _feeToken) external;
226
282
 
227
283
  /// @notice This function should be called to enable an E3 Program.
228
284
  /// @param e3Program The address of the E3 Program.
229
- /// @return success True if the E3 Program was successfully enabled.
230
- function enableE3Program(
231
- IE3Program e3Program
232
- ) external returns (bool success);
285
+ function enableE3Program(IE3Program e3Program) external;
233
286
 
234
287
  /// @notice This function should be called to disable an E3 Program.
235
288
  /// @param e3Program The address of the E3 Program.
236
- /// @return success True if the E3 Program was successfully disabled.
237
- function disableE3Program(
238
- IE3Program e3Program
239
- ) external returns (bool success);
289
+ function disableE3Program(IE3Program e3Program) external;
240
290
 
241
291
  /// @notice Sets or enables a decryption verifier for a specific encryption scheme.
242
292
  /// @dev This function MUST revert if the verifier address is zero or already set to the same value.
243
293
  /// @param encryptionSchemeId The unique identifier for the encryption scheme.
244
294
  /// @param decryptionVerifier The address of the decryption verifier contract.
245
- /// @return success True if the verifier was successfully set.
246
295
  function setDecryptionVerifier(
247
296
  bytes32 encryptionSchemeId,
248
297
  IDecryptionVerifier decryptionVerifier
249
- ) external returns (bool success);
298
+ ) external;
250
299
 
251
300
  /// @notice Disables a previously enabled encryption scheme.
252
301
  /// @dev This function MUST revert if the encryption scheme is not currently enabled.
253
302
  /// @param encryptionSchemeId The unique identifier for the encryption scheme to disable.
254
- /// @return success True if the encryption scheme was successfully disabled.
255
- function disableEncryptionScheme(
256
- bytes32 encryptionSchemeId
257
- ) external returns (bool success);
303
+ function disableEncryptionScheme(bytes32 encryptionSchemeId) external;
258
304
 
259
305
  /// @notice Sets the allowed E3 program parameters.
260
306
  /// @dev This function enables specific parameter sets for E3 programs (e.g., BFV encryption parameters).
261
307
  /// @param _e3ProgramsParams Array of ABI encoded parameter sets to allow.
262
- /// @return success True if the parameters were successfully set.
263
- function setE3ProgramsParams(
264
- bytes[] memory _e3ProgramsParams
265
- ) external returns (bool success);
308
+ function setE3ProgramsParams(bytes[] memory _e3ProgramsParams) external;
266
309
 
267
310
  ////////////////////////////////////////////////////////////
268
311
  // //
@@ -293,4 +336,83 @@ interface IEnclave {
293
336
 
294
337
  /// @notice Returns the ERC20 token used to pay for E3 fees.
295
338
  function feeToken() external view returns (IERC20);
339
+
340
+ /// @notice Returns the BondingRegistry contract.
341
+ function bondingRegistry() external view returns (IBondingRegistry);
342
+
343
+ /// @notice Called by CiphernodeRegistry when committee is finalized (sortition complete).
344
+ /// @dev Updates E3 lifecycle to CommitteeFinalized stage, starts DKG deadline.
345
+ /// @param e3Id ID of the E3.
346
+ function onCommitteeFinalized(uint256 e3Id) external;
347
+
348
+ /// @notice Called by CiphernodeRegistry when committee public key is published (DKG complete).
349
+ /// @dev Updates E3 lifecycle to KeyPublished stage.
350
+ /// @param e3Id ID of the E3.
351
+ /// @param committeePublicKeyHash Hash of the committee public key.
352
+ function onCommitteePublished(
353
+ uint256 e3Id,
354
+ bytes32 committeePublicKeyHash
355
+ ) external;
356
+
357
+ /// @notice Called by authorized contracts to mark an E3 as failed with a specific reason.
358
+ /// @dev Updates E3 lifecycle to Failed stage with the given reason.
359
+ /// @param e3Id ID of the E3.
360
+ /// @param reason The failure reason from FailureReason enum.
361
+ function onE3Failed(uint256 e3Id, uint8 reason) external;
362
+
363
+ ////////////////////////////////////////////////////////////
364
+ // //
365
+ // Lifecycle Functions //
366
+ // //
367
+ ////////////////////////////////////////////////////////////
368
+
369
+ /// @notice Anyone can mark an E3 as failed if timeout passed
370
+ /// @param e3Id The E3 ID
371
+ /// @return reason The failure reason
372
+ function markE3Failed(uint256 e3Id) external returns (FailureReason reason);
373
+
374
+ /// @notice Check if E3 can be marked as failed
375
+ /// @param e3Id The E3 ID
376
+ /// @return canFail Whether failure condition is met
377
+ /// @return reason The failure reason if applicable
378
+ function checkFailureCondition(
379
+ uint256 e3Id
380
+ ) external view returns (bool canFail, FailureReason reason);
381
+
382
+ /// @notice Get current stage of an E3
383
+ /// @param e3Id The E3 ID
384
+ /// @return stage The current stage
385
+ function getE3Stage(uint256 e3Id) external view returns (E3Stage stage);
386
+
387
+ /// @notice Get failure reason for an E3
388
+ /// @param e3Id The E3 ID
389
+ /// @return reason The failure reason
390
+ function getFailureReason(
391
+ uint256 e3Id
392
+ ) external view returns (FailureReason reason);
393
+
394
+ /// @notice Get requester address for an E3
395
+ /// @param e3Id The E3 ID
396
+ /// @return requester The requester address
397
+ function getRequester(
398
+ uint256 e3Id
399
+ ) external view returns (address requester);
400
+
401
+ /// @notice Get deadlines for an E3
402
+ /// @param e3Id The E3 ID
403
+ /// @return deadlines The E3 deadlines
404
+ function getDeadlines(
405
+ uint256 e3Id
406
+ ) external view returns (E3Deadlines memory deadlines);
407
+
408
+ /// @notice Get timeout configuration
409
+ /// @return config The current timeout config
410
+ function getTimeoutConfig()
411
+ external
412
+ view
413
+ returns (E3TimeoutConfig memory config);
414
+
415
+ /// @notice Set timeout configuration
416
+ /// @param config The new timeout config
417
+ function setTimeoutConfig(E3TimeoutConfig calldata config) external;
296
418
  }