@etherisc/gif-next 0.0.2-b421459-499 → 0.0.2-b43fece-589

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 (472) hide show
  1. package/README.md +19 -2
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +105 -65
  4. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  5. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
  7. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +60 -32
  10. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
  12. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
  14. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
  15. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
  16. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  17. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
  18. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +206 -309
  20. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
  22. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +134 -277
  24. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +284 -223
  26. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +116 -104
  28. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +121 -92
  30. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +149 -31
  32. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
  33. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
  34. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
  35. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1491 -0
  36. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
  37. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
  38. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
  39. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2037 -0
  40. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
  41. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
  42. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
  43. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
  44. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
  45. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1471 -0
  46. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
  47. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1231 -0
  48. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
  49. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1613 -0
  50. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
  51. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2327 -0
  52. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  53. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  54. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  55. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +53 -31
  56. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  57. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +29 -84
  58. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  59. package/artifacts/contracts/instance/Instance.sol/Instance.json +56 -123
  60. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  61. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +166 -139
  62. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  63. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +57 -97
  64. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  65. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +464 -141
  66. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +77 -242
  68. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +75 -87
  70. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +340 -253
  72. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  73. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  74. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  75. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  76. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  77. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  78. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
  79. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  80. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  81. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  82. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  83. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  84. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  85. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  86. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  87. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  88. package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
  89. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  90. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +164 -280
  91. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  92. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
  93. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  94. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  95. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +96 -80
  96. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  97. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
  98. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  99. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +106 -262
  100. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  101. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +91 -159
  102. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +75 -83
  104. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  105. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +152 -345
  106. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  107. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
  108. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  109. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +490 -171
  110. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  111. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +161 -89
  112. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  113. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +277 -16
  114. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  115. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +107 -145
  116. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  117. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +422 -215
  118. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  119. package/artifacts/contracts/pool/Pool.sol/Pool.json +118 -328
  120. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  121. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +558 -392
  122. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  123. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +107 -87
  124. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  125. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +76 -168
  126. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  127. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +72 -92
  128. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  129. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +160 -281
  130. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  131. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
  132. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  133. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +303 -187
  134. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  135. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +119 -103
  136. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  137. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +34 -0
  138. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  139. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +176 -6
  140. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  141. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +323 -118
  142. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  143. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +114 -85
  144. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  145. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +148 -97
  146. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
  147. package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +31 -2
  148. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  149. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +444 -325
  150. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  151. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +119 -103
  152. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  153. package/artifacts/contracts/product/PricingService.sol/PricingService.json +202 -307
  154. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  155. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +96 -120
  156. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  157. package/artifacts/contracts/product/Product.sol/Product.json +160 -281
  158. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
  159. package/artifacts/contracts/product/RiskService.sol/RiskService.json +622 -0
  160. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
  161. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +694 -0
  162. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  163. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
  164. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  165. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +286 -34
  166. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  167. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
  168. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  169. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
  170. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  171. package/artifacts/contracts/registry/Registry.sol/Registry.json +492 -95
  172. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  173. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +283 -143
  174. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  175. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +78 -284
  176. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  177. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +67 -75
  178. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  179. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
  180. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  181. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +129 -221
  182. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  183. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
  184. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  185. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  186. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  187. package/artifacts/contracts/shared/Component.sol/Component.json +65 -236
  188. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  189. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +526 -245
  190. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  191. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +136 -106
  192. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  193. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +47 -112
  194. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  195. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  196. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  197. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +55 -54
  198. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +474 -19
  200. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +85 -80
  202. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  203. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
  204. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  205. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
  206. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  207. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
  208. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  209. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
  210. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  211. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -0
  212. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  213. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  214. package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
  215. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
  216. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
  217. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  218. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +98 -265
  219. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  220. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
  221. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  222. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
  223. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  224. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  225. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  226. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +22 -57
  227. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  228. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
  229. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  230. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +58 -89
  231. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  232. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
  233. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  234. package/artifacts/contracts/shared/Service.sol/Service.json +47 -112
  235. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  236. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +330 -11
  237. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
  238. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
  239. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  240. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +82 -55
  241. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  242. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
  243. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  244. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +73 -93
  245. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  246. package/artifacts/contracts/staking/Staking.sol/Staking.json +174 -291
  247. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  248. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
  249. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  250. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +106 -91
  251. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  252. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -11
  253. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  254. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +71 -165
  255. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  256. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +71 -79
  257. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  258. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +174 -128
  259. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  260. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +59 -23
  261. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  262. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  263. package/artifacts/contracts/type/Amount.sol/AmountLib.json +61 -8
  264. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  265. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
  266. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  267. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
  268. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  269. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  270. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  271. package/artifacts/contracts/type/Fee.sol/FeeLib.json +7 -2
  272. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  273. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  274. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  276. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  277. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  278. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  279. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
  280. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
  282. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  284. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  286. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
  288. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  290. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  291. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +50 -2
  292. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  293. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  294. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  295. package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
  296. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  297. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  298. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
  299. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  300. package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
  301. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  302. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +52 -2
  303. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  304. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  305. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
  306. package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
  307. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  308. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +602 -0
  309. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  310. package/artifacts/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +3 -3
  311. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
  312. package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
  313. package/contracts/authorization/AccessAdmin.sol +64 -59
  314. package/contracts/authorization/Authorization.sol +111 -40
  315. package/contracts/authorization/IAccess.sol +1 -0
  316. package/contracts/authorization/IAccessAdmin.sol +4 -3
  317. package/contracts/authorization/IAuthorization.sol +13 -7
  318. package/contracts/authorization/IServiceAuthorization.sol +3 -1
  319. package/contracts/authorization/ReleaseAccessManager.sol +38 -0
  320. package/contracts/authorization/ServiceAuthorization.sol +26 -10
  321. package/contracts/distribution/BasicDistribution.sol +6 -16
  322. package/contracts/distribution/BasicDistributionAuthorization.sol +5 -1
  323. package/contracts/distribution/Distribution.sol +28 -26
  324. package/contracts/distribution/DistributionService.sol +128 -75
  325. package/contracts/distribution/DistributionServiceManager.sol +8 -11
  326. package/contracts/distribution/IDistributionComponent.sol +9 -5
  327. package/contracts/distribution/IDistributionService.sol +18 -2
  328. package/contracts/examples/fire/DamageLevel.sol +59 -0
  329. package/contracts/examples/fire/FirePool.sol +86 -0
  330. package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
  331. package/contracts/examples/fire/FireProduct.sol +431 -0
  332. package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
  333. package/contracts/examples/fire/FireUSD.sol +26 -0
  334. package/contracts/examples/unpermissioned/SimpleDistribution.sol +50 -0
  335. package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
  336. package/contracts/examples/unpermissioned/SimplePool.sol +81 -0
  337. package/contracts/examples/unpermissioned/SimpleProduct.sol +345 -0
  338. package/contracts/instance/IInstance.sol +10 -30
  339. package/contracts/instance/IInstanceService.sol +0 -20
  340. package/contracts/instance/Instance.sol +29 -51
  341. package/contracts/instance/InstanceAdmin.sol +42 -31
  342. package/contracts/instance/InstanceAuthorizationV3.sol +13 -21
  343. package/contracts/instance/InstanceReader.sol +115 -25
  344. package/contracts/instance/InstanceService.sol +65 -97
  345. package/contracts/instance/InstanceServiceManager.sol +8 -13
  346. package/contracts/instance/InstanceStore.sol +12 -1
  347. package/contracts/instance/base/ObjectLifecycle.sol +9 -4
  348. package/contracts/instance/module/IBundle.sol +1 -1
  349. package/contracts/instance/module/IComponents.sol +11 -12
  350. package/contracts/instance/module/IDistribution.sol +0 -1
  351. package/contracts/instance/module/IPolicy.sol +24 -24
  352. package/contracts/mock/Dip.sol +1 -1
  353. package/contracts/oracle/BasicOracle.sol +0 -1
  354. package/contracts/oracle/IOracleComponent.sol +2 -1
  355. package/contracts/oracle/IOracleService.sol +2 -1
  356. package/contracts/oracle/Oracle.sol +21 -22
  357. package/contracts/oracle/OracleService.sol +56 -42
  358. package/contracts/oracle/OracleServiceManager.sol +8 -11
  359. package/contracts/pool/BasicPool.sol +38 -27
  360. package/contracts/pool/BasicPoolAuthorization.sol +22 -3
  361. package/contracts/pool/BundleService.sol +258 -69
  362. package/contracts/pool/BundleServiceManager.sol +8 -11
  363. package/contracts/pool/IBundleService.sol +44 -10
  364. package/contracts/pool/IPoolComponent.sol +20 -10
  365. package/contracts/pool/IPoolService.sol +67 -45
  366. package/contracts/pool/Pool.sol +150 -116
  367. package/contracts/pool/PoolService.sol +336 -166
  368. package/contracts/pool/PoolServiceManager.sol +6 -9
  369. package/contracts/product/ApplicationService.sol +70 -65
  370. package/contracts/product/ApplicationServiceManager.sol +6 -6
  371. package/contracts/product/BasicProduct.sol +11 -44
  372. package/contracts/product/BasicProductAuthorization.sol +2 -0
  373. package/contracts/product/ClaimService.sol +316 -146
  374. package/contracts/product/ClaimServiceManager.sol +6 -6
  375. package/contracts/product/IApplicationService.sol +1 -0
  376. package/contracts/product/IClaimService.sol +31 -7
  377. package/contracts/product/IPolicyService.sol +34 -32
  378. package/contracts/product/IPricingService.sol +10 -10
  379. package/contracts/product/IProductComponent.sol +24 -4
  380. package/contracts/product/{IProductService.sol → IRiskService.sol} +1 -1
  381. package/contracts/product/PolicyService.sol +419 -203
  382. package/contracts/product/PolicyServiceManager.sol +6 -9
  383. package/contracts/product/PricingService.sol +54 -54
  384. package/contracts/product/PricingServiceManager.sol +5 -8
  385. package/contracts/product/Product.sol +126 -87
  386. package/contracts/product/{ProductService.sol → RiskService.sol} +13 -41
  387. package/contracts/product/RiskServiceManager.sol +39 -0
  388. package/contracts/registry/ChainNft.sol +68 -38
  389. package/contracts/registry/IRegistry.sol +55 -18
  390. package/contracts/registry/IRegistryService.sol +5 -12
  391. package/contracts/registry/ITransferInterceptor.sol +1 -2
  392. package/contracts/registry/Registry.sol +342 -201
  393. package/contracts/registry/RegistryAdmin.sol +134 -51
  394. package/contracts/registry/RegistryService.sol +39 -64
  395. package/contracts/registry/RegistryServiceManager.sol +4 -4
  396. package/contracts/registry/ReleaseLifecycle.sol +6 -3
  397. package/contracts/registry/ReleaseRegistry.sol +204 -190
  398. package/contracts/registry/ServiceAuthorizationV3.sol +26 -23
  399. package/contracts/shared/Component.sol +47 -63
  400. package/contracts/shared/ComponentService.sol +314 -150
  401. package/contracts/shared/ComponentServiceManager.sol +10 -7
  402. package/contracts/shared/ComponentVerifyingService.sol +23 -16
  403. package/contracts/shared/ContractLib.sol +38 -0
  404. package/contracts/shared/IComponent.sol +10 -6
  405. package/contracts/shared/IComponentService.sol +38 -20
  406. package/contracts/shared/IInstanceLinkedComponent.sol +8 -17
  407. package/contracts/shared/ILifecycle.sol +3 -1
  408. package/contracts/shared/INftOwnable.sol +2 -0
  409. package/contracts/shared/IPolicyHolder.sol +12 -22
  410. package/contracts/shared/IRegisterable.sol +11 -0
  411. package/contracts/shared/IService.sol +1 -1
  412. package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +3 -3
  413. package/contracts/shared/InstanceLinkedComponent.sol +85 -23
  414. package/contracts/shared/KeyValueStore.sol +1 -1
  415. package/contracts/shared/Lifecycle.sol +15 -4
  416. package/contracts/shared/NftOwnable.sol +29 -9
  417. package/contracts/shared/PolicyHolder.sol +17 -57
  418. package/contracts/shared/Registerable.sol +19 -11
  419. package/contracts/shared/RegistryLinked.sol +3 -2
  420. package/contracts/shared/Service.sol +23 -22
  421. package/contracts/shared/TokenHandler.sol +100 -19
  422. package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
  423. package/contracts/staking/IStaking.sol +3 -2
  424. package/contracts/staking/IStakingService.sol +0 -3
  425. package/contracts/staking/StakeManagerLib.sol +18 -25
  426. package/contracts/staking/Staking.sol +28 -42
  427. package/contracts/staking/StakingManager.sol +10 -11
  428. package/contracts/staking/StakingReader.sol +17 -13
  429. package/contracts/staking/StakingService.sol +25 -29
  430. package/contracts/staking/StakingServiceManager.sol +4 -4
  431. package/contracts/staking/StakingStore.sol +5 -15
  432. package/contracts/staking/TargetManagerLib.sol +7 -3
  433. package/contracts/type/Amount.sol +27 -5
  434. package/contracts/type/Blocknumber.sol +7 -1
  435. package/contracts/type/ClaimId.sol +6 -1
  436. package/contracts/type/NftId.sol +1 -0
  437. package/contracts/type/ObjectType.sol +16 -11
  438. package/contracts/type/PayoutId.sol +10 -10
  439. package/contracts/type/Referral.sol +1 -0
  440. package/contracts/type/RiskId.sol +16 -2
  441. package/contracts/type/RoleId.sol +0 -12
  442. package/contracts/type/Seconds.sol +21 -1
  443. package/contracts/type/StateId.sol +15 -1
  444. package/contracts/type/Timestamp.sol +11 -1
  445. package/contracts/type/UFixed.sol +33 -10
  446. package/contracts/{shared → upgradeability}/ProxyManager.sol +71 -38
  447. package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
  448. package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
  449. package/package.json +2 -1
  450. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
  451. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
  452. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
  453. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
  454. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
  455. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
  456. package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -708
  457. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
  458. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
  459. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
  460. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
  461. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
  462. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
  463. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
  464. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
  465. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
  466. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
  467. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
  468. package/contracts/authorization/IModuleAuthorization.sol +0 -21
  469. package/contracts/authorization/ModuleAuthorization.sol +0 -78
  470. package/contracts/product/ProductServiceManager.sol +0 -42
  471. package/contracts/shared/InitializableCustom.sol +0 -177
  472. /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -1,47 +1,33 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
5
4
  import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
6
- import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
7
- import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
8
5
  import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManaged.sol";
9
- import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
10
6
 
11
7
  import {NftId} from "../type/NftId.sol";
12
- import {RoleId, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
13
8
  import {ObjectType, ObjectTypeLib, POOL, RELEASE, REGISTRY, SERVICE, STAKING} from "../type/ObjectType.sol";
14
- import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
15
- import {Timestamp, TimestampLib, zeroTimestamp, ltTimestamp} from "../type/Timestamp.sol";
16
- import {Seconds, SecondsLib} from "../type/Seconds.sol";
17
- import {StateId, INITIAL, SCHEDULED, DEPLOYING, ACTIVE, PAUSED, CLOSED} from "../type/StateId.sol";
18
- import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
9
+ import {TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
10
+ import {Seconds} from "../type/Seconds.sol";
11
+ import {StateId, SCHEDULED, DEPLOYING, DEPLOYED, SKIPPED, ACTIVE, PAUSED} from "../type/StateId.sol";
12
+ import {VersionPart, VersionPartLib} from "../type/Version.sol";
19
13
 
20
14
  import {IService} from "../shared/IService.sol";
21
- import {ILifecycle} from "../shared/ILifecycle.sol";
22
- import {INftOwnable} from "../shared/INftOwnable.sol";
23
15
  import {IRegisterable} from "../shared/IRegisterable.sol";
24
16
 
25
17
  import {IRegistry} from "./IRegistry.sol";
26
18
  import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
27
- import {IRegistryService} from "./IRegistryService.sol";
28
19
  import {IServiceAuthorization} from "../authorization/IServiceAuthorization.sol";
29
- import {IAccessAdmin} from "../authorization/IAccessAdmin.sol";
30
20
  import {RegistryAdmin} from "./RegistryAdmin.sol";
31
21
  import {Registry} from "./Registry.sol";
32
- import {TokenRegistry} from "./TokenRegistry.sol";
33
22
  import {ReleaseLifecycle} from "./ReleaseLifecycle.sol";
34
23
 
35
- // TODO rename to something that does not end with 'Manager'
36
- // everywhere else *Manager points to an upgradeable contract
24
+
37
25
  contract ReleaseRegistry is
38
26
  AccessManaged,
39
27
  ReleaseLifecycle,
40
28
  IRegistryLinked
41
29
  {
42
- using ObjectTypeLib for ObjectType;
43
-
44
- uint256 public constant INITIAL_GIF_VERSION = 3;
30
+ uint256 public constant INITIAL_GIF_VERSION = 3;// first active version
45
31
 
46
32
  event LogReleaseCreation(VersionPart version, bytes32 salt);
47
33
  event LogReleaseActivation(VersionPart version);
@@ -51,35 +37,22 @@ contract ReleaseRegistry is
51
37
  // constructor
52
38
  error ErrorReleaseRegistryNotRegistry(Registry registry);
53
39
 
54
- // createNextRelease
55
- error ErrorReleaseRegistryReleaseCreationDisallowed(VersionPart version, StateId currentStateId);
56
-
57
- // prepareRelease
58
- error ErrorReleaseRegistryReleasePreparationDisallowed(VersionPart version, StateId currentStateId);
59
- error ErrorReleaseRegistryReleaseAlreadyPrepared(VersionPart version, StateId currentStateId);
60
- error ErrorReleaseRegistryVersionMismatch(VersionPart expected, VersionPart actual);
61
- error ErrorReleaseRegistryNoDomains(VersionPart version);
40
+ // _verifyServiceAuthorization
41
+ error ErrorReleaseRegistryNotServiceAuth(address notAuth);
42
+ error ErrorReleaseRegistryServiceAuthVersionMismatch(IServiceAuthorization auth, VersionPart expected, VersionPart actual);
43
+ error ErrorReleaseRegistryServiceAuthDomainsZero(IServiceAuthorization auth, VersionPart version);
62
44
 
63
45
  // registerService
64
- error ErrorReleaseRegistryNoServiceRegistrationExpected();
65
- error ErrorReleaseRegistryServiceRegistrationDisallowed(StateId currentStateId);
66
- error ErrorReleaseRegistryServiceDomainMismatch(ObjectType expectedDomain, ObjectType actualDomain);
67
- error ErrorReleaseRegistryNotService(address notService);
68
46
  error ErrorReleaseRegistryServiceAddressMismatch(address expected, address actual);
69
47
 
70
48
  // activateNextRelease
71
- error ErrorReleaseRegistryReleaseActivationDisallowed(VersionPart releaseVersion, StateId currentStateId);
72
- error ErrorReleaseRegistryReleaseNotCreated(VersionPart releaseVersion);
73
- error ErrorReleaseRegistryReleaseRegistrationNotFinished(VersionPart releaseVersion, uint awaitingRegistration);
74
- error ErrorReleaseRegistryReleaseAlreadyActivated(VersionPart releaseVersion);
75
-
76
- // disableRelease
77
- error ErrorReleaseRegistryReleaseNotActivated(VersionPart releaseVersion);
78
- error ErrorReleaseRegistryReleaseAlreadyDisabled(VersionPart releaseVersion);
49
+ error ErrorReleaseRegistryRegistryServiceMissing(VersionPart releaseVersion);
79
50
 
80
51
  // _verifyService
81
- error ErrorReleaseRegistryServiceReleaseAuthorityMismatch(IService service, address serviceAuthority, address releaseAuthority);
82
- error ErrorReleaseRegistryServiceReleaseVersionMismatch(IService service, VersionPart serviceVersion, VersionPart releaseVersion);
52
+ error ErrorReleaseRegistryNotService(address notService);
53
+ error ErrorReleaseRegistryServiceAuthorityMismatch(IService service, address serviceAuthority, address releaseAuthority);
54
+ error ErrorReleaseRegistryServiceVersionMismatch(IService service, VersionPart serviceVersion, VersionPart releaseVersion);
55
+ error ErrorReleaseRegistryServiceDomainMismatch(IService service, ObjectType expectedDomain, ObjectType actualDomain);
83
56
 
84
57
  // _verifyServiceInfo
85
58
  error ErrorReleaseRegistryServiceInfoAddressInvalid(IService service, address expected);
@@ -89,23 +62,13 @@ contract ReleaseRegistry is
89
62
  error ErrorReleaseRegistryServiceSelfRegistration(IService service);
90
63
  error ErrorReleaseRegistryServiceOwnerRegistered(IService service, address owner);
91
64
 
92
- Seconds public constant MIN_DISABLE_DELAY = Seconds.wrap(60 * 24 * 365); // 1 year
93
-
94
65
  RegistryAdmin public immutable _admin;
95
66
  Registry public immutable _registry;
96
- IRegisterable private _staking;
97
- address private _stakingOwner;
98
67
 
99
68
  mapping(VersionPart version => IRegistry.ReleaseInfo info) internal _releaseInfo;
100
- mapping(VersionPart version => IServiceAuthorization authz) internal _serviceAuthorization;
101
-
102
- // TODO check where/why this is used
103
- mapping(address registryService => VersionPart version) _releaseVersionByAddress;
104
-
105
- VersionPart private _initial;// first active version
69
+ VersionPart [] internal _release; // array of all created releases
106
70
  VersionPart internal _latest; // latest active version
107
71
  VersionPart internal _next; // version to create and activate
108
- mapping(VersionPart verson => StateId releaseState) private _state;
109
72
 
110
73
  uint256 internal _registeredServices;
111
74
  uint256 internal _servicesToRegister;
@@ -123,21 +86,30 @@ contract ReleaseRegistry is
123
86
  _registry = registry;
124
87
  _admin = RegistryAdmin(_registry.getRegistryAdminAddress());
125
88
 
126
- _initial = VersionPartLib.toVersionPart(INITIAL_GIF_VERSION);
127
89
  _next = VersionPartLib.toVersionPart(INITIAL_GIF_VERSION - 1);
128
90
  }
129
91
 
130
- /// @dev skips previous release if was not activated
92
+ /// @dev sets previous release into SKIPPED state if it was created but not activated
131
93
  /// sets next release into state SCHEDULED
132
94
  function createNextRelease()
133
95
  external
134
96
  restricted() // GIF_ADMIN_ROLE
135
97
  returns(VersionPart)
136
98
  {
137
- _next = VersionPartLib.toVersionPart(_next.toInt() + 1);
99
+ VersionPart version = _next;
100
+
101
+ if(isValidTransition(RELEASE(), _releaseInfo[version].state, SKIPPED())) {
102
+ _releaseInfo[version].state = SKIPPED();
103
+ }
104
+
105
+ version = VersionPartLib.toVersionPart(version.toInt() + 1);
106
+ _release.push(version);
107
+
108
+ _next = version;
109
+ _releaseInfo[version].version = version;
110
+ _releaseInfo[version].state = getInitialState(RELEASE());
138
111
  _servicesToRegister = 0;
139
112
  _registeredServices = 0;
140
- _state[_next] = getInitialState(RELEASE());
141
113
 
142
114
  return _next;
143
115
  }
@@ -149,182 +121,162 @@ contract ReleaseRegistry is
149
121
  external
150
122
  restricted() // GIF_MANAGER_ROLE
151
123
  returns(
152
- address authority,
153
- VersionPart version,
124
+ address releaseAuthority,
125
+ VersionPart releaseVersion,
154
126
  bytes32 releaseSalt
155
127
  )
156
128
  {
157
- authority = _admin.authority();
158
- version = _next;
129
+ releaseVersion = _next;
130
+
131
+ // release can transition into DEPLOYING state
132
+ checkTransition(_releaseInfo[releaseVersion].state, RELEASE(), SCHEDULED(), DEPLOYING());
133
+
134
+ uint256 serviceDomainsCount = _verifyServiceAuthorization(serviceAuthorization, releaseVersion, salt);
159
135
 
136
+ releaseAuthority = _admin.authority();
137
+ releaseSalt = salt;
160
138
  // ensures unique salt
161
139
  // TODO CreateX have clones capability also
162
140
  // what would releaseSalt look like if used with CreateX in pemissioned mode?
163
- releaseSalt = keccak256(
141
+ /*releaseSalt = keccak256(
164
142
  bytes.concat(
165
- bytes32(version.toInt()),
166
- salt));
167
-
168
- // verify release in state SCHEDULED
169
- if (!isValidTransition(RELEASE(), _state[version], DEPLOYING())) {
170
- revert ErrorReleaseRegistryReleasePreparationDisallowed(version, _state[version]);
171
- }
172
-
173
- _state[version] = DEPLOYING();
174
-
175
- // verify authorizaion contract release matches with expected version
176
- VersionPart releaseVersion = serviceAuthorization.getRelease();
177
- if (releaseVersion != version) {
178
- revert ErrorReleaseRegistryVersionMismatch(version, releaseVersion);
179
- }
180
-
181
-
182
- // sanity check to ensure service domain list is not empty
183
- uint256 serviceDomainsCount = serviceAuthorization.getServiceDomains().length;
184
- if (serviceDomainsCount == 0) {
185
- revert ErrorReleaseRegistryNoDomains(version);
186
- }
187
-
188
- // verify prepareNextRelease is only called once per release
189
- if(_servicesToRegister > 0) {
190
- revert ErrorReleaseRegistryReleaseAlreadyPrepared(version, _state[version]);
191
- }
143
+ bytes32(releaseVersion.toInt()),
144
+ salt));*/
192
145
 
193
146
  _servicesToRegister = serviceDomainsCount;
194
- _serviceAuthorization[version] = serviceAuthorization;
147
+ _releaseInfo[releaseVersion].state = DEPLOYING();
148
+ _releaseInfo[releaseVersion].salt = releaseSalt;
149
+ // TODO allow for the same serviceAuthorization address to be used for multiple releases?
150
+ _releaseInfo[releaseVersion].auth = serviceAuthorization;
151
+ //_releaseInfo[releaseVersion].authority = releaseAuthority;
195
152
 
196
- emit LogReleaseCreation(version, releaseSalt);
153
+ emit LogReleaseCreation(releaseVersion, releaseSalt);
197
154
  }
198
155
 
199
- // TODO this function can have 0 args -> use stored addresses from prepareNextRelease()
200
156
  function registerService(IService service)
201
157
  external
202
158
  restricted // GIF_MANAGER_ROLE
203
159
  returns(NftId nftId)
204
160
  {
205
161
  VersionPart releaseVersion = _next;
206
- StateId state = _state[releaseVersion];
207
162
 
208
- // verify release in state DEPLOYING
209
- if (!isValidTransition(RELEASE(), state, DEPLOYING())) {
210
- // TOOD name must represent failed state transition
211
- revert ErrorReleaseRegistryServiceRegistrationDisallowed(state);
212
- }
213
-
214
- _state[releaseVersion] = DEPLOYING();
163
+ // release can transition to DEPLOYED state
164
+ checkTransition(_releaseInfo[releaseVersion].state, RELEASE(), DEPLOYING(), DEPLOYED());
215
165
 
216
- // not all services are registered
217
- if (_servicesToRegister == _registeredServices) {
218
- revert ErrorReleaseRegistryNoServiceRegistrationExpected();
219
- }
166
+ address releaseAuthority = _admin.authority();
167
+ IServiceAuthorization serviceAuth = _releaseInfo[releaseVersion].auth;
168
+ ObjectType expectedDomain = serviceAuth.getServiceDomain(_registeredServices);
220
169
 
221
- // service can work with release manager
170
+ // service can work with release registry and release version
222
171
  (
223
172
  IRegistry.ObjectInfo memory info,
224
173
  ObjectType serviceDomain,
225
174
  VersionPart serviceVersion
226
- ) = _verifyService(service);
175
+ //,string memory serviceName
176
+ ) = _verifyService(
177
+ service,
178
+ releaseAuthority,
179
+ releaseVersion,
180
+ expectedDomain
181
+ );
227
182
 
228
- // service domain matches defined in release config
229
- ObjectType expectedDomain = _serviceAuthorization[releaseVersion].getServiceDomain(_registeredServices);
230
- if (serviceDomain != expectedDomain) {
231
- revert ErrorReleaseRegistryServiceDomainMismatch(expectedDomain, serviceDomain);
183
+ //_releaseInfo[releaseVersion].addresses.push(address(service)); // TODO get this info from auth contract?
184
+ //_releaseInfo[releaseVersion].domains.push(serviceDomain);
185
+ //_releaseInfo[releaseVersion].names.push(serviceName); // TODO if needed read in _verifyService()
186
+
187
+ _registeredServices++; // TODO use releaseInfo.someArray.length instead of _registeredServices
188
+
189
+ // release fully deployed
190
+ if(_servicesToRegister == _registeredServices) {
191
+ _releaseInfo[releaseVersion].state = DEPLOYED();
232
192
  }
233
193
 
234
- // register service with registry
235
- nftId = _registry.registerService(info, serviceVersion, serviceDomain);
236
- service.linkToRegisteredNftId();
237
- _registeredServices++;
194
+ // TODO: service address matches defined in release auth (precalculated one)
195
+ // revert ErrorReleaseRegistryServiceAddressMismatch()
238
196
 
239
197
  // setup service authorization
240
198
  _admin.authorizeService(
241
- _serviceAuthorization[releaseVersion],
242
- service);
243
-
244
- // TODO consider to extend this to REGISTRY
245
- // special roles for registry/staking/pool service
246
- if (serviceDomain == STAKING() || serviceDomain == POOL()) {
247
- // TODO rename to grantServiceDomainRole()
248
- _admin.grantServiceRoleForAllVersions(service, serviceDomain);
249
- }
250
- }
251
-
199
+ serviceAuth,
200
+ service,
201
+ serviceDomain,
202
+ releaseVersion);
252
203
 
204
+ // register service with registry
205
+ nftId = _registry.registerService(info, serviceVersion, serviceDomain);
206
+ service.linkToRegisteredNftId();
207
+ }
208
+ // TODO return activated version
253
209
  function activateNextRelease()
254
210
  external
255
211
  restricted // GIF_ADMIN_ROLE
256
212
  {
257
213
  VersionPart version = _next;
258
- StateId state = _state[version];
259
- StateId newState = ACTIVE();
260
214
 
261
- // verify release in state DEPLOYING
262
- if (!isValidTransition(RELEASE(), state, newState)) {
263
- revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
264
- }
215
+ // release can transition to ACTIVE state
216
+ checkTransition(_releaseInfo[version].state, RELEASE(), DEPLOYED(), ACTIVE());
265
217
 
266
- // release fully deployed
267
- if(_registeredServices < _servicesToRegister) {
268
- revert ErrorReleaseRegistryReleaseRegistrationNotFinished(version, _servicesToRegister - _registeredServices);
269
- }
218
+ _latest = version;
219
+ _releaseInfo[version].state = ACTIVE();
220
+ _releaseInfo[version].activatedAt = TimestampLib.blockTimestamp();
270
221
 
271
- // release exists, registry service MUST exist
222
+ // grant special roles for registry/staking/pool services
223
+ // this will enable access to core contracts functions
224
+
225
+ // registry service MUST be registered for each release
272
226
  address service = _registry.getServiceAddress(REGISTRY(), version);
273
227
  if(service == address(0)) {
274
- revert ErrorReleaseRegistryReleaseNotCreated(version);
228
+ revert ErrorReleaseRegistryRegistryServiceMissing(version);
275
229
  }
276
230
 
277
- _latest = version;
278
- _state[version] = newState;
231
+ _admin.grantServiceRoleForAllVersions(IService(service), REGISTRY());
279
232
 
280
- _releaseVersionByAddress[service] = version;
281
- _releaseInfo[version].activatedAt = TimestampLib.blockTimestamp();
233
+ service = _registry.getServiceAddress(STAKING(), version);
234
+ if(service != address(0)) {
235
+ _admin.grantServiceRoleForAllVersions(IService(service), STAKING());
236
+ }
237
+
238
+ service = _registry.getServiceAddress(POOL(), version);
239
+ if(service != address(0)) {
240
+ _admin.grantServiceRoleForAllVersions(IService(service), POOL());
241
+ }
242
+
243
+ // TODO may run out of gas
244
+ // TODO test how many service can be locked in one transaction
245
+ // -> add to docs + each release must test for this -> add to release version tests (in test call with some gas limit?)
246
+ _setReleaseLocked(version, false);
282
247
 
283
248
  emit LogReleaseActivation(version);
284
249
  }
285
250
 
286
251
  /// @dev stop all operations with release services
287
252
  function pauseRelease(VersionPart version)
288
- external
253
+ external
289
254
  restricted // GIF_ADMIN_ROLE
290
255
  {
291
- StateId state = _state[version];
292
- StateId newState = PAUSED();
293
-
294
- // verify release in state ACTIVE
295
- if (!isValidTransition(RELEASE(), state, newState)) {
296
- revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
297
- }
298
-
299
- // TODO come up with a substitute
300
- //_releaseAccessManager[version].disable();
256
+ // release can transition to PAUSED state
257
+ checkTransition(_releaseInfo[version].state, RELEASE(), ACTIVE(), PAUSED());
301
258
 
302
- _state[version] = newState;
259
+ _releaseInfo[version].state = PAUSED();
303
260
  _releaseInfo[version].disabledAt = TimestampLib.blockTimestamp();
304
261
 
262
+ _setReleaseLocked(version, true);
263
+
305
264
  emit LogReleaseDisabled(version);
306
265
  }
307
266
 
308
- // TODO consider revert if some delay is expired -> becomes disabled automatically
309
267
  /// @dev resume operations with release services
310
268
  function unpauseRelease(VersionPart version)
311
269
  external
312
270
  restricted // GIF_ADMIN_ROLE
313
271
  {
314
- StateId state = _state[version];
315
- StateId newState = ACTIVE();
316
-
317
- // verify release in state PAUSED
318
- if (!isValidTransition(RELEASE(), state, newState)) {
319
- revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
320
- }
321
-
322
- // TODO come up with a substitute
323
- // _releaseAccessManager[version].enable();
272
+ // release can transition to ACTIVE state
273
+ checkTransition(_releaseInfo[version].state, RELEASE(), PAUSED(), ACTIVE());
324
274
 
325
- _state[version] = newState;
275
+ _releaseInfo[version].state = ACTIVE();
326
276
  _releaseInfo[version].disabledAt = zeroTimestamp();
327
277
 
278
+ _setReleaseLocked(version, false);
279
+
328
280
  emit LogReleaseEnabled(version);
329
281
  }
330
282
 
@@ -338,33 +290,39 @@ contract ReleaseRegistry is
338
290
  return Clones.predictDeterministicAddress(implementation, salt, deployer);
339
291
  }
340
292
 
341
- function isActiveRegistryService(address service) external view returns(bool) {
342
- VersionPart version = _releaseVersionByAddress[service];
343
- return isActiveRelease(version);
344
- }
345
-
346
293
  function isActiveRelease(VersionPart version) public view returns(bool) {
347
- return _state[version] == ACTIVE();
294
+ return _releaseInfo[version].state == ACTIVE();
348
295
  }
349
296
 
350
297
  function getReleaseInfo(VersionPart version) external view returns(IRegistry.ReleaseInfo memory) {
351
298
  return _releaseInfo[version];
352
299
  }
353
300
 
301
+ /// @dev Returns the number of created releases.
302
+ /// Releases might be in another state than ACTIVE.
303
+ function releases() external view returns (uint) {
304
+ return _release.length;
305
+ }
306
+
307
+ /// @dev Returns the n-th release version.
308
+ /// Valid values for idx [0 .. releases() - 1]
309
+ function getVersion(uint256 idx) external view returns (VersionPart version) {
310
+ // return _releases;
311
+ return _release[idx];
312
+ }
313
+
354
314
  function getNextVersion() public view returns(VersionPart) {
355
315
  return _next;
356
316
  }
357
317
 
318
+ /// @dev Returns the latest activated relase version.
319
+ /// There is no guarantee that the release is not currently paused.
358
320
  function getLatestVersion() external view returns(VersionPart) {
359
321
  return _latest;
360
322
  }
361
323
 
362
- function getInitialVersion() external view returns(VersionPart) {
363
- return _initial;
364
- }
365
-
366
324
  function getState(VersionPart version) external view returns (StateId stateId) {
367
- return _state[version];
325
+ return _releaseInfo[version].state;
368
326
  }
369
327
 
370
328
  function getRemainingServicesToRegister() external view returns (uint256 services) {
@@ -376,7 +334,7 @@ contract ReleaseRegistry is
376
334
  view
377
335
  returns (IServiceAuthorization serviceAuthorization)
378
336
  {
379
- return _serviceAuthorization[version];
337
+ return _releaseInfo[version].auth;
380
338
  }
381
339
 
382
340
  function getRegistryAdmin() external view returns (address) {
@@ -391,7 +349,61 @@ contract ReleaseRegistry is
391
349
 
392
350
  //--- private functions ----------------------------------------------------//
393
351
 
394
- function _verifyService(IService service)
352
+ // close / open service targets instead of revoking / granting roles
353
+ function _setReleaseLocked(VersionPart version, bool locked)
354
+ private
355
+ {
356
+ address service;
357
+ ObjectType domain;
358
+ IServiceAuthorization auth = _releaseInfo[version].auth;
359
+
360
+ ObjectType[] memory domains = auth.getServiceDomains();
361
+ for(uint idx = 0; idx < domains.length; idx++)
362
+ {
363
+ domain = domains[idx];
364
+ service = _registry.getServiceAddress(domain, version);
365
+ assert(service != address(0));
366
+
367
+ _admin.setServiceLocked(IService(service), locked);
368
+ }
369
+
370
+ // TODO add check for active/disabled release to core contracts functions interacting with releases
371
+ }
372
+
373
+ function _verifyServiceAuthorization(
374
+ IServiceAuthorization serviceAuthorization,
375
+ VersionPart releaseVersion,
376
+ bytes32 salt
377
+ )
378
+ private
379
+ view
380
+ returns (uint256 serviceDomainsCount)
381
+ {
382
+ // authorization contract supports IServiceAuthorization interface
383
+ if(!serviceAuthorization.supportsInterface(type(IServiceAuthorization).interfaceId)) {
384
+ revert ErrorReleaseRegistryNotServiceAuth(address(serviceAuthorization));
385
+ }
386
+
387
+ // authorizaions contract version matches with release version
388
+ VersionPart authVersion = serviceAuthorization.getRelease();
389
+ if (releaseVersion != authVersion) {
390
+ revert ErrorReleaseRegistryServiceAuthVersionMismatch(serviceAuthorization, releaseVersion, authVersion);
391
+ }
392
+
393
+ // sanity check to ensure service domain list is not empty
394
+ serviceDomainsCount = serviceAuthorization.getServiceDomains().length;
395
+ if (serviceDomainsCount == 0) {
396
+ revert ErrorReleaseRegistryServiceAuthDomainsZero(serviceAuthorization, releaseVersion);
397
+ }
398
+ }
399
+
400
+ // TODO get service names
401
+ function _verifyService(
402
+ IService service,
403
+ address expectedAuthority,
404
+ VersionPart expectedVersion,
405
+ ObjectType expectedDomain
406
+ )
395
407
  internal
396
408
  view
397
409
  returns(
@@ -412,22 +424,25 @@ contract ReleaseRegistry is
412
424
 
413
425
  _verifyServiceInfo(service, serviceInfo, owner);
414
426
 
415
- VersionPart releaseVersion = _next; // never 0
416
- address expectedAuthority = _admin.authority(); // can be zero if registering service when release is not created
417
-
418
- // IMPORTANT: can not guarantee service access is actually controlled by authority
419
427
  if(serviceAuthority != expectedAuthority) {
420
- revert ErrorReleaseRegistryServiceReleaseAuthorityMismatch(
428
+ revert ErrorReleaseRegistryServiceAuthorityMismatch(
421
429
  service,
422
430
  serviceAuthority,
423
431
  expectedAuthority);
424
432
  }
425
433
 
426
- if(serviceVersion != releaseVersion) {
427
- revert ErrorReleaseRegistryServiceReleaseVersionMismatch(
434
+ if(serviceVersion != expectedVersion) {
435
+ revert ErrorReleaseRegistryServiceVersionMismatch(
428
436
  service,
429
437
  serviceVersion,
430
- releaseVersion);
438
+ expectedVersion);
439
+ }
440
+
441
+ if(serviceDomain != expectedDomain) {
442
+ revert ErrorReleaseRegistryServiceDomainMismatch(
443
+ service,
444
+ expectedDomain,
445
+ serviceDomain);
431
446
  }
432
447
  }
433
448
 
@@ -441,7 +456,7 @@ contract ReleaseRegistry is
441
456
  view
442
457
  {
443
458
  if(info.objectAddress != address(service)) {
444
- revert ErrorReleaseRegistryServiceInfoAddressInvalid(service, address(service));
459
+ revert ErrorReleaseRegistryServiceInfoAddressInvalid(service, info.objectAddress);
445
460
  }
446
461
 
447
462
  if(info.isInterceptor != false) { // service is never interceptor
@@ -474,10 +489,9 @@ contract ReleaseRegistry is
474
489
  if (registryAddress == address(0)) {
475
490
  return false;
476
491
  }
477
- // TODO try catch and return false in case of revert
478
- // or just panic
492
+ // TODO try catch and return false in case of revert or just panic
479
493
  // check if contract returns a zero nft id for its own address
480
- if (IRegistry(registryAddress).getNftId(registryAddress).eqz()) {
494
+ if (IRegistry(registryAddress).getNftIdForAddress(registryAddress).eqz()) {
481
495
  return false;
482
496
  }
483
497