@etherisc/gif-next 0.0.2-72ddf14-012 → 0.0.2-740f9b7-891

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +63 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  3. package/artifacts/contracts/components/Component.sol/Component.json +656 -0
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +318 -87
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
  7. package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → components/IComponent.sol/IComponent.json} +171 -158
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +496 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +522 -58
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +596 -5
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +306 -174
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +329 -99
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  36. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  38. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  39. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +764 -0
  40. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
  41. package/artifacts/contracts/instance/{AccessManagedSimple.sol/AccessManagedSimple.json → Cloneable.sol/Cloneable.json} +86 -2
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +988 -22
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +125 -19
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +176 -669
  48. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +231 -114
  50. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +75 -82
  52. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +275 -167
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +41 -76
  56. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  57. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +261 -0
  58. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
  59. package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +124 -61
  60. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  63. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +59 -16
  66. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  68. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  69. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  71. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  72. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +4 -0
  73. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +1102 -0
  74. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  75. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +449 -0
  76. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +149 -93
  78. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +29 -36
  80. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
  81. package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IBundleService.sol/IBundleService.json} +295 -46
  82. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -18
  84. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +766 -0
  86. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +15 -82
  88. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +17 -225
  90. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
  91. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +1227 -0
  92. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  93. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +505 -0
  94. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +148 -181
  96. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +29 -40
  98. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +150 -340
  100. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +29 -40
  102. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  103. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  104. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  105. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +227 -129
  106. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  107. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +127 -93
  108. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  109. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  110. package/artifacts/contracts/registry/Registry.sol/Registry.json +240 -223
  111. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  112. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  113. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  114. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +68 -161
  115. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  116. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +51 -100
  117. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  118. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
  119. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  120. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +13 -29
  121. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  122. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  123. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  124. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  125. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -5
  126. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IService.sol/IService.json +13 -18
  128. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  129. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +19 -6
  131. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  132. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +19 -6
  133. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  134. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +19 -11
  135. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  136. package/artifacts/contracts/shared/Service.sol/Service.json +26 -18
  137. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  138. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  139. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  140. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  141. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  142. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +19 -11
  143. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  144. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  145. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  146. package/artifacts/contracts/test/TestService.sol/TestService.json +44 -36
  147. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  148. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  149. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  150. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  151. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  152. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  153. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  154. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  155. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  156. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  157. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  158. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  159. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +26 -3
  160. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  161. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  162. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  164. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  165. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  166. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  167. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  169. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  170. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  171. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  172. package/contracts/components/Component.sol +216 -0
  173. package/contracts/components/Distribution.sol +43 -49
  174. package/contracts/components/IComponent.sol +43 -0
  175. package/contracts/components/IDistributionComponent.sol +5 -2
  176. package/contracts/components/IPoolComponent.sol +7 -18
  177. package/contracts/components/IProductComponent.sol +7 -3
  178. package/contracts/components/Pool.sol +61 -95
  179. package/contracts/components/Product.sol +69 -87
  180. package/contracts/instance/BundleManager.sol +125 -0
  181. package/contracts/instance/Cloneable.sol +46 -0
  182. package/contracts/instance/IInstance.sol +31 -7
  183. package/contracts/instance/IInstanceService.sol +15 -4
  184. package/contracts/instance/Instance.sol +60 -234
  185. package/contracts/instance/InstanceAccessManager.sol +88 -78
  186. package/contracts/instance/InstanceReader.sol +12 -25
  187. package/contracts/instance/InstanceService.sol +339 -99
  188. package/contracts/instance/InstanceServiceManager.sol +5 -8
  189. package/contracts/instance/ObjectManager.sol +84 -0
  190. package/contracts/instance/base/ComponentService.sol +134 -0
  191. package/contracts/instance/module/IAccess.sol +27 -17
  192. package/contracts/instance/module/ISetup.sol +3 -1
  193. package/contracts/instance/service/BundleService.sol +293 -0
  194. package/contracts/instance/service/BundleServiceManager.sol +51 -0
  195. package/contracts/instance/service/DistributionService.sol +43 -25
  196. package/contracts/instance/service/DistributionServiceManager.sol +6 -9
  197. package/contracts/instance/service/IBundleService.sol +44 -0
  198. package/contracts/instance/service/IPolicyService.sol +94 -0
  199. package/contracts/instance/service/IPoolService.sol +6 -23
  200. package/contracts/instance/service/IProductService.sol +3 -70
  201. package/contracts/instance/service/PolicyService.sol +538 -0
  202. package/contracts/instance/service/PolicyServiceManager.sol +54 -0
  203. package/contracts/instance/service/PoolService.sol +37 -121
  204. package/contracts/instance/service/PoolServiceManager.sol +5 -8
  205. package/contracts/instance/service/ProductService.sol +125 -434
  206. package/contracts/registry/ChainNft.sol +1 -1
  207. package/contracts/registry/IRegistry.sol +36 -17
  208. package/contracts/registry/IRegistryService.sol +28 -13
  209. package/contracts/registry/Registry.sol +217 -209
  210. package/contracts/registry/RegistryAccessManager.sol +216 -0
  211. package/contracts/registry/RegistryService.sol +61 -157
  212. package/contracts/registry/RegistryServiceManager.sol +18 -36
  213. package/contracts/registry/ReleaseManager.sol +332 -0
  214. package/contracts/registry/TokenRegistry.sol +8 -7
  215. package/contracts/shared/IRegisterable.sol +1 -3
  216. package/contracts/shared/IService.sol +2 -1
  217. package/contracts/shared/NftOwnable.sol +5 -0
  218. package/contracts/shared/ProxyManager.sol +1 -1
  219. package/contracts/shared/Registerable.sol +10 -14
  220. package/contracts/shared/Service.sol +13 -8
  221. package/contracts/test/TestService.sol +3 -2
  222. package/contracts/types/NftIdSet.sol +26 -24
  223. package/contracts/types/RoleId.sol +10 -10
  224. package/package.json +1 -1
  225. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  226. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -327
  227. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  228. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -280
  229. package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +0 -4
  230. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +0 -4
  231. package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +0 -1132
  232. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
  233. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
  234. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  235. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  236. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
  237. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  238. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
  239. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  240. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
  241. package/contracts/components/BaseComponent.sol +0 -91
  242. package/contracts/components/IBaseComponent.sol +0 -25
  243. package/contracts/instance/AccessManagedSimple.sol +0 -115
  244. package/contracts/instance/AccessManagerSimple.sol +0 -692
  245. package/contracts/instance/IAccessManagerSimple.sol +0 -391
  246. package/contracts/instance/base/ComponentServiceBase.sol +0 -124
  247. package/contracts/instance/base/IInstanceBase.sol +0 -23
  248. package/contracts/instance/service/ComponentOwnerService.sol +0 -317
  249. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
  250. package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -4,6 +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 {IComponent} from "../../components/IComponent.sol";
7
8
  import {IPoolComponent} from "../../components/IPoolComponent.sol";
8
9
  import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
9
10
  import {IInstance} from "../IInstance.sol";
@@ -22,7 +23,7 @@ import {Versionable} from "../../shared/Versionable.sol";
22
23
  import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
23
24
  import {UFixed, UFixedLib} from "../../types/UFixed.sol";
24
25
  import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
25
- import {ObjectType, INSTANCE, PRODUCT, POLICY} from "../../types/ObjectType.sol";
26
+ import {ObjectType, PRODUCT, POOL, POLICY} from "../../types/ObjectType.sol";
26
27
  import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
27
28
  import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
28
29
  import {Fee, FeeLib} from "../../types/Fee.sol";
@@ -30,22 +31,20 @@ import {ReferralId} from "../../types/Referral.sol";
30
31
  import {RiskId} from "../../types/RiskId.sol";
31
32
  import {StateId} from "../../types/StateId.sol";
32
33
  import {Version, VersionLib} from "../../types/Version.sol";
34
+ import {RoleId, PRODUCT_OWNER_ROLE} from "../../types/RoleId.sol";
33
35
 
34
36
  import {IService} from "../../shared/IService.sol";
35
37
  import {Service} from "../../shared/Service.sol";
36
- import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
38
+ import {ComponentService} from "../base/ComponentService.sol";
37
39
  import {IProductService} from "./IProductService.sol";
38
40
  import {InstanceReader} from "../InstanceReader.sol";
39
-
40
- string constant PRODUCT_SERVICE_NAME = "ProductService";
41
+ import {IPoolService} from "./PoolService.sol";
41
42
 
42
43
  // TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
43
- contract ProductService is ComponentServiceBase, IProductService {
44
+ contract ProductService is ComponentService, IProductService {
44
45
  using NftIdLib for NftId;
45
46
 
46
- string public constant NAME = "ProductService";
47
-
48
- address internal _registryAddress;
47
+ IPoolService internal _poolService;
49
48
 
50
49
  event LogProductServiceSender(address sender);
51
50
 
@@ -57,26 +56,121 @@ contract ProductService is ComponentServiceBase, IProductService {
57
56
  initializer
58
57
  virtual override
59
58
  {
60
- address initialOwner = address(0);
61
- (_registryAddress, initialOwner) = abi.decode(data, (address, address));
59
+ address registryAddress;
60
+ address initialOwner;
61
+ (registryAddress, initialOwner) = abi.decode(data, (address, address));
62
+
63
+ _initializeService(registryAddress, owner);
62
64
 
63
- _initializeService(_registryAddress, owner);
65
+ _poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
64
66
 
65
- _registerInterface(type(IService).interfaceId);
66
67
  _registerInterface(type(IProductService).interfaceId);
67
68
  }
68
69
 
69
70
 
70
- function getName() public pure override(IService, Service) returns(string memory name) {
71
- return NAME;
71
+ function register(address productAddress)
72
+ external
73
+ returns(NftId productNftId)
74
+ {
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
+ }
93
+
94
+
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();
112
+
113
+ // create product setup in instance
114
+ instance.createProductSetup(productNftId, product.getSetupInfo());
115
+
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
+ }
123
+
124
+ function getDomain() public pure override(IService, Service) returns(ObjectType) {
125
+ return PRODUCT();
72
126
  }
73
127
 
74
- function _finalizeComponentRegistration(NftId componentNftId, bytes memory initialObjData, IInstance instance) internal override {
75
- ISetup.ProductSetupInfo memory initialSetup = abi.decode(
76
- initialObjData,
77
- (ISetup.ProductSetupInfo)
128
+
129
+ function _decodeAndVerifyProductData(bytes memory data)
130
+ internal
131
+ returns(string memory name, ISetup.ProductSetupInfo memory setup)
132
+ {
133
+ (name, setup) = abi.decode(
134
+ data,
135
+ (string, ISetup.ProductSetupInfo)
78
136
  );
79
- instance.createProductSetup(componentNftId, initialSetup);
137
+
138
+ // TODO add checks
139
+ // if(wallet == address(0)) {
140
+ // revert WalletIsZero();
141
+ // }
142
+
143
+ // IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
144
+
145
+ // if(tokenInfo.objectType != TOKEN()) {
146
+ // revert InvalidToken();
147
+ // }
148
+
149
+ // IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
150
+
151
+ // if(poolInfo.objectType != POOL()) {
152
+ // revert InvalidPool();
153
+ // }
154
+
155
+ // if(poolInfo.parentNftId != instanceNftId) {
156
+ // revert InvalidPoolsInstance();
157
+ // }
158
+ // // TODO pool have the same token
159
+ // //ITreasury.PoolSetup memory poolSetup = instance.getPoolSetup(info.poolNftId);
160
+ // //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
161
+ // // TODO pool is not linked
162
+
163
+ // IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
164
+
165
+ // if(distributionInfo.objectType != DISTRIBUTION()) {
166
+ // revert InvalidDistribution();
167
+ // }
168
+
169
+ // if(distributionInfo.parentNftId != instanceNftId) {
170
+ // revert InvalidDistributionsInstance();
171
+ // }
172
+ // // TODO distribution have the same token
173
+ // // TODO distribution is not linked
80
174
  }
81
175
 
82
176
  function setFees(
@@ -84,13 +178,18 @@ contract ProductService is ComponentServiceBase, IProductService {
84
178
  Fee memory processingFee
85
179
  )
86
180
  external
87
- override
88
181
  {
89
- (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
182
+ // TODO check args
183
+
184
+ (
185
+ IRegistry.ObjectInfo memory productInfo,
186
+ IInstance instance
187
+ ) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
188
+
90
189
  InstanceReader instanceReader = instance.getInstanceReader();
91
190
  NftId productNftId = productInfo.nftId;
92
-
93
191
  ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
192
+
94
193
  productSetupInfo.productFee = productFee;
95
194
  productSetupInfo.processingFee = processingFee;
96
195
 
@@ -101,7 +200,10 @@ contract ProductService is ComponentServiceBase, IProductService {
101
200
  RiskId riskId,
102
201
  bytes memory data
103
202
  ) external override {
104
- (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
203
+ (
204
+ IRegistry.ObjectInfo memory productInfo,
205
+ IInstance instance
206
+ ) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
105
207
  NftId productNftId = productInfo.nftId;
106
208
  IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo(productNftId, data);
107
209
  instance.createRisk(
@@ -128,415 +230,4 @@ contract ProductService is ComponentServiceBase, IProductService {
128
230
  (, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
129
231
  instance.updateRiskState(riskId, state);
130
232
  }
131
-
132
- function _getAndVerifyInstanceAndProduct() internal view returns (Product product) {
133
- IRegistry.ObjectInfo memory productInfo;
134
- (productInfo,) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
135
- product = Product(productInfo.objectAddress);
136
- }
137
-
138
- function calculatePremium(
139
- RiskId riskId,
140
- uint256 sumInsuredAmount,
141
- uint256 lifetime,
142
- bytes memory applicationData,
143
- NftId bundleNftId,
144
- ReferralId referralId
145
- )
146
- public
147
- view
148
- override
149
- returns (
150
- uint256 premiumAmount,
151
- uint256 productFeeAmount,
152
- uint256 poolFeeAmount,
153
- uint256 bundleFeeAmount,
154
- uint256 distributionFeeAmount
155
- )
156
- {
157
- Product product = _getAndVerifyInstanceAndProduct();
158
- uint256 netPremiumAmount = product.calculateNetPremium(
159
- sumInsuredAmount,
160
- riskId,
161
- lifetime,
162
- applicationData
163
- );
164
-
165
- (
166
- productFeeAmount,
167
- poolFeeAmount,
168
- bundleFeeAmount,
169
- distributionFeeAmount
170
- ) = _calculateFeeAmounts(
171
- netPremiumAmount,
172
- product,
173
- bundleNftId,
174
- referralId
175
- );
176
-
177
- premiumAmount = netPremiumAmount + productFeeAmount;
178
- premiumAmount += poolFeeAmount + bundleFeeAmount;
179
- premiumAmount += distributionFeeAmount;
180
- }
181
-
182
- function _calculateFeeAmounts(
183
- uint256 netPremiumAmount,
184
- Product product,
185
- NftId bundleNftId,
186
- ReferralId referralId
187
- )
188
- internal
189
- view
190
- returns (
191
- uint256 productFeeAmount,
192
- uint256 poolFeeAmount,
193
- uint256 bundleFeeAmount,
194
- uint256 distributionFeeAmount
195
- )
196
- {
197
- IInstance instance = product.getInstance();
198
- // FIXME: this
199
- // ITreasury.TreasuryInfo memory treasuryInfo = instance.getTreasuryInfo(product.getNftId());
200
- // IBundle.BundleInfo memory bundleInfo = instance.getBundleInfo(bundleNftId);
201
- // require(bundleInfo.poolNftId == treasuryInfo.poolNftId,"ERROR:PRS-035:BUNDLE_POOL_MISMATCH");
202
-
203
- // (productFeeAmount,) = FeeLib.calculateFee(treasuryInfo.productFee, netPremiumAmount);
204
- // (poolFeeAmount,) = FeeLib.calculateFee(treasuryInfo.poolFee, netPremiumAmount);
205
- // (bundleFeeAmount,) = FeeLib.calculateFee(bundleInfo.fee, netPremiumAmount);
206
-
207
- // IRegistry.ObjectInfo memory distributionInfo = getRegistry().getObjectInfo(treasuryInfo.distributionNftId);
208
- // IDistributionComponent distribution = IDistributionComponent(distributionInfo.objectAddress);
209
- // distributionFeeAmount = distribution.calculateFeeAmount(referralId, netPremiumAmount);
210
- }
211
-
212
-
213
- function createApplication(
214
- address applicationOwner,
215
- RiskId riskId,
216
- uint256 sumInsuredAmount,
217
- uint256 lifetime,
218
- bytes memory applicationData,
219
- NftId bundleNftId,
220
- ReferralId referralId
221
- ) external override returns (NftId policyNftId) {
222
- (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
223
- // TODO add validations (see create bundle in pool service)
224
-
225
- policyNftId = getRegistryService().registerPolicy(
226
- IRegistry.ObjectInfo(
227
- zeroNftId(),
228
- productInfo.nftId,
229
- POLICY(),
230
- false, // intercepting property for policies is defined on product
231
- address(0),
232
- applicationOwner,
233
- ""
234
- )
235
- );
236
-
237
- (uint256 premiumAmount,,,,) = calculatePremium(
238
- riskId,
239
- sumInsuredAmount,
240
- lifetime,
241
- applicationData,
242
- bundleNftId,
243
- referralId
244
- );
245
-
246
- // FIXME: this
247
- // instance.createPolicyInfo(
248
- // policyNftId,
249
- // productInfo.nftId,
250
- // referralId,
251
- // riskId,
252
- // sumInsuredAmount,
253
- // premiumAmount,
254
- // lifetime,
255
- // bundleNftId
256
- // );
257
-
258
- // TODO add logging
259
- }
260
-
261
- function _getAndVerifyUnderwritingSetup(
262
- IInstance instance,
263
- IPolicy.PolicyInfo memory policyInfo
264
- )
265
- internal
266
- view
267
- returns (
268
- ITreasury.TreasuryInfo memory treasuryInfo,
269
- NftId bundleNftId,
270
- IBundle.BundleInfo memory bundleInfo,
271
- uint256 collateralAmount
272
- )
273
- {
274
- // FIXME: this
275
- // check match between policy and bundle (via pool)
276
- // treasuryInfo = instance.getTreasuryInfo(policyInfo.productNftId);
277
- // bundleNftId = policyInfo.bundleNftId;
278
- // bundleInfo = instance.getBundleInfo(bundleNftId);
279
- // require(bundleInfo.poolNftId == treasuryInfo.poolNftId, "POLICY_BUNDLE_MISMATCH");
280
-
281
- // // calculate required collateral
282
- // NftId poolNftId = treasuryInfo.poolNftId;
283
- // ISetup.PoolSetupInfo memory poolInfo = instance.getPoolInfo(poolNftId);
284
-
285
- // // obtain remaining return values
286
- // collateralAmount = calculateRequiredCollateral(poolInfo.collateralizationLevel, policyInfo.sumInsuredAmount);
287
- }
288
-
289
- function _lockCollateralInBundle(
290
- IInstance instance,
291
- NftId bundleNftId,
292
- IBundle.BundleInfo memory bundleInfo,
293
- NftId policyNftId,
294
- uint256 collateralAmount
295
- )
296
- internal
297
- returns (IBundle.BundleInfo memory)
298
- {
299
- bundleInfo.lockedAmount += collateralAmount;
300
- // FIXME: this
301
- // instance.collateralizePolicy(bundleNftId, policyNftId, collateralAmount);
302
- return bundleInfo;
303
- }
304
-
305
- function _underwriteByPool(
306
- ITreasury.TreasuryInfo memory treasuryInfo,
307
- NftId policyNftId,
308
- IPolicy.PolicyInfo memory policyInfo,
309
- bytes memory bundleFilter,
310
- uint256 collateralAmount
311
- )
312
- internal
313
- {
314
- address poolAddress = getRegistry().getObjectInfo(treasuryInfo.poolNftId).objectAddress;
315
- IPoolComponent pool = IPoolComponent(poolAddress);
316
- pool.underwrite(
317
- policyNftId,
318
- policyInfo.applicationData,
319
- bundleFilter,
320
- collateralAmount);
321
- }
322
-
323
-
324
- function revoke(
325
- NftId policyNftId
326
- )
327
- external
328
- override
329
- {
330
- require(false, "ERROR:PRS-234:NOT_YET_IMPLEMENTED");
331
- }
332
-
333
-
334
- function underwrite(
335
- NftId policyNftId,
336
- bool requirePremiumPayment,
337
- Timestamp activateAt
338
- )
339
- external
340
- override
341
- {
342
- // check caller is registered product
343
- (
344
- IRegistry.ObjectInfo memory productInfo,
345
- IInstance instance
346
- ) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
347
-
348
- // check match between policy and calling product
349
- NftId productNftId = productInfo.nftId;
350
- // FIXME: this
351
- // IPolicy.PolicyInfo memory policyInfo = instance.getPolicyInfo(policyNftId);
352
- // require(policyInfo.productNftId == productNftId, "POLICY_PRODUCT_MISMATCH");
353
- // require(instance.getState(policyNftId.toKey32(POLICY())) == APPLIED(), "ERROR:PRS-021:STATE_NOT_APPLIED");
354
-
355
- // ITreasury.TreasuryInfo memory treasuryInfo;
356
- // NftId bundleNftId;
357
- // IBundle.BundleInfo memory bundleInfo;
358
- // uint256 collateralAmount;
359
-
360
- // (
361
- // treasuryInfo,
362
- // bundleNftId,
363
- // bundleInfo,
364
- // collateralAmount
365
- // ) = _getAndVerifyUnderwritingSetup(
366
- // instance,
367
- // policyInfo
368
- // );
369
-
370
- // // lock bundle collateral
371
- // bundleInfo = _lockCollateralInBundle(
372
- // instance,
373
- // bundleNftId,
374
- // bundleInfo,
375
- // policyNftId,
376
- // collateralAmount);
377
-
378
- // // set policy state to underwritten
379
- // instance.updatePolicyState(policyNftId, UNDERWRITTEN());
380
-
381
- // // optional activation of policy
382
- // if(activateAt > zeroTimestamp()) {
383
- // policyInfo.activatedAt = activateAt;
384
- // policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
385
-
386
- // instance.updatePolicyState(policyNftId, ACTIVE());
387
- // }
388
-
389
- // // optional collection of premium
390
- // if(requirePremiumPayment) {
391
- // uint256 netPremiumAmount = _processPremiumByTreasury(
392
- // instance,
393
- // productInfo.nftId,
394
- // treasuryInfo,
395
- // policyNftId,
396
- // policyInfo.premiumAmount);
397
-
398
- // policyInfo.premiumPaidAmount += policyInfo.premiumAmount;
399
- // bundleInfo.balanceAmount += netPremiumAmount;
400
- // }
401
-
402
- // instance.setPolicyInfo(policyNftId, policyInfo);
403
- // instance.setBundleInfo(bundleNftId, bundleInfo);
404
-
405
- // // involve pool if necessary
406
- // {
407
- // NftId poolNftId = treasuryInfo.poolNftId;
408
- // ISetup.PoolSetupInfo memory poolInfo = instance.getPoolInfo(poolNftId);
409
-
410
- // if(poolInfo.isVerifying) {
411
- // _underwriteByPool(
412
- // treasuryInfo,
413
- // policyNftId,
414
- // policyInfo,
415
- // bundleInfo.filter,
416
- // collateralAmount
417
- // );
418
- // }
419
- // }
420
-
421
- // TODO add logging
422
- }
423
-
424
- function calculateRequiredCollateral(UFixed collateralizationLevel, uint256 sumInsuredAmount) public pure override returns(uint256 collateralAmount) {
425
- UFixed sumInsuredUFixed = UFixedLib.toUFixed(sumInsuredAmount);
426
- UFixed collateralUFixed = collateralizationLevel * sumInsuredUFixed;
427
- return collateralUFixed.toInt();
428
- }
429
-
430
- function collectPremium(NftId policyNftId, Timestamp activateAt) external override {
431
- // check caller is registered product
432
- (IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
433
-
434
- // perform actual token transfers
435
- // FIXME: this
436
- // IPolicy.PolicyInfo memory policyInfo = instance.getPolicyInfo(policyNftId);
437
- // ITreasury.TreasuryInfo memory treasuryInfo = instance.getTreasuryInfo(productInfo.nftId);
438
-
439
- // uint256 premiumAmount = policyInfo.premiumAmount;
440
- // _processPremiumByTreasury(instance, productInfo.nftId, treasuryInfo, policyNftId, premiumAmount);
441
-
442
- // // policy level book keeping for premium paid
443
- // policyInfo.premiumPaidAmount += premiumAmount;
444
-
445
- // // optional activation of policy
446
- // if(activateAt > zeroTimestamp()) {
447
- // require(
448
- // policyInfo.activatedAt.eqz(),
449
- // "ERROR:PRS-030:ALREADY_ACTIVATED");
450
-
451
- // policyInfo.activatedAt = activateAt;
452
- // policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
453
-
454
- // instance.updatePolicyState(policyNftId, ACTIVE());
455
- // }
456
-
457
- // instance.setPolicyInfo(policyNftId, policyInfo);
458
-
459
- // TODO add logging
460
- }
461
-
462
- // FIXME: this
463
- function activate(NftId policyNftId, Timestamp activateAt) external override {
464
- // check caller is registered product
465
- (, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
466
-
467
- // IPolicy.PolicyInfo memory policyInfo = instance.getPolicyInfo(policyNftId);
468
-
469
- // require(
470
- // policyInfo.activatedAt.eqz(),
471
- // "ERROR:PRS-020:ALREADY_ACTIVATED");
472
-
473
- // policyInfo.activatedAt = activateAt;
474
- // policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
475
-
476
- // instance.setPolicyInfo(policyNftId, policyInfo);
477
- // instance.updatePolicyState(policyNftId, ACTIVE());
478
-
479
- // TODO add logging
480
- }
481
-
482
- function close(
483
- NftId policyNftId
484
- ) external override // solhint-disable-next-line no-empty-blocks
485
- {
486
-
487
- }
488
-
489
- function _getPoolNftId(
490
- IInstance instance,
491
- NftId productNftId
492
- )
493
- internal
494
- view
495
- returns (NftId poolNftid)
496
- {
497
- // FIXME: this
498
- // return instance.getTreasuryInfo(productNftId).poolNftId;
499
- }
500
-
501
-
502
- function _processPremiumByTreasury(
503
- IInstance instance,
504
- NftId productNftId,
505
- ITreasury.TreasuryInfo memory treasuryInfo,
506
- NftId policyNftId,
507
- uint256 premiumAmount
508
- )
509
- internal
510
- returns (uint256 netPremiumAmount)
511
- {
512
- // process token transfer(s)
513
- if(premiumAmount > 0) {
514
- // FIXME: this
515
- // TokenHandler tokenHandler = instance.getTokenHandler(productNftId);
516
- // address policyOwner = getRegistry().ownerOf(policyNftId);
517
- // address poolWallet = instance.getComponentWallet(treasuryInfo.poolNftId);
518
- // netPremiumAmount = premiumAmount;
519
- // Fee memory productFee = treasuryInfo.productFee;
520
-
521
- // if (FeeLib.feeIsZero(productFee)) {
522
- // tokenHandler.transfer(
523
- // policyOwner,
524
- // poolWallet,
525
- // premiumAmount
526
- // );
527
- // } else {
528
- // (uint256 feeAmount, uint256 netAmount) = instance.calculateFeeAmount(
529
- // premiumAmount,
530
- // productFee
531
- // );
532
-
533
- // address productWallet = instance.getComponentWallet(productNftId);
534
- // tokenHandler.transfer(policyOwner, productWallet, feeAmount);
535
- // tokenHandler.transfer(policyOwner, poolWallet, netAmount);
536
- // netPremiumAmount = netAmount;
537
- // }
538
- }
539
-
540
- // TODO add logging
541
- }
542
233
  }
@@ -59,7 +59,7 @@ contract ChainNft is ERC721Enumerable {
59
59
  }
60
60
 
61
61
  _chainIdMultiplier = 10 ** _chainIdDigits;
62
- _idNext = 4;
62
+ _idNext = 3;
63
63
  }
64
64
 
65
65
  /**