@etherisc/gif-next 0.0.2-e2d8c7d-942 → 0.0.2-e38b7e6-931

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
  2. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +40 -0
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +42 -100
  5. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +40 -0
  7. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  8. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +5 -5
  11. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  12. package/artifacts/contracts/components/Pool.sol/Pool.json +42 -128
  13. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  14. package/artifacts/contracts/components/Product.sol/Product.json +47 -116
  15. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  16. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  17. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  35. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
  36. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  37. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  38. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  39. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  40. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +90 -13
  41. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
  42. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +88 -14
  44. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  45. package/artifacts/contracts/instance/Instance.sol/Instance.json +56 -616
  46. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  47. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +221 -114
  48. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +2 -2
  50. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
  52. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +126 -242
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -126
  56. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  57. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  58. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +114 -13
  60. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -13
  62. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  63. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  64. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  65. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  66. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +59 -16
  68. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  69. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  71. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  72. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  73. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  75. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +235 -37
  76. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +20 -24
  78. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +145 -38
  80. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +17 -21
  82. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +64 -13
  84. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  85. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -13
  86. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +120 -13
  88. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +13 -13
  90. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  91. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +13 -13
  92. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +326 -64
  94. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +51 -23
  96. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +145 -38
  98. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +17 -21
  100. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +151 -44
  102. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +17 -13
  104. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  105. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  106. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  107. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +132 -133
  108. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  109. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +94 -65
  110. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  111. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  112. package/artifacts/contracts/registry/Registry.sol/Registry.json +145 -227
  113. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  114. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  115. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  116. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +30 -128
  117. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  118. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -104
  119. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  120. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +530 -0
  121. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  122. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +14 -27
  123. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  124. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  125. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  126. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  128. package/artifacts/contracts/shared/IService.sol/IService.json +13 -13
  129. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  131. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  132. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  133. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
  134. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  135. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  136. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +1 -1
  137. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  138. package/artifacts/contracts/shared/Service.sol/Service.json +13 -13
  139. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  140. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  141. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  142. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  143. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  144. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +2 -2
  145. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  146. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  147. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  148. package/artifacts/contracts/test/TestService.sol/TestService.json +31 -31
  149. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  150. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  152. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  153. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  154. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  155. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  156. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  157. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  158. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  159. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  160. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  161. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  162. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  164. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  165. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  167. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  169. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  170. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  171. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  173. package/contracts/components/BaseComponent.sol +48 -12
  174. package/contracts/components/Distribution.sol +2 -11
  175. package/contracts/components/IBaseComponent.sol +5 -1
  176. package/contracts/components/IProductComponent.sol +2 -2
  177. package/contracts/components/Pool.sol +5 -18
  178. package/contracts/components/Product.sol +19 -16
  179. package/contracts/instance/IInstance.sol +3 -3
  180. package/contracts/instance/IInstanceBase.sol +0 -1
  181. package/contracts/instance/IInstanceService.sol +9 -3
  182. package/contracts/instance/Instance.sol +12 -214
  183. package/contracts/instance/InstanceAccessManager.sol +92 -77
  184. package/contracts/instance/InstanceBase.sol +0 -2
  185. package/contracts/instance/InstanceService.sol +118 -72
  186. package/contracts/instance/InstanceServiceManager.sol +5 -8
  187. package/contracts/instance/base/ComponentServiceBase.sol +78 -12
  188. package/contracts/instance/base/IInstanceBase.sol +0 -2
  189. package/contracts/instance/module/IAccess.sol +27 -17
  190. package/contracts/instance/service/BundleService.sol +39 -5
  191. package/contracts/instance/service/BundleServiceManager.sol +5 -8
  192. package/contracts/instance/service/DistributionService.sol +33 -36
  193. package/contracts/instance/service/DistributionServiceManager.sol +6 -9
  194. package/contracts/instance/service/IBundleService.sol +5 -6
  195. package/contracts/instance/service/IPolicyService.sol +7 -0
  196. package/contracts/instance/service/PolicyService.sol +65 -34
  197. package/contracts/instance/service/PoolService.sol +46 -28
  198. package/contracts/instance/service/PoolServiceManager.sol +5 -8
  199. package/contracts/instance/service/ProductService.sol +66 -30
  200. package/contracts/registry/ChainNft.sol +1 -1
  201. package/contracts/registry/IRegistry.sol +26 -16
  202. package/contracts/registry/IRegistryService.sol +13 -5
  203. package/contracts/registry/Registry.sol +149 -201
  204. package/contracts/registry/RegistryAccessManager.sol +210 -0
  205. package/contracts/registry/RegistryService.sol +50 -88
  206. package/contracts/registry/RegistryServiceManager.sol +18 -36
  207. package/contracts/registry/ReleaseManager.sol +342 -0
  208. package/contracts/registry/TokenRegistry.sol +5 -6
  209. package/contracts/shared/IRegisterable.sol +0 -2
  210. package/contracts/shared/IService.sol +2 -1
  211. package/contracts/shared/ProxyManager.sol +1 -1
  212. package/contracts/shared/Service.sol +10 -7
  213. package/contracts/test/TestService.sol +3 -2
  214. package/contracts/types/RoleId.sol +10 -12
  215. package/package.json +1 -1
  216. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
  217. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
  218. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  219. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
  220. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  221. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -466
  222. package/contracts/instance/IAccessManagerSimple.sol +0 -391
  223. package/contracts/instance/service/ComponentOwnerService.sol +0 -317
  224. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
@@ -6,7 +6,7 @@ import {ProxyManager} from "../../shared/ProxyManager.sol";
6
6
  import {BundleService} from "./BundleService.sol";
7
7
  import {Registry} from "../../registry/Registry.sol";
8
8
  import {RegistryService} from "../../registry/RegistryService.sol";
9
- import {VersionLib} from "../../types/Version.sol";
9
+ import {ObjectType, REGISTRY} from "../../types/ObjectType.sol";
10
10
 
11
11
  contract BundleServiceManager is ProxyManager {
12
12
 
@@ -26,10 +26,10 @@ contract BundleServiceManager is ProxyManager {
26
26
 
27
27
  _bundleService = BundleService(address(versionable));
28
28
 
29
- Registry registry = Registry(registryAddress);
30
- address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
31
- RegistryService registryService = RegistryService(registryServiceAddress);
32
- // TODO this must have a role or own nft to register service
29
+ // TODO `this` must have a role or own nft to register service
30
+ //Registry registry = Registry(registryAddress);
31
+ //address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _bundleService.getMajorVersion());
32
+ //RegistryService registryService = RegistryService(registryServiceAddress);
33
33
  //registryService.registerService(_poolService);
34
34
 
35
35
  // TODO no nft to link yet
@@ -37,9 +37,6 @@ contract BundleServiceManager is ProxyManager {
37
37
  //_linkToNftOwnable(
38
38
  // address(registryAddress),
39
39
  // address(_poolService));
40
-
41
- // implies that after this constructor call only upgrade functionality is available
42
- _isDeployed = true;
43
40
  }
44
41
 
45
42
  //--- view functions ----------------------------------------------------//
@@ -2,17 +2,16 @@
2
2
  pragma solidity ^0.8.19;
3
3
 
4
4
  import {IRegistry} from "../../registry/IRegistry.sol";
5
- import {IRegistryService} from "../../registry/IRegistryService.sol";
6
5
  import {IInstance} from "../../instance/IInstance.sol";
6
+ import {InstanceAccessManager} from "../InstanceAccessManager.sol";
7
7
  import {InstanceReader} from "../../instance/InstanceReader.sol";
8
8
  import {ISetup} from "../../instance/module/ISetup.sol";
9
- import {ITreasury} from "../../instance/module/ITreasury.sol";
10
9
 
11
10
  import {NftId, NftIdLib} from "../../types/NftId.sol";
12
11
  import {Fee} from "../../types/Fee.sol";
13
12
  import {DISTRIBUTION_OWNER_ROLE} from "../../types/RoleId.sol";
14
13
  import {KEEP_STATE} from "../../types/StateId.sol";
15
- import {DISTRIBUTION} from "../../types/ObjectType.sol";
14
+ import {ObjectType, DISTRIBUTION} from "../../types/ObjectType.sol";
16
15
  import {Version, VersionLib} from "../../types/Version.sol";
17
16
 
18
17
  import {IVersionable} from "../../shared/IVersionable.sol";
@@ -21,14 +20,10 @@ import {Versionable} from "../../shared/Versionable.sol";
21
20
  import {IService} from "../../shared/IService.sol";
22
21
  import {Service} from "../../shared/Service.sol";
23
22
  import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
24
- import {IDistributionService} from "./IDistributionService.sol";
25
- import {Distribution} from "../../components/Distribution.sol";
26
23
  import {InstanceService} from "../InstanceService.sol";
27
- import {Instance} from "../Instance.sol";
28
- import {INftOwnable} from "../../shared/INftOwnable.sol";
24
+ import {IDistributionService} from "./IDistributionService.sol";
29
25
  import {IBaseComponent} from "../../components/IBaseComponent.sol";
30
26
 
31
- string constant DISTRIBUTION_SERVICE_NAME = "DistributionService";
32
27
 
33
28
  contract DistributionService is
34
29
  ComponentServiceBase,
@@ -36,8 +31,6 @@ contract DistributionService is
36
31
  {
37
32
  using NftIdLib for NftId;
38
33
 
39
- string public constant NAME = "DistributionService";
40
-
41
34
  address internal _registryAddress;
42
35
 
43
36
  function _initialize(
@@ -58,43 +51,47 @@ contract DistributionService is
58
51
  _registerInterface(type(IDistributionService).interfaceId);
59
52
  }
60
53
 
61
-
62
- function getName() public pure override(IService, Service) returns(string memory name) {
63
- return NAME;
54
+ function getDomain() public pure override(Service, IService) returns(ObjectType) {
55
+ return DISTRIBUTION();
64
56
  }
65
57
 
66
58
  function register(address distributionAddress)
67
59
  external
68
60
  returns(NftId distributionNftId)
69
61
  {
70
- address distributionOwner = msg.sender;
71
- IBaseComponent distribution = IBaseComponent(distributionAddress);
72
-
73
- IRegistry.ObjectInfo memory info;
74
- bytes memory data;
75
- (info, data) = getRegistryService().registerDistribution(distribution, distributionOwner);
76
-
77
- IInstance instance = _getInstance(info);
78
-
79
- bool hasRole = getInstanceService().hasRole(
80
- distributionOwner,
81
- DISTRIBUTION_OWNER_ROLE(),
82
- address(instance));
83
-
84
- if(!hasRole) {
85
- revert ExpectedRoleMissing(DISTRIBUTION_OWNER_ROLE(), distributionOwner);
86
- }
87
-
88
- distributionNftId = info.nftId;
89
- ISetup.DistributionSetupInfo memory initialSetup = _decodeAndVerifyDistributionSetup(data);
62
+ (
63
+ IBaseComponent distribution,
64
+ address owner,
65
+ IInstance instance,
66
+ NftId instanceNftId
67
+ ) = _checkComponentForRegistration(
68
+ distributionAddress,
69
+ DISTRIBUTION(),
70
+ DISTRIBUTION_OWNER_ROLE());
71
+
72
+ (
73
+ IRegistry.ObjectInfo memory distributionInfo,
74
+ bytes memory data
75
+ ) = getRegistryService().registerDistribution(distribution, owner);
76
+ distribution.linkToRegisteredNftId();
77
+ distributionNftId = distributionInfo.nftId;
78
+
79
+ (
80
+ string memory name,
81
+ ISetup.DistributionSetupInfo memory initialSetup
82
+ ) = _decodeAndVerifyDistributionData(data);
90
83
  instance.createDistributionSetup(distributionNftId, initialSetup);
84
+
85
+ getInstanceService().createTarget(instanceNftId, distributionAddress, name);
91
86
  }
92
87
 
93
- function _decodeAndVerifyDistributionSetup(bytes memory data) internal returns(ISetup.DistributionSetupInfo memory setup)
88
+ function _decodeAndVerifyDistributionData(bytes memory data)
89
+ internal
90
+ returns(string memory name, ISetup.DistributionSetupInfo memory setup)
94
91
  {
95
- setup = abi.decode(
92
+ (name, setup) = abi.decode(
96
93
  data,
97
- (ISetup.DistributionSetupInfo)
94
+ (string, ISetup.DistributionSetupInfo)
98
95
  );
99
96
 
100
97
  // TODO add checks if applicable
@@ -6,7 +6,7 @@ import {ProxyManager} from "../../shared/ProxyManager.sol";
6
6
  import {DistributionService} from "./DistributionService.sol";
7
7
  import {Registry} from "../../registry/Registry.sol";
8
8
  import {RegistryService} from "../../registry/RegistryService.sol";
9
- import {VersionLib} from "../../types/Version.sol";
9
+ import {REGISTRY} from "../../types/ObjectType.sol";
10
10
 
11
11
  contract DistributionServiceManager is ProxyManager {
12
12
 
@@ -25,11 +25,11 @@ contract DistributionServiceManager is ProxyManager {
25
25
  data);
26
26
 
27
27
  _distributionService = DistributionService(address(versionable));
28
-
29
- Registry registry = Registry(registryAddress);
30
- address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
31
- RegistryService registryService = RegistryService(registryServiceAddress);
32
- // TODO this must have a role or own nft to register service
28
+
29
+ // TODO `thi` must have a role or own nft to register service
30
+ //Registry registry = Registry(registryAddress);
31
+ //address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _distributionService.getMajorVersion());
32
+ //RegistryService registryService = RegistryService(registryServiceAddress);
33
33
  //registryService.registerService(_distributionService);
34
34
 
35
35
  // TODO no nft to link yet
@@ -37,9 +37,6 @@ contract DistributionServiceManager is ProxyManager {
37
37
  //_linkToNftOwnable(
38
38
  // address(registryAddress),
39
39
  // address(_distributionService));
40
-
41
- // implies that after this constructor call only upgrade functionality is available
42
- _isDeployed = true;
43
40
  }
44
41
 
45
42
  //--- view functions ----------------------------------------------------//
@@ -26,12 +26,11 @@ interface IBundleService is IService {
26
26
 
27
27
  function updateBundle(NftId instanceNftId, NftId bundleNftId, IBundle.BundleInfo memory bundleInfo, StateId state) external;
28
28
 
29
- function underwritePolicy(IInstance instanceNftId,
30
- NftId policyNftId,
31
- NftId bundleNftId,
32
- uint256 collateralAmount,
33
- uint256 netPremium
34
- ) external;
29
+ function underwritePolicy(IInstance instanceNftId, NftId policyNftId, NftId bundleNftId, uint256 collateralAmount, uint256 netPremium) external;
30
+
31
+ function increaseBalance(IInstance instance, NftId bundleNftId, uint256 amount) external;
32
+
33
+ function closePolicy(IInstance instance, NftId policyNftId, NftId bundleNftId, uint256 collateralAmount) external;
35
34
 
36
35
  // function fundBundle(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
37
36
 
@@ -15,6 +15,13 @@ import {Fee} from "../../types/Fee.sol";
15
15
  interface IPolicyService is IService {
16
16
 
17
17
  error ErrorIPolicyServiceInsufficientAllowance(address customer, address tokenHandlerAddress, uint256 amount);
18
+ error ErrorIPolicyServicePremiumAlreadyPaid(NftId policyNftId, uint256 premiumPaidAmount);
19
+ error ErrorIPolicyServicePolicyNotActivated(NftId policyNftId);
20
+ error ErrorIPolicyServicePolicyAlreadyClosed(NftId policyNftId);
21
+ error ErrorIPolicyServicePolicyNotActive(NftId policyNftId, StateId state);
22
+ error ErrorIPolicyServicePremiumNotFullyPaid(NftId policyNftId, uint256 premiumAmount, uint256 premiumPaidAmount);
23
+ error ErrorIPolicyServiceOpenClaims(NftId policyNftId, uint16 openClaimsCount);
24
+ error ErrorIPolicyServicePolicyHasNotExpired(NftId policyNftId, Timestamp expiredAt);
18
25
 
19
26
  function calculatePremium(
20
27
  RiskId riskId,
@@ -20,11 +20,11 @@ import {TokenHandler} from "../../shared/TokenHandler.sol";
20
20
  import {IVersionable} from "../../shared/IVersionable.sol";
21
21
  import {Versionable} from "../../shared/Versionable.sol";
22
22
 
23
- import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
23
+ import {Timestamp, TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
24
24
  import {UFixed, UFixedLib} from "../../types/UFixed.sol";
25
25
  import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
26
- import {ObjectType, INSTANCE, PRODUCT, POLICY} from "../../types/ObjectType.sol";
27
- import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
26
+ import {ObjectType, INSTANCE, PRODUCT, POOL, POLICY, BUNDLE} from "../../types/ObjectType.sol";
27
+ import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE, CLOSED} from "../../types/StateId.sol";
28
28
  import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
29
29
  import {Fee, FeeLib} from "../../types/Fee.sol";
30
30
  import {ReferralId} from "../../types/Referral.sol";
@@ -40,15 +40,11 @@ import {IPolicyService} from "./IPolicyService.sol";
40
40
  import {InstanceReader} from "../InstanceReader.sol";
41
41
  import {IPoolService} from "./IPoolService.sol";
42
42
  import {IBundleService} from "./IBundleService.sol";
43
- import {POOL_SERVICE_NAME} from "./PoolService.sol";
44
- import {BUNDLE_SERVICE_NAME} from "./BundleService.sol";
45
43
 
46
- string constant POLICY_SERVICE_NAME = "PolicyService";
47
44
 
48
45
  contract PolicyService is ComponentServiceBase, IPolicyService {
49
46
  using NftIdLib for NftId;
50
-
51
- string public constant NAME = "PolicyService";
47
+ using TimestampLib for Timestamp;
52
48
 
53
49
  IPoolService internal _poolService;
54
50
  IBundleService internal _bundleService;
@@ -69,15 +65,15 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
69
65
 
70
66
  _initializeService(registryAddress, owner);
71
67
 
72
- _poolService = IPoolService(_registry.getServiceAddress(POOL_SERVICE_NAME, getMajorVersion()));
73
- _bundleService = IBundleService(_registry.getServiceAddress(BUNDLE_SERVICE_NAME, getMajorVersion()));
68
+ _poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
69
+ _bundleService = IBundleService(_registry.getServiceAddress(BUNDLE(), getMajorVersion()));
74
70
 
75
71
  _registerInterface(type(IPolicyService).interfaceId);
76
72
  }
77
73
 
78
74
 
79
- function getName() public pure override(IService, Service) returns(string memory name) {
80
- return NAME;
75
+ function getDomain() public pure override(IService, Service) returns(ObjectType) {
76
+ return POLICY();
81
77
  }
82
78
 
83
79
 
@@ -86,7 +82,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
86
82
  (productInfo,) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
87
83
  product = Product(productInfo.objectAddress);
88
84
  }
89
- // TODO no access restrictions
85
+ // TODO: no access restrictions
90
86
  function calculatePremium(
91
87
  RiskId riskId,
92
88
  uint256 sumInsuredAmount,
@@ -184,7 +180,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
184
180
  ReferralId referralId
185
181
  ) external override returns (NftId policyNftId) {
186
182
  (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
187
- // TODO add validations (see create bundle in pool service)
183
+ // TODO: add validations (see create bundle in pool service)
188
184
 
189
185
  policyNftId = getRegistryService().registerPolicy(
190
186
  IRegistry.ObjectInfo(
@@ -229,7 +225,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
229
225
  instance.createPolicy(policyNftId, policyInfo);
230
226
  instance.updatePolicyState(policyNftId, APPLIED());
231
227
 
232
- // TODO add logging
228
+ // TODO: add logging
233
229
  }
234
230
 
235
231
  function _getAndVerifyUnderwritingSetup(
@@ -389,7 +385,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
389
385
  }
390
386
  }
391
387
 
392
- // TODO add logging
388
+ // TODO: add logging
393
389
  }
394
390
 
395
391
  function calculateRequiredCollateral(UFixed collateralizationLevel, uint256 sumInsuredAmount) public pure override returns(uint256 collateralAmount) {
@@ -402,28 +398,30 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
402
398
  // check caller is registered product
403
399
  (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
404
400
  InstanceReader instanceReader = instance.getInstanceReader();
401
+ IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
405
402
 
406
- // TODO: check if not paid
407
- // TODO: transfer premium
408
- // TODO: optionally activate
403
+ if (policyInfo.premiumPaidAmount == policyInfo.premiumAmount) {
404
+ revert ErrorIPolicyServicePremiumAlreadyPaid(policyNftId, policyInfo.premiumPaidAmount);
405
+ }
409
406
 
410
- // // perform actual token transfers (this code is probably not complete)
411
- // IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
412
-
413
- // uint256 premiumAmount = policyInfo.premiumAmount;
414
- // _processPremiumByTreasury(instance, productInfo.nftId, policyNftId, premiumAmount);
407
+ uint256 unpaidPremiumAmount = policyInfo.premiumAmount - policyInfo.premiumPaidAmount;
415
408
 
416
- // // policy level book keeping for premium paid
417
- // policyInfo.premiumPaidAmount += premiumAmount;
409
+ uint256 netPremiumAmount = _processPremiumByTreasury(
410
+ instance,
411
+ productInfo.nftId,
412
+ policyNftId,
413
+ unpaidPremiumAmount);
418
414
 
419
- // instance.updatePolicy(policyNftId, policyInfo, KEEP_STATE());
415
+ policyInfo.premiumPaidAmount += unpaidPremiumAmount;
420
416
 
421
- // // optional activation of policy
422
- // if(activateAt > zeroTimestamp()) {
423
- // activate(policyNftId, activateAt);
424
- // }
417
+ _bundleService.increaseBalance(instance, policyInfo.bundleNftId, netPremiumAmount);
418
+ instance.updatePolicy(policyNftId, policyInfo, KEEP_STATE());
425
419
 
426
- // TODO add logging
420
+ if(activateAt.gtz() && policyInfo.activatedAt.eqz()) {
421
+ activate(policyNftId, activateAt);
422
+ }
423
+
424
+ // TODO: add logging
427
425
  }
428
426
 
429
427
  function activate(NftId policyNftId, Timestamp activateAt) public override {
@@ -442,14 +440,47 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
442
440
 
443
441
  instance.updatePolicy(policyNftId, policyInfo, ACTIVE());
444
442
 
445
- // TODO add logging
443
+ // TODO: add logging
446
444
  }
447
445
 
448
446
  function close(
449
447
  NftId policyNftId
450
448
  ) external override // solhint-disable-next-line no-empty-blocks
451
449
  {
450
+ (, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
451
+ InstanceReader instanceReader = instance.getInstanceReader();
452
+
453
+ IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
454
+
455
+ if (policyInfo.activatedAt.eqz()) {
456
+ revert ErrorIPolicyServicePolicyNotActivated(policyNftId);
457
+ }
458
+
459
+ StateId state = instanceReader.getPolicyState(policyNftId);
460
+ if (state != ACTIVE()) {
461
+ revert ErrorIPolicyServicePolicyNotActive(policyNftId, state);
462
+ }
463
+
464
+ if (policyInfo.closedAt.gtz()) {
465
+ revert ErrorIPolicyServicePolicyAlreadyClosed(policyNftId);
466
+ }
467
+
468
+ if (policyInfo.premiumAmount != policyInfo.premiumPaidAmount) {
469
+ revert ErrorIPolicyServicePremiumNotFullyPaid(policyNftId, policyInfo.premiumAmount, policyInfo.premiumPaidAmount);
470
+ }
471
+
472
+ if (policyInfo.openClaimsCount > 0) {
473
+ revert ErrorIPolicyServiceOpenClaims(policyNftId, policyInfo.openClaimsCount);
474
+ }
475
+
476
+ if (TimestampLib.blockTimestamp().lte(policyInfo.expiredAt) && (policyInfo.payoutAmount < policyInfo.sumInsuredAmount)) {
477
+ revert ErrorIPolicyServicePolicyHasNotExpired(policyNftId, policyInfo.expiredAt);
478
+ }
479
+
480
+ policyInfo.closedAt = TimestampLib.blockTimestamp();
452
481
 
482
+ _bundleService.closePolicy(instance, policyNftId, policyInfo.bundleNftId, policyInfo.sumInsuredAmount);
483
+ instance.updatePolicy(policyNftId, policyInfo, CLOSED());
453
484
  }
454
485
 
455
486
  function _getPoolNftId(
@@ -503,6 +534,6 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
503
534
  }
504
535
  }
505
536
 
506
- // TODO add logging
537
+ // TODO: add logging
507
538
  }
508
539
  }
@@ -14,7 +14,7 @@ import {Versionable} from "../../shared/Versionable.sol";
14
14
  import {INftOwnable} from "../../shared/INftOwnable.sol";
15
15
 
16
16
  import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
17
- import {POOL, BUNDLE} from "../../types/ObjectType.sol";
17
+ import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
18
18
  import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
19
19
  import {Fee, FeeLib} from "../../types/Fee.sol";
20
20
  import {Version, VersionLib} from "../../types/Version.sol";
@@ -39,8 +39,6 @@ contract PoolService is
39
39
  {
40
40
  using NftIdLib for NftId;
41
41
 
42
- string public constant NAME = "PoolService";
43
-
44
42
  address internal _registryAddress;
45
43
 
46
44
  function _initialize(
@@ -61,45 +59,65 @@ contract PoolService is
61
59
  _registerInterface(type(IPoolService).interfaceId);
62
60
  }
63
61
 
64
- function getName() public pure override(Service, IService) returns(string memory name) {
65
- return NAME;
62
+ function getDomain() public pure override(Service, IService) returns(ObjectType) {
63
+ return POOL();
66
64
  }
67
65
 
68
66
  function register(address poolAddress)
69
67
  external
70
68
  returns(NftId poolNftId)
71
69
  {
72
- address poolOwner = msg.sender;
73
- IBaseComponent pool = IBaseComponent(poolAddress);
70
+ (
71
+ IBaseComponent pool,
72
+ address owner,
73
+ IInstance instance,
74
+ NftId instanceNftId
75
+ ) = _checkComponentForRegistration(
76
+ poolAddress,
77
+ POOL(),
78
+ POOL_OWNER_ROLE());
79
+
80
+ (
81
+ IRegistry.ObjectInfo memory poolInfo,
82
+ bytes memory data
83
+ ) = getRegistryService().registerPool(pool, owner);
84
+ pool.linkToRegisteredNftId();
85
+ poolNftId = poolInfo.nftId;
86
+
87
+ (
88
+ string memory name,
89
+ ISetup.PoolSetupInfo memory initialSetup
90
+ ) = _decodeAndVerifyPoolData(data);
91
+ instance.createPoolSetup(poolNftId, initialSetup);
74
92
 
75
- IRegistry.ObjectInfo memory info;
76
- bytes memory data;
77
- (info, data) = getRegistryService().registerPool(pool, poolOwner);
93
+ getInstanceService().createTarget(instanceNftId, poolAddress, name);
94
+ }
78
95
 
79
- IInstance instance = _getInstance(info);
96
+ function _decodeAndVerifyPoolData(bytes memory data)
97
+ internal
98
+ returns(string memory name, ISetup.PoolSetupInfo memory setup)
99
+ {
100
+ (name, setup) = abi.decode(
101
+ data,
102
+ (string, ISetup.PoolSetupInfo)
103
+ );
80
104
 
81
- bool hasRole = getInstanceService().hasRole(
82
- poolOwner,
83
- POOL_OWNER_ROLE(),
84
- address(instance));
105
+ // TODO add checks
106
+ /*IRegistry _registry = getRegistry();
85
107
 
86
- if(!hasRole) {
87
- revert ExpectedRoleMissing(POOL_OWNER_ROLE(), poolOwner);
108
+ if(wallet == address(0)) {
109
+ revert WalletIsZero();
88
110
  }
89
111
 
90
- poolNftId = info.nftId;
91
- ISetup.PoolSetupInfo memory initialSetup = _decodeAndVerifyPoolSetup(data);
92
- instance.createPoolSetup(poolNftId, initialSetup);
93
- }
112
+ ObjectType tokenType = _registry.getObjectInfo(address(token)).objectType;
94
113
 
95
- function _decodeAndVerifyPoolSetup(bytes memory data) internal returns(ISetup.PoolSetupInfo memory setup)
96
- {
97
- setup = abi.decode(
98
- data,
99
- (ISetup.PoolSetupInfo)
100
- );
114
+ if(tokenType != TOKEN()) {
115
+ revert InvalidToken();
116
+ }
101
117
 
102
- // TODO add checks if applicable
118
+ if(UFixedLib.eqz(info.collateralizationLevel)) {
119
+ revert CollateralizationLevelIsZero();
120
+ }*/
103
121
  }
104
122
 
105
123
  function setFees(
@@ -6,7 +6,7 @@ import {ProxyManager} from "../../shared/ProxyManager.sol";
6
6
  import {PoolService} from "./PoolService.sol";
7
7
  import {Registry} from "../../registry/Registry.sol";
8
8
  import {RegistryService} from "../../registry/RegistryService.sol";
9
- import {VersionLib} from "../../types/Version.sol";
9
+ import {REGISTRY} from "../../types/ObjectType.sol";
10
10
 
11
11
  contract PoolServiceManager is ProxyManager {
12
12
 
@@ -26,10 +26,10 @@ contract PoolServiceManager is ProxyManager {
26
26
 
27
27
  _poolService = PoolService(address(versionable));
28
28
 
29
- Registry registry = Registry(registryAddress);
30
- address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
31
- RegistryService registryService = RegistryService(registryServiceAddress);
32
- // TODO this must have a role or own nft to register service
29
+ // TODO `this` must have a role or own nft to register service
30
+ //Registry registry = Registry(registryAddress);
31
+ //address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _poolService.getMajorVersion());
32
+ //RegistryService registryService = RegistryService(registryServiceAddress);
33
33
  //registryService.registerService(_poolService);
34
34
 
35
35
  // TODO no nft to link yet
@@ -37,9 +37,6 @@ contract PoolServiceManager is ProxyManager {
37
37
  //_linkToNftOwnable(
38
38
  // address(registryAddress),
39
39
  // address(_poolService));
40
-
41
- // implies that after this constructor call only upgrade functionality is available
42
- _isDeployed = true;
43
40
  }
44
41
 
45
42
  //--- view functions ----------------------------------------------------//