@etherisc/gif-next 0.0.2-b9e43cf-870 → 0.0.2-bad4d33-850

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  2. package/artifacts/contracts/components/{IBaseComponent.sol/IBaseComponent.json → Component.sol/Component.json} +273 -14
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +184 -10
  5. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
  6. package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +61 -88
  7. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +496 -0
  9. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +512 -74
  11. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +596 -5
  13. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  14. package/artifacts/contracts/components/Pool.sol/Pool.json +165 -93
  15. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  16. package/artifacts/contracts/components/Product.sol/Product.json +189 -15
  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/ISM.sol/ISM.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  36. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  37. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  38. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +38 -62
  39. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  40. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  41. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +179 -13
  42. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +21 -5
  44. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  45. package/artifacts/contracts/instance/Instance.sol/Instance.json +111 -74
  46. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  47. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +47 -60
  48. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +41 -82
  50. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +168 -92
  52. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +37 -24
  54. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -32
  56. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
  57. package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +102 -31
  58. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  60. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  63. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  66. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  68. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  69. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  70. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +131 -60
  71. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  72. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +31 -18
  73. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +126 -47
  75. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  76. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +31 -14
  77. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +0 -5
  79. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  80. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +0 -5
  81. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  82. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +0 -5
  83. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  84. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +0 -5
  85. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  86. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +0 -5
  87. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  88. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +152 -81
  89. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  90. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +44 -31
  91. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  92. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +126 -47
  93. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  94. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +31 -14
  95. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  96. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +126 -47
  97. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  98. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +31 -14
  99. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  100. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  101. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +83 -3
  102. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  103. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +33 -28
  104. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  105. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  106. package/artifacts/contracts/registry/Registry.sol/Registry.json +96 -24
  107. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  108. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +18 -18
  109. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  110. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +61 -56
  111. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  112. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +28 -15
  113. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  114. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +70 -53
  115. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  116. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +23 -26
  117. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  118. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  119. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  120. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  121. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -5
  122. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  123. package/artifacts/contracts/shared/IService.sol/IService.json +0 -5
  124. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  125. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  126. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +19 -6
  127. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  128. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +19 -6
  129. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +19 -11
  131. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  132. package/artifacts/contracts/shared/Service.sol/Service.json +13 -5
  133. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  134. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  135. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  136. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  137. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  138. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +19 -11
  139. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  140. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  141. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  142. package/artifacts/contracts/test/TestService.sol/TestService.json +29 -21
  143. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  144. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  145. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  146. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  147. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  148. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  149. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  150. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  151. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  152. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  153. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  154. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  155. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  156. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  157. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  158. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  159. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  160. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  161. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  162. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  164. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  165. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  167. package/contracts/components/Component.sol +216 -0
  168. package/contracts/components/Distribution.sol +40 -51
  169. package/contracts/components/IComponent.sol +43 -0
  170. package/contracts/components/IDistributionComponent.sol +5 -2
  171. package/contracts/components/IPoolComponent.sol +6 -21
  172. package/contracts/components/IProductComponent.sol +7 -3
  173. package/contracts/components/Pool.sol +44 -108
  174. package/contracts/components/Product.sol +51 -86
  175. package/contracts/instance/BundleManager.sol +7 -11
  176. package/contracts/instance/IInstance.sol +20 -10
  177. package/contracts/instance/IInstanceService.sol +2 -1
  178. package/contracts/instance/Instance.sol +28 -31
  179. package/contracts/instance/InstanceAccessManager.sol +6 -11
  180. package/contracts/instance/InstanceReader.sol +3 -25
  181. package/contracts/instance/InstanceService.sol +112 -22
  182. package/contracts/instance/ObjectManager.sol +7 -24
  183. package/contracts/instance/base/ComponentService.sol +134 -0
  184. package/contracts/instance/service/BundleService.sol +2 -3
  185. package/contracts/instance/service/DistributionService.sol +23 -37
  186. package/contracts/instance/service/PolicyService.sol +2 -3
  187. package/contracts/instance/service/PoolService.sol +20 -55
  188. package/contracts/instance/service/ProductService.sol +50 -30
  189. package/contracts/registry/IRegistry.sol +13 -6
  190. package/contracts/registry/IRegistryService.sol +16 -9
  191. package/contracts/registry/Registry.sol +100 -44
  192. package/contracts/registry/RegistryAccessManager.sol +31 -25
  193. package/contracts/registry/RegistryService.sol +27 -85
  194. package/contracts/registry/ReleaseManager.sol +72 -82
  195. package/contracts/registry/TokenRegistry.sol +5 -3
  196. package/contracts/shared/IRegisterable.sol +1 -3
  197. package/contracts/shared/NftOwnable.sol +5 -0
  198. package/contracts/shared/Registerable.sol +10 -14
  199. package/contracts/shared/Service.sol +4 -2
  200. package/contracts/types/RoleId.sol +2 -2
  201. package/package.json +1 -1
  202. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  203. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  204. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  205. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
  206. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  207. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
  208. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  209. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
  210. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  211. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  212. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
  213. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  214. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -814
  215. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  216. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -466
  217. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
  218. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
  219. package/contracts/components/BaseComponent.sol +0 -159
  220. package/contracts/components/IBaseComponent.sol +0 -34
  221. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
  222. package/contracts/instance/IInstanceBase.sol +0 -26
  223. package/contracts/instance/InstanceBase.sol +0 -41
  224. package/contracts/instance/base/ComponentServiceBase.sol +0 -76
  225. package/contracts/instance/base/IInstanceBase.sol +0 -23
  226. package/contracts/instance/service/ComponentOwnerService.sol +0 -315
  227. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
  228. package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -24,17 +24,16 @@ import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
24
24
  import {IService} from "../../shared/IService.sol";
25
25
  import {Service} from "../../shared/Service.sol";
26
26
  import {BundleManager} from "../BundleManager.sol";
27
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
27
+ import {ComponentService} from "../base/ComponentService.sol";
28
28
  import {IBundleService} from "./IBundleService.sol";
29
29
  import {IRegistryService} from "../../registry/IRegistryService.sol";
30
30
  import {InstanceService} from "../InstanceService.sol";
31
31
  import {InstanceReader} from "../InstanceReader.sol";
32
- import {IBaseComponent} from "../../components/IBaseComponent.sol";
33
32
 
34
33
  string constant BUNDLE_SERVICE_NAME = "BundleService";
35
34
 
36
35
  contract BundleService is
37
- ComponentServiceBase,
36
+ ComponentService,
38
37
  IBundleService
39
38
  {
40
39
  using NftIdLib for NftId;
@@ -19,14 +19,14 @@ import {Versionable} from "../../shared/Versionable.sol";
19
19
 
20
20
  import {IService} from "../../shared/IService.sol";
21
21
  import {Service} from "../../shared/Service.sol";
22
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
22
+ import {ComponentService} from "../base/ComponentService.sol";
23
23
  import {InstanceService} from "../InstanceService.sol";
24
+ import {IComponent} from "../../components/IComponent.sol";
25
+ import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
24
26
  import {IDistributionService} from "./IDistributionService.sol";
25
- import {IBaseComponent} from "../../components/IBaseComponent.sol";
26
-
27
27
 
28
28
  contract DistributionService is
29
- ComponentServiceBase,
29
+ ComponentService,
30
30
  IDistributionService
31
31
  {
32
32
  using NftIdLib for NftId;
@@ -59,45 +59,31 @@ contract DistributionService is
59
59
  external
60
60
  returns(NftId distributionNftId)
61
61
  {
62
- address distributionOwner = msg.sender;
63
- IBaseComponent distribution = IBaseComponent(distributionAddress);
64
-
65
- IRegistry.ObjectInfo memory info;
66
- bytes memory data;
67
- (info, data) = getRegistryService().registerDistribution(distribution, distributionOwner);
68
-
69
- NftId instanceNftId = info.parentNftId;
70
- IInstance instance = _getInstance(instanceNftId);
71
- InstanceService instanceService = getInstanceService();
72
-
73
- bool hasRole = instanceService.hasRole(
74
- distributionOwner,
75
- DISTRIBUTION_OWNER_ROLE(),
76
- address(instance));
77
-
78
- if(!hasRole) {
79
- revert ExpectedRoleMissing(DISTRIBUTION_OWNER_ROLE(), distributionOwner);
80
- }
81
-
82
- distributionNftId = info.nftId;
83
- string memory distributionName;
84
- ISetup.DistributionSetupInfo memory initialSetup;
85
- (distributionName, initialSetup) = _decodeAndVerifyDistributionData(data);
86
- instance.createDistributionSetup(distributionNftId, initialSetup);
87
-
88
- instanceService.createTarget(instanceNftId, distributionAddress, distributionName);
89
-
62
+ (
63
+ IComponent component,
64
+ address owner,
65
+ IInstance instance,
66
+ NftId instanceNftId
67
+ ) = _checkComponentForRegistration(
68
+ distributionAddress,
69
+ DISTRIBUTION(),
70
+ DISTRIBUTION_OWNER_ROLE());
71
+
72
+ IRegistry.ObjectInfo memory distributionInfo = getRegistryService().registerDistribution(component, owner);
73
+ IDistributionComponent distribution = IDistributionComponent(distributionAddress);
90
74
  distribution.linkToRegisteredNftId();
75
+ distributionNftId = distributionInfo.nftId;
76
+
77
+ instance.createDistributionSetup(distributionNftId, distribution.getSetupInfo());
78
+ getInstanceService().createGifTarget(instanceNftId, distributionAddress, distribution.getName());
79
+ getInstanceService().grantDistributionDefaultPermissions(instanceNftId, distributionAddress, distribution.getName());
91
80
  }
92
81
 
93
82
  function _decodeAndVerifyDistributionData(bytes memory data)
94
83
  internal
95
- returns(string memory name, ISetup.DistributionSetupInfo memory setup)
84
+ returns(string memory name)
96
85
  {
97
- (name, setup) = abi.decode(
98
- data,
99
- (string, ISetup.DistributionSetupInfo)
100
- );
86
+ (name) = abi.decode(data, (string));
101
87
 
102
88
  // TODO add checks if applicable
103
89
  }
@@ -4,7 +4,6 @@ pragma solidity ^0.8.19;
4
4
  import {IRegistry} from "../../registry/IRegistry.sol";
5
5
  import {IProductComponent} from "../../components/IProductComponent.sol";
6
6
  import {Product} from "../../components/Product.sol";
7
- import {IBaseComponent} from "../../components/IBaseComponent.sol";
8
7
  import {IPoolComponent} from "../../components/IPoolComponent.sol";
9
8
  import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
10
9
  import {IInstance} from "../IInstance.sol";
@@ -35,14 +34,14 @@ import {Version, VersionLib} from "../../types/Version.sol";
35
34
 
36
35
  import {IService} from "../../shared/IService.sol";
37
36
  import {Service} from "../../shared/Service.sol";
38
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
37
+ import {ComponentService} from "../base/ComponentService.sol";
39
38
  import {IPolicyService} from "./IPolicyService.sol";
40
39
  import {InstanceReader} from "../InstanceReader.sol";
41
40
  import {IPoolService} from "./IPoolService.sol";
42
41
  import {IBundleService} from "./IBundleService.sol";
43
42
 
44
43
 
45
- contract PolicyService is ComponentServiceBase, IPolicyService {
44
+ contract PolicyService is ComponentService, IPolicyService {
46
45
  using NftIdLib for NftId;
47
46
  using TimestampLib for Timestamp;
48
47
 
@@ -24,17 +24,18 @@ import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
24
24
  import {IService} from "../../shared/IService.sol";
25
25
  import {Service} from "../../shared/Service.sol";
26
26
  import {BundleManager} from "../BundleManager.sol";
27
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
27
+ import {ComponentService} from "../base/ComponentService.sol";
28
28
  import {IPoolService} from "./IPoolService.sol";
29
29
  import {IRegistryService} from "../../registry/IRegistryService.sol";
30
30
  import {InstanceService} from "../InstanceService.sol";
31
31
  import {InstanceReader} from "../InstanceReader.sol";
32
- import {IBaseComponent} from "../../components/IBaseComponent.sol";
32
+ import {IComponent} from "../../components/IComponent.sol";
33
+ import {IPoolComponent} from "../../components/IPoolComponent.sol";
33
34
 
34
35
  string constant POOL_SERVICE_NAME = "PoolService";
35
36
 
36
37
  contract PoolService is
37
- ComponentServiceBase,
38
+ ComponentService,
38
39
  IPoolService
39
40
  {
40
41
  using NftIdLib for NftId;
@@ -67,60 +68,24 @@ contract PoolService is
67
68
  external
68
69
  returns(NftId poolNftId)
69
70
  {
70
- address poolOwner = msg.sender;
71
- IBaseComponent pool = IBaseComponent(poolAddress);
72
-
73
- IRegistry.ObjectInfo memory info;
74
- bytes memory data;
75
- (info, data) = getRegistryService().registerPool(pool, poolOwner);
76
-
77
- NftId instanceNftId = info.parentNftId;
78
- IInstance instance = _getInstance(instanceNftId);
79
- bool hasRole = getInstanceService().hasRole(
80
- poolOwner,
81
- POOL_OWNER_ROLE(),
82
- address(instance));
83
-
84
- if(!hasRole) {
85
- revert ExpectedRoleMissing(POOL_OWNER_ROLE(), poolOwner);
86
- }
87
-
88
- poolNftId = info.nftId;
89
- string memory poolName;
90
- ISetup.PoolSetupInfo memory initialSetup;
91
- (poolName, initialSetup) = _decodeAndVerifyPoolData(data);
92
- instance.createPoolSetup(poolNftId, initialSetup);
93
-
94
- getInstanceService().createTarget(instanceNftId, poolAddress, poolName);
95
-
71
+ (
72
+ IComponent component,
73
+ address owner,
74
+ IInstance instance,
75
+ NftId instanceNftId
76
+ ) = _checkComponentForRegistration(
77
+ poolAddress,
78
+ POOL(),
79
+ POOL_OWNER_ROLE());
80
+
81
+ IPoolComponent pool = IPoolComponent(poolAddress);
82
+ IRegistry.ObjectInfo memory poolInfo = getRegistryService().registerPool(pool, owner);
96
83
  pool.linkToRegisteredNftId();
97
- }
98
-
99
- function _decodeAndVerifyPoolData(bytes memory data)
100
- internal
101
- returns(string memory name, ISetup.PoolSetupInfo memory setup)
102
- {
103
- (name, setup) = abi.decode(
104
- data,
105
- (string, ISetup.PoolSetupInfo)
106
- );
107
-
108
- // TODO add checks
109
- /*IRegistry _registry = getRegistry();
110
-
111
- if(wallet == address(0)) {
112
- revert WalletIsZero();
113
- }
114
-
115
- ObjectType tokenType = _registry.getObjectInfo(address(token)).objectType;
116
-
117
- if(tokenType != TOKEN()) {
118
- revert InvalidToken();
119
- }
84
+ poolNftId = poolInfo.nftId;
120
85
 
121
- if(UFixedLib.eqz(info.collateralizationLevel)) {
122
- revert CollateralizationLevelIsZero();
123
- }*/
86
+ instance.createPoolSetup(poolNftId, pool.getSetupInfo());
87
+ getInstanceService().createGifTarget(instanceNftId, poolAddress, pool.getName());
88
+ getInstanceService().grantPoolDefaultPermissions(instanceNftId, poolAddress, pool.getName());
124
89
  }
125
90
 
126
91
  function setFees(
@@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
4
4
  import {IRegistry} from "../../registry/IRegistry.sol";
5
5
  import {IProductComponent} from "../../components/IProductComponent.sol";
6
6
  import {Product} from "../../components/Product.sol";
7
- import {IBaseComponent} from "../../components/IBaseComponent.sol";
7
+ import {IComponent} from "../../components/IComponent.sol";
8
8
  import {IPoolComponent} from "../../components/IPoolComponent.sol";
9
9
  import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
10
10
  import {IInstance} from "../IInstance.sol";
@@ -35,13 +35,13 @@ import {RoleId, PRODUCT_OWNER_ROLE} from "../../types/RoleId.sol";
35
35
 
36
36
  import {IService} from "../../shared/IService.sol";
37
37
  import {Service} from "../../shared/Service.sol";
38
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
38
+ import {ComponentService} from "../base/ComponentService.sol";
39
39
  import {IProductService} from "./IProductService.sol";
40
40
  import {InstanceReader} from "../InstanceReader.sol";
41
41
  import {IPoolService} from "./PoolService.sol";
42
42
 
43
43
  // TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
44
- contract ProductService is ComponentServiceBase, IProductService {
44
+ contract ProductService is ComponentService, IProductService {
45
45
  using NftIdLib for NftId;
46
46
 
47
47
  IPoolService internal _poolService;
@@ -68,44 +68,64 @@ contract ProductService is ComponentServiceBase, IProductService {
68
68
  }
69
69
 
70
70
 
71
- function getDomain() public pure override(IService, Service) returns(ObjectType) {
72
- return PRODUCT();
73
- }
74
-
75
71
  function register(address productAddress)
76
72
  external
77
73
  returns(NftId productNftId)
78
74
  {
79
- address productOwner = msg.sender;
80
- IBaseComponent product = IBaseComponent(productAddress);
81
-
82
- IRegistry.ObjectInfo memory info;
83
- bytes memory data;
84
- (info, data) = getRegistryService().registerProduct(product, productOwner);
85
-
86
- NftId instanceNftId = info.parentNftId;
87
- IInstance instance = _getInstance(instanceNftId);
88
- bool hasRole = getInstanceService().hasRole(
89
- productOwner,
90
- PRODUCT_OWNER_ROLE(),
91
- address(instance));
75
+ (
76
+ IComponent component,
77
+ address owner,
78
+ IInstance instance,
79
+ NftId instanceNftId
80
+ ) = _checkComponentForRegistration(
81
+ productAddress,
82
+ PRODUCT(),
83
+ PRODUCT_OWNER_ROLE());
84
+
85
+ IProductComponent product = IProductComponent(productAddress);
86
+ IRegistry.ObjectInfo memory productInfo = getRegistryService().registerProduct(product, owner);
87
+ productNftId = productInfo.nftId;
88
+ _createProductSetup(
89
+ instance,
90
+ product,
91
+ productNftId);
92
+ }
92
93
 
93
- if(!hasRole) {
94
- revert ExpectedRoleMissing(PRODUCT_OWNER_ROLE(), productOwner);
95
- }
96
94
 
97
- productNftId = info.nftId;
98
- string memory productName;
99
- ISetup.ProductSetupInfo memory initialSetup;
100
- (productName, initialSetup) = _decodeAndVerifyProductData(data);
95
+ function _createProductSetup(
96
+ IInstance instance,
97
+ IProductComponent product,
98
+ NftId productNftId
99
+ )
100
+ internal
101
+ returns (string memory name)
102
+ {
103
+ // wire distribution and pool components to product component
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);
107
+
108
+ distribution.setProductNftId(productNftId);
109
+ pool.setProductNftId(productNftId);
110
+ product.setProductNftId(productNftId);
111
+ product.linkToRegisteredNftId();
101
112
 
102
- instance.createProductSetup(productNftId, initialSetup);
113
+ // create product setup in instance
114
+ instance.createProductSetup(productNftId, product.getSetupInfo());
103
115
 
104
- getInstanceService().createTarget(instanceNftId, productAddress, productName);
116
+ // create target for instane access manager
117
+ getInstanceService().createGifTarget(
118
+ _registry.getNftId(address(instance)),
119
+ address(product),
120
+ product.getName());
121
+ getInstanceService().grantProductDefaultPermissions(instance.getNftId(), address(product), product.getName());
122
+ }
105
123
 
106
- product.linkToRegisteredNftId();
124
+ function getDomain() public pure override(IService, Service) returns(ObjectType) {
125
+ return PRODUCT();
107
126
  }
108
127
 
128
+
109
129
  function _decodeAndVerifyProductData(bytes memory data)
110
130
  internal
111
131
  returns(string memory name, ISetup.ProductSetupInfo memory setup)
@@ -14,13 +14,16 @@ interface IRegistry is IERC165 {
14
14
  event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
15
15
  event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
16
16
 
17
+ // registerService()
18
+ error CallerNotReleaseManager();
19
+ error ServiceAlreadyRegistered(address service);
20
+
17
21
  // register()
18
22
  error CallerNotRegistryService();
19
23
  error ServiceRegistration();
20
24
 
21
- // registerService()
22
- error CallerNotReleaseManager();
23
- error ServiceAlreadyRegistered(address service);
25
+ // registerWithCustomTypes()
26
+ error CoreTypeRegistration();
24
27
 
25
28
  // _register()
26
29
  error ZeroParentAddress();
@@ -52,11 +55,13 @@ interface IRegistry is IERC165 {
52
55
 
53
56
  function register(ObjectInfo memory info) external returns (NftId nftId);
54
57
 
55
- function getMajorVersionMin() external view returns (VersionPart);
58
+ function registerWithCustomType(ObjectInfo memory info) external returns (NftId nftId);
56
59
 
57
- function getMajorVersionMax() external view returns (VersionPart);
60
+ function getInitialVersion() external view returns (VersionPart);
58
61
 
59
- function getMajorVersion() external view returns (VersionPart);
62
+ function getNextVersion() external view returns (VersionPart);
63
+
64
+ function getLatestVersion() external view returns (VersionPart);
60
65
 
61
66
  function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
62
67
 
@@ -80,6 +85,8 @@ interface IRegistry is IERC165 {
80
85
 
81
86
  function isRegisteredService(address contractAddress) external view returns (bool);
82
87
 
88
+ function isValidRelease(VersionPart version) external view returns (bool);
89
+
83
90
  function getServiceAddress(
84
91
  ObjectType serviceDomain,
85
92
  VersionPart releaseVersion
@@ -10,7 +10,7 @@ import {IService} from "../shared/IService.sol";
10
10
  import {IRegistry} from "./IRegistry.sol";
11
11
 
12
12
  import {IRegisterable} from "../shared/IRegisterable.sol";
13
- import {IBaseComponent} from "../components/IBaseComponent.sol";
13
+ import {IComponent} from "../components/IComponent.sol";
14
14
 
15
15
  interface IRegistryService is
16
16
  IService,
@@ -38,18 +38,25 @@ interface IRegistryService is
38
38
  bytes4 selector;
39
39
  }
40
40
 
41
+ function getFunctionConfigs()
42
+ external
43
+ pure
44
+ returns(
45
+ FunctionConfig[] memory config
46
+ );
47
+
41
48
  // TODO used by service -> add owner arg
42
- function registerInstance(IRegisterable instance)
43
- external returns(IRegistry.ObjectInfo memory info, bytes memory data);
49
+ function registerInstance(IRegisterable instance, address owner)
50
+ external returns(IRegistry.ObjectInfo memory info);
44
51
 
45
- function registerProduct(IBaseComponent product, address owner)
46
- external returns(IRegistry.ObjectInfo memory info, bytes memory data);
52
+ function registerProduct(IComponent product, address owner)
53
+ external returns(IRegistry.ObjectInfo memory info);
47
54
 
48
- function registerPool(IBaseComponent pool, address owner)
49
- external returns(IRegistry.ObjectInfo memory info, bytes memory data);
55
+ function registerPool(IComponent pool, address owner)
56
+ external returns(IRegistry.ObjectInfo memory info);
50
57
 
51
- function registerDistribution(IBaseComponent distribution, address owner)
52
- external returns(IRegistry.ObjectInfo memory info, bytes memory data);
58
+ function registerDistribution(IComponent distribution, address owner)
59
+ external returns(IRegistry.ObjectInfo memory info);
53
60
 
54
61
  function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
55
62