@etherisc/gif-next 0.0.2-c96f882-016 → 0.0.2-ca84135-795

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. package/README.md +63 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  3. package/artifacts/contracts/{instance/service/IComponentOwnerService.sol/IComponentOwnerService.json → components/Component.sol/Component.json} +210 -178
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +171 -90
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
  7. package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → components/IComponent.sol/IComponent.json} +133 -162
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +28 -2
  11. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +5 -5
  13. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  14. package/artifacts/contracts/components/Pool.sol/Pool.json +203 -119
  15. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  16. package/artifacts/contracts/components/Product.sol/Product.json +183 -146
  17. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  32. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
  36. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
  38. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  39. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  40. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
  41. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
  42. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  43. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +764 -0
  44. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
  45. package/artifacts/contracts/instance/{AccessManagedSimple.sol/AccessManagedSimple.json → Cloneable.sol/Cloneable.json} +74 -3
  46. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1649 -28
  48. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
  49. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +619 -0
  50. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  51. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +104 -14
  52. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  53. package/artifacts/contracts/instance/Instance.sol/Instance.json +155 -662
  54. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +243 -126
  56. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +4 -0
  57. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +763 -0
  58. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  59. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +164 -66
  60. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  61. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +275 -74
  62. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  63. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +52 -24
  64. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  65. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +261 -0
  66. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
  67. package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +125 -11
  68. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
  69. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -13
  70. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  71. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  72. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  73. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  74. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  75. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  76. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  77. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +59 -16
  78. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  79. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  80. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  81. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  82. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  83. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  84. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +1094 -0
  86. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  87. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +436 -0
  88. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
  89. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +764 -0
  90. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
  91. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +424 -0
  92. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
  93. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +720 -0
  94. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -13
  96. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  97. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +771 -0
  98. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +15 -77
  100. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +25 -240
  102. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
  103. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +1219 -0
  104. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  105. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +492 -0
  106. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
  107. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +798 -0
  108. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
  109. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +424 -0
  110. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
  111. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +848 -0
  112. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
  113. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +424 -0
  114. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  115. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  116. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  117. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +146 -229
  118. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  119. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +195 -86
  120. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  121. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  122. package/artifacts/contracts/registry/Registry.sol/Registry.json +159 -316
  123. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  124. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  125. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  126. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +38 -112
  127. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  128. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -95
  129. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  130. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +530 -0
  131. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
  132. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +397 -0
  133. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  134. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  135. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
  136. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  137. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  138. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  139. package/artifacts/contracts/shared/IService.sol/IService.json +13 -13
  140. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  141. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  142. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  143. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  144. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
  145. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  146. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +4 -4
  147. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  148. package/artifacts/contracts/shared/Service.sol/Service.json +13 -13
  149. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  150. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  151. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  152. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  154. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +4 -4
  155. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  156. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  157. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  158. package/artifacts/contracts/test/TestService.sol/TestService.json +31 -31
  159. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  160. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  161. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  162. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  163. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  164. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  165. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  167. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  169. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  170. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  171. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +26 -3
  172. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  173. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  175. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  176. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  177. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  178. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  180. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  181. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  185. package/contracts/components/Component.sol +177 -0
  186. package/contracts/components/Distribution.sol +17 -29
  187. package/contracts/components/IComponent.sol +37 -0
  188. package/contracts/components/IDistributionComponent.sol +1 -0
  189. package/contracts/components/IPoolComponent.sol +5 -1
  190. package/contracts/components/IProductComponent.sol +2 -2
  191. package/contracts/components/Pool.sol +46 -47
  192. package/contracts/components/Product.sol +57 -59
  193. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +23 -0
  194. package/contracts/instance/BundleManager.sol +125 -0
  195. package/contracts/instance/Cloneable.sol +46 -0
  196. package/contracts/instance/IInstance.sol +43 -9
  197. package/contracts/instance/IInstanceBase.sol +27 -0
  198. package/contracts/instance/IInstanceService.sol +14 -4
  199. package/contracts/instance/Instance.sol +54 -237
  200. package/contracts/instance/InstanceAccessManager.sol +93 -78
  201. package/contracts/instance/InstanceBase.sol +38 -0
  202. package/contracts/instance/InstanceReader.sol +29 -26
  203. package/contracts/instance/InstanceService.sol +301 -77
  204. package/contracts/instance/InstanceServiceManager.sol +10 -12
  205. package/contracts/instance/ObjectManager.sol +84 -0
  206. package/contracts/instance/base/ComponentService.sol +133 -0
  207. package/contracts/instance/base/IInstanceBase.sol +0 -2
  208. package/contracts/instance/module/IAccess.sol +27 -17
  209. package/contracts/instance/module/IBundle.sol +1 -0
  210. package/contracts/instance/module/ISetup.sol +3 -0
  211. package/contracts/instance/service/BundleService.sol +293 -0
  212. package/contracts/instance/service/BundleServiceManager.sol +51 -0
  213. package/contracts/instance/service/DistributionService.sol +115 -0
  214. package/contracts/instance/service/DistributionServiceManager.sol +51 -0
  215. package/contracts/instance/service/IBundleService.sol +44 -0
  216. package/contracts/instance/service/IPolicyService.sol +94 -0
  217. package/contracts/instance/service/IPoolService.sol +6 -23
  218. package/contracts/instance/service/IProductService.sol +6 -73
  219. package/contracts/instance/service/PolicyService.sol +538 -0
  220. package/contracts/instance/service/PolicyServiceManager.sol +54 -0
  221. package/contracts/instance/service/PoolService.sol +142 -0
  222. package/contracts/instance/service/PoolServiceManager.sol +51 -0
  223. package/contracts/instance/service/ProductService.sol +241 -0
  224. package/contracts/instance/service/ProductServiceManager.sol +54 -0
  225. package/contracts/registry/ChainNft.sol +1 -1
  226. package/contracts/registry/IRegistry.sol +30 -29
  227. package/contracts/registry/IRegistryService.sol +36 -14
  228. package/contracts/registry/Registry.sol +163 -239
  229. package/contracts/registry/RegistryAccessManager.sol +210 -0
  230. package/contracts/registry/RegistryService.sol +86 -218
  231. package/contracts/registry/RegistryServiceManager.sol +20 -22
  232. package/contracts/registry/ReleaseManager.sol +342 -0
  233. package/contracts/registry/TokenRegistry.sol +110 -0
  234. package/contracts/shared/ERC165.sol +6 -2
  235. package/contracts/shared/IRegisterable.sol +0 -2
  236. package/contracts/shared/IService.sol +2 -1
  237. package/contracts/shared/NftOwnable.sol +4 -4
  238. package/contracts/shared/ProxyManager.sol +1 -1
  239. package/contracts/shared/Registerable.sol +1 -0
  240. package/contracts/shared/Service.sol +14 -8
  241. package/contracts/test/TestService.sol +3 -2
  242. package/contracts/types/NftIdSet.sol +26 -24
  243. package/contracts/types/RoleId.sol +14 -6
  244. package/contracts/types/StateId.sol +4 -0
  245. package/package.json +1 -1
  246. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  247. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -314
  248. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  249. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -267
  250. package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +0 -4
  251. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +0 -4
  252. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +0 -1132
  253. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
  254. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
  255. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  256. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  257. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
  258. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  259. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
  260. package/contracts/components/BaseComponent.sol +0 -86
  261. package/contracts/components/IBaseComponent.sol +0 -24
  262. package/contracts/instance/AccessManagedSimple.sol +0 -122
  263. package/contracts/instance/AccessManagerSimple.sol +0 -692
  264. package/contracts/instance/IAccessManagerSimple.sol +0 -391
  265. package/contracts/instance/base/ComponentServiceBase.sol +0 -49
  266. package/contracts/instance/service/ComponentOwnerService.sol +0 -317
  267. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
  268. package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -9,6 +9,7 @@ import {Registry} from "./Registry.sol";
9
9
  import {IVersionable} from "../shared/IVersionable.sol";
10
10
  import {ProxyManager} from "../shared/ProxyManager.sol";
11
11
  import {RegistryService} from "./RegistryService.sol";
12
+ import {TokenRegistry} from "./TokenRegistry.sol";
12
13
 
13
14
 
14
15
  contract RegistryServiceManager is
@@ -16,36 +17,41 @@ contract RegistryServiceManager is
16
17
  {
17
18
  bytes32 constant public ACCESS_MANAGER_CREATION_CODE_HASH = 0x0;
18
19
 
19
- RegistryService private _registryService;
20
-
21
- AccessManager private _accessManager;
20
+ RegistryService private immutable _registryService;
22
21
 
23
22
  /// @dev initializes proxy manager with registry service implementation and deploys registry
24
23
  constructor(
25
- address accessManager
26
- )
24
+ address initialAuthority, // used by implementation
25
+ address registry) // used by implementation
27
26
  ProxyManager()
28
27
  {
29
- _accessManager = AccessManager(accessManager);
30
-
31
- bytes memory initializationData = abi.encode(accessManager, type(Registry).creationCode);
28
+ require(initialAuthority > address(0), "RegistryServiceManager: initial authority is 0");
29
+ require(registry > address(0), "RegistryServiceManager: registry is 0");
30
+
31
+ // implementation's initializer func `data` argument
32
+ bytes memory initializationData = abi.encode(
33
+ initialAuthority,
34
+ registry);
32
35
 
33
36
  IVersionable versionable = deploy(
34
37
  address(new RegistryService()),
35
38
  initializationData);
36
39
 
37
40
  _registryService = RegistryService(address(versionable));
41
+ }
38
42
 
39
- // link ownership of registry service manager ot nft owner of registry service
40
- _linkToNftOwnable(
41
- address(_registryService.getRegistry()),
42
- address(_registryService));
43
+ // from IRegisterable
43
44
 
44
- // implies that after this constructor call only upgrade functionality is available
45
- _isDeployed = true;
45
+ // IMPORTANT: registry here and in constructor MUST be the same
46
+ function linkToNftOwnable(address registry)
47
+ public
48
+ onlyOwner
49
+ {
50
+ _linkToNftOwnable(registry, address(_registryService));
46
51
  }
47
52
 
48
53
  //--- view functions ----------------------------------------------------//
54
+
49
55
  function getRegistryService()
50
56
  external
51
57
  view
@@ -53,12 +59,4 @@ contract RegistryServiceManager is
53
59
  {
54
60
  return _registryService;
55
61
  }
56
-
57
- function getAccessManager()
58
- external
59
- view
60
- returns (AccessManager)
61
- {
62
- return _accessManager;
63
- }
64
62
  }
@@ -0,0 +1,342 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManaged.sol";
5
+
6
+ import {NftId} from "../types/NftId.sol";
7
+ import {RoleId} from "../types/RoleId.sol";
8
+ import {ObjectType, ObjectTypeLib, zeroObjectType, REGISTRY, SERVICE} from "../types/ObjectType.sol";
9
+ import {VersionPart, VersionPartLib} from "../types/Version.sol";
10
+ import {Timestamp, TimestampLib} from "../types/Timestamp.sol";
11
+
12
+ import {IService} from "../shared/IService.sol";
13
+
14
+ import {IRegistry} from "./IRegistry.sol";
15
+ import {Registry} from "./Registry.sol";
16
+ import {IRegistryService} from "./IRegistryService.sol";
17
+ import {RegistryAccessManager} from "./RegistryAccessManager.sol";
18
+
19
+
20
+ contract ReleaseManager is AccessManaged
21
+ {
22
+ using ObjectTypeLib for ObjectType;
23
+
24
+ event LogReleaseCreation(VersionPart version, IService registryService);
25
+ event LogReleaseActivation(VersionPart version);
26
+
27
+ // createNextRelease
28
+ error NotRegistryService();
29
+ error UnexpectedServiceAuthority(address expected, address found);
30
+
31
+ // registerService
32
+ error NotService();
33
+
34
+ // activateNextRelease
35
+ //error ReleaseNotCreated();
36
+ //error ReleaseRegistrationNotFinished();
37
+
38
+ // _getAndVerifyContractInfo
39
+ error UnexpectedRegisterableType(ObjectType expected, ObjectType found);
40
+ error NotRegisterableOwner(address notOwner);
41
+ error SelfRegistration();
42
+ error RegisterableOwnerIsRegistered();
43
+
44
+ // _verifyServiceInfo
45
+ error UnexpectedServiceVersion(VersionPart expected, VersionPart found);
46
+ error UnexpectedServiceDomain(ObjectType expected, ObjectType found);
47
+
48
+ // _verifyAndStoreConfig
49
+ error ConfigMissing();
50
+ error ConfigServiceDomainInvalid(uint configArrayIndex, ObjectType domain);
51
+ error ConfigSelectorZero(uint configArrayIndex);
52
+ error SelectorAlreadyExists(VersionPart releaseVersion, ObjectType serviceDomain);
53
+
54
+
55
+ RegistryAccessManager private immutable _accessManager;
56
+ IRegistry private immutable _registry;
57
+
58
+ VersionPart _latest;// latest active version
59
+ VersionPart immutable _initial;// first active version
60
+
61
+ mapping(VersionPart version => IRegistry.ReleaseInfo info) _release;
62
+
63
+ mapping(VersionPart version => mapping(ObjectType serviceDomain => bytes4)) _selector; // registry service function selector assigned to domain
64
+
65
+ uint _awaitingRegistration; // "services left to register" counter
66
+
67
+ mapping(address registryService => bool isActive) _active;
68
+
69
+ constructor(
70
+ RegistryAccessManager accessManager,
71
+ VersionPart initialVersion)
72
+ AccessManaged(accessManager.authority())
73
+ {
74
+ require(initialVersion.toInt() > 0, "ReleaseManager: initial version is 0");
75
+
76
+ _accessManager = accessManager;
77
+
78
+ _initial = initialVersion;
79
+
80
+ _registry = new Registry();
81
+ }
82
+
83
+ // TODO deploy proxy and initialize with given implementation instead of using given proxy?
84
+ // IMPORTANT: MUST never be possible to create with access/release manager, token registry
85
+ function createNextRelease(IRegistryService service)
86
+ external
87
+ restricted // GIF_ADMIN_ROLE
88
+ returns(NftId nftId)
89
+ {
90
+ if(!service.supportsInterface(type(IRegistryService).interfaceId)) {
91
+ revert NotRegistryService();
92
+ }
93
+ // TODO unreliable! MUST guarantee the same authority -> how?
94
+ address serviceAuthority = service.authority();
95
+ if(serviceAuthority != authority()) {
96
+ revert UnexpectedServiceAuthority(
97
+ authority(),
98
+ serviceAuthority);
99
+ }
100
+
101
+ (
102
+ IRegistry.ObjectInfo memory info,
103
+ bytes memory data
104
+ ) = _getAndVerifyContractInfo(service, SERVICE(), msg.sender);
105
+
106
+ VersionPart version = getNextVersion();
107
+ ObjectType domain = REGISTRY();
108
+ _verifyServiceInfo(info, version, domain);
109
+
110
+ _createRelease(data);
111
+
112
+ //setTargetClosed(service, true);
113
+
114
+ nftId = _registry.registerService(info, version, domain);
115
+
116
+ // external call
117
+ service.linkToRegisteredNftId();
118
+
119
+ emit LogReleaseCreation(version, service);
120
+ }
121
+
122
+ // TODO adding service to release -> synchronized with proxy upgrades or simple addServiceToRelease(service, version, selector)?
123
+ // TODO removing service from release? -> set _active to false forever, but keep all other records?
124
+ function registerService(IService service)
125
+ external
126
+ restricted // GIF_MANAGER_ROLE
127
+ returns(NftId nftId)
128
+ {
129
+ if(!service.supportsInterface(type(IService).interfaceId)) {
130
+ revert NotService();
131
+ }
132
+
133
+ (
134
+ IRegistry.ObjectInfo memory info,
135
+ //bytes memory data
136
+ ) = _getAndVerifyContractInfo(service, SERVICE(), msg.sender);
137
+
138
+ VersionPart version = getNextVersion();
139
+ ObjectType domain = _release[version].domains[_awaitingRegistration];// reversed registration order of services specified in RegistryService config
140
+ _verifyServiceInfo(info, version, domain);
141
+
142
+ // setup and grant unique role if service does registrations
143
+ address registryService = _registry.getServiceAddress(REGISTRY(), version);
144
+ bytes4[] memory selector = new bytes4[](1);
145
+ selector[0] = _selector[version][domain];
146
+ if(selector[0] != 0) {
147
+ _accessManager.setAndGrantUniqueRole(
148
+ address(service),
149
+ registryService,
150
+ selector);
151
+ }
152
+
153
+ _awaitingRegistration--;
154
+
155
+ // activate release
156
+ if(_awaitingRegistration == 0) {
157
+ _latest = version;
158
+ _active[registryService] = true;
159
+
160
+ emit LogReleaseActivation(version);
161
+ }
162
+
163
+ nftId = _registry.registerService(info, version, domain);
164
+
165
+ // external call
166
+ service.linkToRegisteredNftId();
167
+ }
168
+
169
+ /*function activateNextRelease()
170
+ external
171
+ restricted // GIF_ADMIN_ROLE
172
+ {
173
+ VersionPart version = getNextVersion();
174
+ address service = _registry.getServiceAddress(REGISTRY(), version);
175
+
176
+ // release was created
177
+ if(service == address(0)) {
178
+ revert ReleaseNotCreated();
179
+ }
180
+
181
+ // release fully deployed
182
+ if(_awaitingRegistration > 0) {
183
+ revert ReleaseRegistrationNotFinished();
184
+ }
185
+
186
+ //setTargetClosed(service, false);
187
+
188
+ _latest = version;
189
+ _active[service] = true;
190
+
191
+ LogReleaseActivation(version);
192
+ }*/
193
+
194
+ //--- view functions ----------------------------------------------------//
195
+
196
+ function isActiveRegistryService(address service) external view returns(bool)
197
+ {
198
+ return _active[service];
199
+ }
200
+
201
+ function getRegistry() external view returns(address)
202
+ {
203
+ return (address(_registry));
204
+ }
205
+
206
+ function getReleaseInfo(VersionPart version) external view returns(IRegistry.ReleaseInfo memory)
207
+ {
208
+ return _release[version];
209
+ }
210
+
211
+ function getNextVersion() public view returns(VersionPart)
212
+ {
213
+ uint256 latest = _latest.toInt();
214
+
215
+ return latest == 0 ?
216
+ _initial : // no active releases yet
217
+ VersionPartLib.toVersionPart(latest + 1);
218
+ }
219
+
220
+ function getLatestVersion() external view returns(VersionPart) {
221
+ return _latest;
222
+ }
223
+
224
+ function getInitialVersion() external view returns(VersionPart) {
225
+ return _initial;
226
+ }
227
+
228
+ //--- private functions ----------------------------------------------------//
229
+
230
+ function _getAndVerifyContractInfo(
231
+ IService service,
232
+ ObjectType expectedType,
233
+ address expectedOwner // assume always valid, can not be 0
234
+ )
235
+ internal
236
+ view
237
+ returns(
238
+ IRegistry.ObjectInfo memory info,
239
+ bytes memory data
240
+ )
241
+ {
242
+ (info, data) = service.getInitialInfo();
243
+ info.objectAddress = address(service);
244
+ info.isInterceptor = false; // service is never interceptor, at least now
245
+
246
+ if(info.objectType != expectedType) {// type is checked in registry anyway...but service logic may depend on expected value
247
+ revert UnexpectedRegisterableType(expectedType, info.objectType);
248
+ }
249
+
250
+ address owner = info.initialOwner;
251
+
252
+ if(owner != expectedOwner) { // registerable owner protection
253
+ revert NotRegisterableOwner(expectedOwner);
254
+ }
255
+
256
+ if(owner == address(service)) {
257
+ revert SelfRegistration();
258
+ }
259
+
260
+ /*if(owner == address(0)) { // never 0
261
+ revert();// RegisterableOwnerIsZero();
262
+ }*/
263
+
264
+ if(_registry.isRegistered(owner)) {
265
+ revert RegisterableOwnerIsRegistered();
266
+ }
267
+
268
+ /*NftId parentNftId = info.parentNftId;
269
+ IRegistry.ObjectInfo memory parentInfo = getRegistry().getObjectInfo(parentNftId);
270
+
271
+ if(parentInfo.objectType != parentType) { // parent registration + type
272
+ revert InvalidParent(parentNftId);
273
+ }*/
274
+
275
+ return(info, data);
276
+ }
277
+
278
+ function _verifyServiceInfo(
279
+ IRegistry.ObjectInfo memory info,
280
+ VersionPart expectedVersion,
281
+ ObjectType expectedDomain
282
+ )
283
+ internal
284
+ view
285
+ returns(ObjectType)
286
+ {
287
+ (
288
+ ObjectType domain,
289
+ VersionPart version
290
+ ) = abi.decode(info.data, (ObjectType, VersionPart));
291
+
292
+ if(version != expectedVersion) {
293
+ revert UnexpectedServiceVersion(expectedVersion, version);
294
+ }
295
+
296
+ if(expectedDomain.gtz()) {
297
+ if(domain != expectedDomain) {
298
+ revert UnexpectedServiceDomain(expectedDomain, domain);
299
+ }
300
+ }
301
+
302
+ return domain;
303
+ }
304
+
305
+ // TODO check if registry supports types specified in the config array
306
+ function _createRelease(bytes memory configBytes)
307
+ internal
308
+ {
309
+ VersionPart version = getNextVersion();
310
+ IRegistryService.FunctionConfig[] memory config = abi.decode(configBytes, (IRegistryService.FunctionConfig[]));
311
+
312
+ if(config.length == 0) {
313
+ revert ConfigMissing();
314
+ }
315
+ // always in release
316
+ _release[version].domains.push(REGISTRY());
317
+ for(uint idx = 0; idx < config.length; idx++)
318
+ {
319
+ ObjectType domain = config[idx].serviceDomain;
320
+ bytes4 selector = config[idx].selector;
321
+
322
+ // not "registry service" / zero domain
323
+ if(
324
+ domain == REGISTRY() ||
325
+ domain.eqz()
326
+ ) { revert ConfigServiceDomainInvalid(idx, domain); }
327
+
328
+ // no overwrite
329
+ if(_selector[version][domain] > 0) {
330
+ revert SelectorAlreadyExists(version, domain);
331
+ }
332
+
333
+ _selector[version][domain] = selector;
334
+ _release[version].domains.push(domain);
335
+ }
336
+ // TODO set when activated?
337
+ _release[version].createdAt = TimestampLib.blockTimestamp();
338
+ //_release[version].updatedAt = TimestampLib.blockTimestamp();
339
+
340
+ _awaitingRegistration = config.length;
341
+ }
342
+ }
@@ -0,0 +1,110 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
6
+
7
+ import {IRegisterable} from "../shared/IRegisterable.sol";
8
+ import {IRegistry} from "./IRegistry.sol";
9
+ import {VersionPart} from "../types/Version.sol";
10
+ import {REGISTRY} from "../types/ObjectType.sol";
11
+ import {NftOwnable} from "../shared/NftOwnable.sol";
12
+
13
+ /// @title contract to register token per GIF major release.
14
+ contract TokenRegistry is
15
+ NftOwnable
16
+ {
17
+ event LogRegistered(address token, string symbol, uint256 decimals);
18
+ event LogTokenStateSet(address token, VersionPart majorVersion, bool active);
19
+
20
+ error NotContract(address account);
21
+ error NotToken(address account);
22
+ error TokenDecimalsZero();
23
+ error TokenMajorVersionInvalid(VersionPart majorVersion);
24
+
25
+ address [] internal _token;
26
+ mapping(address token => bool registered) internal _registered;
27
+ mapping(address token => mapping(VersionPart majorVersion => bool isActive)) internal _active;
28
+
29
+ constructor()
30
+ NftOwnable()
31
+ { }
32
+
33
+
34
+ /// @dev link ownership of token registry to nft owner of registry service
35
+ function linkToNftOwnable(address registryAddress)
36
+ external
37
+ onlyOwner
38
+ {
39
+ IRegistry registry = IRegistry(registryAddress);
40
+ // TODO use _latest instead of `next version` -> but _latest is 0 before first release activation
41
+ address registryServiceAddress = registry.getServiceAddress(REGISTRY(), registry.getMajorVersionMax());
42
+
43
+ _linkToNftOwnable(registryAddress, registryServiceAddress);
44
+ }
45
+
46
+ /// @dev token state is informative, registry have no clue about used tokens
47
+ // component owner is responsible for token selection and operations
48
+ // service MUST deny registration of component with inactive token
49
+ function setActive(address token, VersionPart majorVersion, bool active)
50
+ external
51
+ onlyOwner
52
+ {
53
+ // verify that token is registered
54
+ if (!_registered[token]) {
55
+ _registerToken(token);
56
+ }
57
+
58
+ // verify valid major version
59
+ // ensure major version increments is one
60
+ uint256 version = majorVersion.toInt();
61
+ if (version < _registry.getMajorVersionMin().toInt() || version > _registry.getMajorVersionMax().toInt()) {
62
+ revert TokenMajorVersionInvalid(majorVersion);
63
+ }
64
+
65
+ _active[token][majorVersion] = active;
66
+
67
+ emit LogTokenStateSet(token, majorVersion, active);
68
+ }
69
+
70
+ function tokens() external view returns (uint256) {
71
+ return _token.length;
72
+ }
73
+
74
+ function getToken(uint256 idx) external view returns (IERC20Metadata token) {
75
+ return IERC20Metadata(_token[idx]);
76
+ }
77
+
78
+ function isRegistered(address token) external view returns (bool) {
79
+ return _registered[token];
80
+ }
81
+
82
+ function isActive(address token, VersionPart majorVersion) external view returns (bool) {
83
+ return _active[token][majorVersion];
84
+ }
85
+
86
+ /// @dev some sanity checks to prevent unintended registration
87
+ function _registerToken(address token) internal {
88
+
89
+ // MUST be contract
90
+ if(token.code.length == 0) {
91
+ revert NotContract(token);
92
+ }
93
+
94
+ // MUST not be GIF registerable
95
+ if(ERC165Checker.supportsInterface(token, type(IRegisterable).interfaceId)) {
96
+ revert NotToken(token);
97
+ }
98
+
99
+ // MUST have decimals > 0
100
+ IERC20Metadata erc20 = IERC20Metadata(token);
101
+ if(erc20.decimals() == 0) {
102
+ revert TokenDecimalsZero();
103
+ }
104
+
105
+ _registered[token] = true;
106
+ _token.push(token);
107
+
108
+ emit LogRegistered(token, erc20.symbol(), erc20.decimals());
109
+ }
110
+ }
@@ -7,14 +7,18 @@ contract ERC165 is IERC165 {
7
7
  mapping(bytes4 => bool) private _isSupported;
8
8
 
9
9
  constructor() {
10
- // register support for ERC165
11
- _registerInterface(type(IERC165).interfaceId);
10
+ _initializeERC165();
12
11
  }
13
12
 
14
13
  function supportsInterface(bytes4 interfaceId) external view override returns (bool) {
15
14
  return _isSupported[interfaceId];
16
15
  }
17
16
 
17
+ // @dev register support for ERC165 itself
18
+ function _initializeERC165() internal {
19
+ _isSupported[type(IERC165).interfaceId] = true;
20
+ }
21
+
18
22
  function _registerInterface(bytes4 interfaceId) internal {
19
23
  _isSupported[interfaceId] = true;
20
24
  }
@@ -5,8 +5,6 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
5
 
6
6
  import {INftOwnable} from "./INftOwnable.sol";
7
7
  import {IRegistry} from "../registry/IRegistry.sol";
8
- import {NftId} from "../types/NftId.sol";
9
- import {ObjectType} from "../types/ObjectType.sol";
10
8
 
11
9
  interface IRegisterable is IERC165, INftOwnable {
12
10
 
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.19;
3
3
 
4
4
  import {VersionPart} from "../types/Version.sol";
5
+ import {ObjectType} from "../types/ObjectType.sol";
5
6
 
6
7
  import {IRegisterable} from "./IRegisterable.sol";
7
8
  import {IVersionable} from "./IVersionable.sol";
@@ -10,6 +11,6 @@ interface IService is
10
11
  IRegisterable,
11
12
  IVersionable
12
13
  {
13
- function getName() external pure returns(string memory name);
14
+ function getDomain() external pure returns(ObjectType serviceDomain);
14
15
  function getMajorVersion() external view returns(VersionPart majorVersion);
15
16
  }
@@ -5,18 +5,17 @@ import {INftOwnable} from "./INftOwnable.sol";
5
5
  import {IRegistry} from "../registry/IRegistry.sol";
6
6
  import {NftId, zeroNftId} from "../types/NftId.sol";
7
7
 
8
+ // TODO make contract upgradeable
8
9
  contract NftOwnable is INftOwnable {
9
10
 
11
+ // TODO move vars to struct and add _getNftOwnableStorage
10
12
  IRegistry internal _registry;
11
13
  NftId private _nftId;
12
14
  address private _initialOwner;
13
15
 
14
16
  /// @dev enforces msg.sender is owner of nft (or initial owner of nft ownable)
15
17
  modifier onlyOwner() {
16
- address owner = getOwner();
17
-
18
- // owner == address(0) is eg uninitialized upgradable contract
19
- if (owner != address(0) && msg.sender != owner) {
18
+ if (msg.sender != getOwner()) {
20
19
  revert ErrorNotOwner(msg.sender);
21
20
  }
22
21
  _;
@@ -77,6 +76,7 @@ contract NftOwnable is INftOwnable {
77
76
  internal
78
77
  virtual
79
78
  {
79
+ require(initialOwner > address(0), "NftOwnable: initial owner is 0");
80
80
  _initialOwner = initialOwner;
81
81
  _setRegistry(registryAddress);
82
82
  }
@@ -38,6 +38,7 @@ contract ProxyManager is
38
38
  returns (IVersionable versionable)
39
39
  {
40
40
  if (_isDeployed) { revert ErrorAlreadyDeployed(); }
41
+ _isDeployed = true;
41
42
 
42
43
  address currentProxyOwner = getOwner(); // used by implementation
43
44
  address initialProxyAdminOwner = address(this); // used by proxy
@@ -49,7 +50,6 @@ contract ProxyManager is
49
50
  data
50
51
  );
51
52
 
52
- _isDeployed = true;
53
53
  versionable = IVersionable(address(_proxy));
54
54
 
55
55
  emit LogProxyDeployed(address(_proxy), initialImplementation);
@@ -49,6 +49,7 @@ contract Registerable is
49
49
  //onlyInitializing//TODO uncomment when "fully" upgradeable
50
50
  virtual
51
51
  {
52
+ _initializeERC165();
52
53
  _initializeNftOwnable(
53
54
  initialOwner,
54
55
  registryAddress);
@@ -1,21 +1,26 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.19;
3
3
 
4
- import {IRegistry} from "../registry/IRegistry.sol";
5
- import {IService} from "./IService.sol";
6
- import {IVersionable} from "./IVersionable.sol";
4
+ import {ObjectType, SERVICE} from "../types/ObjectType.sol";
7
5
  import {NftId, zeroNftId} from "../types/NftId.sol";
8
- import {RegisterableUpgradable} from "./RegisterableUpgradable.sol";
9
- import {SERVICE} from "../types/ObjectType.sol";
10
6
  import {Version, VersionPart, VersionLib} from "../types/Version.sol";
7
+
8
+ import {Versionable} from "./Versionable.sol";
9
+ import {IService} from "./IService.sol";
10
+ import {IVersionable} from "./IVersionable.sol";
11
11
  import {Versionable} from "./Versionable.sol";
12
+ import {Registerable} from "./Registerable.sol";
13
+
14
+ import {IRegistry} from "../registry/IRegistry.sol";
15
+
12
16
 
13
17
  /// @dev service base contract
14
18
  abstract contract Service is
15
- RegisterableUpgradable,
19
+ Registerable,
20
+ Versionable,
16
21
  IService
17
22
  {
18
- function getName() public pure virtual override returns(string memory name);
23
+ function getDomain() public pure virtual override returns(ObjectType);
19
24
 
20
25
  function getMajorVersion() public view virtual override returns(VersionPart majorVersion) {
21
26
  return getVersion().toMajorPart();
@@ -36,10 +41,11 @@ abstract contract Service is
36
41
  address initialOwner
37
42
  )
38
43
  internal
44
+ virtual
39
45
  //onlyInitializing //TODO uncomment when "fully" upgradeable
40
46
  {
41
47
  // service must provide its name and version upon registration
42
- bytes memory data = abi.encode(getName(), getMajorVersion());
48
+ bytes memory data = abi.encode(getDomain(), getMajorVersion());
43
49
  NftId registryNftId = _getRegistryNftId(registry);
44
50
  bool isInterceptor = false;
45
51