@etherisc/gif-next 0.0.2-ab82da8-607 → 0.0.2-abde86b-349

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 (301) hide show
  1. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +26 -45
  3. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  4. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  5. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
  6. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +0 -19
  9. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
  14. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  15. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  16. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +2 -2
  17. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  18. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
  19. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  20. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +13 -8
  22. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +92 -61
  24. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  26. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  27. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +16 -16
  28. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  29. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +11 -11
  30. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  31. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +60 -32
  32. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  33. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +71 -69
  34. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  35. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  36. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  37. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  38. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  39. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  40. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  41. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +88 -91
  42. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  43. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  44. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  45. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +291 -66
  46. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  47. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +17 -12
  48. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -38
  50. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +71 -51
  52. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  53. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  54. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  55. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  56. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  57. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  58. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  60. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  61. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  63. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  64. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  65. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  66. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  67. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  68. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
  69. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  70. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +18 -18
  71. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  72. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  73. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  74. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  75. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  76. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +31 -26
  77. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  78. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +68 -37
  79. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  80. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +28 -0
  81. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  82. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
  83. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  84. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +15 -10
  85. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  86. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -59
  87. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  88. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  89. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +28 -0
  90. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  91. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +73 -4
  92. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  93. package/artifacts/contracts/pool/Pool.sol/Pool.json +28 -0
  94. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  95. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +170 -43
  96. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +95 -40
  98. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  99. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +31 -26
  100. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  101. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +65 -34
  102. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  103. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +28 -26
  104. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  105. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
  106. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  107. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +103 -82
  108. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  109. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +97 -58
  110. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  111. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  112. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +8 -8
  113. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  114. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +82 -0
  115. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  116. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  117. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +28 -26
  118. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  119. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  120. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +167 -48
  121. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  122. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -45
  123. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  124. package/artifacts/contracts/product/PricingService.sol/PricingService.json +39 -34
  125. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  126. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -45
  127. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  128. package/artifacts/contracts/product/Product.sol/Product.json +28 -26
  129. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  130. package/artifacts/contracts/product/RiskService.sol/RiskService.json +11 -6
  131. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  132. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +62 -31
  133. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  134. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  135. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +19 -0
  136. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  137. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  138. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  139. package/artifacts/contracts/registry/Registry.sol/Registry.json +55 -36
  140. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  141. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +108 -111
  142. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  143. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +23 -201
  144. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  145. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +60 -29
  146. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  147. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  148. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  149. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  150. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
  151. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  152. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  153. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  154. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  155. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +39 -34
  156. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  157. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +97 -56
  158. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  159. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -0
  160. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  161. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  162. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  163. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  164. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  165. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  166. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  167. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  168. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  169. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -6
  170. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  171. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  172. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  173. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  174. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  175. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  176. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  177. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  178. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  179. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  180. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  181. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  182. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +18 -8
  183. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  184. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  185. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  186. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  187. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  188. package/artifacts/contracts/shared/Service.sol/Service.json +5 -0
  189. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  190. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  191. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  192. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  193. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  194. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  195. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  196. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
  197. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  198. package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
  199. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  200. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  201. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +78 -42
  202. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  203. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  204. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  205. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +11 -6
  206. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  207. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +64 -33
  208. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  209. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  210. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  211. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  212. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  213. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  214. package/artifacts/contracts/type/Amount.sol/AmountLib.json +2 -2
  215. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  216. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  217. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  218. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  219. package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
  220. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  221. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  222. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  223. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  224. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  225. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
  226. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  227. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  228. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  229. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  230. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  231. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  232. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  233. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  234. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  235. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  236. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  237. package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
  238. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  239. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
  240. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  241. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  242. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  243. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  244. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +47 -27
  245. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  246. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  247. package/contracts/authorization/AccessAdmin.sol +24 -21
  248. package/contracts/authorization/Authorization.sol +5 -1
  249. package/contracts/authorization/IAccessAdmin.sol +0 -1
  250. package/contracts/distribution/DistributionService.sol +7 -7
  251. package/contracts/distribution/DistributionServiceManager.sol +6 -6
  252. package/contracts/instance/InstanceAdmin.sol +6 -3
  253. package/contracts/instance/InstanceReader.sol +93 -4
  254. package/contracts/instance/InstanceService.sol +3 -5
  255. package/contracts/instance/InstanceServiceManager.sol +6 -7
  256. package/contracts/instance/module/IComponents.sol +3 -1
  257. package/contracts/instance/module/IPolicy.sol +2 -2
  258. package/contracts/oracle/OracleService.sol +8 -6
  259. package/contracts/oracle/OracleServiceManager.sol +6 -6
  260. package/contracts/pool/BundleService.sol +6 -6
  261. package/contracts/pool/BundleServiceManager.sol +6 -6
  262. package/contracts/pool/IPoolComponent.sol +18 -8
  263. package/contracts/pool/IPoolService.sol +19 -8
  264. package/contracts/pool/Pool.sol +37 -10
  265. package/contracts/pool/PoolService.sol +61 -22
  266. package/contracts/pool/PoolServiceManager.sol +4 -4
  267. package/contracts/product/ApplicationService.sol +10 -7
  268. package/contracts/product/ApplicationServiceManager.sol +4 -4
  269. package/contracts/product/ClaimService.sol +147 -61
  270. package/contracts/product/ClaimServiceManager.sol +4 -4
  271. package/contracts/product/IClaimService.sol +1 -1
  272. package/contracts/product/IPolicyService.sol +7 -3
  273. package/contracts/product/IProductComponent.sol +17 -3
  274. package/contracts/product/PolicyService.sol +93 -20
  275. package/contracts/product/PolicyServiceManager.sol +4 -4
  276. package/contracts/product/PricingService.sol +2 -3
  277. package/contracts/product/PricingServiceManager.sol +3 -3
  278. package/contracts/product/Product.sol +25 -18
  279. package/contracts/product/RiskService.sol +2 -3
  280. package/contracts/product/RiskServiceManager.sol +4 -4
  281. package/contracts/registry/IRegistry.sol +2 -0
  282. package/contracts/registry/IRegistryService.sol +0 -9
  283. package/contracts/registry/Registry.sol +7 -2
  284. package/contracts/registry/RegistryService.sol +53 -46
  285. package/contracts/registry/RegistryServiceManager.sol +2 -2
  286. package/contracts/shared/ComponentService.sol +5 -5
  287. package/contracts/shared/ComponentServiceManager.sol +8 -5
  288. package/contracts/shared/ComponentVerifyingService.sol +1 -2
  289. package/contracts/shared/ContractLib.sol +38 -0
  290. package/contracts/shared/IPolicyHolder.sol +12 -13
  291. package/contracts/shared/InstanceLinkedComponent.sol +1 -2
  292. package/contracts/shared/PolicyHolder.sol +11 -5
  293. package/contracts/shared/Service.sol +12 -7
  294. package/contracts/staking/Staking.sol +1 -1
  295. package/contracts/staking/StakingManager.sol +8 -6
  296. package/contracts/staking/StakingServiceManager.sol +2 -2
  297. package/contracts/type/PayoutId.sol +10 -10
  298. package/contracts/type/UFixed.sol +4 -0
  299. package/contracts/upgradeability/ProxyManager.sol +67 -34
  300. package/contracts/upgradeability/Versionable.sol +2 -2
  301. package/package.json +1 -1
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.20;
3
3
 
4
4
  import {Amount} from "../type/Amount.sol";
5
+ import {ClaimId} from "../type/ClaimId.sol";
5
6
  import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
6
7
  import {IComponents} from "../instance/module/IComponents.sol";
7
8
  import {NftId} from "../type/NftId.sol";
@@ -13,6 +14,18 @@ interface IProductComponent is
13
14
  IInstanceLinkedComponent
14
15
  {
15
16
 
17
+ /// @dev Callback function to inform product compnent about arrival of funding for a claim.
18
+ /// The callback is called by the pool service after the corresponding pool triggers this function.
19
+ /// The callback is only called when the product's property isProcessingFundedClaims is set.
20
+ function processFundedClaim(
21
+ NftId policyNftId,
22
+ ClaimId claimId,
23
+ Amount availableAmount
24
+ ) external;
25
+
26
+
27
+ /// @dev Calculates the premium amount for the provided application data.
28
+ /// The returned premium amounts takes into account potential discounts and fees.
16
29
  function calculatePremium(
17
30
  Amount sumInsuredAmount,
18
31
  RiskId riskId,
@@ -22,6 +35,10 @@ interface IProductComponent is
22
35
  ReferralId referralId
23
36
  ) external view returns (Amount premiumAmount);
24
37
 
38
+
39
+ /// @dev Calculates the net premium amount for the provided application data.
40
+ /// The returned net premium amounts only covers the cost of collateralizing the application.
41
+ /// This amount purely depends on the use case specific risk and does not include any fees/commission.
25
42
  function calculateNetPremium(
26
43
  Amount sumInsuredAmount,
27
44
  RiskId riskId,
@@ -29,9 +46,6 @@ interface IProductComponent is
29
46
  bytes memory applicationData
30
47
  ) external view returns (Amount netPremiumAmount);
31
48
 
32
- function getPoolNftId() external view returns (NftId poolNftId);
33
- function getDistributionNftId() external view returns (NftId distributionNftId);
34
-
35
49
 
36
50
  /// @dev returns initial pool specific infos for this pool
37
51
  function getInitialProductInfo() external view returns (IComponents.ProductInfo memory info);
@@ -21,6 +21,7 @@ import {StateId} from "../type/StateId.sol";
21
21
  import {VersionPart} from "../type/Version.sol";
22
22
 
23
23
  import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
24
+ import {ContractLib} from "../shared/ContractLib.sol";
24
25
  import {IApplicationService} from "./IApplicationService.sol";
25
26
  import {IBundleService} from "../pool/IBundleService.sol";
26
27
  import {IClaimService} from "./IClaimService.sol";
@@ -28,6 +29,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
28
29
  import {IDistributionService} from "../distribution/IDistributionService.sol";
29
30
  import {InstanceReader} from "../instance/InstanceReader.sol";
30
31
  import {InstanceStore} from "../instance/InstanceStore.sol";
32
+ import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
31
33
  import {IPolicyService} from "./IPolicyService.sol";
32
34
  import {IPoolService} from "../pool/IPoolService.sol";
33
35
  import {IPricingService} from "./IPricingService.sol";
@@ -56,10 +58,9 @@ contract PolicyService is
56
58
  initializer
57
59
  {
58
60
  (
59
- address registryAddress,,
60
- //address managerAddress
61
+ address registryAddress,
61
62
  address authority
62
- ) = abi.decode(data, (address, address, address));
63
+ ) = abi.decode(data, (address, address));
63
64
 
64
65
  _initializeService(registryAddress, authority, owner);
65
66
 
@@ -80,7 +81,8 @@ contract PolicyService is
80
81
  NftId applicationNftId // = policyNftId
81
82
  )
82
83
  external
83
- virtual override
84
+ virtual
85
+ nonReentrant()
84
86
  {
85
87
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
86
88
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -115,7 +117,8 @@ contract PolicyService is
115
117
  Timestamp activateAt
116
118
  )
117
119
  external
118
- virtual override
120
+ virtual
121
+ nonReentrant()
119
122
  {
120
123
  // check caller is registered product
121
124
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -179,12 +182,14 @@ contract PolicyService is
179
182
  productInfo.distributionNftId,
180
183
  applicationInfo.referralId);
181
184
  }
182
-
183
- // TODO add calling pool contract if it needs to validate application
184
185
 
185
- // TODO: add logging
186
+ // log policy creation before interactions with token and policy holder
187
+ emit LogPolicyServicePolicyCreated(applicationNftId, premium.premiumAmount, activateAt);
186
188
 
187
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
189
+ // TODO add calling pool contract if it needs to validate application
190
+
191
+ // callback to policy holder if applicable
192
+ _policyHolderPolicyActivated(applicationNftId, activateAt);
188
193
  }
189
194
 
190
195
 
@@ -195,6 +200,7 @@ contract PolicyService is
195
200
  )
196
201
  external
197
202
  virtual
203
+ nonReentrant()
198
204
  {
199
205
  // check caller is registered product
200
206
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -228,15 +234,18 @@ contract PolicyService is
228
234
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
229
235
  instance.getInstanceStore().updatePremiumState(policyNftId, PAID());
230
236
 
231
- // TODO: add logging
237
+ // log premium collection before interactions with token
238
+ emit LogPolicyServicePolicyPremiumCollected(policyNftId, premium.premiumAmount);
232
239
 
233
240
  _transferFunds(instanceReader, policyNftId, policyInfo.productNftId, premium);
234
-
235
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
236
241
  }
237
242
 
238
243
  /// @inheritdoc IPolicyService
239
- function activate(NftId policyNftId, Timestamp activateAt) public override {
244
+ function activate(NftId policyNftId, Timestamp activateAt)
245
+ external
246
+ virtual
247
+ nonReentrant()
248
+ {
240
249
  // check caller is registered product
241
250
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
242
251
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -246,9 +255,11 @@ contract PolicyService is
246
255
 
247
256
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
248
257
 
249
- // TODO: add logging
258
+ // log policy activation before interactions with policy holder
259
+ emit LogPolicyServicePolicyActivated(policyNftId, activateAt);
250
260
 
251
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
261
+ // callback to policy holder if applicable
262
+ _policyHolderPolicyActivated(policyNftId, activateAt);
252
263
  }
253
264
 
254
265
 
@@ -258,8 +269,8 @@ contract PolicyService is
258
269
  Timestamp expireAt
259
270
  )
260
271
  external
261
- override
262
272
  virtual
273
+ nonReentrant()
263
274
  returns (Timestamp expiredAt)
264
275
  {
265
276
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -297,12 +308,14 @@ contract PolicyService is
297
308
  }
298
309
 
299
310
  // update policyInfo with new expiredAt timestamp
311
+ Timestamp originalExpiredAt = policyInfo.expiredAt;
300
312
  policyInfo.expiredAt = expiredAt;
301
313
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
302
314
 
303
- emit LogPolicyServicePolicyExpirationUpdated(policyNftId, expiredAt);
315
+ emit LogPolicyServicePolicyExpirationUpdated(policyNftId, originalExpiredAt, expiredAt);
304
316
 
305
- // TODO: add callback IPolicyHolder.policyExpired() if applicable
317
+ // callback to policy holder if applicable
318
+ _policyHolderPolicyExpired(policyNftId, expiredAt);
306
319
  }
307
320
 
308
321
 
@@ -310,7 +323,8 @@ contract PolicyService is
310
323
  NftId policyNftId
311
324
  )
312
325
  external
313
- override
326
+ virtual
327
+ nonReentrant()
314
328
  {
315
329
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
316
330
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -351,7 +365,7 @@ contract PolicyService is
351
365
  policyInfo.closedAt = TimestampLib.blockTimestamp();
352
366
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, CLOSED());
353
367
 
354
- // TODO add logging
368
+ emit LogPolicyServicePolicyClosed(policyNftId);
355
369
  }
356
370
 
357
371
 
@@ -525,6 +539,64 @@ contract PolicyService is
525
539
  }
526
540
 
527
541
 
542
+ function _policyHolderPolicyActivated(
543
+ NftId policyNftId,
544
+ Timestamp activateAt
545
+ )
546
+ internal
547
+ virtual
548
+ {
549
+ // immediately return if policy is not activated
550
+ if (activateAt.eqz()) {
551
+ return;
552
+ }
553
+
554
+ // get policy holder address
555
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
556
+
557
+ // execute callback if policy holder implements IPolicyHolder
558
+ if (address(policyHolder) != address(0)) {
559
+ policyHolder.policyActivated(policyNftId, activateAt);
560
+ }
561
+ }
562
+
563
+
564
+ function _policyHolderPolicyExpired(
565
+ NftId policyNftId,
566
+ Timestamp expiredAt
567
+ )
568
+ internal
569
+ virtual
570
+ {
571
+ // immediately return if policy is not activated
572
+ if (expiredAt.eqz()) {
573
+ return;
574
+ }
575
+
576
+ // get policy holder address
577
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
578
+
579
+ // execute callback if policy holder implements IPolicyHolder
580
+ if (address(policyHolder) != address(0)) {
581
+ policyHolder.policyExpired(policyNftId, expiredAt);
582
+ }
583
+ }
584
+
585
+
586
+ function _getPolicyHolder(NftId policyNftId)
587
+ internal
588
+ view
589
+ returns (IPolicyHolder policyHolder)
590
+ {
591
+ address policyHolderAddress = getRegistry().ownerOf(policyNftId);
592
+ policyHolder = IPolicyHolder(policyHolderAddress);
593
+
594
+ if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
595
+ policyHolder = IPolicyHolder(address(0));
596
+ }
597
+ }
598
+
599
+
528
600
  function _getTokenHandler(
529
601
  InstanceReader instanceReader,
530
602
  NftId productNftId
@@ -539,6 +611,7 @@ contract PolicyService is
539
611
  tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
540
612
  }
541
613
 
614
+
542
615
  function _getDistributionNftAndWallets(
543
616
  InstanceReader instanceReader,
544
617
  NftId productNftId
@@ -12,14 +12,14 @@ contract PolicyServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with product service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  PolicyService svc = new PolicyService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
23
  address(svc),
24
24
  data,
25
25
  salt);
@@ -45,10 +45,9 @@ contract PricingService is
45
45
  initializer()
46
46
  {
47
47
  (
48
- address registryAddress,,
49
- //address managerAddress
48
+ address registryAddress,
50
49
  address authority
51
- ) = abi.decode(data, (address, address, address));
50
+ ) = abi.decode(data, (address, address));
52
51
 
53
52
  _initializeService(registryAddress, authority, owner);
54
53
  _registerInterface(type(IPricingService).interfaceId);
@@ -15,11 +15,11 @@ contract PricingServiceManager is ProxyManager {
15
15
  address registryAddress,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  PricingService pricingSrv = new PricingService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registryAddress, authority);
21
+ IVersionable versionable = initialize(
22
+ registryAddress,
23
23
  address(pricingSrv),
24
24
  data,
25
25
  salt);
@@ -49,6 +49,29 @@ abstract contract Product is
49
49
  }
50
50
 
51
51
 
52
+ function register()
53
+ external
54
+ virtual
55
+ onlyOwner()
56
+ {
57
+ _getProductStorage()._componentService.registerProduct();
58
+ _approveTokenHandler(type(uint256).max);
59
+ }
60
+
61
+
62
+ function processFundedClaim(
63
+ NftId policyNftId,
64
+ ClaimId claimId,
65
+ Amount availableAmount
66
+ )
67
+ external
68
+ virtual
69
+ restricted() // pool service role
70
+ {
71
+ // default implementation does nothing
72
+ }
73
+
74
+
52
75
  function calculatePremium(
53
76
  Amount sumInsuredAmount,
54
77
  RiskId riskId,
@@ -91,16 +114,6 @@ abstract contract Product is
91
114
  }
92
115
 
93
116
 
94
- function register()
95
- external
96
- virtual
97
- onlyOwner()
98
- {
99
- _getProductStorage()._componentService.registerProduct();
100
- _approveTokenHandler(type(uint256).max);
101
- }
102
-
103
-
104
117
  function getInitialProductInfo()
105
118
  public
106
119
  virtual
@@ -112,6 +125,7 @@ abstract contract Product is
112
125
  return IComponents.ProductInfo({
113
126
  distributionNftId: $._distributionNftId,
114
127
  poolNftId: $._poolNftId,
128
+ isProcessingFundedClaims: false,
115
129
  productFee: FeeLib.zero(),
116
130
  processingFee: FeeLib.zero(),
117
131
  distributionFee: FeeLib.zero(),
@@ -122,13 +136,6 @@ abstract contract Product is
122
136
  });
123
137
  }
124
138
 
125
- function getPoolNftId() external view override returns (NftId poolNftId) {
126
- return getRegistry().getNftIdForAddress(address(_getProductStorage()._pool));
127
- }
128
-
129
- function getDistributionNftId() external view override returns (NftId distributionNftId) {
130
- return getRegistry().getNftIdForAddress(address(_getProductStorage()._distribution));
131
- }
132
139
 
133
140
  function _initializeProduct(
134
141
  address registry,
@@ -413,7 +420,7 @@ abstract contract Product is
413
420
  return RiskIdLib.toRiskId(riskName);
414
421
  }
415
422
 
416
- function _getProductStorage() private pure returns (ProductStorage storage $) {
423
+ function _getProductStorage() internal pure returns (ProductStorage storage $) {
417
424
  assembly {
418
425
  $.slot := PRODUCT_STORAGE_LOCATION_V1
419
426
  }
@@ -33,10 +33,9 @@ contract RiskService is
33
33
  virtual override
34
34
  {
35
35
  (
36
- address registryAddress,,
37
- //address managerAddress
36
+ address registryAddress,
38
37
  address authority
39
- ) = abi.decode(data, (address, address, address));
38
+ ) = abi.decode(data, (address, address));
40
39
 
41
40
  _initializeService(registryAddress, authority, owner);
42
41
 
@@ -12,14 +12,14 @@ contract RiskServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with product service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  RiskService svc = new RiskService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
23
  address(svc),
24
24
  data,
25
25
  salt);
@@ -128,6 +128,8 @@ interface IRegistry is IERC165 {
128
128
 
129
129
  function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory info);
130
130
 
131
+ function getObjectAddress(NftId nftId) external view returns (address objectAddress);
132
+
131
133
  /// @dev Returns the object info for the specified object address.
132
134
  // MUST not be used with chain registry address (resides on different chan id)
133
135
  function getObjectInfo(address object) external view returns (ObjectInfo memory info);
@@ -50,15 +50,6 @@ interface IRegistryService is
50
50
  function registerComponent(IComponent component, ObjectType objectType, address owner)
51
51
  external returns(IRegistry.ObjectInfo memory info);
52
52
 
53
- // function registerProduct(IComponent product, address owner)
54
- // external returns(IRegistry.ObjectInfo memory info);
55
-
56
- // function registerPool(IComponent pool, address owner)
57
- // external returns(IRegistry.ObjectInfo memory info);
58
-
59
- // function registerDistribution(IComponent distribution, address owner)
60
- // external returns(IRegistry.ObjectInfo memory info);
61
-
62
53
  function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
63
54
 
64
55
  function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
@@ -243,6 +243,9 @@ contract Registry is
243
243
  {
244
244
  address objectAddress = info.objectAddress;
245
245
  ObjectType objectType = info.objectType;
246
+
247
+ // this indidirectly enforces that the parent is registered
248
+ // parentType would be zero for a non-registered parent which is never a valid type combination
246
249
  ObjectType parentType = _info[info.parentNftId].objectType;
247
250
 
248
251
  // check type combinations for core objects
@@ -347,6 +350,10 @@ contract Registry is
347
350
  return _info[nftId];
348
351
  }
349
352
 
353
+ function getObjectAddress(NftId nftId) external view returns (address) {
354
+ return _info[nftId].objectAddress;
355
+ }
356
+
350
357
  function getObjectInfo(address object) external view returns (ObjectInfo memory) {
351
358
  return _info[_nftIdByAddress[object]];
352
359
  }
@@ -374,8 +381,6 @@ contract Registry is
374
381
  }
375
382
 
376
383
  function getStakingAddress() external view returns (address staking) {
377
- //return getObjectInfo(_stakingNftId).objectAddress;
378
- //return _info[_stakingNftId].objectAddress;
379
384
  return _stakingAddress;
380
385
  }
381
386
 
@@ -75,21 +75,21 @@ contract RegistryService is
75
75
  instance.linkToRegisteredNftId(); // asume safe
76
76
  }
77
77
 
78
- function registerProduct(IComponent product, address owner)
79
- external
80
- restricted
81
- returns(
82
- IRegistry.ObjectInfo memory info
83
- )
84
- {
85
- // CAN revert if no ERC165 support -> will revert with empty message
86
- if(!product.supportsInterface(type(IProductComponent).interfaceId)) {
87
- revert ErrorRegistryServiceNotProduct(address(product));
88
- }
89
-
90
- info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
91
- info.nftId = getRegistry().register(info);
92
- }
78
+ // function registerProduct(IComponent product, address owner)
79
+ // external
80
+ // restricted
81
+ // returns(
82
+ // IRegistry.ObjectInfo memory info
83
+ // )
84
+ // {
85
+ // // CAN revert if no ERC165 support -> will revert with empty message
86
+ // if(!product.supportsInterface(type(IProductComponent).interfaceId)) {
87
+ // revert ErrorRegistryServiceNotProduct(address(product));
88
+ // }
89
+
90
+ // info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
91
+ // info.nftId = getRegistry().register(info);
92
+ // }
93
93
 
94
94
  function registerComponent(
95
95
  IComponent component,
@@ -111,35 +111,35 @@ contract RegistryService is
111
111
  info.nftId = getRegistry().register(info);
112
112
  }
113
113
 
114
- function registerPool(IComponent pool, address owner)
115
- external
116
- restricted
117
- returns(
118
- IRegistry.ObjectInfo memory info
119
- )
120
- {
121
- if(!pool.supportsInterface(type(IPoolComponent).interfaceId)) {
122
- revert ErrorRegistryServiceNotPool(address(pool));
123
- }
124
-
125
- info = _getAndVerifyContractInfo(pool, POOL(), owner);
126
- info.nftId = getRegistry().register(info);
127
- }
128
-
129
- function registerDistribution(IComponent distribution, address owner)
130
- external
131
- restricted
132
- returns(
133
- IRegistry.ObjectInfo memory info
134
- )
135
- {
136
- if(!distribution.supportsInterface(type(IDistributionComponent).interfaceId)) {
137
- revert ErrorRegistryServiceNotDistribution(address(distribution));
138
- }
139
-
140
- info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
141
- info.nftId = getRegistry().register(info);
142
- }
114
+ // function registerPool(IComponent pool, address owner)
115
+ // external
116
+ // restricted
117
+ // returns(
118
+ // IRegistry.ObjectInfo memory info
119
+ // )
120
+ // {
121
+ // if(!pool.supportsInterface(type(IPoolComponent).interfaceId)) {
122
+ // revert ErrorRegistryServiceNotPool(address(pool));
123
+ // }
124
+
125
+ // info = _getAndVerifyContractInfo(pool, POOL(), owner);
126
+ // info.nftId = getRegistry().register(info);
127
+ // }
128
+
129
+ // function registerDistribution(IComponent distribution, address owner)
130
+ // external
131
+ // restricted
132
+ // returns(
133
+ // IRegistry.ObjectInfo memory info
134
+ // )
135
+ // {
136
+ // if(!distribution.supportsInterface(type(IDistributionComponent).interfaceId)) {
137
+ // revert ErrorRegistryServiceNotDistribution(address(distribution));
138
+ // }
139
+
140
+ // info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
141
+ // info.nftId = getRegistry().register(info);
142
+ // }
143
143
 
144
144
  function registerDistributor(IRegistry.ObjectInfo memory info)
145
145
  external
@@ -240,8 +240,15 @@ contract RegistryService is
240
240
  revert ErrorRegistryServiceObjectOwnerZero(info.objectType);
241
241
  }
242
242
 
243
- if(getRegistry().isRegistered(owner)) {
244
- revert ErrorRegistryServiceObjectOwnerRegistered(info.objectType, owner);
243
+ if(owner == msg.sender) {
244
+ revert ErrorRegistryServiceInvalidInitialOwner(owner);
245
+ }
246
+
247
+ if(getRegistry().isRegistered(owner)) {
248
+ ObjectType ownerType = getRegistry().getObjectInfo(owner).objectType;
249
+ if(ownerType == REGISTRY() || ownerType == STAKING() || ownerType == SERVICE() || ownerType == INSTANCE()) {
250
+ revert ErrorRegistryServiceObjectOwnerRegistered(info.objectType, owner);
251
+ }
245
252
  }
246
253
  }
247
254
 
@@ -21,7 +21,6 @@ contract RegistryServiceManager is
21
21
  address registry, // used by implementation
22
22
  bytes32 salt
23
23
  )
24
- ProxyManager(registry)
25
24
  {
26
25
  if(authority == address(0)) {
27
26
  revert ErrorRegistryAccessManagerAuthorityZero();
@@ -33,7 +32,8 @@ contract RegistryServiceManager is
33
32
 
34
33
  RegistryService srv = new RegistryService{ salt: salt }();
35
34
  bytes memory data = abi.encode(registry, authority);
36
- IVersionable versionable = deployDetermenistic(
35
+ IVersionable versionable = initialize(
36
+ registry,
37
37
  address(srv),
38
38
  data,
39
39
  salt);
@@ -48,12 +48,12 @@ contract ComponentService is
48
48
  virtual override
49
49
  initializer()
50
50
  {
51
- // TODO check this, might no longer be the way, refactor if necessary
52
- address registryAddress;
53
- address initialOwner;
54
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
51
+ (
52
+ address registryAddress,
53
+ address authority
54
+ ) = abi.decode(data, (address, address));
55
55
 
56
- _initializeService(registryAddress, address(0), owner);
56
+ _initializeService(registryAddress, authority, owner);
57
57
 
58
58
  _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
59
59
  _instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
@@ -11,15 +11,18 @@ contract ComponentServiceManager is ProxyManager {
11
11
 
12
12
  /// @dev initializes proxy manager with service implementation
13
13
  constructor(
14
- address registryAddress
14
+ address authority,
15
+ address registry,
16
+ bytes32 salt
15
17
  )
16
- ProxyManager(registryAddress)
17
18
  {
18
19
  ComponentService svc = new ComponentService();
19
- bytes memory data = abi.encode(registryAddress, address(this));
20
- IVersionable versionable = deploy(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
21
23
  address(svc),
22
- data);
24
+ data,
25
+ salt);
23
26
 
24
27
  _componentService = ComponentService(address(versionable));
25
28
  }