@enclave-e3/contracts 0.1.4 → 0.1.6

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 (467) hide show
  1. package/README.md +46 -2
  2. package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +135 -0
  3. package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/artifacts.d.ts +27 -0
  4. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +77 -0
  5. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +126 -0
  6. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/artifacts.d.ts +43 -0
  7. package/artifacts/build-info/solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.json +311 -0
  8. package/artifacts/build-info/solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.output.json +1 -0
  9. package/artifacts/contracts/Enclave.sol/Enclave.json +239 -147
  10. package/artifacts/contracts/Enclave.sol/artifacts.d.ts +6 -6
  11. package/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +881 -0
  12. package/artifacts/contracts/interfaces/IBondingRegistry.sol/artifacts.d.ts +27 -0
  13. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +326 -10
  14. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/artifacts.d.ts +2 -2
  15. package/artifacts/contracts/interfaces/IComputeProvider.sol/IComputeProvider.json +1 -1
  16. package/artifacts/contracts/interfaces/IComputeProvider.sol/artifacts.d.ts +1 -1
  17. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/IDecryptionVerifier.json +1 -1
  18. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/artifacts.d.ts +1 -1
  19. package/artifacts/contracts/interfaces/IE3Program.sol/IE3Program.json +21 -3
  20. package/artifacts/contracts/interfaces/IE3Program.sol/artifacts.d.ts +2 -2
  21. package/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json +247 -27
  22. package/artifacts/contracts/interfaces/IEnclave.sol/artifacts.d.ts +2 -2
  23. package/artifacts/contracts/interfaces/{IRegistryFilter.sol/IRegistryFilter.json → ISlashVerifier.sol/ISlashVerifier.json} +10 -10
  24. package/artifacts/contracts/interfaces/ISlashVerifier.sol/artifacts.d.ts +27 -0
  25. package/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +759 -0
  26. package/artifacts/contracts/interfaces/ISlashingManager.sol/artifacts.d.ts +27 -0
  27. package/artifacts/contracts/lib/ExitQueueLib.sol/ExitQueueLib.json +116 -0
  28. package/artifacts/contracts/lib/ExitQueueLib.sol/artifacts.d.ts +27 -0
  29. package/artifacts/contracts/registry/BondingRegistry.sol/BondingRegistry.json +1217 -0
  30. package/artifacts/contracts/registry/BondingRegistry.sol/artifacts.d.ts +27 -0
  31. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/CiphernodeRegistryOwnable.json +351 -57
  32. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/artifacts.d.ts +6 -6
  33. package/artifacts/contracts/slashing/SlashingManager.sol/SlashingManager.json +1107 -0
  34. package/artifacts/contracts/slashing/SlashingManager.sol/artifacts.d.ts +27 -0
  35. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.json +328 -12
  36. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.json +328 -12
  37. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/artifacts.d.ts +8 -8
  38. package/artifacts/contracts/test/MockComputeProvider.sol/MockComputeProvider.json +4 -4
  39. package/artifacts/contracts/test/MockComputeProvider.sol/artifacts.d.ts +4 -4
  40. package/artifacts/contracts/test/MockDecryptionVerifier.sol/MockDecryptionVerifier.json +3 -3
  41. package/artifacts/contracts/test/MockDecryptionVerifier.sol/artifacts.d.ts +3 -3
  42. package/artifacts/contracts/test/MockE3Program.sol/MockE3Program.json +26 -32
  43. package/artifacts/contracts/test/MockE3Program.sol/artifacts.d.ts +4 -4
  44. package/artifacts/contracts/test/MockSlashingVerifier.sol/MockSlashingVerifier.json +38 -0
  45. package/artifacts/contracts/test/MockSlashingVerifier.sol/artifacts.d.ts +27 -0
  46. package/artifacts/contracts/test/MockStableToken.sol/MockUSDC.json +425 -0
  47. package/artifacts/contracts/test/MockStableToken.sol/artifacts.d.ts +27 -0
  48. package/artifacts/contracts/token/EnclaveTicketToken.sol/EnclaveTicketToken.json +1222 -0
  49. package/artifacts/contracts/token/EnclaveTicketToken.sol/artifacts.d.ts +27 -0
  50. package/artifacts/contracts/token/EnclaveToken.sol/EnclaveToken.json +1460 -0
  51. package/artifacts/contracts/token/EnclaveToken.sol/artifacts.d.ts +27 -0
  52. package/artifacts/poseidon-solidity/PoseidonT3.sol/PoseidonT3.json +3 -3
  53. package/artifacts/poseidon-solidity/PoseidonT3.sol/artifacts.d.ts +3 -3
  54. package/contracts/Enclave.sol +230 -81
  55. package/contracts/interfaces/IBondingRegistry.sol +446 -0
  56. package/contracts/interfaces/ICiphernodeRegistry.sol +153 -9
  57. package/contracts/interfaces/IComputeProvider.sol +12 -2
  58. package/contracts/interfaces/IDecryptionVerifier.sol +11 -6
  59. package/contracts/interfaces/IE3.sol +21 -17
  60. package/contracts/interfaces/IE3Program.sol +30 -17
  61. package/contracts/interfaces/IEnclave.sol +95 -21
  62. package/contracts/interfaces/ISlashVerifier.sol +23 -0
  63. package/contracts/interfaces/ISlashingManager.sol +426 -0
  64. package/contracts/lib/ExitQueueLib.sol +490 -0
  65. package/contracts/registry/BondingRegistry.sol +737 -0
  66. package/contracts/registry/CiphernodeRegistryOwnable.sol +393 -26
  67. package/contracts/slashing/SlashingManager.sol +367 -0
  68. package/contracts/test/MockCiphernodeRegistry.sol +118 -24
  69. package/contracts/test/MockComputeProvider.sol +2 -2
  70. package/contracts/test/MockE3Program.sol +17 -14
  71. package/contracts/test/MockSlashingVerifier.sol +19 -0
  72. package/contracts/test/MockStableToken.sol +28 -0
  73. package/contracts/token/EnclaveTicketToken.sol +243 -0
  74. package/contracts/token/EnclaveToken.sol +267 -0
  75. package/dist/hardhat.config.d.ts.map +1 -1
  76. package/dist/hardhat.config.js +35 -16
  77. package/dist/ignition/modules/{mockInputValidator.d.ts → bondingRegistry.d.ts} +1 -1
  78. package/dist/ignition/modules/bondingRegistry.d.ts.map +1 -0
  79. package/dist/ignition/modules/bondingRegistry.js +35 -0
  80. package/dist/ignition/modules/ciphernodeRegistry.d.ts.map +1 -1
  81. package/dist/ignition/modules/ciphernodeRegistry.js +12 -2
  82. package/dist/ignition/modules/enclave.d.ts.map +1 -1
  83. package/dist/ignition/modules/enclave.js +16 -7
  84. package/dist/ignition/modules/{naiveRegistryFilter.d.ts → enclaveTicketToken.d.ts} +1 -1
  85. package/dist/ignition/modules/enclaveTicketToken.d.ts.map +1 -0
  86. package/dist/ignition/modules/enclaveTicketToken.js +17 -0
  87. package/dist/ignition/modules/enclaveToken.d.ts +3 -0
  88. package/dist/ignition/modules/enclaveToken.d.ts.map +1 -0
  89. package/dist/ignition/modules/{mockInputValidator.js → enclaveToken.js} +4 -4
  90. package/dist/ignition/modules/mockCiphernodeRegistry.d.ts.map +1 -1
  91. package/dist/ignition/modules/mockCiphernodeRegistry.js +0 -1
  92. package/dist/ignition/modules/mockCiphernodeRegistryEmptyKey.d.ts.map +1 -1
  93. package/dist/ignition/modules/mockCiphernodeRegistryEmptyKey.js +0 -1
  94. package/dist/ignition/modules/mockComputeProvider.d.ts.map +1 -1
  95. package/dist/ignition/modules/mockComputeProvider.js +0 -1
  96. package/dist/ignition/modules/mockDecryptionVerifier.d.ts.map +1 -1
  97. package/dist/ignition/modules/mockDecryptionVerifier.js +0 -1
  98. package/dist/ignition/modules/mockE3Program.d.ts.map +1 -1
  99. package/dist/ignition/modules/mockE3Program.js +1 -3
  100. package/dist/ignition/modules/mockSlashingVerifier.d.ts +3 -0
  101. package/dist/ignition/modules/mockSlashingVerifier.d.ts.map +1 -0
  102. package/dist/ignition/modules/mockSlashingVerifier.js +10 -0
  103. package/dist/ignition/modules/mockStableToken.d.ts +3 -0
  104. package/dist/ignition/modules/mockStableToken.d.ts.map +1 -0
  105. package/dist/ignition/modules/mockStableToken.js +11 -0
  106. package/dist/ignition/modules/poseidonT3.d.ts.map +1 -1
  107. package/dist/ignition/modules/poseidonT3.js +0 -1
  108. package/dist/ignition/modules/slashingManager.d.ts +3 -0
  109. package/dist/ignition/modules/slashingManager.d.ts.map +1 -0
  110. package/dist/ignition/modules/slashingManager.js +16 -0
  111. package/dist/scripts/cleanIgnitionState.d.ts +12 -0
  112. package/dist/scripts/cleanIgnitionState.d.ts.map +1 -0
  113. package/dist/scripts/cleanIgnitionState.js +41 -0
  114. package/dist/scripts/deployAndSave/bondingRegistry.d.ts +38 -0
  115. package/dist/scripts/deployAndSave/bondingRegistry.d.ts.map +1 -0
  116. package/dist/scripts/deployAndSave/bondingRegistry.js +133 -0
  117. package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.d.ts +11 -1
  118. package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.d.ts.map +1 -1
  119. package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.js +76 -19
  120. package/dist/scripts/deployAndSave/enclave.d.ts +16 -2
  121. package/dist/scripts/deployAndSave/enclave.d.ts.map +1 -1
  122. package/dist/scripts/deployAndSave/enclave.js +89 -22
  123. package/dist/scripts/deployAndSave/enclaveTicketToken.d.ts +20 -0
  124. package/dist/scripts/deployAndSave/enclaveTicketToken.d.ts.map +1 -0
  125. package/dist/scripts/deployAndSave/enclaveTicketToken.js +41 -0
  126. package/dist/scripts/deployAndSave/enclaveToken.d.ts +18 -0
  127. package/dist/scripts/deployAndSave/enclaveToken.d.ts.map +1 -0
  128. package/dist/scripts/deployAndSave/enclaveToken.js +57 -0
  129. package/dist/scripts/deployAndSave/mockComputeProvider.d.ts.map +1 -1
  130. package/dist/scripts/deployAndSave/mockComputeProvider.js +5 -5
  131. package/dist/scripts/deployAndSave/mockDecryptionVerifier.d.ts.map +1 -1
  132. package/dist/scripts/deployAndSave/mockDecryptionVerifier.js +5 -5
  133. package/dist/scripts/deployAndSave/mockProgram.d.ts +1 -2
  134. package/dist/scripts/deployAndSave/mockProgram.d.ts.map +1 -1
  135. package/dist/scripts/deployAndSave/mockProgram.js +7 -19
  136. package/dist/scripts/deployAndSave/mockStableToken.d.ts +18 -0
  137. package/dist/scripts/deployAndSave/mockStableToken.d.ts.map +1 -0
  138. package/dist/scripts/deployAndSave/mockStableToken.js +36 -0
  139. package/dist/scripts/deployAndSave/poseidonT3.d.ts +11 -0
  140. package/dist/scripts/deployAndSave/poseidonT3.d.ts.map +1 -0
  141. package/dist/scripts/deployAndSave/poseidonT3.js +41 -0
  142. package/dist/scripts/deployAndSave/slashingManager.d.ts +19 -0
  143. package/dist/scripts/deployAndSave/slashingManager.d.ts.map +1 -0
  144. package/dist/scripts/deployAndSave/slashingManager.js +38 -0
  145. package/dist/scripts/deployEnclave.d.ts.map +1 -1
  146. package/dist/scripts/deployEnclave.js +109 -23
  147. package/dist/scripts/deployMocks.d.ts +0 -1
  148. package/dist/scripts/deployMocks.d.ts.map +1 -1
  149. package/dist/scripts/deployMocks.js +3 -6
  150. package/dist/scripts/index.d.ts +7 -2
  151. package/dist/scripts/index.d.ts.map +1 -1
  152. package/dist/scripts/index.js +7 -2
  153. package/dist/scripts/proxy.d.ts +22 -0
  154. package/dist/scripts/proxy.d.ts.map +1 -0
  155. package/dist/scripts/proxy.js +36 -0
  156. package/dist/scripts/runVerification.d.ts +2 -0
  157. package/dist/scripts/runVerification.d.ts.map +1 -0
  158. package/dist/scripts/runVerification.js +16 -0
  159. package/dist/scripts/upgrade/bondingRegistry.d.ts +6 -0
  160. package/dist/scripts/upgrade/bondingRegistry.d.ts.map +1 -0
  161. package/dist/scripts/upgrade/bondingRegistry.js +49 -0
  162. package/dist/scripts/upgrade/ciphernodeRegistryOwnable.d.ts +6 -0
  163. package/dist/scripts/upgrade/ciphernodeRegistryOwnable.d.ts.map +1 -0
  164. package/dist/scripts/upgrade/ciphernodeRegistryOwnable.js +52 -0
  165. package/dist/scripts/upgrade/enclave.d.ts +6 -0
  166. package/dist/scripts/upgrade/enclave.d.ts.map +1 -0
  167. package/dist/scripts/upgrade/enclave.js +49 -0
  168. package/dist/scripts/utils.d.ts +51 -2
  169. package/dist/scripts/utils.d.ts.map +1 -1
  170. package/dist/scripts/utils.js +67 -4
  171. package/dist/scripts/verify.d.ts +6 -0
  172. package/dist/scripts/verify.d.ts.map +1 -0
  173. package/dist/scripts/verify.js +142 -0
  174. package/dist/tasks/ciphernode.d.ts +2 -0
  175. package/dist/tasks/ciphernode.d.ts.map +1 -1
  176. package/dist/tasks/ciphernode.js +290 -19
  177. package/dist/tasks/enclave.d.ts.map +1 -1
  178. package/dist/tasks/enclave.js +76 -31
  179. package/dist/test/Enclave.spec.js +377 -370
  180. package/dist/test/Registry/BondingRegistry.spec.d.ts +2 -0
  181. package/dist/test/Registry/BondingRegistry.spec.d.ts.map +1 -0
  182. package/dist/test/Registry/BondingRegistry.spec.js +684 -0
  183. package/dist/test/Registry/CiphernodeRegistryOwnable.spec.d.ts.map +1 -0
  184. package/dist/test/Registry/CiphernodeRegistryOwnable.spec.js +374 -0
  185. package/dist/test/Slashing/SlashingManager.spec.d.ts +2 -0
  186. package/dist/test/Slashing/SlashingManager.spec.d.ts.map +1 -0
  187. package/dist/test/Slashing/SlashingManager.spec.js +672 -0
  188. package/dist/types/@openzeppelin/contracts/index.d.ts +3 -0
  189. package/dist/types/@openzeppelin/contracts/index.d.ts.map +1 -0
  190. package/dist/types/@openzeppelin/contracts/proxy/index.d.ts +3 -0
  191. package/dist/types/@openzeppelin/contracts/proxy/index.d.ts.map +1 -0
  192. package/dist/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts +97 -0
  193. package/dist/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts.map +1 -0
  194. package/dist/types/{contracts/registry/NaiveRegistryFilter.js → @openzeppelin/contracts/proxy/transparent/ProxyAdmin.js} +0 -4
  195. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.d.ts +81 -0
  196. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.d.ts.map +1 -0
  197. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.js +12 -0
  198. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.d.ts +52 -0
  199. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.d.ts.map +1 -0
  200. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.js +8 -0
  201. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +3 -0
  202. package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts.map +1 -0
  203. package/dist/types/@openzeppelin/contracts/proxy/transparent/index.d.ts +4 -0
  204. package/dist/types/@openzeppelin/contracts/proxy/transparent/index.d.ts.map +1 -0
  205. package/dist/types/@openzeppelin/index.d.ts +3 -0
  206. package/dist/types/@openzeppelin/index.d.ts.map +1 -0
  207. package/dist/types/contracts/Enclave.d.ts +126 -53
  208. package/dist/types/contracts/Enclave.d.ts.map +1 -1
  209. package/dist/types/contracts/Enclave.js +12 -0
  210. package/dist/types/contracts/index.d.ts +6 -0
  211. package/dist/types/contracts/index.d.ts.map +1 -1
  212. package/dist/types/contracts/interfaces/IBondingRegistry.d.ts +622 -0
  213. package/dist/types/contracts/interfaces/IBondingRegistry.d.ts.map +1 -0
  214. package/dist/types/contracts/interfaces/IBondingRegistry.js +24 -0
  215. package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts +245 -15
  216. package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts.map +1 -1
  217. package/dist/types/contracts/interfaces/ICiphernodeRegistry.js +16 -0
  218. package/dist/types/contracts/interfaces/IE3Program.d.ts +20 -10
  219. package/dist/types/contracts/interfaces/IE3Program.d.ts.map +1 -1
  220. package/dist/types/contracts/interfaces/IEnclave.d.ts +149 -20
  221. package/dist/types/contracts/interfaces/IEnclave.d.ts.map +1 -1
  222. package/dist/types/contracts/interfaces/IEnclave.js +12 -0
  223. package/dist/types/contracts/interfaces/{IRegistryFilter.d.ts → ISlashVerifier.d.ts} +16 -16
  224. package/dist/types/contracts/interfaces/ISlashVerifier.d.ts.map +1 -0
  225. package/dist/types/contracts/interfaces/ISlashVerifier.js +1 -0
  226. package/dist/types/contracts/interfaces/ISlashingManager.d.ts +384 -0
  227. package/dist/types/contracts/interfaces/ISlashingManager.d.ts.map +1 -0
  228. package/dist/types/contracts/interfaces/ISlashingManager.js +24 -0
  229. package/dist/types/contracts/interfaces/index.d.ts +3 -2
  230. package/dist/types/contracts/interfaces/index.d.ts.map +1 -1
  231. package/dist/types/contracts/lib/ExitQueueLib.d.ts +73 -0
  232. package/dist/types/contracts/lib/ExitQueueLib.d.ts.map +1 -0
  233. package/dist/types/contracts/lib/ExitQueueLib.js +12 -0
  234. package/dist/types/contracts/lib/index.d.ts +2 -0
  235. package/dist/types/contracts/lib/index.d.ts.map +1 -0
  236. package/dist/types/contracts/lib/index.js +1 -0
  237. package/dist/types/contracts/registry/BondingRegistry.d.ts +821 -0
  238. package/dist/types/contracts/registry/BondingRegistry.d.ts.map +1 -0
  239. package/dist/types/contracts/registry/BondingRegistry.js +44 -0
  240. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts +194 -34
  241. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts.map +1 -1
  242. package/dist/types/contracts/registry/CiphernodeRegistryOwnable.js +20 -0
  243. package/dist/types/contracts/registry/index.d.ts +1 -1
  244. package/dist/types/contracts/registry/index.d.ts.map +1 -1
  245. package/dist/types/contracts/slashing/SlashingManager.d.ts +592 -0
  246. package/dist/types/contracts/slashing/SlashingManager.d.ts.map +1 -0
  247. package/dist/types/contracts/slashing/SlashingManager.js +36 -0
  248. package/dist/types/contracts/slashing/index.d.ts +2 -0
  249. package/dist/types/contracts/slashing/index.d.ts.map +1 -0
  250. package/dist/types/contracts/slashing/index.js +1 -0
  251. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts +247 -17
  252. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts.map +1 -1
  253. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.js +16 -0
  254. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts +247 -17
  255. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts.map +1 -1
  256. package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.js +16 -0
  257. package/dist/types/contracts/test/MockE3Program.d.ts +20 -14
  258. package/dist/types/contracts/test/MockE3Program.d.ts.map +1 -1
  259. package/dist/types/contracts/test/{MockInputValidator.d.ts → MockSlashingVerifier.d.ts} +15 -15
  260. package/dist/types/contracts/test/MockSlashingVerifier.d.ts.map +1 -0
  261. package/dist/types/contracts/test/MockSlashingVerifier.js +1 -0
  262. package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.d.ts +227 -0
  263. package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.d.ts.map +1 -0
  264. package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.js +12 -0
  265. package/dist/types/contracts/test/MockStableToken.sol/index.d.ts +2 -0
  266. package/dist/types/contracts/test/MockStableToken.sol/index.d.ts.map +1 -0
  267. package/dist/types/contracts/test/MockStableToken.sol/index.js +1 -0
  268. package/dist/types/contracts/test/index.d.ts +3 -3
  269. package/dist/types/contracts/test/index.d.ts.map +1 -1
  270. package/dist/types/contracts/token/EnclaveTicketToken.d.ts +574 -0
  271. package/dist/types/contracts/token/EnclaveTicketToken.d.ts.map +1 -0
  272. package/dist/types/contracts/token/EnclaveTicketToken.js +24 -0
  273. package/dist/types/contracts/token/EnclaveToken.d.ts +775 -0
  274. package/dist/types/contracts/token/EnclaveToken.d.ts.map +1 -0
  275. package/dist/types/contracts/token/EnclaveToken.js +48 -0
  276. package/dist/types/contracts/token/index.d.ts +3 -0
  277. package/dist/types/contracts/token/index.d.ts.map +1 -0
  278. package/dist/types/contracts/token/index.js +1 -0
  279. package/dist/types/factories/@openzeppelin/contracts/index.d.ts +2 -0
  280. package/dist/types/factories/@openzeppelin/contracts/index.d.ts.map +1 -0
  281. package/dist/types/factories/@openzeppelin/contracts/index.js +4 -0
  282. package/dist/types/factories/@openzeppelin/contracts/proxy/index.d.ts +2 -0
  283. package/dist/types/factories/@openzeppelin/contracts/proxy/index.d.ts.map +1 -0
  284. package/dist/types/factories/@openzeppelin/contracts/proxy/index.js +4 -0
  285. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts +118 -0
  286. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts.map +1 -0
  287. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.js +157 -0
  288. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.d.ts +57 -0
  289. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.d.ts.map +1 -0
  290. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.js +78 -0
  291. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts +105 -0
  292. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts.map +1 -0
  293. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.js +141 -0
  294. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +3 -0
  295. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts.map +1 -0
  296. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.js +5 -0
  297. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.d.ts +3 -0
  298. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.d.ts.map +1 -0
  299. package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.js +5 -0
  300. package/dist/types/factories/@openzeppelin/index.d.ts +2 -0
  301. package/dist/types/factories/@openzeppelin/index.d.ts.map +1 -0
  302. package/dist/types/factories/@openzeppelin/index.js +4 -0
  303. package/dist/types/factories/contracts/Enclave__factory.d.ts +190 -104
  304. package/dist/types/factories/contracts/Enclave__factory.d.ts.map +1 -1
  305. package/dist/types/factories/contracts/Enclave__factory.js +241 -134
  306. package/dist/types/factories/contracts/index.d.ts +3 -0
  307. package/dist/types/factories/contracts/index.d.ts.map +1 -1
  308. package/dist/types/factories/contracts/index.js +3 -0
  309. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts +678 -0
  310. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts.map +1 -0
  311. package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.js +882 -0
  312. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts +253 -9
  313. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts.map +1 -1
  314. package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.js +325 -9
  315. package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts +16 -2
  316. package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts.map +1 -1
  317. package/dist/types/factories/contracts/interfaces/IE3Program__factory.js +20 -2
  318. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts +190 -24
  319. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts.map +1 -1
  320. package/dist/types/factories/contracts/interfaces/IEnclave__factory.js +246 -26
  321. package/dist/types/factories/contracts/interfaces/ISlashVerifier__factory.d.ts +26 -0
  322. package/dist/types/factories/contracts/interfaces/ISlashVerifier__factory.d.ts.map +1 -0
  323. package/dist/types/factories/contracts/interfaces/{IRegistryFilter__factory.js → ISlashVerifier__factory.js} +7 -7
  324. package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.d.ts +594 -0
  325. package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.d.ts.map +1 -0
  326. package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.js +760 -0
  327. package/dist/types/factories/contracts/interfaces/index.d.ts +3 -2
  328. package/dist/types/factories/contracts/interfaces/index.d.ts.map +1 -1
  329. package/dist/types/factories/contracts/interfaces/index.js +3 -2
  330. package/dist/types/factories/contracts/lib/ExitQueueLib__factory.d.ts +107 -0
  331. package/dist/types/factories/contracts/lib/ExitQueueLib__factory.d.ts.map +1 -0
  332. package/dist/types/factories/contracts/lib/ExitQueueLib__factory.js +138 -0
  333. package/dist/types/factories/contracts/lib/index.d.ts +2 -0
  334. package/dist/types/factories/contracts/lib/index.d.ts.map +1 -0
  335. package/dist/types/factories/contracts/lib/index.js +4 -0
  336. package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts +958 -0
  337. package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts.map +1 -0
  338. package/dist/types/factories/contracts/registry/BondingRegistry__factory.js +1239 -0
  339. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts +272 -40
  340. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts.map +1 -1
  341. package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.js +343 -49
  342. package/dist/types/factories/contracts/registry/index.d.ts +1 -1
  343. package/dist/types/factories/contracts/registry/index.d.ts.map +1 -1
  344. package/dist/types/factories/contracts/registry/index.js +1 -1
  345. package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts +879 -0
  346. package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts.map +1 -0
  347. package/dist/types/factories/contracts/slashing/SlashingManager__factory.js +1129 -0
  348. package/dist/types/factories/contracts/slashing/index.d.ts +2 -0
  349. package/dist/types/factories/contracts/slashing/index.d.ts.map +1 -0
  350. package/dist/types/factories/contracts/slashing/index.js +4 -0
  351. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts +254 -10
  352. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts.map +1 -1
  353. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.js +326 -10
  354. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts +254 -10
  355. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts.map +1 -1
  356. package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.js +326 -10
  357. package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts +2 -2
  358. package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts.map +1 -1
  359. package/dist/types/factories/contracts/test/MockComputeProvider__factory.js +2 -2
  360. package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.d.ts +1 -1
  361. package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.d.ts.map +1 -1
  362. package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.js +1 -1
  363. package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts +23 -27
  364. package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts.map +1 -1
  365. package/dist/types/factories/contracts/test/MockE3Program__factory.js +28 -34
  366. package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.d.ts +43 -0
  367. package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.d.ts.map +1 -0
  368. package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.js +60 -0
  369. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts +338 -0
  370. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts.map +1 -0
  371. package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.js +447 -0
  372. package/dist/types/factories/contracts/test/MockStableToken.sol/index.d.ts +2 -0
  373. package/dist/types/factories/contracts/test/MockStableToken.sol/index.d.ts.map +1 -0
  374. package/dist/types/factories/contracts/test/MockStableToken.sol/index.js +4 -0
  375. package/dist/types/factories/contracts/test/index.d.ts +2 -2
  376. package/dist/types/factories/contracts/test/index.d.ts.map +1 -1
  377. package/dist/types/factories/contracts/test/index.js +2 -2
  378. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts +894 -0
  379. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts.map +1 -0
  380. package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.js +1175 -0
  381. package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts +1101 -0
  382. package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts.map +1 -0
  383. package/dist/types/factories/contracts/token/EnclaveToken__factory.js +1439 -0
  384. package/dist/types/factories/contracts/token/index.d.ts +3 -0
  385. package/dist/types/factories/contracts/token/index.d.ts.map +1 -0
  386. package/dist/types/factories/contracts/token/index.js +5 -0
  387. package/dist/types/factories/index.d.ts +1 -0
  388. package/dist/types/factories/index.d.ts.map +1 -1
  389. package/dist/types/factories/index.js +1 -0
  390. package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.d.ts +1 -1
  391. package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.d.ts.map +1 -1
  392. package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.js +1 -1
  393. package/dist/types/index.d.ts +28 -12
  394. package/dist/types/index.d.ts.map +1 -1
  395. package/dist/types/index.js +13 -6
  396. package/package.json +30 -21
  397. package/LICENSE.md +0 -165
  398. package/artifacts/build-info/solc-0_8_27-9aea5e3f6e25811e781e96c22e8edaf1eb1a01c5.json +0 -130
  399. package/artifacts/build-info/solc-0_8_27-9aea5e3f6e25811e781e96c22e8edaf1eb1a01c5.output.json +0 -1
  400. package/artifacts/contracts/interfaces/IInputValidator.sol/IInputValidator.json +0 -38
  401. package/artifacts/contracts/interfaces/IInputValidator.sol/artifacts.d.ts +0 -27
  402. package/artifacts/contracts/interfaces/IRegistryFilter.sol/artifacts.d.ts +0 -27
  403. package/artifacts/contracts/registry/NaiveRegistryFilter.sol/NaiveRegistryFilter.json +0 -309
  404. package/artifacts/contracts/registry/NaiveRegistryFilter.sol/artifacts.d.ts +0 -27
  405. package/artifacts/contracts/test/MockInputValidator.sol/MockInputValidator.json +0 -43
  406. package/artifacts/contracts/test/MockInputValidator.sol/artifacts.d.ts +0 -27
  407. package/artifacts/contracts/test/MockRegistryFilter.sol/IRegistry.json +0 -37
  408. package/artifacts/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.json +0 -262
  409. package/artifacts/contracts/test/MockRegistryFilter.sol/artifacts.d.ts +0 -43
  410. package/contracts/interfaces/IInputValidator.sol +0 -18
  411. package/contracts/interfaces/IRegistryFilter.sol +0 -13
  412. package/contracts/registry/NaiveRegistryFilter.sol +0 -124
  413. package/contracts/test/MockInputValidator.sol +0 -29
  414. package/contracts/test/MockRegistryFilter.sol +0 -117
  415. package/dist/ignition/modules/mockInputValidator.d.ts.map +0 -1
  416. package/dist/ignition/modules/naiveRegistryFilter.d.ts.map +0 -1
  417. package/dist/ignition/modules/naiveRegistryFilter.js +0 -16
  418. package/dist/scripts/deployAndSave/mockInputValidator.d.ts +0 -6
  419. package/dist/scripts/deployAndSave/mockInputValidator.d.ts.map +0 -1
  420. package/dist/scripts/deployAndSave/mockInputValidator.js +0 -18
  421. package/dist/scripts/deployAndSave/naiveRegistryFilter.d.ts +0 -11
  422. package/dist/scripts/deployAndSave/naiveRegistryFilter.d.ts.map +0 -1
  423. package/dist/scripts/deployAndSave/naiveRegistryFilter.js +0 -41
  424. package/dist/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.d.ts.map +0 -1
  425. package/dist/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.js +0 -279
  426. package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.d.ts +0 -2
  427. package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.d.ts.map +0 -1
  428. package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.js +0 -160
  429. package/dist/types/contracts/interfaces/IInputValidator.d.ts +0 -36
  430. package/dist/types/contracts/interfaces/IInputValidator.d.ts.map +0 -1
  431. package/dist/types/contracts/interfaces/IRegistryFilter.d.ts.map +0 -1
  432. package/dist/types/contracts/registry/NaiveRegistryFilter.d.ts +0 -187
  433. package/dist/types/contracts/registry/NaiveRegistryFilter.d.ts.map +0 -1
  434. package/dist/types/contracts/test/MockInputValidator.d.ts.map +0 -1
  435. package/dist/types/contracts/test/MockRegistryFilter.sol/IRegistry.d.ts +0 -38
  436. package/dist/types/contracts/test/MockRegistryFilter.sol/IRegistry.d.ts.map +0 -1
  437. package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.d.ts +0 -163
  438. package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.d.ts.map +0 -1
  439. package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.js +0 -8
  440. package/dist/types/contracts/test/MockRegistryFilter.sol/index.d.ts +0 -3
  441. package/dist/types/contracts/test/MockRegistryFilter.sol/index.d.ts.map +0 -1
  442. package/dist/types/factories/contracts/interfaces/IInputValidator__factory.d.ts +0 -26
  443. package/dist/types/factories/contracts/interfaces/IInputValidator__factory.d.ts.map +0 -1
  444. package/dist/types/factories/contracts/interfaces/IInputValidator__factory.js +0 -39
  445. package/dist/types/factories/contracts/interfaces/IRegistryFilter__factory.d.ts +0 -26
  446. package/dist/types/factories/contracts/interfaces/IRegistryFilter__factory.d.ts.map +0 -1
  447. package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.d.ts +0 -251
  448. package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.d.ts.map +0 -1
  449. package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.js +0 -331
  450. package/dist/types/factories/contracts/test/MockInputValidator__factory.d.ts +0 -47
  451. package/dist/types/factories/contracts/test/MockInputValidator__factory.d.ts.map +0 -1
  452. package/dist/types/factories/contracts/test/MockInputValidator__factory.js +0 -65
  453. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.d.ts +0 -26
  454. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.d.ts.map +0 -1
  455. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.js +0 -38
  456. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.d.ts +0 -216
  457. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.d.ts.map +0 -1
  458. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.js +0 -284
  459. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.d.ts +0 -3
  460. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.d.ts.map +0 -1
  461. package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.js +0 -5
  462. /package/dist/test/{CiphernodeRegistry → Registry}/CiphernodeRegistryOwnable.spec.d.ts +0 -0
  463. /package/dist/types/{contracts/test/MockRegistryFilter.sol → @openzeppelin/contracts}/index.js +0 -0
  464. /package/dist/types/{contracts/interfaces/IInputValidator.js → @openzeppelin/contracts/proxy/index.js} +0 -0
  465. /package/dist/types/{contracts/interfaces/IRegistryFilter.js → @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.js} +0 -0
  466. /package/dist/types/{contracts/test/MockInputValidator.js → @openzeppelin/contracts/proxy/transparent/index.js} +0 -0
  467. /package/dist/types/{contracts/test/MockRegistryFilter.sol/IRegistry.js → @openzeppelin/index.js} +0 -0
@@ -5,13 +5,18 @@
5
5
  // or FITNESS FOR A PARTICULAR PURPOSE.
6
6
  pragma solidity >=0.8.27;
7
7
 
8
+ /**
9
+ * @title IDecryptionVerifier
10
+ * @notice Interface for verifying decrypted computation outputs
11
+ * @dev Implements cryptographic verification of plaintext outputs from encrypted computations
12
+ */
8
13
  interface IDecryptionVerifier {
9
- /// @notice This function should be called by the Enclave contract to verify the
10
- /// decryption of output of a computation.
11
- /// @param e3Id ID of the E3.
12
- /// @param plaintextOutputHash The keccak256 hash of the plaintext output to be verified.
13
- /// @param proof ABI encoded proof of the given output hash.
14
- /// @return success Whether or not the plaintextOutputHash was successfully verified.
14
+ /// @notice Verify the decryption of a computation output
15
+ /// @dev This function is called by the Enclave contract when plaintext output is published
16
+ /// @param e3Id ID of the E3 computation
17
+ /// @param plaintextOutputHash The keccak256 hash of the plaintext output to be verified
18
+ /// @param proof ABI encoded proof of the decryption validity
19
+ /// @return success Whether the plaintextOutputHash was successfully verified
15
20
  function verify(
16
21
  uint256 e3Id,
17
22
  bytes32 plaintextOutputHash,
@@ -5,25 +5,29 @@
5
5
  // or FITNESS FOR A PARTICULAR PURPOSE.
6
6
  pragma solidity >=0.8.27;
7
7
 
8
- import { IInputValidator } from "./IInputValidator.sol";
9
8
  import { IE3Program } from "./IE3Program.sol";
10
9
  import { IDecryptionVerifier } from "./IDecryptionVerifier.sol";
11
10
 
12
- /// @title E3 struct
13
- /// @notice This struct represents an E3 computation.
14
- /// @param threshold M/N threshold for the committee.
15
- /// @param requestBlock Block number when the E3 was requested.
16
- /// @param startWindow Start window for the computation: index zero is minimum, index 1 is the maxium.
17
- /// @param duration Duration of the E3.
18
- /// @param expiration Timestamp when committee duties expire.
19
- /// @param e3Program Address of the E3 Program contract.
20
- /// @param e3ProgramParams ABI encoded computation parameters.
21
- /// @param computeProvider Address of the compute provider contract.
22
- /// @param inputValidator Address of the input validator contract.
23
- /// @param decryptionVerifier Address of the output verifier contract.
24
- /// @param committeeId ID of the selected committee.
25
- /// @param ciphertextOutput Encrypted output data.
26
- /// @param plaintextOutput Decrypted output data.
11
+ /**
12
+ * @title E3
13
+ * @notice Represents a complete E3 (Encrypted Execution Environment) computation request and its lifecycle
14
+ * @dev This struct tracks all parameters, state, and results of an encrypted computation
15
+ * from request through completion
16
+ * @param seed Random seed for committee selection and computation initialization
17
+ * @param threshold M/N threshold for the committee (M required out of N total members)
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
22
+ * @param encryptionSchemeId Identifier for the encryption scheme used in this computation
23
+ * @param e3Program Address of the E3 Program contract that validates and verifies the computation
24
+ * @param e3ProgramParams ABI encoded computation parameters specific to the E3 program
25
+ * @param customParams Arbitrary ABI-encoded application-defined parameters.
26
+ * @param decryptionVerifier Address of the output verifier contract for decryption verification
27
+ * @param committeePublicKey The public key of the selected committee for this computation
28
+ * @param ciphertextOutput Hash of the encrypted output data produced by the computation
29
+ * @param plaintextOutput Decrypted output data after committee decryption
30
+ */
27
31
  struct E3 {
28
32
  uint256 seed;
29
33
  uint32[2] threshold;
@@ -34,7 +38,7 @@ struct E3 {
34
38
  bytes32 encryptionSchemeId;
35
39
  IE3Program e3Program;
36
40
  bytes e3ProgramParams;
37
- IInputValidator inputValidator;
41
+ bytes customParams;
38
42
  IDecryptionVerifier decryptionVerifier;
39
43
  bytes32 committeePublicKey;
40
44
  bytes32 ciphertextOutput;
@@ -5,33 +5,46 @@
5
5
  // or FITNESS FOR A PARTICULAR PURPOSE.
6
6
  pragma solidity >=0.8.27;
7
7
 
8
- import { IInputValidator } from "./IInputValidator.sol";
9
-
8
+ /**
9
+ * @title IE3Program
10
+ * @notice Interface for E3 program validation and verification
11
+ * @dev E3 programs define the computation logic and validation rules for encrypted execution environments
12
+ */
10
13
  interface IE3Program {
11
- /// @notice This function should be called by the Enclave contract to validate the computation parameters.
12
- /// @param e3Id ID of the E3.
13
- /// @param seed Seed for the computation.
14
- /// @param e3ProgramParams ABI encoded computation parameters.
15
- /// @param computeProviderParams ABI encoded compute provider parameters.
16
- /// @return encryptionSchemeId ID of the encryption scheme to be used for the computation.
17
- /// @return inputValidator The input validator to be used for the computation.
14
+ /// @notice Validate E3 computation parameters and return encryption scheme and input validator
15
+ /// @dev This function is called by the Enclave contract during E3 request to configure the computation
16
+ /// @param e3Id ID of the E3 computation
17
+ /// @param seed Random seed for the computation
18
+ /// @param e3ProgramParams ABI encoded E3 program parameters
19
+ /// @param computeProviderParams ABI encoded compute provider parameters
20
+ /// @return encryptionSchemeId ID of the encryption scheme to be used for the computation
18
21
  function validate(
19
22
  uint256 e3Id,
20
23
  uint256 seed,
21
24
  bytes calldata e3ProgramParams,
22
25
  bytes calldata computeProviderParams
23
- )
24
- external
25
- returns (bytes32 encryptionSchemeId, IInputValidator inputValidator);
26
+ ) external returns (bytes32 encryptionSchemeId);
26
27
 
27
- /// @notice This function should be called by the Enclave contract to verify the decrypted output of an E3.
28
- /// @param e3Id ID of the E3.
29
- /// @param ciphertextOutputHash The keccak256 hash of output data to be verified.
30
- /// @param proof ABI encoded data to verify the ciphertextOutputHash.
31
- /// @return success Whether the output data is valid.
28
+ /// @notice Verify the ciphertext output of an E3 computation
29
+ /// @dev This function is called by the Enclave contract when ciphertext output is published
30
+ /// @param e3Id ID of the E3 computation
31
+ /// @param ciphertextOutputHash The keccak256 hash of output data to be verified
32
+ /// @param proof ABI encoded data to verify the ciphertextOutputHash
33
+ /// @return success Whether the output data is valid
32
34
  function verify(
33
35
  uint256 e3Id,
34
36
  bytes32 ciphertextOutputHash,
35
37
  bytes memory proof
36
38
  ) external returns (bool success);
39
+
40
+ /// @notice Validate and process input data for a computation
41
+ /// @dev This function is called by the Enclave contract when input is published
42
+ /// @param e3Id ID of the E3 computation
43
+ /// @param sender The account that is submitting the input
44
+ /// @param data The input data to be validated
45
+ function validateInput(
46
+ uint256 e3Id,
47
+ address sender,
48
+ bytes memory data
49
+ ) external;
37
50
  }
@@ -6,6 +6,10 @@
6
6
  pragma solidity >=0.8.27;
7
7
 
8
8
  import { E3, IE3Program } from "./IE3.sol";
9
+ import { ICiphernodeRegistry } from "./ICiphernodeRegistry.sol";
10
+ import { IBondingRegistry } from "./IBondingRegistry.sol";
11
+ import { IDecryptionVerifier } from "./IDecryptionVerifier.sol";
12
+ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
9
13
 
10
14
  interface IEnclave {
11
15
  ////////////////////////////////////////////////////////////
@@ -17,14 +21,8 @@ interface IEnclave {
17
21
  /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully requested.
18
22
  /// @param e3Id ID of the E3.
19
23
  /// @param e3 Details of the E3.
20
- /// @param filter Address of the pool of nodes from which the Cipher Node committee was selected.
21
24
  /// @param e3Program Address of the Computation module selected.
22
- event E3Requested(
23
- uint256 e3Id,
24
- E3 e3,
25
- address filter,
26
- IE3Program indexed e3Program
27
- );
25
+ event E3Requested(uint256 e3Id, E3 e3, IE3Program indexed e3Program);
28
26
 
29
27
  /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully activated.
30
28
  /// @param e3Id ID of the E3.
@@ -70,6 +68,24 @@ interface IEnclave {
70
68
  /// @param ciphernodeRegistry The address of the CiphernodeRegistry contract.
71
69
  event CiphernodeRegistrySet(address ciphernodeRegistry);
72
70
 
71
+ /// @notice This event MUST be emitted any time the BondingRegistry is set.
72
+ /// @param bondingRegistry The address of the BondingRegistry contract.
73
+ event BondingRegistrySet(address bondingRegistry);
74
+
75
+ /// @notice This event MUST be emitted any time the fee token is set.
76
+ /// @param feeToken The address of the fee token.
77
+ event FeeTokenSet(address feeToken);
78
+
79
+ /// @notice This event MUST be emitted when rewards are distributed to committee members.
80
+ /// @param e3Id The ID of the E3 computation.
81
+ /// @param nodes The addresses of the committee members receiving rewards.
82
+ /// @param amounts The reward amounts for each committee member.
83
+ event RewardsDistributed(
84
+ uint256 indexed e3Id,
85
+ address[] nodes,
86
+ uint256[] amounts
87
+ );
88
+
73
89
  /// @notice The event MUST be emitted any time an encryption scheme is enabled.
74
90
  /// @param encryptionSchemeId The ID of the encryption scheme that was enabled.
75
91
  event EncryptionSchemeEnabled(bytes32 encryptionSchemeId);
@@ -97,20 +113,21 @@ interface IEnclave {
97
113
  ////////////////////////////////////////////////////////////
98
114
 
99
115
  /// @notice This struct contains the parameters to submit a request to Enclave.
100
- /// @param filter The address of the pool of nodes from which to select the committee.
101
116
  /// @param threshold The M/N threshold for the committee.
102
117
  /// @param startWindow The start window for the computation.
103
118
  /// @param duration The duration of the computation in seconds.
104
119
  /// @param e3Program The address of the E3 Program.
105
120
  /// @param e3ProgramParams The ABI encoded computation parameters.
121
+ /// @param computeProviderParams The ABI encoded compute provider parameters.
122
+ /// @param customParams Arbitrary ABI-encoded application-defined parameters.
106
123
  struct E3RequestParams {
107
- address filter;
108
124
  uint32[2] threshold;
109
125
  uint256[2] startWindow;
110
126
  uint256 duration;
111
127
  IE3Program e3Program;
112
128
  bytes e3ProgramParams;
113
129
  bytes computeProviderParams;
130
+ bytes customParams;
114
131
  }
115
132
 
116
133
  ////////////////////////////////////////////////////////////
@@ -125,8 +142,8 @@ interface IEnclave {
125
142
  /// @return e3Id ID of the E3.
126
143
  /// @return e3 The E3 struct.
127
144
  function request(
128
- E3RequestParams memory requestParams
129
- ) external payable returns (uint256 e3Id, E3 memory e3);
145
+ E3RequestParams calldata requestParams
146
+ ) external returns (uint256 e3Id, E3 memory e3);
130
147
 
131
148
  /// @notice This function should be called to activate an Encrypted Execution Environment (E3) once it has been
132
149
  /// initialized and is ready for input.
@@ -138,7 +155,7 @@ interface IEnclave {
138
155
  /// @return success True if the E3 was successfully activated.
139
156
  function activate(
140
157
  uint256 e3Id,
141
- bytes memory publicKey
158
+ bytes calldata publicKey
142
159
  ) external returns (bool success);
143
160
 
144
161
  /// @notice This function should be called to publish input data for Encrypted Execution Environment (E3).
@@ -160,8 +177,8 @@ interface IEnclave {
160
177
  /// @return success True if the output was successfully published.
161
178
  function publishCiphertextOutput(
162
179
  uint256 e3Id,
163
- bytes memory ciphertextOutput,
164
- bytes memory proof
180
+ bytes calldata ciphertextOutput,
181
+ bytes calldata proof
165
182
  ) external returns (bool success);
166
183
 
167
184
  /// @notice This function publishes the plaintext output of an Encrypted Execution Environment (E3).
@@ -172,8 +189,8 @@ interface IEnclave {
172
189
  /// @param proof ABI encoded data to verify the plaintextOutput.
173
190
  function publishPlaintextOutput(
174
191
  uint256 e3Id,
175
- bytes memory plaintextOutput,
176
- bytes memory proof
192
+ bytes calldata plaintextOutput,
193
+ bytes calldata proof
177
194
  ) external returns (bool success);
178
195
 
179
196
  ////////////////////////////////////////////////////////////
@@ -189,6 +206,28 @@ interface IEnclave {
189
206
  uint256 _maxDuration
190
207
  ) external returns (bool success);
191
208
 
209
+ /// @notice Sets the Ciphernode Registry contract address.
210
+ /// @dev This function MUST revert if the address is zero or the same as the current registry.
211
+ /// @param _ciphernodeRegistry The address of the new Ciphernode Registry contract.
212
+ /// @return success True if the registry was successfully set.
213
+ function setCiphernodeRegistry(
214
+ ICiphernodeRegistry _ciphernodeRegistry
215
+ ) external returns (bool success);
216
+
217
+ /// @notice Sets the Bonding Registry contract address.
218
+ /// @dev This function MUST revert if the address is zero or the same as the current registry.
219
+ /// @param _bondingRegistry The address of the new Bonding Registry contract.
220
+ /// @return success True if the registry was successfully set.
221
+ function setBondingRegistry(
222
+ IBondingRegistry _bondingRegistry
223
+ ) external returns (bool success);
224
+
225
+ /// @notice Sets the fee token used for E3 payments.
226
+ /// @dev This function MUST revert if the address is zero or the same as the current fee token.
227
+ /// @param _feeToken The address of the new fee token.
228
+ /// @return success True if the fee token was successfully set.
229
+ function setFeeToken(IERC20 _feeToken) external returns (bool success);
230
+
192
231
  /// @notice This function should be called to enable an E3 Program.
193
232
  /// @param e3Program The address of the E3 Program.
194
233
  /// @return success True if the E3 Program was successfully enabled.
@@ -203,6 +242,32 @@ interface IEnclave {
203
242
  IE3Program e3Program
204
243
  ) external returns (bool success);
205
244
 
245
+ /// @notice Sets or enables a decryption verifier for a specific encryption scheme.
246
+ /// @dev This function MUST revert if the verifier address is zero or already set to the same value.
247
+ /// @param encryptionSchemeId The unique identifier for the encryption scheme.
248
+ /// @param decryptionVerifier The address of the decryption verifier contract.
249
+ /// @return success True if the verifier was successfully set.
250
+ function setDecryptionVerifier(
251
+ bytes32 encryptionSchemeId,
252
+ IDecryptionVerifier decryptionVerifier
253
+ ) external returns (bool success);
254
+
255
+ /// @notice Disables a previously enabled encryption scheme.
256
+ /// @dev This function MUST revert if the encryption scheme is not currently enabled.
257
+ /// @param encryptionSchemeId The unique identifier for the encryption scheme to disable.
258
+ /// @return success True if the encryption scheme was successfully disabled.
259
+ function disableEncryptionScheme(
260
+ bytes32 encryptionSchemeId
261
+ ) external returns (bool success);
262
+
263
+ /// @notice Sets the allowed E3 program parameters.
264
+ /// @dev This function enables specific parameter sets for E3 programs (e.g., BFV encryption parameters).
265
+ /// @param _e3ProgramsParams Array of ABI encoded parameter sets to allow.
266
+ /// @return success True if the parameters were successfully set.
267
+ function setE3ProgramsParams(
268
+ bytes[] memory _e3ProgramsParams
269
+ ) external returns (bool success);
270
+
206
271
  ////////////////////////////////////////////////////////////
207
272
  // //
208
273
  // Get Functions //
@@ -215,9 +280,18 @@ interface IEnclave {
215
280
  /// @return e3 The struct representing the requested E3.
216
281
  function getE3(uint256 e3Id) external view returns (E3 memory e3);
217
282
 
218
- /// @notice This function returns root of the input merkle tree for a given E3.
219
- /// @dev This function MUST revert if the E3 does not exist.
220
- /// @param e3Id ID of the E3.
221
- /// @return root The root of the input merkle tree.
222
- function getInputRoot(uint256 e3Id) external view returns (uint256 root);
283
+ /// @notice This function returns the fee of an E3
284
+ /// @dev This function MUST revert if the E3 parameters are invalid.
285
+ /// @param e3Params the struct representing the E3 request parameters
286
+ /// @return fee the fee of the E3
287
+ function getE3Quote(
288
+ E3RequestParams calldata e3Params
289
+ ) external view returns (uint256 fee);
290
+
291
+ /// @notice Returns the decryption verifier for a given encryption scheme.
292
+ /// @param encryptionSchemeId The unique identifier for the encryption scheme.
293
+ /// @return The decryption verifier contract for the specified encryption scheme.
294
+ function getDecryptionVerifier(
295
+ bytes32 encryptionSchemeId
296
+ ) external view returns (IDecryptionVerifier);
223
297
  }
@@ -0,0 +1,23 @@
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
+
8
+ /**
9
+ * @title ISlashVerifier
10
+ * @notice Interface for verifying slash proofs
11
+ * @dev Slash verifiers implement cryptographic or logical verification of slash proposals
12
+ */
13
+ interface ISlashVerifier {
14
+ /// @notice Verify a slash proof
15
+ /// @dev This function is called by the SlashingManager contract during slash proposal to verify proof validity
16
+ /// @param proposalId ID of the slash proposal
17
+ /// @param proof ABI encoded proof data supporting the slash
18
+ /// @return success Whether the proof was successfully verified
19
+ function verify(
20
+ uint256 proposalId,
21
+ bytes memory proof
22
+ ) external view returns (bool success);
23
+ }