@etherisc/gif-next 0.0.2-eadf4ad-932 → 0.0.2-eae5e95-691

Sign up to get free protection for your applications and to get access to all the features.
Files changed (527) hide show
  1. package/README.md +51 -5
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
  4. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
  5. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
  6. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
  7. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +414 -0
  8. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
  9. package/artifacts/contracts/{instance/module/ISetup.sol/ISetup.json → authorization/IAccess.sol/IAccess.json} +2 -2
  10. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
  11. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
  12. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
  13. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
  14. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
  15. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
  16. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
  17. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
  18. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
  19. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
  20. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
  21. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1415 -0
  22. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
  23. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
  24. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +230 -545
  26. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +315 -432
  28. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +120 -109
  30. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +214 -290
  32. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  33. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +215 -94
  34. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
  35. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
  36. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
  37. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1551 -0
  38. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
  39. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +470 -0
  40. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
  41. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2090 -0
  42. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
  43. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
  44. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
  45. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
  46. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
  47. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1484 -0
  48. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
  49. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1244 -0
  50. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
  51. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1605 -0
  52. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
  53. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2108 -0
  54. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
  55. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
  56. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  57. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +113 -97
  58. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  59. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +171 -85
  60. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  61. package/artifacts/contracts/instance/Instance.sol/Instance.json +120 -207
  62. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
  63. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1653 -0
  64. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
  65. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +561 -0
  66. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +850 -366
  68. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +245 -229
  70. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +106 -79
  72. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1212 -381
  74. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
  75. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
  76. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  77. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
  78. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
  79. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
  80. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
  81. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
  82. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
  83. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
  84. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  85. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
  86. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  87. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  88. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  89. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  90. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  91. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
  92. package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
  93. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
  94. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1052 -0
  95. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
  96. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
  97. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
  98. package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
  99. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
  100. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +783 -0
  101. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
  102. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
  103. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
  104. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +920 -0
  105. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
  106. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +966 -0
  107. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
  108. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +722 -0
  109. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
  110. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1312 -0
  111. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
  112. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +470 -0
  113. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  114. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +494 -317
  115. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  116. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +186 -87
  117. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  118. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +256 -31
  119. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  120. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +235 -375
  121. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  122. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +460 -254
  123. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  124. package/artifacts/contracts/pool/Pool.sol/Pool.json +269 -565
  125. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  126. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +572 -569
  127. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  128. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +112 -93
  129. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  130. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +117 -264
  131. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  132. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +99 -76
  133. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
  134. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1186 -0
  135. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
  136. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
  137. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  138. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +329 -284
  139. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  140. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +141 -90
  141. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +54 -1
  143. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +196 -7
  145. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  146. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +354 -80
  147. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  148. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +154 -86
  149. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  150. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +355 -209
  151. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
  152. package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +44 -57
  153. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  154. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +418 -397
  155. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  156. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +124 -121
  157. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  158. package/artifacts/contracts/product/PricingService.sol/PricingService.json +233 -330
  159. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  160. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +128 -93
  161. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  162. package/artifacts/contracts/product/Product.sol/Product.json +377 -431
  163. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
  164. package/artifacts/contracts/product/RiskService.sol/RiskService.json +622 -0
  165. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
  166. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +694 -0
  167. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  168. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
  169. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  170. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +391 -45
  171. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  172. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +123 -64
  173. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  174. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +0 -18
  175. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  176. package/artifacts/contracts/registry/Registry.sol/Registry.json +789 -60
  177. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
  178. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1886 -0
  179. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  180. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +179 -185
  181. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  182. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +86 -74
  183. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
  184. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
  185. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
  186. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
  187. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
  188. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -0
  189. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  190. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +314 -138
  191. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  192. package/artifacts/contracts/shared/Component.sol/Component.json +136 -271
  193. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  194. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1335 -198
  195. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
  196. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +814 -0
  197. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
  198. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +474 -0
  199. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  200. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  201. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  202. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +105 -114
  203. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
  204. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +1335 -0
  205. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
  206. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +718 -0
  207. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  208. package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +46 -14
  209. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  210. package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +35 -4
  211. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  212. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +23 -1
  213. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  214. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -30
  215. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  216. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +36 -1
  217. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  218. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  219. package/artifacts/contracts/shared/IService.sol/IService.json +49 -1
  220. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
  221. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
  222. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
  223. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +842 -0
  224. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  225. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +538 -0
  226. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  227. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +174 -0
  228. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
  229. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
  230. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  231. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +26 -55
  232. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  233. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +20 -124
  234. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  235. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +68 -85
  236. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  237. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
  238. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  239. package/artifacts/contracts/shared/Service.sol/Service.json +55 -101
  240. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  241. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +362 -7
  242. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
  243. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
  244. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
  245. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1460 -0
  246. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  247. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +573 -53
  248. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
  249. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
  250. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
  251. package/artifacts/contracts/staking/Staking.sol/Staking.json +1901 -0
  252. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
  253. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
  254. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
  255. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +776 -0
  256. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
  257. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
  258. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  259. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +658 -176
  260. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  261. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +109 -66
  262. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
  263. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
  264. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
  265. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -0
  266. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  267. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
  268. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  269. package/artifacts/contracts/type/Amount.sol/AmountLib.json +121 -4
  270. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  271. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +53 -2
  272. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  273. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
  274. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
  276. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  277. package/artifacts/contracts/type/Fee.sol/FeeLib.json +39 -34
  278. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  279. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  280. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -4
  282. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  283. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  284. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
  286. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
  288. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
  290. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
  291. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
  292. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  293. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
  294. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  295. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
  296. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  297. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +124 -2
  298. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
  299. package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
  300. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
  301. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
  302. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  303. package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
  304. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
  305. package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
  306. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  307. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +36 -4
  308. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  309. package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
  310. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  311. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +71 -2
  312. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  313. package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
  314. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  315. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
  316. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
  317. package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
  318. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  319. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +602 -0
  320. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  321. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  322. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
  323. package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
  324. package/contracts/authorization/AccessAdmin.sol +596 -0
  325. package/contracts/authorization/AccessManagerCloneable.sol +16 -0
  326. package/contracts/authorization/Authorization.sol +289 -0
  327. package/contracts/authorization/IAccess.sol +49 -0
  328. package/contracts/authorization/IAccessAdmin.sol +137 -0
  329. package/contracts/authorization/IAuthorization.sol +60 -0
  330. package/contracts/authorization/IServiceAuthorization.sol +40 -0
  331. package/contracts/authorization/ReleaseAccessManager.sol +38 -0
  332. package/contracts/authorization/ServiceAuthorization.sol +106 -0
  333. package/contracts/distribution/BasicDistribution.sol +139 -0
  334. package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
  335. package/contracts/distribution/Distribution.sol +154 -154
  336. package/contracts/distribution/DistributionService.sol +175 -172
  337. package/contracts/distribution/DistributionServiceManager.sol +8 -23
  338. package/contracts/distribution/IDistributionComponent.sol +28 -47
  339. package/contracts/distribution/IDistributionService.sol +24 -10
  340. package/contracts/examples/fire/DamageLevel.sol +59 -0
  341. package/contracts/examples/fire/FirePool.sol +75 -0
  342. package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
  343. package/contracts/examples/fire/FireProduct.sol +412 -0
  344. package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
  345. package/contracts/examples/fire/FireUSD.sol +26 -0
  346. package/contracts/examples/unpermissioned/SimpleDistribution.sol +50 -0
  347. package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
  348. package/contracts/examples/unpermissioned/SimplePool.sol +76 -0
  349. package/contracts/examples/unpermissioned/SimpleProduct.sol +351 -0
  350. package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
  351. package/contracts/instance/IInstance.sol +33 -44
  352. package/contracts/instance/IInstanceService.sol +32 -33
  353. package/contracts/instance/Instance.sol +131 -122
  354. package/contracts/instance/InstanceAdmin.sol +277 -0
  355. package/contracts/instance/InstanceAuthorizationV3.sol +194 -0
  356. package/contracts/instance/InstanceReader.sol +194 -67
  357. package/contracts/instance/InstanceService.sol +243 -134
  358. package/contracts/instance/InstanceServiceManager.sol +8 -13
  359. package/contracts/instance/InstanceStore.sol +142 -66
  360. package/contracts/instance/base/BalanceStore.sol +123 -0
  361. package/contracts/instance/base/Cloneable.sol +2 -25
  362. package/contracts/instance/base/ObjectCounter.sol +21 -0
  363. package/contracts/instance/base/ObjectLifecycle.sol +111 -0
  364. package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +11 -14
  365. package/contracts/instance/module/IAccess.sol +2 -10
  366. package/contracts/instance/module/IBundle.sol +1 -4
  367. package/contracts/instance/module/IComponents.sol +21 -11
  368. package/contracts/instance/module/IDistribution.sol +0 -1
  369. package/contracts/instance/module/IPolicy.sol +31 -25
  370. package/contracts/mock/Dip.sol +26 -0
  371. package/contracts/oracle/BasicOracle.sol +47 -0
  372. package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
  373. package/contracts/oracle/IOracle.sol +36 -0
  374. package/contracts/oracle/IOracleComponent.sol +33 -0
  375. package/contracts/oracle/IOracleService.sol +66 -0
  376. package/contracts/oracle/Oracle.sol +156 -0
  377. package/contracts/oracle/OracleService.sol +291 -0
  378. package/contracts/oracle/OracleServiceManager.sol +39 -0
  379. package/contracts/pool/BasicPool.sol +154 -0
  380. package/contracts/pool/BasicPoolAuthorization.sol +57 -0
  381. package/contracts/pool/BundleService.sol +278 -201
  382. package/contracts/pool/BundleServiceManager.sol +8 -11
  383. package/contracts/pool/IBundleService.sol +44 -19
  384. package/contracts/pool/IPoolComponent.sol +27 -73
  385. package/contracts/pool/IPoolService.sol +93 -40
  386. package/contracts/pool/Pool.sol +186 -153
  387. package/contracts/pool/PoolService.sol +357 -236
  388. package/contracts/pool/PoolServiceManager.sol +6 -9
  389. package/contracts/product/ApplicationService.sol +148 -84
  390. package/contracts/product/ApplicationServiceManager.sol +6 -6
  391. package/contracts/product/BasicProduct.sol +53 -0
  392. package/contracts/product/BasicProductAuthorization.sol +42 -0
  393. package/contracts/product/ClaimService.sol +293 -145
  394. package/contracts/product/ClaimServiceManager.sol +6 -6
  395. package/contracts/product/IApplicationService.sol +2 -1
  396. package/contracts/product/IClaimService.sol +35 -5
  397. package/contracts/product/IPolicyService.sol +38 -38
  398. package/contracts/product/IPricingService.sol +13 -11
  399. package/contracts/product/IProductComponent.sol +28 -10
  400. package/contracts/product/{IProductService.sol → IRiskService.sol} +2 -9
  401. package/contracts/product/PolicyService.sol +504 -199
  402. package/contracts/product/PolicyServiceManager.sol +6 -9
  403. package/contracts/product/PricingService.sol +103 -82
  404. package/contracts/product/PricingServiceManager.sol +5 -8
  405. package/contracts/product/Product.sol +222 -146
  406. package/contracts/product/RiskService.sol +96 -0
  407. package/contracts/product/RiskServiceManager.sol +39 -0
  408. package/contracts/registry/ChainNft.sol +72 -36
  409. package/contracts/registry/IRegistry.sol +85 -22
  410. package/contracts/registry/IRegistryService.sol +10 -6
  411. package/contracts/registry/ITransferInterceptor.sol +0 -1
  412. package/contracts/registry/Registry.sol +433 -187
  413. package/contracts/registry/RegistryAdmin.sol +448 -0
  414. package/contracts/registry/RegistryService.sol +76 -66
  415. package/contracts/registry/RegistryServiceManager.sol +6 -25
  416. package/contracts/registry/ReleaseLifecycle.sol +30 -0
  417. package/contracts/registry/ReleaseRegistry.sol +501 -0
  418. package/contracts/registry/ServiceAuthorizationV3.sol +194 -0
  419. package/contracts/registry/TokenRegistry.sol +261 -62
  420. package/contracts/shared/Component.sol +153 -148
  421. package/contracts/shared/ComponentService.sol +688 -94
  422. package/contracts/shared/ComponentServiceManager.sol +38 -0
  423. package/contracts/shared/ComponentVerifyingService.sol +126 -0
  424. package/contracts/shared/ContractLib.sol +38 -0
  425. package/contracts/shared/IComponent.sol +25 -41
  426. package/contracts/shared/IComponentService.sol +120 -0
  427. package/contracts/shared/IInstanceLinkedComponent.sol +41 -0
  428. package/contracts/{instance/base → shared}/IKeyValueStore.sol +7 -6
  429. package/contracts/{instance/base → shared}/ILifecycle.sol +5 -4
  430. package/contracts/shared/INftOwnable.sol +3 -1
  431. package/contracts/shared/IPolicyHolder.sol +12 -17
  432. package/contracts/shared/IRegisterable.sol +11 -0
  433. package/contracts/shared/IService.sol +9 -2
  434. package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +4 -4
  435. package/contracts/shared/InstanceLinkedComponent.sol +213 -0
  436. package/contracts/{instance/base → shared}/KeyValueStore.sol +36 -74
  437. package/contracts/shared/Lifecycle.sol +88 -0
  438. package/contracts/shared/NftIdSet.sol +65 -0
  439. package/contracts/shared/NftOwnable.sol +27 -22
  440. package/contracts/shared/PolicyHolder.sol +18 -50
  441. package/contracts/shared/Registerable.sol +21 -11
  442. package/contracts/shared/RegistryLinked.sol +3 -2
  443. package/contracts/shared/Service.sol +48 -36
  444. package/contracts/shared/TokenHandler.sol +112 -8
  445. package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
  446. package/contracts/staking/IStaking.sol +168 -0
  447. package/contracts/staking/IStakingService.sol +103 -48
  448. package/contracts/staking/StakeManagerLib.sol +224 -0
  449. package/contracts/staking/Staking.sol +497 -0
  450. package/contracts/staking/StakingLifecycle.sol +23 -0
  451. package/contracts/staking/StakingManager.sol +52 -0
  452. package/contracts/staking/StakingReader.sol +190 -0
  453. package/contracts/staking/StakingService.sol +273 -49
  454. package/contracts/staking/StakingServiceManager.sol +11 -7
  455. package/contracts/staking/StakingStore.sol +605 -0
  456. package/contracts/staking/TargetManagerLib.sol +211 -0
  457. package/contracts/type/AddressSet.sol +1 -1
  458. package/contracts/type/Amount.sol +44 -3
  459. package/contracts/type/Blocknumber.sol +26 -3
  460. package/contracts/type/ClaimId.sol +6 -1
  461. package/contracts/type/Fee.sol +17 -16
  462. package/contracts/type/NftId.sol +15 -16
  463. package/contracts/type/NftIdSet.sol +1 -1
  464. package/contracts/type/ObjectType.sol +176 -62
  465. package/contracts/type/PayoutId.sol +10 -10
  466. package/contracts/type/Referral.sol +2 -1
  467. package/contracts/type/RequestId.sol +75 -0
  468. package/contracts/type/RiskId.sol +16 -2
  469. package/contracts/type/RoleId.sol +98 -75
  470. package/contracts/type/Seconds.sol +48 -1
  471. package/contracts/type/Selector.sol +102 -0
  472. package/contracts/type/StateId.sol +41 -2
  473. package/contracts/type/String.sol +53 -0
  474. package/contracts/type/Timestamp.sol +17 -3
  475. package/contracts/type/UFixed.sol +38 -9
  476. package/contracts/type/Version.sol +4 -2
  477. package/contracts/{shared → upgradeability}/ProxyManager.sol +76 -39
  478. package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
  479. package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
  480. package/package.json +9 -5
  481. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
  482. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
  483. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
  484. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
  485. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
  486. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -124
  487. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
  488. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  489. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
  490. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -581
  491. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
  492. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -194
  493. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
  494. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
  495. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +0 -4
  496. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +0 -4
  497. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +0 -10
  498. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
  499. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
  500. package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -864
  501. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
  502. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -679
  503. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
  504. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -238
  505. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
  506. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -846
  507. package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  508. package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
  509. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
  510. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
  511. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
  512. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
  513. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -598
  514. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
  515. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
  516. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
  517. package/contracts/instance/InstanceAccessManager.sol +0 -543
  518. package/contracts/instance/InstanceAuthorizationsLib.sol +0 -308
  519. package/contracts/instance/base/Lifecycle.sol +0 -121
  520. package/contracts/instance/module/ISetup.sol +0 -33
  521. package/contracts/instance/module/ITreasury.sol +0 -23
  522. package/contracts/product/ProductService.sol +0 -212
  523. package/contracts/product/ProductServiceManager.sol +0 -42
  524. package/contracts/registry/RegistryAccessManager.sol +0 -132
  525. package/contracts/registry/ReleaseManager.sol +0 -382
  526. package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
  527. /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -4,14 +4,20 @@ pragma solidity ^0.8.20;
4
4
  import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
5
5
  import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
6
6
 
7
+ import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
8
+ import {Amount} from "../type/Amount.sol";
9
+ import {BundleSet} from "./BundleSet.sol";
10
+ import {ChainNft} from "../registry/ChainNft.sol";
7
11
  import {NftId} from "../type/NftId.sol";
8
12
  import {RoleId} from "../type/RoleId.sol";
9
- import {ADMIN_ROLE, INSTANCE_OWNER_ROLE, DISTRIBUTION_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, INSTANCE_SERVICE_ROLE, DISTRIBUTION_SERVICE_ROLE, POOL_SERVICE_ROLE, PRODUCT_SERVICE_ROLE, APPLICATION_SERVICE_ROLE, POLICY_SERVICE_ROLE, CLAIM_SERVICE_ROLE, BUNDLE_SERVICE_ROLE, INSTANCE_ROLE} from "../type/RoleId.sol";
10
- import {ObjectType, INSTANCE, BUNDLE, APPLICATION, POLICY, CLAIM, PRODUCT, DISTRIBUTION, REGISTRY, POOL} from "../type/ObjectType.sol";
13
+ import {SecondsLib} from "../type/Seconds.sol";
14
+ import {UFixed, UFixedLib} from "../type/UFixed.sol";
15
+ import {ADMIN_ROLE} from "../type/RoleId.sol";
16
+ import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
11
17
 
12
18
  import {Service} from "../shared/Service.sol";
19
+ import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
13
20
  import {IService} from "../shared/IService.sol";
14
- import {AccessManagerUpgradeableInitializeable} from "../shared/AccessManagerUpgradeableInitializeable.sol";
15
21
 
16
22
  import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
17
23
  import {IPoolComponent} from "../pool/IPoolComponent.sol";
@@ -19,16 +25,18 @@ import {IProductComponent} from "../product/IProductComponent.sol";
19
25
 
20
26
  import {IRegistry} from "../registry/IRegistry.sol";
21
27
  import {IRegistryService} from "../registry/IRegistryService.sol";
22
- import {ChainNft} from "../registry/ChainNft.sol";
28
+ import {IStakingService} from "../staking/IStakingService.sol";
29
+ import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
23
30
 
24
31
  import {Instance} from "./Instance.sol";
25
32
  import {IInstance} from "./IInstance.sol";
26
- import {InstanceAccessManager} from "./InstanceAccessManager.sol";
33
+ import {InstanceAdmin} from "./InstanceAdmin.sol";
27
34
  import {IInstanceService} from "./IInstanceService.sol";
28
35
  import {InstanceReader} from "./InstanceReader.sol";
29
- import {BundleManager} from "./BundleManager.sol";
30
36
  import {InstanceStore} from "./InstanceStore.sol";
31
- import {InstanceAuthorizationsLib} from "./InstanceAuthorizationsLib.sol";
37
+ import {Seconds} from "../type/Seconds.sol";
38
+ import {VersionPart, VersionPartLib} from "../type/Version.sol";
39
+
32
40
 
33
41
  contract InstanceService is
34
42
  Service,
@@ -39,13 +47,37 @@ contract InstanceService is
39
47
  bytes32 public constant INSTANCE_CREATION_CODE_HASH = bytes32(0);
40
48
 
41
49
  IRegistryService internal _registryService;
42
- address internal _masterOzAccessManager;
43
- address internal _masterInstanceAccessManager;
50
+ IStakingService internal _stakingService;
51
+
52
+ address internal _masterAccessManager;
53
+ address internal _masterInstanceAdmin;
44
54
  address internal _masterInstance;
45
55
  address internal _masterInstanceReader;
46
- address internal _masterInstanceBundleManager;
56
+ address internal _masterInstanceBundleSet;
47
57
  address internal _masterInstanceStore;
48
58
 
59
+
60
+ modifier onlyInstance() {
61
+ address instanceAddress = msg.sender;
62
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
63
+ if (instanceNftId.eqz()) {
64
+ revert ErrorInstanceServiceNotRegistered(instanceAddress);
65
+ }
66
+
67
+ ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
68
+ if (objectType != INSTANCE()) {
69
+ revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
70
+ }
71
+
72
+ VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
73
+ if (instanceVersion != getVersion().toMajorPart()) {
74
+ revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
75
+ }
76
+
77
+ _;
78
+ }
79
+
80
+
49
81
  modifier onlyInstanceOwner(NftId instanceNftId) {
50
82
  if(msg.sender != getRegistry().ownerOf(instanceNftId)) {
51
83
  revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
@@ -61,71 +93,117 @@ contract InstanceService is
61
93
  _;
62
94
  }
63
95
 
64
- function createInstanceClone()
96
+ function createInstance()
65
97
  external
66
98
  returns (
67
99
  Instance clonedInstance,
68
100
  NftId clonedInstanceNftId
69
101
  )
70
102
  {
103
+ // tx sender will become instance owner
71
104
  address instanceOwner = msg.sender;
72
- AccessManagerUpgradeableInitializeable clonedOzAccessManager = AccessManagerUpgradeableInitializeable(
73
- Clones.clone(_masterOzAccessManager));
74
105
 
75
- // initially grants ADMIN_ROLE to this (being the instance service).
76
- // This will allow the instance service to bootstrap the authorizations of the instance.
77
- // Instance service will not use oz access manager directlly but through instance access manager instead
78
- // Instance service will renounce ADMIN_ROLE when bootstraping is finished
79
- clonedOzAccessManager.initialize(address(this));
106
+ // create instance admin and instance
107
+ InstanceAdmin instanceAdmin = _createInstanceAdmin();
108
+ clonedInstance = _createInstance(instanceAdmin, instanceOwner);
80
109
 
81
- clonedInstance = Instance(Clones.clone(_masterInstance));
82
- clonedInstance.initialize(
83
- address(clonedOzAccessManager),
84
- address(getRegistry()),
85
- instanceOwner);
86
- // initialize and set before instance reader
87
- InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
88
- clonedInstanceStore.initialize(address(clonedInstance));
89
- clonedInstance.setInstanceStore(clonedInstanceStore);
90
-
91
- InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
92
- clonedInstanceReader.initialize(address(clonedInstance));
93
- clonedInstance.setInstanceReader(clonedInstanceReader);
94
-
95
- BundleManager clonedBundleManager = BundleManager(Clones.clone(_masterInstanceBundleManager));
96
- clonedBundleManager.initialize(address(clonedInstance));
97
- clonedInstance.setBundleManager(clonedBundleManager);
98
-
99
- InstanceAccessManager clonedInstanceAccessManager = InstanceAccessManager(Clones.clone(_masterInstanceAccessManager));
100
- clonedOzAccessManager.grantRole(ADMIN_ROLE().toInt(), address(clonedInstanceAccessManager), 0);
101
- clonedInstanceAccessManager.initialize(address(clonedInstance));
102
- clonedInstance.setInstanceAccessManager(clonedInstanceAccessManager);
103
-
104
- // TODO amend setters with instance specific , policy manager ...
105
-
106
- // TODO library does external calls -> but it is registry and access manager -> find out is it best practice
107
- InstanceAuthorizationsLib.grantInitialAuthorizations(
108
- clonedInstanceAccessManager,
109
- clonedInstance,
110
- clonedBundleManager,
111
- clonedInstanceStore,
112
- instanceOwner,
113
- getRegistry(),
114
- getVersion().toMajorPart());
110
+ // register cloned instance with registry
111
+ clonedInstanceNftId = _registryService.registerInstance(
112
+ clonedInstance, instanceOwner).nftId;
115
113
 
116
- clonedOzAccessManager.renounceRole(ADMIN_ROLE().toInt(), address(this));
114
+ // register cloned instance as staking target
115
+ _stakingService.createInstanceTarget(
116
+ clonedInstanceNftId,
117
+ TargetManagerLib.getDefaultLockingPeriod(),
118
+ TargetManagerLib.getDefaultRewardRate());
117
119
 
118
- IRegistry.ObjectInfo memory info = _registryService.registerInstance(clonedInstance, instanceOwner);
119
- clonedInstanceNftId = info.nftId;
120
+ // MUST be set after instance is set up and registered
121
+ instanceAdmin.initializeInstanceAuthorization(address(clonedInstance));
120
122
 
121
123
  emit LogInstanceCloned(
122
- address(clonedOzAccessManager),
123
- address(clonedInstanceAccessManager),
124
- address(clonedInstance),
125
- address(clonedInstanceStore),
126
- address(clonedBundleManager),
127
- address(clonedInstanceReader),
128
- clonedInstanceNftId);
124
+ clonedInstanceNftId,
125
+ address(clonedInstance));
126
+ }
127
+
128
+
129
+ function setStakingLockingPeriod(Seconds stakeLockingPeriod)
130
+ external
131
+ virtual
132
+ onlyInstance()
133
+ {
134
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
135
+ _stakingService.setInstanceLockingPeriod(
136
+ instanceNftId,
137
+ stakeLockingPeriod);
138
+ }
139
+
140
+
141
+ function setStakingRewardRate(UFixed rewardRate)
142
+ external
143
+ virtual
144
+ onlyInstance()
145
+ {
146
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
147
+ _stakingService.setInstanceRewardRate(
148
+ instanceNftId,
149
+ rewardRate);
150
+ }
151
+
152
+
153
+ function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
154
+ external
155
+ virtual
156
+ onlyInstance()
157
+ {
158
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
159
+ _stakingService.refillInstanceRewardReserves(
160
+ instanceNftId,
161
+ rewardProvider,
162
+ dipAmount);
163
+ }
164
+
165
+
166
+ function withdrawStakingRewardReserves(Amount dipAmount)
167
+ external
168
+ virtual
169
+ onlyInstance()
170
+ returns (Amount newBalance)
171
+ {
172
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
173
+ _stakingService.withdrawInstanceRewardReserves(
174
+ instanceNftId,
175
+ dipAmount);
176
+ }
177
+
178
+
179
+ function setComponentLocked(bool locked)
180
+ external
181
+ virtual
182
+ onlyComponent()
183
+ {
184
+ // checks
185
+ address componentAddress = msg.sender;
186
+
187
+ if (!IInstanceLinkedComponent(componentAddress).supportsInterface(type(IInstanceLinkedComponent).interfaceId)) {
188
+ revert ErrorInstanceServiceComponentNotInstanceLinked(componentAddress);
189
+ }
190
+
191
+ IRegistry registry = getRegistry();
192
+ NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
193
+
194
+ IInstance instance = IInstance(
195
+ registry.getObjectAddress(instanceNftId));
196
+
197
+ // no revert in case already locked
198
+ // TODO refactor/implement
199
+ // instance.getInstanceAdmin().setTargetLockedByService(
200
+ // componentAddress,
201
+ // locked);
202
+ }
203
+
204
+
205
+ function getMasterInstanceReader() external view returns (address) {
206
+ return _masterInstanceReader;
129
207
  }
130
208
 
131
209
  function setAndRegisterMasterInstance(address instanceAddress)
@@ -134,38 +212,39 @@ contract InstanceService is
134
212
  returns(NftId masterInstanceNftId)
135
213
  {
136
214
  if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
137
- if(_masterOzAccessManager != address(0)) { revert ErrorInstanceServiceMasterOzAccessManagerAlreadySet(); }
138
- if(_masterInstanceAccessManager != address(0)) { revert ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet(); }
139
- if(_masterInstanceBundleManager != address(0)) { revert ErrorInstanceServiceMasterBundleManagerAlreadySet(); }
215
+ if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
216
+ if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
140
217
 
141
218
  if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
142
219
 
143
220
  IInstance instance = IInstance(instanceAddress);
144
- InstanceAccessManager instanceAccessManager = instance.getInstanceAccessManager();
145
- address instanceAccessManagerAddress = address(instanceAccessManager);
221
+ address accessManagerAddress = instance.authority();
222
+ InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
223
+ address instanceAdminAddress = address(instanceAdmin);
146
224
  InstanceReader instanceReader = instance.getInstanceReader();
147
225
  address instanceReaderAddress = address(instanceReader);
148
- BundleManager bundleManager = instance.getBundleManager();
226
+ BundleSet bundleManager = instance.getBundleSet();
149
227
  address bundleManagerAddress = address(bundleManager);
150
228
  InstanceStore instanceStore = instance.getInstanceStore();
151
229
  address instanceStoreAddress = address(instanceStore);
152
230
 
153
- if(instanceAccessManagerAddress == address(0)) { revert ErrorInstanceServiceInstanceAccessManagerZero(); }
231
+ if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
232
+ if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
154
233
  if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
155
- if(bundleManagerAddress == address(0)) { revert ErrorInstanceServiceBundleManagerZero(); }
234
+ if(bundleManagerAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
156
235
  if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
157
236
 
158
- if(instance.authority() != instanceAccessManager.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
159
- if(bundleManager.authority() != instanceAccessManager.authority()) { revert ErrorInstanceServiceBundleManagerAuthorityMismatch(); }
160
- if(instanceStore.authority() != instanceAccessManager.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
237
+ if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
238
+ if(bundleManager.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
239
+ if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
161
240
  if(bundleManager.getInstance() != instance) { revert ErrorInstanceServiceBundleMangerInstanceMismatch(); }
162
241
  if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
163
242
 
164
- _masterOzAccessManager = instance.authority();
165
- _masterInstanceAccessManager = instanceAccessManagerAddress;
243
+ _masterAccessManager = accessManagerAddress;
244
+ _masterInstanceAdmin = instanceAdminAddress;
166
245
  _masterInstance = instanceAddress;
167
246
  _masterInstanceReader = instanceReaderAddress;
168
- _masterInstanceBundleManager = bundleManagerAddress;
247
+ _masterInstanceBundleSet = bundleManagerAddress;
169
248
  _masterInstanceStore = instanceStoreAddress;
170
249
 
171
250
  IInstance masterInstance = IInstance(_masterInstance);
@@ -173,7 +252,7 @@ contract InstanceService is
173
252
  masterInstanceNftId = info.nftId;
174
253
  }
175
254
 
176
- function setMasterInstanceReader(address instanceReaderAddress) external onlyOwner {
255
+ function upgradeMasterInstanceReader(address instanceReaderAddress) external onlyOwner {
177
256
  if(_masterInstanceReader == address(0)) { revert ErrorInstanceServiceMasterInstanceReaderNotSet(); }
178
257
  if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderAddressZero(); }
179
258
  if(instanceReaderAddress == _masterInstanceReader) { revert ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader(); }
@@ -193,64 +272,85 @@ contract InstanceService is
193
272
  Instance instance = Instance(instanceInfo.objectAddress);
194
273
 
195
274
  InstanceReader upgradedInstanceReaderClone = InstanceReader(Clones.clone(address(_masterInstanceReader)));
196
- upgradedInstanceReaderClone.initialize(address(instance));
275
+ upgradedInstanceReaderClone.initializeWithInstance(address(instance));
197
276
  instance.setInstanceReader(upgradedInstanceReaderClone);
198
277
  }
199
278
 
279
+ /// @dev create new cloned instance admin
280
+ /// function used to setup a new instance
281
+ function _createInstanceAdmin()
282
+ internal
283
+ virtual
284
+ returns (InstanceAdmin clonedInstanceAdmin)
285
+ {
286
+ // start with setting up a new OZ access manager
287
+ AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
288
+ Clones.clone(_masterAccessManager));
289
+
290
+ // set up the instance admin
291
+ clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
292
+ clonedAccessManager.initialize(
293
+ address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
294
+
295
+ clonedInstanceAdmin.initialize(
296
+ clonedAccessManager,
297
+ InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
298
+ }
299
+
300
+
301
+ /// @dev create new cloned instance
302
+ /// function used to setup a new instance
303
+ function _createInstance(
304
+ InstanceAdmin instanceAdmin,
305
+ address instanceOwner
306
+ )
307
+ internal
308
+ virtual
309
+ returns (Instance clonedInstance)
310
+ {
311
+ InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
312
+ BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
313
+ InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
314
+
315
+ // clone instance
316
+ clonedInstance = Instance(Clones.clone(_masterInstance));
317
+ clonedInstance.initialize(
318
+ instanceAdmin,
319
+ clonedInstanceStore,
320
+ clonedBundleSet,
321
+ clonedInstanceReader,
322
+ getRegistry(),
323
+ instanceOwner);
324
+ }
325
+
200
326
 
201
- // all gif targets MUST be childs of instanceNftId
202
- function createGifTarget(
327
+ /// all gif targets MUST be children of instanceNftId
328
+ function _createGifTarget(
203
329
  NftId instanceNftId,
204
330
  address targetAddress,
205
331
  string memory targetName,
206
- bytes4[][] memory selectors,
207
- RoleId[] memory roles
332
+ RoleId[] memory roles,
333
+ bytes4[][] memory selectors
208
334
  )
209
- external
210
- restricted
335
+ internal
336
+ virtual
211
337
  {
338
+ // TODO instanceAdmin will check target instance match anyway
212
339
  (
213
340
  IInstance instance, // or instanceInfo
214
341
  // or targetInfo
215
342
  ) = _validateInstanceAndComponent(instanceNftId, targetAddress);
216
343
 
217
- InstanceAccessManager accessManager = instance.getInstanceAccessManager();
218
- accessManager.createGifTarget(targetAddress, targetName);
219
- // set proposed target config
220
- // TODO restriction: gif targets are set only once and only here?
221
- // assume config is a mix of gif and custom roles and no further configuration by INSTANCE_OWNER_ROLE is ever needed?
222
- for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++)
223
- {
224
- accessManager.setCoreTargetFunctionRole(targetName, selectors[roleIdx], roles[roleIdx]);
225
- }
226
- }
227
-
228
-
229
- // TODO called by component, but target can be component helper...so needs target name
230
- // TODO check that targetName associated with component...how???
231
- function setComponentLocked(bool locked) onlyComponent external {
232
-
233
- address componentAddress = msg.sender;
234
- IRegistry registry = getRegistry();
235
- NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
236
-
237
- IInstance instance = IInstance(
238
- registry.getObjectInfo(
239
- instanceNftId).objectAddress);
240
-
241
- instance.getInstanceAccessManager().setTargetLockedByService(
242
- componentAddress,
243
- locked);
244
- }
344
+ InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
245
345
 
346
+ // TODO refactor/implement
347
+ // instanceAdmin.createGifTarget(targetAddress, targetName);
246
348
 
247
- function getMasterInstanceReader() external view returns (address) {
248
- return _masterInstanceReader;
249
- }
250
-
251
- // From IService
252
- function getDomain() public pure override returns(ObjectType) {
253
- return INSTANCE();
349
+ // set proposed target config
350
+ for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++) {
351
+ // TODO refactor/implement
352
+ // instanceAdmin.setTargetFunctionRoleByService(targetName, selectors[roleIdx], roles[roleIdx]);
353
+ }
254
354
  }
255
355
 
256
356
  /// @dev top level initializer
@@ -259,23 +359,20 @@ contract InstanceService is
259
359
  bytes memory data
260
360
  )
261
361
  internal
262
- initializer
263
362
  virtual override
363
+ initializer()
264
364
  {
265
365
  (
266
- address registryAddress,,
267
- //address managerAddress
366
+ address registryAddress,
268
367
  address authority
269
- ) = abi.decode(data, (address, address, address));
368
+ ) = abi.decode(data, (address, address));
270
369
 
271
- initializeService(registryAddress, authority, owner);
370
+ _initializeService(registryAddress, authority, owner);
272
371
 
273
- _registryService = IRegistryService(
274
- IRegistry(registryAddress).getServiceAddress(
275
- REGISTRY(),
276
- getVersion().toMajorPart()));
372
+ _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
373
+ _stakingService = IStakingService(_getServiceAddress(STAKING()));
277
374
 
278
- registerInterface(type(IInstanceService).interfaceId);
375
+ _registerInterface(type(IInstanceService).interfaceId);
279
376
  }
280
377
 
281
378
 
@@ -287,15 +384,27 @@ contract InstanceService is
287
384
  IRegistry registry = getRegistry();
288
385
  IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
289
386
  if(instanceInfo.objectType != INSTANCE()) {
290
- revert ErrorInstanceServiceNotInstance(instanceNftId);
387
+ revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
291
388
  }
292
389
 
293
- IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
294
- if(componentInfo.parentNftId != instanceNftId) {
295
- revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
390
+ if (registry.getNftIdForAddress(componentAddress).gtz()) {
391
+ IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
392
+
393
+ if(componentInfo.parentNftId != instanceNftId) {
394
+ revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
395
+ }
396
+
397
+ componentNftId = componentInfo.nftId;
398
+ } else {
399
+
296
400
  }
297
401
 
298
402
  instance = Instance(instanceInfo.objectAddress);
299
- componentNftId = componentInfo.nftId;
403
+
404
+ }
405
+
406
+ // From IService
407
+ function _getDomain() internal pure override returns(ObjectType) {
408
+ return INSTANCE();
300
409
  }
301
410
  }
@@ -1,13 +1,9 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {Instance} from "./Instance.sol";
5
- import {IVersionable} from "../shared/IVersionable.sol";
6
- import {ProxyManager} from "../shared/ProxyManager.sol";
4
+ import {IVersionable} from "../upgradeability/IVersionable.sol";
5
+ import {ProxyManager} from "../upgradeability/ProxyManager.sol";
7
6
  import {InstanceService} from "./InstanceService.sol";
8
- import {Registry} from "../registry/Registry.sol";
9
- import {RegistryService} from "../registry/RegistryService.sol";
10
- import {REGISTRY} from "../type/ObjectType.sol";
11
7
 
12
8
  contract InstanceServiceManager is ProxyManager {
13
9
 
@@ -16,16 +12,15 @@ contract InstanceServiceManager is ProxyManager {
16
12
  /// @dev initializes proxy manager with instance service implementation
17
13
  constructor(
18
14
  address authority,
19
- address registryAddress,
15
+ address registry,
20
16
  bytes32 salt
21
17
  )
22
- ProxyManager(registryAddress)
23
18
  {
24
- InstanceService instSrv = new InstanceService{salt: salt}();
25
- // bytes memory initCode = type(InstanceService).creationCode;
26
- bytes memory data = abi.encode(registryAddress, address(this), authority);
27
- IVersionable versionable = deployDetermenistic(
28
- address(instSrv),
19
+ InstanceService svc = new InstanceService{salt: salt}();
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
+ address(svc),
29
24
  data,
30
25
  salt);
31
26