@etherisc/gif-next 0.0.2-da06f3b-803 → 0.0.2-da0f894-204

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. package/README.md +73 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/Component.json +212 -94
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +552 -122
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +64 -72
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +279 -98
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +406 -90
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +68 -144
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +654 -117
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +316 -166
  18. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  19. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  20. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  21. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  22. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +765 -323
  23. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  24. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +97 -180
  25. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  26. package/artifacts/contracts/instance/Instance.sol/Instance.json +841 -574
  27. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  28. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +134 -231
  29. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  30. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +98 -124
  31. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  32. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +265 -269
  33. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  34. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +319 -99
  35. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  36. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  37. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  38. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +118 -169
  39. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  40. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  41. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  42. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  43. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  44. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  45. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  46. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +62 -36
  47. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  48. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  49. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  50. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  51. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  52. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  53. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  54. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +947 -0
  55. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  56. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
  57. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  58. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +261 -267
  59. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  60. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -93
  61. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
  62. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +754 -0
  63. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  64. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
  65. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  66. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +1031 -250
  67. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  68. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +441 -85
  69. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  70. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +535 -0
  71. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  72. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +130 -212
  73. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
  74. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +409 -0
  75. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  76. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +552 -135
  77. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +40 -287
  79. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  80. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +22 -169
  81. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  82. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -169
  83. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  84. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +164 -391
  85. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  86. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -127
  87. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  88. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +142 -221
  89. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  90. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +302 -90
  91. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  92. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +142 -221
  93. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  94. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +302 -90
  95. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  96. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  97. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -21
  98. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  99. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +83 -174
  100. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  101. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  102. package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -34
  103. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  104. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  105. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  106. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +193 -216
  107. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  108. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -94
  109. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  110. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
  111. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  112. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
  113. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  114. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  115. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  116. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  117. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
  118. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  119. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  120. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  121. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -29
  122. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  123. package/artifacts/contracts/{experiment/inheritance/IB.sol/IB.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +18 -20
  124. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  125. package/artifacts/contracts/shared/IService.sol/IService.json +22 -169
  126. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
  128. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  129. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +113 -33
  130. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  131. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
  132. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  133. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -74
  134. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  135. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +125 -55
  136. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  137. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
  138. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  139. package/artifacts/contracts/shared/Service.sol/Service.json +113 -164
  140. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  141. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  142. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  143. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  144. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
  145. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  146. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  147. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +125 -55
  148. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  149. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +6 -6
  150. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestService.sol/TestService.json +134 -221
  152. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  154. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  155. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
  156. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  157. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  158. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  159. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  160. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  161. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
  162. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  164. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  165. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  166. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  167. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  169. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  170. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  171. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  173. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  174. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  175. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
  176. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  177. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  178. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  180. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  181. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  182. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
  183. package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
  184. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  185. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +25 -7
  187. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  188. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  189. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  190. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  191. package/contracts/components/Component.sol +82 -77
  192. package/contracts/components/Distribution.sol +188 -48
  193. package/contracts/components/IComponent.sol +42 -17
  194. package/contracts/components/IDistributionComponent.sol +39 -7
  195. package/contracts/components/IPoolComponent.sol +121 -21
  196. package/contracts/components/IProductComponent.sol +3 -2
  197. package/contracts/components/Pool.sol +290 -120
  198. package/contracts/components/Product.sol +92 -69
  199. package/contracts/instance/BundleManager.sol +1 -1
  200. package/contracts/instance/IInstance.sol +21 -1
  201. package/contracts/instance/IInstanceService.sol +19 -2
  202. package/contracts/instance/Instance.sol +58 -36
  203. package/contracts/instance/InstanceAccessManager.sol +136 -253
  204. package/contracts/instance/InstanceService.sol +154 -137
  205. package/contracts/instance/InstanceServiceManager.sol +1 -1
  206. package/contracts/instance/base/ComponentService.sol +1 -1
  207. package/contracts/instance/module/IAccess.sol +10 -11
  208. package/contracts/instance/module/IBundle.sol +2 -1
  209. package/contracts/instance/module/IDistribution.sol +2 -0
  210. package/contracts/instance/module/IPolicy.sol +30 -3
  211. package/contracts/instance/module/ISetup.sol +10 -10
  212. package/contracts/instance/service/ApplicationService.sol +346 -0
  213. package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
  214. package/contracts/instance/service/BundleService.sol +15 -9
  215. package/contracts/instance/service/BundleServiceManager.sol +1 -1
  216. package/contracts/instance/service/ClaimService.sol +151 -0
  217. package/contracts/instance/service/ClaimServiceManager.sol +35 -0
  218. package/contracts/instance/service/DistributionService.sol +303 -15
  219. package/contracts/instance/service/DistributionServiceManager.sol +1 -1
  220. package/contracts/instance/service/IApplicationService.sol +81 -0
  221. package/contracts/instance/service/IBundleService.sol +14 -3
  222. package/contracts/instance/service/IClaimService.sol +61 -0
  223. package/contracts/instance/service/IDistributionService.sol +74 -0
  224. package/contracts/instance/service/IPolicyService.sol +26 -50
  225. package/contracts/instance/service/PolicyService.sol +126 -260
  226. package/contracts/instance/service/PolicyServiceManager.sol +2 -2
  227. package/contracts/instance/service/PoolService.sol +2 -3
  228. package/contracts/instance/service/PoolServiceManager.sol +1 -1
  229. package/contracts/instance/service/ProductService.sol +9 -9
  230. package/contracts/instance/service/ProductServiceManager.sol +2 -2
  231. package/contracts/registry/IRegistry.sol +3 -4
  232. package/contracts/registry/IRegistryService.sol +10 -8
  233. package/contracts/registry/Registry.sol +28 -21
  234. package/contracts/registry/RegistryService.sol +69 -48
  235. package/contracts/registry/RegistryServiceManager.sol +13 -13
  236. package/contracts/registry/ReleaseManager.sol +18 -28
  237. package/contracts/registry/TokenRegistry.sol +16 -12
  238. package/contracts/shared/ERC165.sol +14 -12
  239. package/contracts/shared/INftOwnable.sol +11 -10
  240. package/contracts/shared/IPolicyHolder.sol +26 -0
  241. package/contracts/shared/IRegisterable.sol +3 -3
  242. package/contracts/shared/IRegistryLinked.sol +12 -0
  243. package/contracts/shared/IService.sol +2 -0
  244. package/contracts/shared/IVersionable.sol +4 -47
  245. package/contracts/shared/NftOwnable.sol +66 -85
  246. package/contracts/shared/PolicyHolder.sol +81 -0
  247. package/contracts/shared/ProxyManager.sol +100 -25
  248. package/contracts/shared/Registerable.sol +7 -19
  249. package/contracts/shared/RegistryLinked.sol +48 -0
  250. package/contracts/shared/Service.sol +15 -17
  251. package/contracts/shared/Versionable.sol +4 -92
  252. package/contracts/test/TestRegisterable.sol +1 -1
  253. package/contracts/test/TestService.sol +1 -1
  254. package/contracts/types/ClaimId.sol +52 -0
  255. package/contracts/types/DistributorType.sol +2 -2
  256. package/contracts/types/ObjectType.sol +9 -5
  257. package/contracts/types/PayoutId.sol +54 -0
  258. package/contracts/types/RoleId.sol +14 -12
  259. package/contracts/types/Seconds.sol +54 -0
  260. package/contracts/types/Timestamp.sol +12 -13
  261. package/package.json +1 -1
  262. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +0 -4
  263. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +0 -66
  264. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +0 -4
  265. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +0 -24
  266. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +0 -4
  267. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +0 -42
  268. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
  269. package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
  270. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
  271. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
  272. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
  273. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
  274. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
  275. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
  276. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
  277. package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
  278. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
  279. package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
  280. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
  281. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
  282. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
  283. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
  284. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
  285. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
  286. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
  287. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
  288. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
  289. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
  290. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
  291. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
  292. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
  293. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
  294. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
  295. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
  296. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
  297. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
  298. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
  299. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
  300. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
  301. package/contracts/experiment/cloning/Cloner.sol +0 -47
  302. package/contracts/experiment/errors/Require.sol +0 -38
  303. package/contracts/experiment/errors/Revert.sol +0 -44
  304. package/contracts/experiment/inheritance/A.sol +0 -53
  305. package/contracts/experiment/inheritance/B.sol +0 -28
  306. package/contracts/experiment/inheritance/C.sol +0 -34
  307. package/contracts/experiment/inheritance/IA.sol +0 -13
  308. package/contracts/experiment/inheritance/IB.sol +0 -10
  309. package/contracts/experiment/inheritance/IC.sol +0 -12
  310. package/contracts/experiment/statemachine/Dummy.sol +0 -27
  311. package/contracts/experiment/statemachine/ISM.sol +0 -25
  312. package/contracts/experiment/statemachine/SM.sol +0 -57
  313. package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
  314. package/contracts/experiment/types/TypeA.sol +0 -47
  315. package/contracts/experiment/types/TypeB.sol +0 -29
@@ -60,11 +60,11 @@ contract ProductService is ComponentService, IProductService {
60
60
  address initialOwner;
61
61
  (registryAddress, initialOwner) = abi.decode(data, (address, address));
62
62
 
63
- _initializeService(registryAddress, owner);
63
+ initializeService(registryAddress, owner);
64
64
 
65
- _poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
65
+ _poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getMajorVersion()));
66
66
 
67
- _registerInterface(type(IProductService).interfaceId);
67
+ registerInterface(type(IProductService).interfaceId);
68
68
  }
69
69
 
70
70
 
@@ -102,8 +102,8 @@ contract ProductService is ComponentService, IProductService {
102
102
  {
103
103
  // wire distribution and pool components to product component
104
104
  ISetup.ProductSetupInfo memory setup = product.getSetupInfo();
105
- IComponent distribution = IComponent(_registry.getObjectInfo(setup.distributionNftId).objectAddress);
106
- IComponent pool = IComponent(_registry.getObjectInfo(setup.poolNftId).objectAddress);
105
+ IComponent distribution = IComponent(getRegistry().getObjectInfo(setup.distributionNftId).objectAddress);
106
+ IComponent pool = IComponent(getRegistry().getObjectInfo(setup.poolNftId).objectAddress);
107
107
 
108
108
  distribution.setProductNftId(productNftId);
109
109
  pool.setProductNftId(productNftId);
@@ -115,7 +115,7 @@ contract ProductService is ComponentService, IProductService {
115
115
 
116
116
  // create target for instane access manager
117
117
  getInstanceService().createGifTarget(
118
- _registry.getNftId(address(instance)),
118
+ getRegistry().getNftId(address(instance)),
119
119
  address(product),
120
120
  product.getName());
121
121
  getInstanceService().grantProductDefaultPermissions(instance.getNftId(), address(product), product.getName());
@@ -140,13 +140,13 @@ contract ProductService is ComponentService, IProductService {
140
140
  // revert WalletIsZero();
141
141
  // }
142
142
 
143
- // IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
143
+ // IRegistry.ObjectInfo memory tokenInfo = getRegistry().getObjectInfo(address(info.token));
144
144
 
145
145
  // if(tokenInfo.objectType != TOKEN()) {
146
146
  // revert InvalidToken();
147
147
  // }
148
148
 
149
- // IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
149
+ // IRegistry.ObjectInfo memory poolInfo = getRegistry().getObjectInfo(info.poolNftId);
150
150
 
151
151
  // if(poolInfo.objectType != POOL()) {
152
152
  // revert InvalidPool();
@@ -160,7 +160,7 @@ contract ProductService is ComponentService, IProductService {
160
160
  // //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
161
161
  // // TODO pool is not linked
162
162
 
163
- // IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
163
+ // IRegistry.ObjectInfo memory distributionInfo = getRegistry().getObjectInfo(info.distributionNftId);
164
164
 
165
165
  // if(distributionInfo.objectType != DISTRIBUTION()) {
166
166
  // revert InvalidDistribution();
@@ -16,7 +16,7 @@ contract ProductServiceManager is ProxyManager {
16
16
  constructor(
17
17
  address registryAddress
18
18
  )
19
- ProxyManager()
19
+ ProxyManager(registryAddress)
20
20
  {
21
21
  ProductService svc = new ProductService();
22
22
  bytes memory data = abi.encode(registryAddress, address(this));
@@ -39,7 +39,7 @@ contract ProductServiceManager is ProxyManager {
39
39
  // address(_productService));
40
40
 
41
41
  // implies that after this constructor call only upgrade functionality is available
42
- _isDeployed = true;
42
+ // _isDeployed = true;
43
43
  }
44
44
 
45
45
  //--- view functions ----------------------------------------------------//
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
5
 
6
- import {ChainNft} from "./ChainNft.sol";
7
6
  import {NftId} from "../types/NftId.sol";
8
7
  import {ObjectType} from "../types/ObjectType.sol";
9
8
  import {VersionPart} from "../types/Version.sol";
@@ -85,8 +84,6 @@ interface IRegistry is IERC165 {
85
84
 
86
85
  function isRegisteredService(address contractAddress) external view returns (bool);
87
86
 
88
- function isRegisteredComponent(address object) external view returns (bool);
89
-
90
87
  function isValidRelease(VersionPart version) external view returns (bool);
91
88
 
92
89
  function getServiceAddress(
@@ -94,7 +91,9 @@ interface IRegistry is IERC165 {
94
91
  VersionPart releaseVersion
95
92
  ) external view returns (address serviceAddress);
96
93
 
97
- function getChainNft() external view returns (ChainNft);
94
+ function getReleaseManagerAddress() external view returns (address);
95
+
96
+ function getChainNftAddress() external view returns (address);
98
97
 
99
98
  function getOwner() external view returns (address);
100
99
  }
@@ -35,18 +35,18 @@ interface IRegistryService is
35
35
  struct FunctionConfig
36
36
  {
37
37
  ObjectType serviceDomain;
38
- bytes4 selector;
38
+ bytes4[] selectors;
39
39
  }
40
40
 
41
- function getFunctionConfigs()
42
- external
43
- pure
44
- returns(
45
- FunctionConfig[] memory config
46
- );
41
+ function getFunctionConfigs()
42
+ external
43
+ pure
44
+ returns(
45
+ FunctionConfig[] memory config
46
+ );
47
47
 
48
48
  // TODO used by service -> add owner arg
49
- function registerInstance(IRegisterable instance, address owner)
49
+ function registerInstance(IRegisterable instance, address owner)
50
50
  external returns(IRegistry.ObjectInfo memory info);
51
51
 
52
52
  function registerProduct(IComponent product, address owner)
@@ -58,6 +58,8 @@ interface IRegistryService is
58
58
  function registerDistribution(IComponent distribution, address owner)
59
59
  external returns(IRegistry.ObjectInfo memory info);
60
60
 
61
+ function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
62
+
61
63
  function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
62
64
 
63
65
  function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
@@ -1,12 +1,11 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
4
5
 
5
6
  import {NftId, toNftId, zeroNftId} from "../types/NftId.sol";
6
7
  import {VersionPart} from "../types/Version.sol";
7
- import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
8
-
9
- import {ERC165} from "../shared/ERC165.sol";
8
+ import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
10
9
 
11
10
  import {ChainNft} from "./ChainNft.sol";
12
11
  import {IRegistry} from "./IRegistry.sol";
@@ -23,7 +22,6 @@ import {ReleaseManager} from "./ReleaseManager.sol";
23
22
  // 4) state object by regular service (POLICY, BUNDLE, STAKE)
24
23
 
25
24
  contract Registry is
26
- ERC165,
27
25
  IRegistry
28
26
  {
29
27
  address public constant NFT_LOCK_ADDRESS = address(0x1);
@@ -75,8 +73,6 @@ contract Registry is
75
73
 
76
74
  // set object types and object parent relations
77
75
  _setupValidCoreTypesAndCombinations();
78
-
79
- _registerInterface(type(IRegistry).interfaceId);
80
76
  }
81
77
 
82
78
  function registerService(
@@ -190,19 +186,23 @@ contract Registry is
190
186
  return _releaseManager.getReleaseInfo(version);
191
187
  }
192
188
 
193
- function getObjectCount() external view returns (uint256) {
189
+ function getObjectCount() external view override returns (uint256) {
194
190
  return _chainNft.totalSupply();
195
191
  }
196
192
 
193
+ function getReleaseManagerAddress() external view returns (address) {
194
+ return address(_releaseManager);
195
+ }
196
+
197
197
  function getNftId() external view returns (NftId nftId) {
198
198
  return _registryNftId;
199
199
  }
200
200
 
201
- function getNftId(address object) external view returns (NftId id) {
201
+ function getNftId(address object) external view override returns (NftId id) {
202
202
  return _nftIdByAddress[object];
203
203
  }
204
204
 
205
- function ownerOf(NftId nftId) public view returns (address) {
205
+ function ownerOf(NftId nftId) public view override returns (address) {
206
206
  return _chainNft.ownerOf(nftId.toInt());
207
207
  }
208
208
 
@@ -210,31 +210,26 @@ contract Registry is
210
210
  return _chainNft.ownerOf(_nftIdByAddress[contractAddress].toInt());
211
211
  }
212
212
 
213
- function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory) {
213
+ function getObjectInfo(NftId nftId) external view override returns (ObjectInfo memory) {
214
214
  return _info[nftId];
215
215
  }
216
216
 
217
- function getObjectInfo(address object) external view returns (ObjectInfo memory) {
217
+ function getObjectInfo(address object) external view override returns (ObjectInfo memory) {
218
218
  return _info[_nftIdByAddress[object]];
219
219
  }
220
220
 
221
- function isRegistered(NftId nftId) public view returns (bool) {
221
+ function isRegistered(NftId nftId) public view override returns (bool) {
222
222
  return _info[nftId].objectType.gtz();
223
223
  }
224
224
 
225
- function isRegistered(address object) external view returns (bool) {
225
+ function isRegistered(address object) external view override returns (bool) {
226
226
  return _nftIdByAddress[object].gtz();
227
227
  }
228
228
 
229
- function isRegisteredService(address object) external view returns (bool) {
229
+ function isRegisteredService(address object) external view override returns (bool) {
230
230
  return _info[_nftIdByAddress[object]].objectType == SERVICE();
231
231
  }
232
232
 
233
- function isRegisteredComponent(address object) external view returns (bool) {
234
- NftId objectParentNftId = _info[_nftIdByAddress[object]].parentNftId;
235
- return _info[objectParentNftId].objectType == INSTANCE();
236
- }
237
-
238
233
  function isValidRelease(VersionPart version) external view returns (bool)
239
234
  {
240
235
  return _releaseManager.isValidRelease(version);
@@ -251,14 +246,24 @@ contract Registry is
251
246
  //}
252
247
  }
253
248
 
254
- function getChainNft() external view override returns (ChainNft) {
255
- return _chainNft;
249
+ function getChainNftAddress() external view override returns (address) {
250
+ return address(_chainNft);
256
251
  }
257
252
 
258
253
  function getOwner() public view returns (address owner) {
259
254
  return ownerOf(address(this));
260
255
  }
261
256
 
257
+ // IERC165
258
+
259
+ function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
260
+ if(interfaceId == type(IERC165).interfaceId || interfaceId == type(IRegistry).interfaceId) {
261
+ return true;
262
+ }
263
+
264
+ return false;
265
+ }
266
+
262
267
  // Internals
263
268
 
264
269
  /// @dev registry protects only against tampering existing records, registering with invalid types pairs and 0 parent address
@@ -447,6 +452,8 @@ contract Registry is
447
452
  _coreContractCombinations[ORACLE()][INSTANCE()] = true;
448
453
  _coreContractCombinations[POOL()][INSTANCE()] = true;
449
454
 
455
+ _coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
456
+
450
457
  // product as parent, ONLY approved
451
458
  _coreObjectCombinations[POLICY()][PRODUCT()] = true;
452
459
 
@@ -19,7 +19,7 @@ import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
19
19
  import {Registerable} from "../../contracts/shared/Registerable.sol";
20
20
 
21
21
  import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/types/RoleId.sol";
22
- import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, POLICY, BUNDLE, STAKE} from "../../contracts/types/ObjectType.sol";
22
+ import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE} from "../../contracts/types/ObjectType.sol";
23
23
  import {StateId, ACTIVE, PAUSED} from "../../contracts/types/StateId.sol";
24
24
  import {NftId, NftIdLib, zeroNftId} from "../../contracts/types/NftId.sol";
25
25
  import {Fee, FeeLib} from "../../contracts/types/Fee.sol";
@@ -40,6 +40,33 @@ contract RegistryService is
40
40
  // TODO update to real hash when registry is stable
41
41
  bytes32 public constant REGISTRY_CREATION_CODE_HASH = bytes32(0);
42
42
 
43
+ // From IService
44
+ function getDomain() public pure override(IService, Service) returns(ObjectType serviceDomain) {
45
+ return REGISTRY();
46
+ }
47
+
48
+ // from Versionable
49
+
50
+ /// @dev top level initializer
51
+ function _initialize(
52
+ address owner,
53
+ bytes memory data
54
+ )
55
+ internal
56
+ virtual override
57
+ initializer()
58
+ {
59
+ (
60
+ address registryAddress,
61
+ address initialAuthority
62
+ ) = abi.decode(data, (address, address));
63
+
64
+ __AccessManaged_init(initialAuthority);
65
+
66
+ initializeService(registryAddress, owner);
67
+ registerInterface(type(IRegistryService).interfaceId);
68
+ }
69
+
43
70
  function registerInstance(IRegisterable instance, address owner)
44
71
  external
45
72
  restricted
@@ -52,7 +79,7 @@ contract RegistryService is
52
79
  }
53
80
 
54
81
  info = _getAndVerifyContractInfo(instance, INSTANCE(), owner);
55
- info.nftId = _registry.register(info);
82
+ info.nftId = getRegistry().register(info);
56
83
 
57
84
  instance.linkToRegisteredNftId(); // asume safe
58
85
  }
@@ -70,7 +97,7 @@ contract RegistryService is
70
97
  }
71
98
 
72
99
  info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
73
- info.nftId = _registry.register(info);
100
+ info.nftId = getRegistry().register(info);
74
101
  }
75
102
 
76
103
  function registerPool(IComponent pool, address owner)
@@ -85,7 +112,7 @@ contract RegistryService is
85
112
  }
86
113
 
87
114
  info = _getAndVerifyContractInfo(pool, POOL(), owner);
88
- info.nftId = _registry.register(info);
115
+ info.nftId = getRegistry().register(info);
89
116
  }
90
117
 
91
118
  function registerDistribution(IComponent distribution, address owner)
@@ -100,7 +127,16 @@ contract RegistryService is
100
127
  }
101
128
 
102
129
  info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
103
- info.nftId = _registry.register(info);
130
+ info.nftId = getRegistry().register(info);
131
+ }
132
+
133
+ function registerDistributor(IRegistry.ObjectInfo memory info)
134
+ external
135
+ restricted
136
+ returns(NftId nftId)
137
+ {
138
+ _verifyObjectInfo(info, DISTRIBUTOR());
139
+ nftId = getRegistry().register(info);
104
140
  }
105
141
 
106
142
  function registerPolicy(IRegistry.ObjectInfo memory info)
@@ -110,7 +146,7 @@ contract RegistryService is
110
146
  {
111
147
  _verifyObjectInfo(info, POLICY());
112
148
 
113
- nftId = _registry.register(info);
149
+ nftId = getRegistry().register(info);
114
150
  }
115
151
 
116
152
  function registerBundle(IRegistry.ObjectInfo memory info)
@@ -120,7 +156,7 @@ contract RegistryService is
120
156
  {
121
157
  _verifyObjectInfo(info, BUNDLE());
122
158
 
123
- nftId = _registry.register(info);
159
+ nftId = getRegistry().register(info);
124
160
  }
125
161
 
126
162
  function registerStake(IRegistry.ObjectInfo memory info)
@@ -130,35 +166,7 @@ contract RegistryService is
130
166
  {
131
167
  _verifyObjectInfo(info, STAKE());
132
168
 
133
- nftId = _registry.register(info);
134
- }
135
-
136
- // From IService
137
- function getDomain() public pure override(IService, Service) returns(ObjectType serviceDomain) {
138
- return REGISTRY();
139
- }
140
-
141
- // from Versionable
142
-
143
- /// @dev top level initializer
144
- function _initialize(
145
- address owner,
146
- bytes memory data
147
- )
148
- internal
149
- initializer
150
- virtual override
151
- {
152
- (
153
- address initialAuthority,
154
- address registry
155
- ) = abi.decode(data, (address, address));
156
-
157
- __AccessManaged_init(initialAuthority);
158
-
159
- _initializeService(address(registry), owner);
160
-
161
- _registerInterface(type(IRegistryService).interfaceId);
169
+ nftId = getRegistry().register(info);
162
170
  }
163
171
 
164
172
  // from IRegisterable
@@ -170,30 +178,43 @@ contract RegistryService is
170
178
  FunctionConfig[] memory config
171
179
  )
172
180
  {
173
- config = new FunctionConfig[](6);
181
+ config = new FunctionConfig[](8);
174
182
 
175
183
  // order of service registrations MUST be reverse to this array
176
184
  /*config[-1].serviceDomain = STAKE();
177
185
  config[-1].selector = RegistryService.registerStake.selector;*/
178
186
 
179
187
  config[0].serviceDomain = POLICY();
180
- config[0].selector = RegistryService.registerPolicy.selector;
188
+ config[0].selectors = new bytes4[](0);
189
+
190
+ config[1].serviceDomain = APPLICATION();
191
+ config[1].selectors = new bytes4[](1);
192
+ config[1].selectors[0] = RegistryService.registerPolicy.selector;
193
+
194
+ config[2].serviceDomain = CLAIM();
195
+ config[2].selectors = new bytes4[](0);
181
196
 
182
- config[1].serviceDomain = BUNDLE();
183
- config[1].selector = RegistryService.registerBundle.selector;
197
+ config[3].serviceDomain = BUNDLE();
198
+ config[3].selectors = new bytes4[](1);
199
+ config[3].selectors[0] = RegistryService.registerBundle.selector;
184
200
 
185
- config[2].serviceDomain = PRODUCT();
186
- config[2].selector = RegistryService.registerProduct.selector;
201
+ config[4].serviceDomain = PRODUCT();
202
+ config[4].selectors = new bytes4[](1);
203
+ config[4].selectors[0] = RegistryService.registerProduct.selector;
187
204
 
188
- config[3].serviceDomain = POOL();
189
- config[3].selector = RegistryService.registerPool.selector;
205
+ config[5].serviceDomain = POOL();
206
+ config[5].selectors = new bytes4[](1);
207
+ config[5].selectors[0] = RegistryService.registerPool.selector;
190
208
 
191
- config[4].serviceDomain = DISTRIBUTION();
192
- config[4].selector = RegistryService.registerDistribution.selector;
209
+ config[6].serviceDomain = DISTRIBUTION();
210
+ config[6].selectors = new bytes4[](2);
211
+ config[6].selectors[0] = RegistryService.registerDistribution.selector;
212
+ config[6].selectors[1] = RegistryService.registerDistributor.selector;
193
213
 
194
214
  // registerInstance() have no restriction
195
- config[5].serviceDomain = INSTANCE();
196
- config[5].selector = RegistryService.registerInstance.selector;
215
+ config[7].serviceDomain = INSTANCE();
216
+ config[7].selectors = new bytes4[](1);
217
+ config[7].selectors[0] = RegistryService.registerInstance.selector;
197
218
  }
198
219
 
199
220
  // Internal
@@ -22,32 +22,32 @@ contract RegistryServiceManager is
22
22
  /// @dev initializes proxy manager with registry service implementation and deploys registry
23
23
  constructor(
24
24
  address initialAuthority, // used by implementation
25
- address registry) // used by implementation
26
- ProxyManager()
25
+ address registryAddress) // used by implementation
26
+ ProxyManager(registryAddress)
27
27
  {
28
28
  require(initialAuthority > address(0), "RegistryServiceManager: initial authority is 0");
29
- require(registry > address(0), "RegistryServiceManager: registry is 0");
29
+ require(registryAddress > address(0), "RegistryServiceManager: registry is 0");
30
30
 
31
31
  // implementation's initializer func `data` argument
32
- bytes memory initializationData = abi.encode(
33
- initialAuthority,
34
- registry);
35
-
32
+ RegistryService srv = new RegistryService();
33
+ bytes memory data = abi.encode(registryAddress, initialAuthority);
36
34
  IVersionable versionable = deploy(
37
- address(new RegistryService()),
38
- initializationData);
35
+ address(srv),
36
+ data);
39
37
 
40
38
  _registryService = RegistryService(address(versionable));
39
+
40
+ // _linkToNftOwnable(address(_registryService));
41
41
  }
42
42
 
43
- // from IRegisterable
43
+ // // from IRegisterable
44
44
 
45
- // IMPORTANT: registry here and in constructor MUST be the same
46
- function linkToNftOwnable(address registry)
45
+ // // IMPORTANT: registry here and in constructor MUST be the same
46
+ function linkOwnershipToServiceNft()
47
47
  public
48
48
  onlyOwner
49
49
  {
50
- _linkToNftOwnable(registry, address(_registryService));
50
+ _linkToNftOwnable(address(_registryService));
51
51
  }
52
52
 
53
53
  //--- view functions ----------------------------------------------------//
@@ -41,7 +41,7 @@ contract ReleaseManager is AccessManaged
41
41
  error SelfRegistration();
42
42
  error RegisterableOwnerIsRegistered();
43
43
 
44
- // _verifyServiceInfo
44
+ // _verifyService
45
45
  error UnexpectedServiceVersion(VersionPart expected, VersionPart found);
46
46
  error UnexpectedServiceDomain(ObjectType expected, ObjectType found);
47
47
 
@@ -61,7 +61,7 @@ contract ReleaseManager is AccessManaged
61
61
 
62
62
  mapping(VersionPart version => IRegistry.ReleaseInfo info) _release;
63
63
 
64
- mapping(VersionPart version => mapping(ObjectType serviceDomain => bytes4)) _selector; // registry service function selector assigned to domain
64
+ mapping(VersionPart version => mapping(ObjectType serviceDomain => bytes4[])) _selectors; // registry service function selector assigned to domain
65
65
 
66
66
  uint _awaitingRegistration; // "services left to register" counter
67
67
 
@@ -148,12 +148,8 @@ contract ReleaseManager is AccessManaged
148
148
 
149
149
  VersionPart version = _next;
150
150
  ObjectType domain = REGISTRY();
151
- _verifyServiceInfo(info, version, domain);
152
-
153
- // data: config bytes
151
+ _verifyService(service, version, domain);
154
152
  _createRelease(service.getFunctionConfigs());
155
-
156
- //setTargetClosed(service, true);
157
153
 
158
154
  nftId = _registry.registerService(info, version, domain);
159
155
 
@@ -175,17 +171,16 @@ contract ReleaseManager is AccessManaged
175
171
  IRegistry.ObjectInfo memory info = _getAndVerifyContractInfo(service, SERVICE(), msg.sender);
176
172
  VersionPart version = getNextVersion();
177
173
  ObjectType domain = _release[version].domains[_awaitingRegistration];// reversed registration order of services specified in RegistryService config
178
- _verifyServiceInfo(info, version, domain);
174
+ _verifyService(service, version, domain);
179
175
 
180
176
  // setup and grant unique role if service does registrations
181
- bytes4[] memory selector = new bytes4[](1);
182
- selector[0] = _selector[version][domain];
177
+ bytes4[] memory selectors = _selectors[version][domain];
183
178
  address registryService = _registry.getServiceAddress(REGISTRY(), version);
184
- if(selector[0] != 0) {
179
+ if(selectors.length > 0) {
185
180
  _accessManager.setAndGrantUniqueRole(
186
181
  address(service),
187
182
  registryService,
188
- selector);
183
+ selectors);
189
184
  }
190
185
 
191
186
  _awaitingRegistration--;
@@ -267,8 +262,8 @@ contract ReleaseManager is AccessManaged
267
262
  }
268
263
  }
269
264
 
270
- function _verifyServiceInfo(
271
- IRegistry.ObjectInfo memory info,
265
+ function _verifyService(
266
+ IService service,
272
267
  VersionPart expectedVersion,
273
268
  ObjectType expectedDomain
274
269
  )
@@ -276,20 +271,15 @@ contract ReleaseManager is AccessManaged
276
271
  view
277
272
  returns(ObjectType)
278
273
  {
279
- (
280
- ObjectType domain,
281
- VersionPart version
282
- ) = abi.decode(info.data, (ObjectType, VersionPart));
283
-
284
- if(version != expectedVersion) {
285
- revert UnexpectedServiceVersion(expectedVersion, version);
274
+ if(service.getMajorVersion() != expectedVersion) {
275
+ revert UnexpectedServiceVersion(expectedVersion, service.getMajorVersion());
286
276
  }
287
277
 
288
- if(domain != expectedDomain) {
289
- revert UnexpectedServiceDomain(expectedDomain, domain);
278
+ if(service.getDomain() != expectedDomain) {
279
+ revert UnexpectedServiceDomain(expectedDomain, service.getDomain());
290
280
  }
291
281
 
292
- return domain;
282
+ return expectedDomain;
293
283
  }
294
284
 
295
285
  // TODO check if registry supports types specified in the config array
@@ -306,21 +296,21 @@ contract ReleaseManager is AccessManaged
306
296
  for(uint idx = 0; idx < config.length; idx++)
307
297
  {
308
298
  ObjectType domain = config[idx].serviceDomain;
309
- bytes4 selector = config[idx].selector;
310
-
311
299
  // not "registry service" / zero domain
312
300
  if(
313
301
  domain == REGISTRY() ||
314
302
  domain.eqz()
315
303
  ) { revert ConfigServiceDomainInvalid(idx, domain); }
316
304
 
305
+ bytes4[] memory selectors = config[idx].selectors;
306
+
317
307
  // TODO can be zero -> e.g. duplicate domain, first with zero selector, second with non zero selector -> need to check _release[version].domains.contains(domain) instead
318
308
  // no overwrite
319
- if(_selector[version][domain] > 0) {
309
+ if(_selectors[version][domain].length > 0) {
320
310
  revert SelectorAlreadyExists(version, domain);
321
311
  }
322
312
 
323
- _selector[version][domain] = selector;
313
+ _selectors[version][domain] = selectors;
324
314
  _release[version].domains.push(domain);
325
315
  }
326
316
  // TODO set when activated?