@etherisc/gif-next 0.0.2-dc7e4cb-141 → 0.0.2-de0a1d3-009

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 +58 -11
  2. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +4 -0
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +405 -0
  5. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  7. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +340 -0
  8. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +131 -0
  10. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +109 -18
  12. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  13. package/artifacts/contracts/components/Pool.sol/Pool.json +194 -3
  14. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  15. package/artifacts/contracts/components/Product.sol/Product.json +160 -21
  16. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  17. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  28. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
  32. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
  34. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  36. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  37. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +709 -678
  38. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +1 -1
  39. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  40. package/artifacts/contracts/instance/Instance.sol/Instance.json +916 -717
  41. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +4 -0
  42. package/artifacts/contracts/instance/{InstanceBase.sol/InstanceBase.json → base/ComponentServiceBase.sol/ComponentServiceBase.json} +102 -28
  43. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
  44. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +113 -0
  45. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  46. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +560 -0
  47. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  48. package/artifacts/contracts/instance/{module/lifecycle/ILifecycle.sol/ILifecycleModule.json → base/ILifecycle.sol/ILifecycle.json} +10 -77
  49. package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +4 -0
  50. package/artifacts/contracts/instance/{service → base}/IService.sol/IService.json +58 -17
  51. package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +4 -0
  52. package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.json +463 -0
  53. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  54. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +710 -0
  55. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  56. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +169 -0
  57. package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +4 -0
  58. package/artifacts/contracts/instance/{module/compensation/ICompensation.sol/ICompensation.json → base/ModuleBase.sol/ModuleBase.json} +2 -2
  59. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +4 -0
  60. package/artifacts/contracts/instance/{service → base}/ServiceBase.sol/ServiceBase.json +88 -1
  61. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +1 -1
  63. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +71 -50
  66. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +1 -1
  68. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +71 -50
  69. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +22 -93
  71. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +1 -1
  72. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +1 -1
  73. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +22 -93
  74. package/artifacts/contracts/instance/module/distribution/DistributionModule.sol/DistributionModule.dbg.json +4 -0
  75. package/artifacts/contracts/instance/module/distribution/DistributionModule.sol/DistributionModule.json +10 -0
  76. package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistribution.dbg.json +4 -0
  77. package/artifacts/contracts/instance/module/{compensation/ICompensation.sol/ICompensationModule.json → distribution/IDistribution.sol/IDistribution.json} +2 -2
  78. package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistributionModule.dbg.json +4 -0
  79. package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistributionModule.json +10 -0
  80. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
  81. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
  82. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +61 -38
  83. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
  84. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +61 -38
  85. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +1 -1
  86. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
  87. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -5
  88. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
  89. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -5
  90. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +1 -1
  91. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +1 -1
  92. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +104 -1
  93. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +1 -1
  94. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +126 -5
  95. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +1 -1
  96. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +1 -1
  97. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +209 -231
  98. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  99. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +2 -2
  100. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +1 -1
  101. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +209 -231
  102. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +145 -18
  104. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
  105. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +507 -0
  106. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +57 -16
  108. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  109. package/artifacts/contracts/instance/service/{ComponentServiceBase.sol/ComponentServiceBase.json → IDistributionService.sol/IDistributionService.json} +91 -25
  110. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  111. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +122 -17
  112. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  113. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +210 -16
  114. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  115. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +171 -12
  116. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  117. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +303 -31
  118. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  119. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
  120. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  121. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  122. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  123. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  124. package/artifacts/contracts/registry/RegistryUpgradeable.sol/RegistryUpgradeable.dbg.json +4 -0
  125. package/artifacts/contracts/registry/RegistryUpgradeable.sol/RegistryUpgradeable.json +724 -0
  126. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +1 -1
  128. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  129. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +53 -12
  131. package/artifacts/contracts/shared/Proxy.sol/ProxyDeployer.dbg.json +4 -0
  132. package/artifacts/contracts/shared/Proxy.sol/ProxyDeployer.json +248 -0
  133. package/artifacts/contracts/shared/Proxy.sol/ProxyWithProxyAdminGetter.dbg.json +4 -0
  134. package/artifacts/contracts/shared/Proxy.sol/ProxyWithProxyAdminGetter.json +129 -0
  135. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  136. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  137. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +87 -0
  138. package/artifacts/contracts/shared/VersionableUpgradeable.sol/VersionableUpgradeable.dbg.json +4 -0
  139. package/artifacts/contracts/shared/VersionableUpgradeable.sol/VersionableUpgradeable.json +228 -0
  140. package/artifacts/contracts/test/TestDistribution.sol/TestDistribution.dbg.json +4 -0
  141. package/artifacts/contracts/test/TestDistribution.sol/TestDistribution.json +405 -0
  142. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  143. package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
  144. package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +1 -1
  145. package/artifacts/contracts/test/TestPool.sol/TestPool.json +194 -3
  146. package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +1 -1
  147. package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +209 -27
  148. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  149. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +2 -2
  150. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +38 -4
  152. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestService.sol/TestService.json +95 -8
  154. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  155. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  156. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
  157. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  158. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +95 -8
  159. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  160. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  161. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  162. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  164. package/artifacts/contracts/types/Fee.sol/FeeLib.json +50 -11
  165. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
  166. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +111 -0
  167. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +65 -4
  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/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  173. package/artifacts/contracts/types/ReferralId.sol/ReferralIdLib.dbg.json +4 -0
  174. package/artifacts/contracts/types/ReferralId.sol/ReferralIdLib.json +99 -0
  175. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
  176. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
  177. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
  178. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +30 -0
  179. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  180. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  181. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/Version.sol/VersionLib.json +40 -2
  185. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
  187. package/contracts/components/BaseComponent.sol +7 -2
  188. package/contracts/components/Distribution.sol +132 -0
  189. package/contracts/components/IDistributionComponent.sol +47 -0
  190. package/contracts/components/IPoolComponent.sol +14 -0
  191. package/contracts/components/IProductComponent.sol +24 -5
  192. package/contracts/components/Pool.sol +64 -3
  193. package/contracts/components/Product.sol +123 -13
  194. package/contracts/instance/IInstance.sol +14 -14
  195. package/contracts/instance/Instance.sol +20 -12
  196. package/contracts/instance/{service → base}/ComponentServiceBase.sol +1 -0
  197. package/contracts/instance/base/IInstanceBase.sol +22 -0
  198. package/contracts/instance/base/IKeyValueStore.sol +50 -0
  199. package/contracts/instance/base/ILifecycle.sol +30 -0
  200. package/contracts/instance/{InstanceBase.sol → base/InstanceBase.sol} +33 -13
  201. package/contracts/instance/base/KeyValueStore.sol +161 -0
  202. package/contracts/instance/{module/lifecycle/LifecycleModule.sol → base/Lifecycle.sol} +50 -39
  203. package/contracts/instance/base/ModuleBase.sol +57 -0
  204. package/contracts/instance/{service → base}/ServiceBase.sol +0 -2
  205. package/contracts/instance/module/access/Access.sol +6 -6
  206. package/contracts/instance/module/bundle/BundleModule.sol +24 -118
  207. package/contracts/instance/module/bundle/IBundle.sol +9 -9
  208. package/contracts/instance/module/component/ComponentModule.sol +27 -60
  209. package/contracts/instance/module/component/IComponent.sol +5 -30
  210. package/contracts/instance/module/distribution/DistributionModule.sol +17 -0
  211. package/contracts/instance/module/distribution/IDistribution.sol +10 -0
  212. package/contracts/instance/module/policy/IPolicy.sol +12 -9
  213. package/contracts/instance/module/policy/PolicyModule.sol +33 -26
  214. package/contracts/instance/module/pool/IPoolModule.sol +0 -1
  215. package/contracts/instance/module/pool/PoolModule.sol +12 -9
  216. package/contracts/instance/module/risk/IRisk.sol +18 -2
  217. package/contracts/instance/module/risk/RiskModule.sol +56 -2
  218. package/contracts/instance/module/treasury/ITreasury.sol +29 -50
  219. package/contracts/instance/module/treasury/TreasuryModule.sol +71 -85
  220. package/contracts/instance/service/ComponentOwnerService.sol +30 -44
  221. package/contracts/instance/service/DistributionService.sol +59 -0
  222. package/contracts/instance/service/IComponentOwnerService.sol +1 -1
  223. package/contracts/instance/service/IDistributionService.sol +12 -0
  224. package/contracts/instance/service/IPoolService.sol +8 -1
  225. package/contracts/instance/service/IProductService.sol +56 -7
  226. package/contracts/instance/service/PoolService.sol +31 -5
  227. package/contracts/instance/service/ProductService.sol +231 -77
  228. package/contracts/registry/Registry.sol +4 -4
  229. package/contracts/registry/RegistryUpgradeable.sol +473 -0
  230. package/contracts/shared/IVersionable.sol +17 -4
  231. package/contracts/shared/Proxy.sol +94 -0
  232. package/contracts/shared/Versionable.sol +13 -3
  233. package/contracts/shared/VersionableUpgradeable.sol +133 -0
  234. package/contracts/test/TestDistribution.sol +21 -0
  235. package/contracts/test/TestPool.sol +5 -2
  236. package/contracts/test/TestProduct.sol +35 -7
  237. package/contracts/test/TestRoleId.sol +2 -2
  238. package/contracts/test/TestService.sol +1 -1
  239. package/contracts/types/Fee.sol +8 -3
  240. package/contracts/types/Key32.sol +45 -0
  241. package/contracts/types/NftId.sol +16 -1
  242. package/contracts/types/ObjectType.sol +24 -8
  243. package/contracts/types/ReferralId.sol +48 -0
  244. package/contracts/types/RiskId.sol +43 -0
  245. package/contracts/types/RoleId.sol +12 -10
  246. package/contracts/types/StateId.sol +7 -1
  247. package/contracts/types/Version.sol +8 -0
  248. package/package.json +1 -1
  249. package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.dbg.json +0 -4
  250. package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.json +0 -50
  251. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  252. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +0 -4
  253. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +0 -10
  254. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +0 -4
  255. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +0 -4
  256. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  257. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.json +0 -134
  258. package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +0 -4
  259. package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +0 -4
  260. package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.json +0 -221
  261. package/artifacts/contracts/instance/service/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  262. package/artifacts/contracts/instance/service/IService.sol/IService.dbg.json +0 -4
  263. package/artifacts/contracts/instance/service/ServiceBase.sol/ServiceBase.dbg.json +0 -4
  264. package/contracts/instance/IServiceLinked.sol +0 -12
  265. package/contracts/instance/module/compensation/CompensationModule.sol +0 -8
  266. package/contracts/instance/module/compensation/ICompensation.sol +0 -10
  267. package/contracts/instance/module/lifecycle/ILifecycle.sol +0 -47
  268. /package/contracts/instance/{service → base}/IService.sol +0 -0
@@ -1,42 +1,138 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.19;
3
3
 
4
+ import {IRisk} from "../instance/module/risk/IRisk.sol";
5
+ import {ITreasury} from "../instance/module/treasury/ITreasury.sol";
4
6
  import {IProductService} from "../instance/service/IProductService.sol";
5
7
  import {IProductComponent} from "./IProductComponent.sol";
6
8
  import {NftId} from "../types/NftId.sol";
7
9
  import {ObjectType, PRODUCT} from "../types/ObjectType.sol";
10
+ import {ReferralId} from "../types/ReferralId.sol";
11
+ import {RiskId, RiskIdLib} from "../types/RiskId.sol";
12
+ import {StateId} from "../types/StateId.sol";
8
13
  import {Timestamp} from "../types/Timestamp.sol";
9
14
  import {Fee} from "../types/Fee.sol";
10
15
  import {BaseComponent} from "./BaseComponent.sol";
11
16
 
12
17
  contract Product is BaseComponent, IProductComponent {
13
- IProductService private _productService;
14
- address private _pool;
18
+ IProductService internal _productService;
19
+ address internal _pool;
20
+ address internal _distribution;
21
+ Fee internal _initialProductFee;
22
+ Fee internal _initialProcessingFee;
15
23
 
16
24
  constructor(
17
25
  address registry,
18
26
  NftId instanceNftid,
19
27
  address token,
20
- address pool
28
+ address pool,
29
+ address distribution,
30
+ Fee memory productFee,
31
+ Fee memory processingFee
21
32
  ) BaseComponent(registry, instanceNftid, token) {
22
33
  // TODO add validation
23
34
  _productService = _instance.getProductService();
24
35
  _pool = pool;
36
+ _distribution = distribution;
37
+ _initialProductFee = productFee;
38
+ _initialProcessingFee = processingFee;
39
+ }
40
+
41
+
42
+ function calculatePremium(
43
+ uint256 sumInsuredAmount,
44
+ RiskId riskId,
45
+ uint256 lifetime,
46
+ bytes memory applicationData,
47
+ ReferralId referralId,
48
+ NftId bundleNftId
49
+ )
50
+ external
51
+ view
52
+ override
53
+ returns (uint256 premiumAmount)
54
+ {
55
+ (premiumAmount,,,,) = _productService.calculatePremium(
56
+ riskId,
57
+ sumInsuredAmount,
58
+ lifetime,
59
+ applicationData,
60
+ bundleNftId,
61
+ referralId
62
+ );
63
+ }
64
+
65
+
66
+ function calculateNetPremium(
67
+ uint256 sumInsuredAmount,
68
+ RiskId riskId,
69
+ uint256 lifetime,
70
+ bytes memory applicationData
71
+ )
72
+ external
73
+ view
74
+ virtual override
75
+ returns (uint256 netPremiumAmount)
76
+ {
77
+ // default 10% of sum insured
78
+ return sumInsuredAmount / 10;
79
+ }
80
+
81
+ function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
82
+ return RiskIdLib.toRiskId(riskName);
83
+ }
84
+
85
+ function _createRisk(
86
+ RiskId id,
87
+ bytes memory data
88
+ ) internal {
89
+ _productService.createRisk(
90
+ id,
91
+ data
92
+ );
93
+ }
94
+
95
+ function _setRiskInfo(
96
+ RiskId id,
97
+ IRisk.RiskInfo memory info
98
+ ) internal {
99
+ _productService.setRiskInfo(
100
+ id,
101
+ info
102
+ );
103
+ }
104
+
105
+ function _updateRiskState(
106
+ RiskId id,
107
+ StateId state
108
+ ) internal {
109
+ _productService.updateRiskState(
110
+ id,
111
+ state
112
+ );
113
+ }
114
+
115
+ function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
116
+ return _instance.getRiskInfo(id);
25
117
  }
26
118
 
27
119
  function _createApplication(
28
120
  address applicationOwner,
121
+ RiskId riskId,
29
122
  uint256 sumInsuredAmount,
30
- uint256 premiumAmount,
31
123
  uint256 lifetime,
32
- NftId bundleNftId
124
+ bytes memory applicationData,
125
+ NftId bundleNftId,
126
+ ReferralId referralId
33
127
  ) internal returns (NftId nftId) {
34
128
  nftId = _productService.createApplication(
35
129
  applicationOwner,
130
+ riskId,
36
131
  sumInsuredAmount,
37
- premiumAmount,
38
132
  lifetime,
39
- bundleNftId
133
+ applicationData,
134
+ bundleNftId,
135
+ referralId
40
136
  );
41
137
  }
42
138
 
@@ -79,26 +175,35 @@ contract Product is BaseComponent, IProductComponent {
79
175
  return _registry.getNftId(_pool);
80
176
  }
81
177
 
178
+ function getDistributionNftId() external view override returns (NftId distributionNftId) {
179
+ return _registry.getNftId(_distribution);
180
+ }
181
+
82
182
  // from product component
83
183
  function setFees(
84
- Fee memory policyFee,
184
+ Fee memory productFee,
85
185
  Fee memory processingFee
86
186
  )
87
187
  external
88
188
  onlyOwner
89
189
  override
90
190
  {
91
- _productService.setFees(policyFee, processingFee);
191
+ _productService.setFees(productFee, processingFee);
92
192
  }
93
193
 
94
194
 
95
- function getPolicyFee()
195
+ function getProductFee()
96
196
  external
97
197
  view
98
198
  override
99
- returns (Fee memory policyFee)
199
+ returns (Fee memory productFee)
100
200
  {
101
- return _instance.getProductSetup(getNftId()).policyFee;
201
+ NftId productNftId = getNftId();
202
+ if (_instance.hasTreasuryInfo(productNftId)) {
203
+ return _instance.getTreasuryInfo(productNftId).productFee;
204
+ } else {
205
+ return _initialProductFee;
206
+ }
102
207
  }
103
208
 
104
209
  function getProcessingFee()
@@ -107,7 +212,12 @@ contract Product is BaseComponent, IProductComponent {
107
212
  override
108
213
  returns (Fee memory processingFee)
109
214
  {
110
- return _instance.getProductSetup(getNftId()).processingFee;
215
+ NftId productNftId = getNftId();
216
+ if (_instance.hasTreasuryInfo(productNftId)) {
217
+ return _instance.getTreasuryInfo(productNftId).processingFee;
218
+ } else {
219
+ return _initialProcessingFee;
220
+ }
111
221
  }
112
222
 
113
223
  // from registerable
@@ -3,7 +3,6 @@ pragma solidity ^0.8.19;
3
3
 
4
4
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
5
 
6
-
7
6
  import {IVersionable} from "../shared/IVersionable.sol";
8
7
  import {IRegisterable} from "../shared/IRegisterable.sol";
9
8
  import {IOwnable} from "../shared/IOwnable.sol";
@@ -11,21 +10,21 @@ import {RoleId} from "../types/RoleId.sol";
11
10
 
12
11
  import {IAccessModule} from "./module/access/IAccess.sol";
13
12
  import {IBundleModule} from "./module/bundle/IBundle.sol";
14
- import {ICompensationModule} from "./module/compensation/ICompensation.sol";
15
- import {ILifecycleModule} from "./module/lifecycle/ILifecycle.sol";
13
+ import {IDistributionModule} from "./module/distribution/IDistribution.sol";
16
14
  import {IComponentModule} from "./module/component/IComponent.sol";
17
15
  import {IPolicyModule} from "./module/policy/IPolicy.sol";
18
16
  import {IPoolModule} from "./module/pool/IPoolModule.sol";
19
17
  import {IRiskModule} from "./module/risk/IRisk.sol";
20
18
  import {ITreasuryModule} from "./module/treasury/ITreasury.sol";
21
19
 
20
+ import {IKeyValueStore} from "./base/IKeyValueStore.sol";
22
21
  import {IRegistry, IRegistryLinked} from "../registry/IRegistryLinked.sol";
23
- import {IServiceLinked} from "./IServiceLinked.sol";
24
22
 
25
23
  import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
24
+ import {IDistributionService} from "./service/IDistributionService.sol";
26
25
  import {IProductService} from "./service/IProductService.sol";
27
26
  import {IPoolService} from "./service/IPoolService.sol";
28
-
27
+ import {IInstanceBase} from "./base/IInstanceBase.sol";
29
28
 
30
29
  // solhint-disable-next-line no-empty-blocks
31
30
  interface IInstance is
@@ -33,21 +32,22 @@ interface IInstance is
33
32
  IVersionable,
34
33
  IRegisterable,
35
34
  IAccessModule,
36
- ILifecycleModule,
37
35
  IPolicyModule,
38
36
  IPoolModule,
37
+ IRiskModule,
39
38
  IBundleModule,
40
39
  IComponentModule,
41
40
  ITreasuryModule,
42
- ICompensationModule,
43
- IServiceLinked
41
+ IDistributionModule,
42
+ IInstanceBase
44
43
  {
45
- function getRegistry() external view override (IBundleModule, IComponentModule, IPolicyModule, IRegisterable) returns (IRegistry registry);
46
- function hasRole(RoleId role, address member) external view override (IAccessModule, IComponentModule) returns (bool hasRole);
44
+ function getRegistry() external view override (IPolicyModule, IRegisterable) returns (IRegistry registry);
45
+ function getOwner() external view override (IOwnable, IAccessModule) returns(address owner);
47
46
 
48
- function getComponentOwnerService() external view override (IServiceLinked, IComponentModule) returns(IComponentOwnerService);
49
- function getProductService() external view override (IServiceLinked, IBundleModule, IPolicyModule) returns(IProductService);
50
- function getPoolService() external view override (IServiceLinked, IBundleModule, IPoolModule) returns(IPoolService);
47
+ function getKeyValueStore() external view override (IInstanceBase) returns (IKeyValueStore keyValueStore);
48
+ function getComponentOwnerService() external view override (IInstanceBase, IComponentModule) returns(IComponentOwnerService);
49
+ function getDistributionService() external view override returns(IDistributionService);
50
+ function getProductService() external view override (IInstanceBase, IBundleModule, IPolicyModule) returns(IProductService);
51
+ function getPoolService() external view override (IInstanceBase, IBundleModule, IPoolModule) returns(IPoolService);
51
52
 
52
- function getOwner() external view override (IOwnable, IAccessModule) returns(address owner);
53
53
  }
@@ -4,11 +4,10 @@ pragma solidity ^0.8.19;
4
4
  import {NftId} from "../types/NftId.sol";
5
5
  import {RoleId} from "../types/RoleId.sol";
6
6
 
7
- import {InstanceBase} from "./InstanceBase.sol";
7
+ import {InstanceBase} from "./base/InstanceBase.sol";
8
8
  import {AccessModule} from "./module/access/Access.sol";
9
- import {CompensationModule} from "./module/compensation/CompensationModule.sol";
10
- import {LifecycleModule} from "./module/lifecycle/LifecycleModule.sol";
11
9
  import {ComponentModule} from "./module/component/ComponentModule.sol";
10
+ import {DistributionModule} from "./module/distribution/DistributionModule.sol";
12
11
  import {PolicyModule} from "./module/policy/PolicyModule.sol";
13
12
  import {PoolModule} from "./module/pool/PoolModule.sol";
14
13
  import {RiskModule} from "./module/risk/RiskModule.sol";
@@ -22,19 +21,21 @@ import {IBundleModule} from "./module/bundle/IBundle.sol";
22
21
  import {IComponentModule} from "./module/component/IComponent.sol";
23
22
  import {IPoolModule} from "./module/pool/IPoolModule.sol";
24
23
  import {IPolicyModule} from "./module/policy/IPolicy.sol";
25
- import {IServiceLinked} from "./IServiceLinked.sol";
24
+ import {IInstanceBase} from "./base/IInstanceBase.sol";
26
25
 
27
26
  import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
27
+ import {IDistributionService} from "./service/IDistributionService.sol";
28
28
  import {IProductService} from "./service/IProductService.sol";
29
29
  import {IPoolService} from "./service/IPoolService.sol";
30
30
 
31
+ import {IKeyValueStore} from "./base/IKeyValueStore.sol";
32
+
31
33
  contract Instance is
32
34
  InstanceBase,
33
35
  AccessModule,
34
36
  BundleModule,
35
37
  ComponentModule,
36
- CompensationModule,
37
- LifecycleModule,
38
+ DistributionModule,
38
39
  PolicyModule,
39
40
  PoolModule,
40
41
  RiskModule,
@@ -47,20 +48,27 @@ contract Instance is
47
48
  InstanceBase(registry, registryNftId)
48
49
  AccessModule()
49
50
  BundleModule()
51
+ DistributionModule()
50
52
  ComponentModule()
51
53
  PolicyModule()
52
54
  PoolModule()
53
55
  TreasuryModule()
54
56
  {
57
+ initializeBundleModule(_keyValueStore);
58
+ initializeComponentModule(_keyValueStore);
59
+ initializeDistributionModule(_keyValueStore);
60
+ initializePolicyModule(_keyValueStore);
61
+ initializePoolModule(_keyValueStore);
62
+ initializeRiskModule(_keyValueStore);
55
63
  }
56
64
 
57
- function getRegistry() public view override (Registerable, IBundleModule, IComponentModule, IPolicyModule) returns (IRegistry registry) { return super.getRegistry(); }
58
-
59
- function hasRole(RoleId role, address member) public view override (AccessModule, IComponentModule) returns (bool) { return super.hasRole(role, member); }
65
+ function getRegistry() public view override (Registerable, IPolicyModule) returns (IRegistry registry) { return super.getRegistry(); }
66
+ function getKeyValueStore() public view override (InstanceBase) returns (IKeyValueStore keyValueStore) { return super.getKeyValueStore(); }
60
67
 
61
- function getComponentOwnerService() external view override (IComponentModule, IServiceLinked) returns(IComponentOwnerService service) { return _componentOwnerService; }
62
- function getProductService() external view override (IBundleModule, IPolicyModule, IServiceLinked) returns(IProductService service) { return _productService; }
63
- function getPoolService() external view override (IBundleModule, IPoolModule, IServiceLinked) returns(IPoolService service) { return _poolService; }
68
+ function getComponentOwnerService() external view override (IComponentModule, IInstanceBase) returns(IComponentOwnerService service) { return _componentOwnerService; }
69
+ function getDistributionService() external view override (IInstanceBase) returns(IDistributionService service) { return _distributionService; }
70
+ function getProductService() external view override (IBundleModule, IPolicyModule, IInstanceBase) returns(IProductService service) { return _productService; }
71
+ function getPoolService() external view override (IBundleModule, IPoolModule, IInstanceBase) returns(IPoolService service) { return _poolService; }
64
72
 
65
73
  function getOwner() public view override (IAccessModule, Registerable) returns(address owner) { return super.getOwner(); }
66
74
  }
@@ -15,6 +15,7 @@ abstract contract ComponentServiceBase is ServiceBase {
15
15
  NftId registryNftId
16
16
  )
17
17
  ServiceBase(registry, registryNftId)
18
+ // solhint-disable-next-line no-empty-blocks
18
19
  {
19
20
  }
20
21
 
@@ -0,0 +1,22 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {Key32} from "../../types/Key32.sol";
5
+ import {StateId} from "../../types/StateId.sol";
6
+
7
+ import {IKeyValueStore} from "./IKeyValueStore.sol";
8
+ import {IComponentOwnerService} from "../service/IComponentOwnerService.sol";
9
+ import {IDistributionService} from "../service/IDistributionService.sol";
10
+ import {IProductService} from "../service/IProductService.sol";
11
+ import {IPoolService} from "../service/IPoolService.sol";
12
+
13
+ interface IInstanceBase {
14
+ function getKeyValueStore() external view returns (IKeyValueStore keyValueStore);
15
+ function updateState(Key32 key, StateId state) external;
16
+ function getState(Key32 key) external view returns (StateId state);
17
+
18
+ function getComponentOwnerService() external view returns(IComponentOwnerService service);
19
+ function getDistributionService() external view returns(IDistributionService);
20
+ function getProductService() external view returns(IProductService service);
21
+ function getPoolService() external view returns(IPoolService service);
22
+ }
@@ -0,0 +1,50 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {Blocknumber, blockBlocknumber, zeroBlocknumber} from "../../types/Blocknumber.sol";
5
+ import {Key32, KeyId} from "../../types/Key32.sol";
6
+ import {NftId} from "../../types/NftId.sol";
7
+ import {ObjectType} from "../../types/ObjectType.sol";
8
+ import {StateId} from "../../types/StateId.sol";
9
+
10
+ import {ILifecycle} from "./ILifecycle.sol";
11
+
12
+ interface IKeyValueStore is ILifecycle {
13
+
14
+ struct Key {
15
+ ObjectType objectType;
16
+ KeyId id;
17
+ }
18
+
19
+ struct Value {
20
+ Metadata metadata;
21
+ bytes data;
22
+ }
23
+
24
+ struct Metadata {
25
+ ObjectType objectType;
26
+ StateId state;
27
+ address updatedBy;
28
+ Blocknumber updatedIn;
29
+ Blocknumber createdIn;
30
+ }
31
+
32
+ event LogInfoCreated(Key key, StateId state, address createdBy, address txOrigin);
33
+ event LogInfoUpdated(Key key, StateId state, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn);
34
+ event LogStateUpdated(Key key, StateId stateOld, StateId stateNew, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn);
35
+
36
+ // generic state changing functions
37
+ function create(Key32 key, ObjectType objectType, bytes memory data) external;
38
+ function update(Key32 key, StateId state, bytes memory data) external;
39
+ function updateData(Key32 key, bytes memory data) external;
40
+ function updateState(Key32 key, StateId state) external;
41
+
42
+ function exists(Key32 key) external view returns (bool);
43
+ function get(Key32 key) external view returns (Value memory value);
44
+ function getData(Key32 key) external view returns (bytes memory data);
45
+ function getMetadata(Key32 key) external view returns (Metadata memory metadata);
46
+ function getState(Key32 key) external view returns (StateId state);
47
+
48
+ function toKey32(ObjectType objectType, KeyId id) external pure returns(Key32);
49
+ function toKey(Key32 key32) external pure returns(Key memory key);
50
+ }
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {ObjectType} from "../../types/ObjectType.sol";
5
+ import {StateId, toStateId, zeroStateId} from "../../types/StateId.sol";
6
+ import {NftId} from "../../types/NftId.sol";
7
+
8
+ interface ILifecycle {
9
+
10
+ error ErrorNoLifecycle(NftId nftId, ObjectType objectType);
11
+ error ErrorInvalidStateTransition(
12
+ ObjectType objectType,
13
+ StateId fromStateId,
14
+ StateId toStateId
15
+ );
16
+
17
+ function hasLifecycle(
18
+ ObjectType objectType
19
+ ) external view returns (bool);
20
+
21
+ function getInitialState(
22
+ ObjectType objectType
23
+ ) external view returns (StateId);
24
+
25
+ function isValidTransition(
26
+ ObjectType objectType,
27
+ StateId fromId,
28
+ StateId toId
29
+ ) external view returns (bool);
30
+ }
@@ -1,28 +1,35 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.19;
3
3
 
4
- import {Versionable} from "../shared/Versionable.sol";
5
- import {Registerable} from "../shared/Registerable.sol";
6
- // import {IRegistry} from "../registry/IRegistry.sol";
4
+ import {Versionable} from "../../shared/Versionable.sol";
5
+ import {Registerable} from "../../shared/Registerable.sol";
7
6
 
8
- // import {IInstance} from "./IInstance.sol";
9
- import {ObjectType, INSTANCE} from "../types/ObjectType.sol";
10
- import {NftId} from "../types/NftId.sol";
11
- import {Version, VersionPart, VersionLib} from "../types/Version.sol";
7
+ import {ObjectType, INSTANCE} from "../../types/ObjectType.sol";
8
+ import {Key32} from "../../types/Key32.sol";
9
+ import {NftId} from "../../types/NftId.sol";
10
+ import {StateId} from "../../types/StateId.sol";
11
+ import {Version, VersionPart, VersionLib} from "../../types/Version.sol";
12
12
 
13
- import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
14
- import {IProductService} from "./service/IProductService.sol";
15
- import {IPoolService} from "./service/IPoolService.sol";
13
+ import {IComponentOwnerService} from "../service/IComponentOwnerService.sol";
14
+ import {IDistributionService} from "../service/IDistributionService.sol";
15
+ import {IProductService} from "../service/IProductService.sol";
16
+ import {IPoolService} from "../service/IPoolService.sol";
16
17
 
17
- import {IServiceLinked} from "./IServiceLinked.sol";
18
- import {IInstance} from "./IInstance.sol";
18
+ import {IKeyValueStore} from "./IKeyValueStore.sol";
19
+ import {IInstance} from "../IInstance.sol";
20
+ import {IInstanceBase} from "./IInstanceBase.sol";
21
+
22
+ import {KeyValueStore} from "./KeyValueStore.sol";
19
23
 
20
24
  abstract contract InstanceBase is
21
25
  Versionable,
22
26
  Registerable,
23
- IServiceLinked
27
+ IInstanceBase
24
28
  {
29
+ IKeyValueStore internal _keyValueStore;
30
+
25
31
  IComponentOwnerService internal _componentOwnerService;
32
+ IDistributionService internal _distributionService;
26
33
  IProductService internal _productService;
27
34
  IPoolService internal _poolService;
28
35
 
@@ -33,10 +40,22 @@ abstract contract InstanceBase is
33
40
  Registerable(registry, registryNftId)
34
41
  Versionable()
35
42
  {
43
+ _keyValueStore = new KeyValueStore();
44
+
36
45
  _registerInterface(type(IInstance).interfaceId);
37
46
  _linkToServicesInRegistry();
38
47
  }
39
48
 
49
+ function getKeyValueStore() public view virtual override returns (IKeyValueStore keyValueStore) { return _keyValueStore; }
50
+
51
+ function updateState(Key32 key, StateId state) external override {
52
+ _keyValueStore.updateState(key, state);
53
+ }
54
+
55
+ function getState(Key32 key) external view override returns (StateId state) {
56
+ return _keyValueStore.getState(key);
57
+ }
58
+
40
59
  // from versionable
41
60
  function getVersion()
42
61
  public
@@ -57,6 +76,7 @@ abstract contract InstanceBase is
57
76
  function _linkToServicesInRegistry() internal {
58
77
  VersionPart majorVersion = getVersion().toMajorPart();
59
78
  _componentOwnerService = IComponentOwnerService(_getAndCheck("ComponentOwnerService", majorVersion));
79
+ _distributionService = IDistributionService(_getAndCheck("DistributionService", majorVersion));
60
80
  _productService = IProductService(_getAndCheck("ProductService", majorVersion));
61
81
  _poolService = IPoolService(_getAndCheck("PoolService", majorVersion));
62
82
  }