@etherisc/gif-next 0.0.2-e8b06c8-540 → 0.0.2-e8ea17d-715

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