@etherisc/gif-next 0.0.2-7dc3cd3-858 → 0.0.2-7e48d89-379

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 (419) hide show
  1. package/README.md +32 -3
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +38 -33
  4. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
  5. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
  6. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +8 -8
  8. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  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/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +8 -8
  16. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  17. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +23 -4
  18. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +85 -90
  20. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +19 -19
  22. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +43 -64
  24. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +182 -74
  26. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +71 -55
  28. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +43 -26
  30. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +71 -0
  32. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
  33. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
  34. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  35. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +7 -7
  36. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  37. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +10 -5
  38. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  39. package/artifacts/contracts/instance/Instance.sol/Instance.json +19 -19
  40. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
  41. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1626 -0
  42. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  43. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +31 -31
  44. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  45. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +80 -122
  46. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  47. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +44 -39
  48. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +35 -35
  50. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +89 -212
  52. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  53. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  54. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  55. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  56. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  57. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
  58. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
  59. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
  60. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
  61. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  63. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  66. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  67. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  68. package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
  69. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  70. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +59 -77
  71. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  72. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +21 -21
  73. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  74. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  75. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +30 -26
  76. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  77. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  78. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +27 -61
  79. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  80. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +32 -32
  81. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  82. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -34
  83. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  84. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +54 -125
  85. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  86. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +19 -19
  87. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  88. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +394 -62
  89. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  90. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +107 -43
  91. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  92. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +205 -1
  93. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  94. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +44 -83
  95. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  96. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +158 -54
  97. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  98. package/artifacts/contracts/pool/Pool.sol/Pool.json +44 -121
  99. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  100. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +226 -90
  101. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  102. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +52 -36
  103. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  104. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +33 -44
  105. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  106. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +32 -40
  107. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  108. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +19 -64
  109. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  110. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +19 -19
  111. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  112. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +88 -72
  113. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  114. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +54 -54
  115. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  116. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +5 -0
  117. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  118. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +16 -0
  119. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  120. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +188 -108
  121. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  122. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  123. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +19 -26
  124. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
  125. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  126. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +260 -167
  127. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  128. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +59 -43
  129. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  130. package/artifacts/contracts/product/PricingService.sol/PricingService.json +63 -58
  131. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  132. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +47 -47
  133. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  134. package/artifacts/contracts/product/Product.sol/Product.json +19 -64
  135. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
  136. package/artifacts/contracts/product/ProductService.sol/ProductService.json +20 -20
  137. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  138. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +28 -28
  139. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  140. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  141. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  142. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +50 -2
  143. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  144. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -183
  145. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  146. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  147. package/artifacts/contracts/registry/Registry.sol/Registry.json +101 -29
  148. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  149. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +100 -95
  150. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  151. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  152. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  153. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +27 -27
  154. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
  155. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
  156. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
  157. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1159 -0
  158. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  159. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -7
  160. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  161. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
  162. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  163. package/artifacts/contracts/shared/Component.sol/Component.json +0 -64
  164. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  165. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +255 -62
  166. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  167. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +69 -49
  168. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  169. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  170. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -26
  171. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  172. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +153 -0
  173. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  174. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -26
  175. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  176. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -5
  177. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  178. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
  179. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  180. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  181. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  182. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  183. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  184. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  185. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
  186. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +73 -0
  187. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  188. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +19 -64
  189. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  190. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -89
  191. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  192. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
  193. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
  194. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
  195. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  196. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -6
  197. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  198. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +6 -6
  199. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  200. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -8
  201. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  202. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  203. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  204. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  205. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +330 -11
  206. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
  207. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
  208. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  209. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +0 -26
  210. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  211. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  212. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +40 -113
  213. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  214. package/artifacts/contracts/staking/Staking.sol/Staking.json +55 -119
  215. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
  216. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
  217. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  218. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +46 -46
  219. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  220. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
  221. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  222. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +26 -26
  223. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  224. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -31
  225. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  226. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +146 -165
  227. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  228. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +27 -22
  229. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  230. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
  231. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  232. package/artifacts/contracts/type/Amount.sol/AmountLib.json +37 -8
  233. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  234. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
  235. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  236. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
  237. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  238. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
  239. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  240. package/artifacts/contracts/type/Fee.sol/FeeLib.json +17 -12
  241. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  242. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  243. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  244. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +4 -4
  245. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  246. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  247. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  248. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
  249. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  250. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
  251. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  252. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
  253. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
  255. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  256. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
  257. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  258. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +14 -14
  259. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  260. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +26 -2
  261. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  262. package/artifacts/contracts/type/Selector.sol/SelectorLib.json +2 -2
  263. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  264. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
  265. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  266. package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
  267. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  268. package/artifacts/contracts/type/String.sol/StrLib.json +2 -2
  269. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  270. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
  271. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
  273. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +39 -2
  275. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
  277. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
  279. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
  280. package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
  281. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  282. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +617 -0
  283. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  284. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  285. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
  286. package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
  287. package/contracts/authorization/AccessAdmin.sol +8 -10
  288. package/contracts/authorization/AccessManagerCloneable.sol +16 -0
  289. package/contracts/authorization/Authorization.sol +0 -1
  290. package/contracts/authorization/IServiceAuthorization.sol +3 -0
  291. package/contracts/authorization/ServiceAuthorization.sol +4 -0
  292. package/contracts/distribution/BasicDistribution.sol +4 -15
  293. package/contracts/distribution/BasicDistributionAuthorization.sol +5 -1
  294. package/contracts/distribution/Distribution.sol +22 -10
  295. package/contracts/distribution/DistributionService.sol +47 -27
  296. package/contracts/distribution/DistributionServiceManager.sol +2 -5
  297. package/contracts/distribution/IDistributionComponent.sol +8 -4
  298. package/contracts/distribution/IDistributionService.sol +10 -0
  299. package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
  300. package/contracts/instance/IInstance.sol +7 -7
  301. package/contracts/instance/IInstanceService.sol +6 -5
  302. package/contracts/instance/Instance.sol +8 -8
  303. package/contracts/instance/{InstanceAdminNew.sol → InstanceAdmin.sol} +33 -9
  304. package/contracts/instance/InstanceAuthorizationV3.sol +16 -21
  305. package/contracts/instance/InstanceReader.sol +10 -7
  306. package/contracts/instance/InstanceService.sol +69 -32
  307. package/contracts/instance/InstanceServiceManager.sol +2 -6
  308. package/contracts/instance/InstanceStore.sol +8 -4
  309. package/contracts/instance/base/ObjectLifecycle.sol +105 -0
  310. package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +5 -5
  311. package/contracts/instance/module/IBundle.sol +1 -1
  312. package/contracts/instance/module/IComponents.sol +1 -7
  313. package/contracts/instance/module/IDistribution.sol +0 -1
  314. package/contracts/instance/module/IPolicy.sol +1 -1
  315. package/contracts/mock/Dip.sol +1 -1
  316. package/contracts/oracle/IOracleComponent.sol +2 -1
  317. package/contracts/oracle/Oracle.sol +15 -6
  318. package/contracts/oracle/OracleServiceManager.sol +2 -5
  319. package/contracts/pool/BasicPool.sol +7 -5
  320. package/contracts/pool/BasicPoolAuthorization.sol +11 -2
  321. package/contracts/pool/BundleService.sol +181 -41
  322. package/contracts/pool/BundleServiceManager.sol +2 -5
  323. package/contracts/pool/IBundleService.sol +33 -5
  324. package/contracts/pool/IPoolComponent.sol +6 -0
  325. package/contracts/pool/IPoolService.sol +14 -17
  326. package/contracts/pool/Pool.sol +32 -15
  327. package/contracts/pool/PoolService.sol +152 -85
  328. package/contracts/pool/PoolServiceManager.sol +2 -5
  329. package/contracts/product/ApplicationService.sol +49 -53
  330. package/contracts/product/ApplicationServiceManager.sol +2 -2
  331. package/contracts/product/BasicProduct.sol +3 -33
  332. package/contracts/product/BasicProductAuthorization.sol +3 -0
  333. package/contracts/product/ClaimService.sol +13 -39
  334. package/contracts/product/ClaimServiceManager.sol +2 -2
  335. package/contracts/product/IApplicationService.sol +1 -0
  336. package/contracts/product/IClaimService.sol +1 -0
  337. package/contracts/product/IPolicyService.sol +23 -17
  338. package/contracts/product/IProductComponent.sol +1 -0
  339. package/contracts/product/IProductService.sol +1 -0
  340. package/contracts/product/PolicyService.sol +251 -134
  341. package/contracts/product/PolicyServiceManager.sol +2 -5
  342. package/contracts/product/PricingService.sol +5 -1
  343. package/contracts/product/PricingServiceManager.sol +2 -5
  344. package/contracts/product/Product.sol +27 -6
  345. package/contracts/product/ProductService.sol +7 -32
  346. package/contracts/product/ProductServiceManager.sol +2 -5
  347. package/contracts/registry/IRegistry.sol +26 -13
  348. package/contracts/registry/IRegistryService.sol +6 -6
  349. package/contracts/registry/Registry.sol +80 -82
  350. package/contracts/registry/RegistryAdmin.sol +34 -23
  351. package/contracts/registry/RegistryService.sol +4 -18
  352. package/contracts/registry/RegistryServiceManager.sol +2 -2
  353. package/contracts/registry/ReleaseLifecycle.sol +27 -0
  354. package/contracts/registry/{ReleaseManager.sol → ReleaseRegistry.sol} +145 -178
  355. package/contracts/registry/ServiceAuthorizationV3.sol +5 -5
  356. package/contracts/registry/TokenRegistry.sol +2 -2
  357. package/contracts/shared/Component.sol +24 -37
  358. package/contracts/shared/ComponentService.sol +83 -21
  359. package/contracts/shared/ComponentServiceManager.sol +2 -2
  360. package/contracts/shared/IComponent.sol +4 -4
  361. package/contracts/shared/IComponentService.sol +15 -9
  362. package/contracts/shared/IInstanceLinkedComponent.sol +9 -3
  363. package/contracts/shared/IKeyValueStore.sol +1 -0
  364. package/contracts/shared/ILifecycle.sol +1 -2
  365. package/contracts/shared/IService.sol +1 -1
  366. package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +1 -1
  367. package/contracts/shared/InstanceLinkedComponent.sol +21 -0
  368. package/contracts/shared/KeyValueStore.sol +6 -2
  369. package/contracts/shared/Lifecycle.sol +16 -69
  370. package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
  371. package/contracts/shared/NftOwnable.sol +2 -2
  372. package/contracts/shared/PolicyHolder.sol +2 -5
  373. package/contracts/shared/Service.sol +3 -4
  374. package/contracts/shared/TokenHandler.sol +100 -19
  375. package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
  376. package/contracts/staking/IStaking.sol +1 -2
  377. package/contracts/staking/IStakingService.sol +12 -5
  378. package/contracts/staking/StakeManagerLib.sol +0 -25
  379. package/contracts/staking/Staking.sol +21 -37
  380. package/contracts/staking/StakingLifecycle.sol +23 -0
  381. package/contracts/staking/StakingManager.sol +2 -6
  382. package/contracts/staking/StakingReader.sol +12 -16
  383. package/contracts/staking/StakingService.sol +8 -12
  384. package/contracts/staking/StakingServiceManager.sol +2 -2
  385. package/contracts/staking/StakingStore.sol +15 -23
  386. package/contracts/type/Amount.sol +12 -5
  387. package/contracts/type/Blocknumber.sol +7 -1
  388. package/contracts/type/ObjectType.sol +3 -7
  389. package/contracts/type/Referral.sol +1 -0
  390. package/contracts/type/Seconds.sol +13 -1
  391. package/contracts/type/Timestamp.sol +11 -1
  392. package/contracts/type/UFixed.sol +29 -10
  393. package/contracts/type/Version.sol +3 -1
  394. package/contracts/{shared → upgradeability}/ProxyManager.sol +3 -4
  395. package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
  396. package/package.json +3 -3
  397. package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +0 -4
  398. package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +0 -1385
  399. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
  400. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -703
  401. package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +0 -4
  402. package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +0 -1616
  403. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
  404. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -181
  405. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
  406. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1140
  407. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
  408. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
  409. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
  410. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
  411. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
  412. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
  413. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
  414. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
  415. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
  416. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
  417. package/contracts/authorization/InstanceAdmin.sol +0 -108
  418. /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
  419. /package/contracts/{shared → upgradeability}/Versionable.sol +0 -0
@@ -14,7 +14,7 @@ import {ObjectType, ObjectTypeLib, POOL, RELEASE, REGISTRY, SERVICE, STAKING} fr
14
14
  import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
15
15
  import {Timestamp, TimestampLib, zeroTimestamp, ltTimestamp} from "../type/Timestamp.sol";
16
16
  import {Seconds, SecondsLib} from "../type/Seconds.sol";
17
- import {StateId, INITIAL, SCHEDULED, DEPLOYING, ACTIVE} from "../type/StateId.sol";
17
+ import {StateId, INITIAL, SCHEDULED, DEPLOYING, ACTIVE, PAUSED, CLOSED} from "../type/StateId.sol";
18
18
  import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
19
19
 
20
20
  import {IService} from "../shared/IService.sol";
@@ -30,64 +30,62 @@ import {IAccessAdmin} from "../authorization/IAccessAdmin.sol";
30
30
  import {RegistryAdmin} from "./RegistryAdmin.sol";
31
31
  import {Registry} from "./Registry.sol";
32
32
  import {TokenRegistry} from "./TokenRegistry.sol";
33
+ import {ReleaseLifecycle} from "./ReleaseLifecycle.sol";
33
34
 
34
- // TODO rename to something that does not end with 'Manager'
35
- // everywhere else *Manager points to an upgradeable contract
36
- contract ReleaseManager is
37
- AccessManaged,
38
- ILifecycle,
35
+ contract ReleaseRegistry is
36
+ AccessManaged,
37
+ ReleaseLifecycle,
39
38
  IRegistryLinked
40
39
  {
41
40
  using ObjectTypeLib for ObjectType;
42
41
 
43
42
  uint256 public constant INITIAL_GIF_VERSION = 3;
44
43
 
45
- event LogReleaseCreation(VersionPart version, bytes32 salt, address authority);
44
+ event LogReleaseCreation(VersionPart version, bytes32 salt);
46
45
  event LogReleaseActivation(VersionPart version);
46
+ event LogReleaseDisabled(VersionPart version);
47
+ event LogReleaseEnabled(VersionPart version);
47
48
 
48
49
  // constructor
49
- error ErrorReleaseManagerNotRegistry(Registry registry);
50
+ error ErrorReleaseRegistryNotRegistry(Registry registry);
50
51
 
51
52
  // createNextRelease
52
- error ErrorReleaseManagerReleaseCreationDisallowed(StateId currentStateId);
53
+ error ErrorReleaseRegistryReleaseCreationDisallowed(VersionPart version, StateId currentStateId);
53
54
 
54
55
  // prepareRelease
55
- error ErrorReleaseManagerReleasePreparationDisallowed(StateId currentStateId);
56
- error ErrorReleaseManagerReleaseAlreadyPrepared(VersionPart version);
57
- error ErrorReleaseManagerVersionMismatch(VersionPart expectedVersion, VersionPart providedVersion);
58
- error ErrorReleaseManagerNoDomains(VersionPart version);
59
-
60
- // register staking
61
- //error ErrorReleaseManagerStakingAlreadySet(address stakingAddress);
56
+ error ErrorReleaseRegistryReleasePreparationDisallowed(VersionPart version, StateId currentStateId);
57
+ error ErrorReleaseRegistryReleaseAlreadyPrepared(VersionPart version, StateId currentStateId);
58
+ error ErrorReleaseRegistryVersionMismatch(VersionPart expected, VersionPart actual);
59
+ error ErrorReleaseRegistryNoDomains(VersionPart version);
62
60
 
63
61
  // registerService
64
- error ErrorReleaseManagerNoServiceRegistrationExpected();
65
- error ErrorReleaseManagerServiceRegistrationDisallowed(StateId currentStateId);
66
- error ErrorReleaseManagerServiceDomainMismatch(ObjectType expectedDomain, ObjectType actualDomain);
67
- error ErrorReleaseManagerNotService(IService service);
68
- error ErrorReleaseManagerServiceAddressInvalid(IService given, address expected);
62
+ error ErrorReleaseRegistryNoServiceRegistrationExpected();
63
+ error ErrorReleaseRegistryServiceRegistrationDisallowed(StateId currentStateId);
64
+ error ErrorReleaseRegistryServiceDomainMismatch(ObjectType expectedDomain, ObjectType actualDomain);
65
+ error ErrorReleaseRegistryNotService(address notService);
66
+ error ErrorReleaseRegistryServiceAddressMismatch(address expected, address actual);
69
67
 
70
68
  // activateNextRelease
71
- error ErrorReleaseManagerReleaseActivationDisallowed(StateId currentStateId);
72
- error ErrorReleaseManagerReleaseNotCreated(VersionPart releaseVersion);
73
- error ErrorReleaseManagerReleaseRegistrationNotFinished(VersionPart releaseVersion, uint awaitingRegistration);
74
- error ErrorReleaseManagerReleaseAlreadyActivated(VersionPart releaseVersion);
69
+ error ErrorReleaseRegistryReleaseActivationDisallowed(VersionPart releaseVersion, StateId currentStateId);
70
+ error ErrorReleaseRegistryReleaseNotCreated(VersionPart releaseVersion);
71
+ error ErrorReleaseRegistryReleaseRegistrationNotFinished(VersionPart releaseVersion, uint awaitingRegistration);
72
+ error ErrorReleaseRegistryReleaseAlreadyActivated(VersionPart releaseVersion);
75
73
 
76
74
  // disableRelease
77
- error ErrorReleaseManagerReleaseNotActivated(VersionPart releaseVersion);
78
- error ErrorReleaseManagerReleaseAlreadyDisabled(VersionPart releaseVersion);
75
+ error ErrorReleaseRegistryReleaseNotActivated(VersionPart releaseVersion);
76
+ error ErrorReleaseRegistryReleaseAlreadyDisabled(VersionPart releaseVersion);
79
77
 
80
78
  // _verifyService
81
- error ErrorReleaseManagerServiceReleaseAuthorityMismatch(IService service, address serviceAuthority, address releaseAuthority);
82
- error ErrorReleaseManagerServiceReleaseVersionMismatch(IService service, VersionPart serviceVersion, VersionPart releaseVersion);
79
+ error ErrorReleaseRegistryServiceReleaseAuthorityMismatch(IService service, address serviceAuthority, address releaseAuthority);
80
+ error ErrorReleaseRegistryServiceReleaseVersionMismatch(IService service, VersionPart serviceVersion, VersionPart releaseVersion);
83
81
 
84
82
  // _verifyServiceInfo
85
- error ErrorReleaseManagerServiceInfoAddressInvalid(IService service, address expected);
86
- error ErrorReleaseManagerServiceInfoInterceptorInvalid(IService service, bool isInterceptor);
87
- error ErrorReleaseManagerServiceInfoTypeInvalid(IService service, ObjectType expected, ObjectType found);
88
- error ErrorReleaseManagerServiceInfoOwnerInvalid(IService service, address expected, address found);
89
- error ErrorReleaseManagerServiceSelfRegistration(IService service);
90
- error ErrorReleaseManagerServiceOwnerRegistered(IService service, address owner);
83
+ error ErrorReleaseRegistryServiceInfoAddressInvalid(IService service, address expected);
84
+ error ErrorReleaseRegistryServiceInfoInterceptorInvalid(IService service, bool isInterceptor);
85
+ error ErrorReleaseRegistryServiceInfoTypeInvalid(IService service, ObjectType expected, ObjectType found);
86
+ error ErrorReleaseRegistryServiceInfoOwnerInvalid(IService service, address expected, address found);
87
+ error ErrorReleaseRegistryServiceSelfRegistration(IService service);
88
+ error ErrorReleaseRegistryServiceOwnerRegistered(IService service, address owner);
91
89
 
92
90
  Seconds public constant MIN_DISABLE_DELAY = Seconds.wrap(60 * 24 * 365); // 1 year
93
91
 
@@ -102,51 +100,42 @@ contract ReleaseManager is
102
100
  // TODO check where/why this is used
103
101
  mapping(address registryService => VersionPart version) _releaseVersionByAddress;
104
102
 
105
- // TODO remove once it's clear that release authority will always be registry authority
106
- mapping(VersionPart version => address authority) internal _releaseAccessManager;
107
-
108
-
109
- VersionPart immutable internal _initial;// first active version
103
+ VersionPart private _initial;// first active version
110
104
  VersionPart internal _latest; // latest active version
111
105
  VersionPart internal _next; // version to create and activate
112
- StateId internal _state; // current state of release manager
106
+ mapping(VersionPart verson => StateId releaseState) private _state;
113
107
 
114
108
  uint256 internal _registeredServices;
115
109
  uint256 internal _servicesToRegister;
116
110
 
117
- // deployer of this contract must be gif admin
118
111
  constructor(Registry registry)
119
112
  AccessManaged(msg.sender)
120
113
  {
121
114
  // TODO move this part to RegistryLinked constructor
122
115
  if(!_isRegistry(address(registry))) {
123
- revert ErrorReleaseManagerNotRegistry(registry);
116
+ revert ErrorReleaseRegistryNotRegistry(registry);
124
117
  }
125
118
 
119
+ setAuthority(registry.getAuthority());
120
+
126
121
  _registry = registry;
127
- setAuthority(_registry.getAuthority());
128
122
  _admin = RegistryAdmin(_registry.getRegistryAdminAddress());
129
123
 
130
124
  _initial = VersionPartLib.toVersionPart(INITIAL_GIF_VERSION);
131
125
  _next = VersionPartLib.toVersionPart(INITIAL_GIF_VERSION - 1);
132
- _state = getInitialState(RELEASE());
133
126
  }
134
127
 
135
128
  /// @dev skips previous release if was not activated
136
- /// sets release manager into state SCHEDULED
129
+ /// sets next release into state SCHEDULED
137
130
  function createNextRelease()
138
131
  external
139
132
  restricted() // GIF_ADMIN_ROLE
140
133
  returns(VersionPart)
141
134
  {
142
- if (!isValidTransition(RELEASE(), _state, SCHEDULED())) {
143
- revert ErrorReleaseManagerReleaseCreationDisallowed(_state);
144
- }
145
-
146
135
  _next = VersionPartLib.toVersionPart(_next.toInt() + 1);
147
136
  _servicesToRegister = 0;
148
137
  _registeredServices = 0;
149
- _state = SCHEDULED();
138
+ _state[_next] = getInitialState(RELEASE());
150
139
 
151
140
  return _next;
152
141
  }
@@ -163,94 +152,98 @@ contract ReleaseManager is
163
152
  bytes32 releaseSalt
164
153
  )
165
154
  {
166
- // verify release manager is in proper state to start deploying a next release
167
- if (!isValidTransition(RELEASE(), _state, DEPLOYING())) {
168
- revert ErrorReleaseManagerReleasePreparationDisallowed(_state);
169
- }
155
+ authority = _admin.authority();
156
+ version = _next;
170
157
 
171
- // verify prepareNextRelease is only called once per release
172
- if(_servicesToRegister > 0) {
173
- revert ErrorReleaseManagerReleaseAlreadyPrepared(version);
158
+ // ensures unique salt
159
+ // TODO CreateX have clones capability also
160
+ // what would releaseSalt look like if used with CreateX in pemissioned mode?
161
+ releaseSalt = keccak256(
162
+ bytes.concat(
163
+ bytes32(version.toInt()),
164
+ salt));
165
+
166
+ // verify release in state SCHEDULED
167
+ if (!isValidTransition(RELEASE(), _state[version], DEPLOYING())) {
168
+ revert ErrorReleaseRegistryReleasePreparationDisallowed(version, _state[version]);
174
169
  }
175
170
 
171
+ _state[version] = DEPLOYING();
172
+
176
173
  // verify authorizaion contract release matches with expected version
177
174
  VersionPart releaseVersion = serviceAuthorization.getRelease();
178
- if (releaseVersion != _next) {
179
- revert ErrorReleaseManagerVersionMismatch(_next, releaseVersion);
175
+ if (releaseVersion != version) {
176
+ revert ErrorReleaseRegistryVersionMismatch(version, releaseVersion);
180
177
  }
181
178
 
179
+
182
180
  // sanity check to ensure service domain list is not empty
183
181
  uint256 serviceDomainsCount = serviceAuthorization.getServiceDomains().length;
184
182
  if (serviceDomainsCount == 0) {
185
- revert ErrorReleaseManagerNoDomains(_next);
183
+ revert ErrorReleaseRegistryNoDomains(version);
186
184
  }
187
185
 
188
- _state = DEPLOYING();
189
- _servicesToRegister = serviceDomainsCount;
190
-
191
- // store release specific service authorization
192
- authority = _admin.authority();
193
- _serviceAuthorization[_next] = serviceAuthorization;
194
- // TODO refactor: authority no longer release specific
195
- _releaseAccessManager[_next] = authority;
186
+ // verify prepareNextRelease is only called once per release
187
+ if(_servicesToRegister > 0) {
188
+ revert ErrorReleaseRegistryReleaseAlreadyPrepared(version, _state[version]);
189
+ }
196
190
 
197
- // ensures unique salt
198
- releaseSalt = keccak256(
199
- bytes.concat(
200
- bytes32(version.toInt()),
201
- salt));
191
+ _servicesToRegister = serviceDomainsCount;
192
+ _serviceAuthorization[version] = serviceAuthorization;
202
193
 
203
- emit LogReleaseCreation(version, releaseSalt, authority);
194
+ emit LogReleaseCreation(version, releaseSalt);
204
195
  }
205
196
 
206
-
197
+ // TODO this function can have 0 args -> use stored addresses from prepareNextRelease()
207
198
  function registerService(IService service)
208
199
  external
209
200
  restricted // GIF_MANAGER_ROLE
210
201
  returns(NftId nftId)
211
202
  {
212
- // TODO is it usefull to check transition from A to A?
213
- if (!isValidTransition(RELEASE(), _state, DEPLOYING())) {
214
- revert ErrorReleaseManagerServiceRegistrationDisallowed(_state);
203
+ VersionPart releaseVersion = _next;
204
+ StateId state = _state[releaseVersion];
205
+
206
+ // verify release in state DEPLOYING
207
+ if (!isValidTransition(RELEASE(), state, DEPLOYING())) {
208
+ // TOOD name must represent failed state transition
209
+ revert ErrorReleaseRegistryServiceRegistrationDisallowed(state);
215
210
  }
216
211
 
212
+ _state[releaseVersion] = DEPLOYING();
213
+
214
+ // not all services are registered
217
215
  if (_servicesToRegister == _registeredServices) {
218
- revert ErrorReleaseManagerNoServiceRegistrationExpected();
216
+ revert ErrorReleaseRegistryNoServiceRegistrationExpected();
219
217
  }
220
218
 
219
+ // service can work with release manager
221
220
  (
222
221
  IRegistry.ObjectInfo memory info,
223
- ObjectType domain,
224
- VersionPart version
222
+ ObjectType serviceDomain,
223
+ VersionPart serviceVersion
225
224
  ) = _verifyService(service);
226
225
 
227
- ObjectType expectedDomain = _serviceAuthorization[version].getServiceDomains()[_registeredServices];
228
- if (service.getDomain() != expectedDomain) {
229
- revert ErrorReleaseManagerServiceDomainMismatch(expectedDomain, service.getDomain());
226
+ // service domain matches defined in release config
227
+ ObjectType expectedDomain = _serviceAuthorization[releaseVersion].getServiceDomain(_registeredServices);
228
+ if (serviceDomain != expectedDomain) {
229
+ revert ErrorReleaseRegistryServiceDomainMismatch(expectedDomain, serviceDomain);
230
230
  }
231
231
 
232
232
  // register service with registry
233
- nftId = _registry.registerService(info, version, domain);
234
- _registeredServices++;
235
-
233
+ nftId = _registry.registerService(info, serviceVersion, serviceDomain);
236
234
  service.linkToRegisteredNftId();
235
+ _registeredServices++;
237
236
 
238
237
  // setup service authorization
239
238
  _admin.authorizeService(
240
- _serviceAuthorization[version],
239
+ _serviceAuthorization[releaseVersion],
241
240
  service);
242
241
 
243
242
  // TODO consider to extend this to REGISTRY
244
243
  // special roles for registry/staking/pool service
245
- if (domain == STAKING() || domain == POOL()) {
244
+ if (serviceDomain == STAKING() || serviceDomain == POOL()) {
246
245
  // TODO rename to grantServiceDomainRole()
247
- _admin.grantServiceRoleForAllVersions(service, domain);
248
- }
249
-
250
- if (_registeredServices < _servicesToRegister) {
251
- _state = DEPLOYING();
252
- } else {
253
- // TODO end state depends on (_awaitingRegistration == 0)
246
+ _admin.grantServiceRoleForAllVersions(service, serviceDomain);
254
247
  }
255
248
  }
256
249
 
@@ -259,29 +252,28 @@ contract ReleaseManager is
259
252
  external
260
253
  restricted // GIF_ADMIN_ROLE
261
254
  {
262
- if (!isValidTransition(RELEASE(), _state, ACTIVE())) {
263
- revert ErrorReleaseManagerReleaseActivationDisallowed(_state);
255
+ VersionPart version = _next;
256
+ StateId state = _state[version];
257
+ StateId newState = ACTIVE();
258
+
259
+ // verify release in state DEPLOYING
260
+ if (!isValidTransition(RELEASE(), state, newState)) {
261
+ revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
264
262
  }
265
263
 
266
264
  // release fully deployed
267
- VersionPart version = _next;
268
265
  if(_registeredServices < _servicesToRegister) {
269
- revert ErrorReleaseManagerReleaseRegistrationNotFinished(version, _servicesToRegister - _registeredServices);
266
+ revert ErrorReleaseRegistryReleaseRegistrationNotFinished(version, _servicesToRegister - _registeredServices);
270
267
  }
271
268
 
272
269
  // release exists, registry service MUST exist
273
270
  address service = _registry.getServiceAddress(REGISTRY(), version);
274
271
  if(service == address(0)) {
275
- revert ErrorReleaseManagerReleaseNotCreated(version);
276
- }
277
-
278
- // release is not activated
279
- if(_releaseInfo[version].activatedAt.gtz()) {
280
- revert ErrorReleaseManagerReleaseAlreadyActivated(version);
272
+ revert ErrorReleaseRegistryReleaseNotCreated(version);
281
273
  }
282
274
 
283
275
  _latest = version;
284
- _state = ACTIVE();
276
+ _state[version] = newState;
285
277
 
286
278
  _releaseVersionByAddress[service] = version;
287
279
  _releaseInfo[version].activatedAt = TimestampLib.blockTimestamp();
@@ -289,43 +281,49 @@ contract ReleaseManager is
289
281
  emit LogReleaseActivation(version);
290
282
  }
291
283
 
292
- // release becomes disabled after delay expiration (can be reenabled before that)
293
- function disableRelease(VersionPart version, Seconds disableDelay)
284
+ /// @dev stop all operations with release services
285
+ function pauseRelease(VersionPart version)
294
286
  external
295
287
  restricted // GIF_ADMIN_ROLE
296
288
  {
297
- // release was activated
298
- if(_releaseInfo[version].activatedAt.eqz()) {
299
- revert ErrorReleaseManagerReleaseNotActivated(version);
300
- }
289
+ StateId state = _state[version];
290
+ StateId newState = PAUSED();
301
291
 
302
- // release not disabled already
303
- if(_releaseInfo[version].disabledAt.gtz()) {
304
- revert ErrorReleaseManagerReleaseAlreadyDisabled(version);
292
+ // verify release in state ACTIVE
293
+ if (!isValidTransition(RELEASE(), state, newState)) {
294
+ revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
305
295
  }
306
296
 
307
- disableDelay = SecondsLib.toSeconds(Math.max(disableDelay.toInt(), MIN_DISABLE_DELAY.toInt()));
308
-
309
297
  // TODO come up with a substitute
310
- // _releaseAccessManager[version].disable(disableDelay);
298
+ //_releaseAccessManager[version].disable();
311
299
 
312
- _releaseInfo[version].disabledAt = TimestampLib.blockTimestamp().addSeconds(disableDelay);
300
+ _state[version] = newState;
301
+ _releaseInfo[version].disabledAt = TimestampLib.blockTimestamp();
302
+
303
+ emit LogReleaseDisabled(version);
313
304
  }
314
-
315
- function enableRelease(VersionPart version)
305
+
306
+ // TODO consider revert if some delay is expired -> becomes disabled automatically
307
+ /// @dev resume operations with release services
308
+ function unpauseRelease(VersionPart version)
316
309
  external
317
310
  restricted // GIF_ADMIN_ROLE
318
311
  {
319
- // release was disabled
320
- //if(_releaseInfo[version].disabledAt.eqz()) {
321
- // revert ErrorReleaseManagerReleaseAlreadyEnabled(version);
322
- //}
312
+ StateId state = _state[version];
313
+ StateId newState = ACTIVE();
314
+
315
+ // verify release in state PAUSED
316
+ if (!isValidTransition(RELEASE(), state, newState)) {
317
+ revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
318
+ }
323
319
 
324
- // reverts if disable delay expired
325
320
  // TODO come up with a substitute
326
321
  // _releaseAccessManager[version].enable();
327
322
 
323
+ _state[version] = newState;
328
324
  _releaseInfo[version].disabledAt = zeroTimestamp();
325
+
326
+ emit LogReleaseEnabled(version);
329
327
  }
330
328
 
331
329
  //--- view functions ----------------------------------------------------//
@@ -344,7 +342,7 @@ contract ReleaseManager is
344
342
  }
345
343
 
346
344
  function isActiveRelease(VersionPart version) public view returns(bool) {
347
- return _releaseInfo[version].activatedAt.gtz();
345
+ return _state[version] == ACTIVE();
348
346
  }
349
347
 
350
348
  function getReleaseInfo(VersionPart version) external view returns(IRegistry.ReleaseInfo memory) {
@@ -363,8 +361,8 @@ contract ReleaseManager is
363
361
  return _initial;
364
362
  }
365
363
 
366
- function getState() external view returns (StateId stateId) {
367
- return _state;
364
+ function getState(VersionPart version) external view returns (StateId stateId) {
365
+ return _state[version];
368
366
  }
369
367
 
370
368
  function getRemainingServicesToRegister() external view returns (uint256 services) {
@@ -379,7 +377,6 @@ contract ReleaseManager is
379
377
  return _serviceAuthorization[version];
380
378
  }
381
379
 
382
- // TODO token registry knows nothing about adfmin, only registry
383
380
  function getRegistryAdmin() external view returns (address) {
384
381
  return address(_admin);
385
382
  }
@@ -390,37 +387,6 @@ contract ReleaseManager is
390
387
  return _registry;
391
388
  }
392
389
 
393
- //--- ILifecycle -----------------------------------------------------------//
394
-
395
- function hasLifecycle(ObjectType objectType) external pure returns (bool) { return objectType == RELEASE(); }
396
-
397
- function getInitialState(ObjectType objectType) public pure returns (StateId stateId) {
398
- if (objectType == RELEASE()) {
399
- stateId = INITIAL();
400
- }
401
- }
402
-
403
- function isValidTransition(
404
- ObjectType objectType,
405
- StateId fromId,
406
- StateId toId
407
- )
408
- public
409
- pure
410
- returns (bool isValid)
411
- {
412
- if (objectType != RELEASE()) { return false; }
413
-
414
- if (fromId == INITIAL() && toId == SCHEDULED()) { return true; }
415
- if (fromId == SCHEDULED() && toId == DEPLOYING()) { return true; }
416
- if (fromId == DEPLOYING() && toId == SCHEDULED()) { return true; }
417
- if (fromId == DEPLOYING() && toId == DEPLOYING()) { return true; }
418
- if (fromId == DEPLOYING() && toId == ACTIVE()) { return true; }
419
- // TODO active -> scheduled missing, add tests to cover this and more scenarios (#358)
420
-
421
- return false;
422
- }
423
-
424
390
  //--- private functions ----------------------------------------------------//
425
391
 
426
392
  function _verifyService(IService service)
@@ -433,7 +399,7 @@ contract ReleaseManager is
433
399
  )
434
400
  {
435
401
  if(!service.supportsInterface(type(IService).interfaceId)) {
436
- revert ErrorReleaseManagerNotService(service);
402
+ revert ErrorReleaseRegistryNotService(address(service));
437
403
  }
438
404
 
439
405
  address owner = msg.sender;
@@ -444,19 +410,19 @@ contract ReleaseManager is
444
410
 
445
411
  _verifyServiceInfo(service, serviceInfo, owner);
446
412
 
447
- VersionPart releaseVersion = getNextVersion(); // never 0
448
- address releaseAuthority = address(_releaseAccessManager[releaseVersion]); // can be zero if registering service when release is not created
413
+ VersionPart releaseVersion = _next; // never 0
414
+ address expectedAuthority = _admin.authority(); // can be zero if registering service when release is not created
449
415
 
450
416
  // IMPORTANT: can not guarantee service access is actually controlled by authority
451
- if(serviceAuthority != releaseAuthority) {
452
- revert ErrorReleaseManagerServiceReleaseAuthorityMismatch(
417
+ if(serviceAuthority != expectedAuthority) {
418
+ revert ErrorReleaseRegistryServiceReleaseAuthorityMismatch(
453
419
  service,
454
420
  serviceAuthority,
455
- releaseAuthority);
421
+ expectedAuthority);
456
422
  }
457
423
 
458
424
  if(serviceVersion != releaseVersion) {
459
- revert ErrorReleaseManagerServiceReleaseVersionMismatch(
425
+ revert ErrorReleaseRegistryServiceReleaseVersionMismatch(
460
426
  service,
461
427
  serviceVersion,
462
428
  releaseVersion);
@@ -473,29 +439,29 @@ contract ReleaseManager is
473
439
  view
474
440
  {
475
441
  if(info.objectAddress != address(service)) {
476
- revert ErrorReleaseManagerServiceInfoAddressInvalid(service, address(service));
442
+ revert ErrorReleaseRegistryServiceInfoAddressInvalid(service, address(service));
477
443
  }
478
444
 
479
445
  if(info.isInterceptor != false) { // service is never interceptor
480
- revert ErrorReleaseManagerServiceInfoInterceptorInvalid(service, info.isInterceptor);
446
+ revert ErrorReleaseRegistryServiceInfoInterceptorInvalid(service, info.isInterceptor);
481
447
  }
482
448
 
483
- if(info.objectType != SERVICE()) {// type is checked in registry anyway...but service logic may depend on expected value
484
- revert ErrorReleaseManagerServiceInfoTypeInvalid(service, SERVICE(), info.objectType);
449
+ if(info.objectType != SERVICE()) {
450
+ revert ErrorReleaseRegistryServiceInfoTypeInvalid(service, SERVICE(), info.objectType);
485
451
  }
486
452
 
487
453
  address owner = info.initialOwner;
488
454
 
489
455
  if(owner != expectedOwner) { // registerable owner protection
490
- revert ErrorReleaseManagerServiceInfoOwnerInvalid(service, expectedOwner, owner);
456
+ revert ErrorReleaseRegistryServiceInfoOwnerInvalid(service, expectedOwner, owner);
491
457
  }
492
458
 
493
459
  if(owner == address(service)) {
494
- revert ErrorReleaseManagerServiceSelfRegistration(service);
460
+ revert ErrorReleaseRegistryServiceSelfRegistration(service);
495
461
  }
496
462
 
497
463
  if(_registry.isRegistered(owner)) {
498
- revert ErrorReleaseManagerServiceOwnerRegistered(service, owner);
464
+ revert ErrorReleaseRegistryServiceOwnerRegistered(service, owner);
499
465
  }
500
466
  }
501
467
 
@@ -507,7 +473,7 @@ contract ReleaseManager is
507
473
  return false;
508
474
  }
509
475
  // TODO try catch and return false in case of revert
510
- // a just panic
476
+ // or just panic
511
477
  // check if contract returns a zero nft id for its own address
512
478
  if (IRegistry(registryAddress).getNftId(registryAddress).eqz()) {
513
479
  return false;
@@ -516,3 +482,4 @@ contract ReleaseManager is
516
482
  return true;
517
483
  }
518
484
  }
485
+
@@ -69,14 +69,14 @@ contract ServiceAuthorizationV3
69
69
  functions = _authorizeForService(REGISTRY(), APPLICATION());
70
70
  _authorize(functions, IRegistryService.registerPolicy.selector, "registerPolicy");
71
71
 
72
- functions = _authorizeForService(REGISTRY(), POOL());
73
- _authorize(functions, IRegistryService.registerPool.selector, "registerPool");
72
+ // functions = _authorizeForService(REGISTRY(), POOL());
73
+ // _authorize(functions, IRegistryService.registerPool.selector, "registerPool");
74
74
 
75
75
  functions = _authorizeForService(REGISTRY(), BUNDLE());
76
76
  _authorize(functions, IRegistryService.registerBundle.selector, "registerBundle");
77
77
 
78
78
  functions = _authorizeForService(REGISTRY(), DISTRIBUTION());
79
- _authorize(functions, IRegistryService.registerDistribution.selector, "registerDistribution");
79
+ // _authorize(functions, IRegistryService.registerDistribution.selector, "registerDistribution");
80
80
  _authorize(functions, IRegistryService.registerDistributor.selector, "registerDistributor");
81
81
 
82
82
  functions = _authorizeForService(REGISTRY(), COMPONENT());
@@ -88,8 +88,8 @@ contract ServiceAuthorizationV3
88
88
  functions = _authorizeForService(REGISTRY(), STAKING());
89
89
  _authorize(functions, IRegistryService.registerStake.selector, "registerStake");
90
90
 
91
- functions = _authorizeForService(REGISTRY(), PRODUCT());
92
- _authorize(functions, IRegistryService.registerProduct.selector, "registerProduct");
91
+ // functions = _authorizeForService(REGISTRY(), PRODUCT());
92
+ // _authorize(functions, IRegistryService.registerProduct.selector, "registerProduct");
93
93
  }
94
94
 
95
95
 
@@ -12,7 +12,7 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
12
12
 
13
13
  import {IRegistry} from "./IRegistry.sol";
14
14
  import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
15
- import {ReleaseManager} from "./ReleaseManager.sol";
15
+ import {ReleaseRegistry} from "./ReleaseRegistry.sol";
16
16
  import {RegistryAdmin} from "./RegistryAdmin.sol";
17
17
 
18
18
 
@@ -49,7 +49,7 @@ contract TokenRegistry is
49
49
  TokenInfo [] internal _token;
50
50
 
51
51
  IRegistry internal _registry;
52
- ReleaseManager internal _releaseManager;
52
+ ReleaseRegistry internal _releaseRegistry;
53
53
  IERC20Metadata internal _dipToken;
54
54
 
55
55
  /// @dev enforces msg.sender is owner of nft (or initial owner of nft ownable)