@etherisc/gif-next 0.0.2-9e6b423-414 → 0.0.2-9f51324-299

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 (337) hide show
  1. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
  3. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +2 -2
  5. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +97 -267
  8. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
  9. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
  10. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +36 -652
  12. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
  14. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +47 -222
  16. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  17. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  18. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +27 -175
  19. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  20. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -85
  21. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  22. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +16 -246
  23. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  24. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +27 -420
  25. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  26. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +3 -3
  27. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  28. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +60 -221
  29. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  30. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -1
  31. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  32. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +114 -167
  33. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  34. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +60 -72
  35. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  36. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  37. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +0 -29
  38. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  39. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  40. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +2 -2
  41. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  42. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +59 -220
  43. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  44. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2 -2
  45. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  46. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +59 -220
  47. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  48. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  49. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +3 -3
  50. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  51. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +59 -220
  52. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  53. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
  54. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  55. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +2 -2
  56. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  57. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +59 -220
  58. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  59. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2 -2
  60. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
  61. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +59 -220
  62. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  63. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  64. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  65. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +32 -310
  66. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  67. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +0 -182
  68. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  69. package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -322
  70. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +292 -605
  72. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +56 -242
  74. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  75. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +290 -478
  76. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +26 -208
  78. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +14 -14
  80. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  81. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
  82. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  83. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  84. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  85. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  86. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  87. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  88. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  89. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  90. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  91. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  92. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  93. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  94. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
  95. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  96. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  97. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  98. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  99. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  100. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  101. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  102. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
  103. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  104. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +56 -234
  105. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  106. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  107. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  108. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  109. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  110. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
  111. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  112. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
  113. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  114. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  115. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +59 -220
  116. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  117. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -92
  118. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  119. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +55 -31
  120. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  121. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  122. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  123. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  124. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  125. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +26 -92
  126. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  127. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
  128. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  129. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +2 -2
  130. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  131. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +36 -60
  132. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  133. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +19 -15
  134. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  135. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  136. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +59 -220
  137. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  138. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
  139. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  140. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +40 -40
  141. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  143. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  145. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  146. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  147. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  148. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
  149. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  150. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +26 -82
  151. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  152. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
  153. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  154. package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
  155. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  156. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
  157. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  158. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  159. package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
  160. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  161. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +2 -2
  162. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  163. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  164. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  165. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  166. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  167. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  168. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  169. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  170. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +249 -378
  171. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
  172. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +68 -243
  173. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  174. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  175. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  176. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +10 -10
  177. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  178. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +186 -384
  179. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  180. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  181. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  182. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +76 -128
  183. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  184. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -437
  185. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  186. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  187. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  188. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  189. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +54 -54
  190. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  191. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +28 -28
  192. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  193. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  194. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +45 -16
  195. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  196. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  197. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  198. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  200. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  202. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  203. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  204. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  205. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  206. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  207. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  208. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  209. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  210. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  211. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  212. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  213. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  214. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  215. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  216. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  217. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  218. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  219. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  220. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  221. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  222. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  223. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  224. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  225. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  226. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  227. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  228. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  229. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  230. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  231. package/artifacts/contracts/staking/Staking.sol/Staking.json +8 -8
  232. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
  233. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
  234. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  235. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  236. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  237. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +5 -5
  238. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  239. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  240. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  241. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
  242. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  243. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +2 -2
  244. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  245. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  246. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  247. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
  248. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  249. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  250. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  251. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  252. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  253. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  255. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  256. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  257. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  258. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  259. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
  260. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  261. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  262. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  263. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  264. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  265. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +6 -6
  266. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  267. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  268. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  269. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  270. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  271. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  272. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  273. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
  274. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +218 -39
  276. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  277. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  279. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/String.sol/StrLib.json +2 -50
  282. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  284. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  286. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  287. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  288. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
  289. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  290. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  291. package/contracts/authorization/AccessAdmin.sol +185 -261
  292. package/contracts/authorization/AccessAdminLib.sol +7 -220
  293. package/contracts/authorization/Authorization.sol +229 -38
  294. package/contracts/authorization/IAccess.sol +4 -14
  295. package/contracts/authorization/IAccessAdmin.sol +45 -19
  296. package/contracts/authorization/IAuthorization.sol +56 -3
  297. package/contracts/authorization/IServiceAuthorization.sol +17 -55
  298. package/contracts/authorization/ServiceAuthorization.sol +33 -247
  299. package/contracts/distribution/BasicDistributionAuthorization.sol +4 -11
  300. package/contracts/distribution/Distribution.sol +1 -2
  301. package/contracts/distribution/DistributionService.sol +33 -75
  302. package/contracts/distribution/IDistributionComponent.sol +1 -3
  303. package/contracts/distribution/IDistributionService.sol +4 -10
  304. package/contracts/instance/IInstance.sol +4 -43
  305. package/contracts/instance/IInstanceService.sol +3 -28
  306. package/contracts/instance/Instance.sol +39 -80
  307. package/contracts/instance/InstanceAdmin.sol +229 -162
  308. package/contracts/instance/InstanceAuthorizationV3.sol +28 -58
  309. package/contracts/instance/InstanceReader.sol +389 -371
  310. package/contracts/instance/InstanceService.sol +53 -105
  311. package/contracts/oracle/BasicOracleAuthorization.sol +2 -18
  312. package/contracts/pool/BasicPoolAuthorization.sol +3 -9
  313. package/contracts/pool/BundleService.sol +9 -8
  314. package/contracts/pool/PoolLib.sol +0 -44
  315. package/contracts/product/ApplicationService.sol +26 -4
  316. package/contracts/product/BasicProductAuthorization.sol +4 -9
  317. package/contracts/product/ClaimService.sol +20 -11
  318. package/contracts/product/PolicyService.sol +2 -2
  319. package/contracts/product/PolicyServiceLib.sol +0 -20
  320. package/contracts/registry/RegistryAdmin.sol +97 -27
  321. package/contracts/registry/RegistryAuthorization.sol +25 -35
  322. package/contracts/registry/ReleaseAdmin.sol +100 -42
  323. package/contracts/registry/ReleaseRegistry.sol +9 -12
  324. package/contracts/registry/ServiceAuthorizationV3.sol +20 -32
  325. package/contracts/registry/TokenRegistry.sol +4 -2
  326. package/contracts/shared/ComponentService.sol +5 -22
  327. package/contracts/shared/ContractLib.sol +45 -9
  328. package/contracts/shared/IRegisterable.sol +1 -0
  329. package/contracts/shared/Service.sol +4 -6
  330. package/contracts/staking/Staking.sol +5 -4
  331. package/contracts/staking/TargetManagerLib.sol +1 -1
  332. package/contracts/type/ObjectType.sol +3 -16
  333. package/contracts/type/RoleId.sol +59 -57
  334. package/contracts/type/String.sol +0 -12
  335. package/contracts/upgradeability/ProxyManager.sol +2 -2
  336. package/contracts/upgradeability/Versionable.sol +1 -4
  337. package/package.json +1 -1
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
5
5
 
6
- import {IAccess} from "../authorization/IAccess.sol";
7
6
  import {IAuthorization} from "../authorization/IAuthorization.sol";
8
7
  import {IComponentService} from "../shared/IComponentService.sol";
9
8
  import {IInstance} from "./IInstance.sol";
@@ -57,123 +56,45 @@ contract InstanceService is
57
56
  }
58
57
 
59
58
 
60
- /// @inheritdoc IInstanceService
61
- function createRole(
62
- string memory roleName,
63
- RoleId adminRoleId,
64
- uint32 maxMemberCount
65
- )
66
- external
67
- restricted()
68
- onlyInstance()
69
- returns (RoleId roleId)
70
- {
71
- IInstance instance = IInstance(msg.sender);
72
- roleId = instance.getInstanceAdmin().createRole(
73
- roleName,
74
- adminRoleId,
75
- maxMemberCount);
76
- }
77
-
78
-
79
- /// @inheritdoc IInstanceService
80
- function setRoleActive(RoleId roleId, bool active)
81
- external
82
- restricted()
83
- onlyInstance()
84
- {
85
- IInstance instance = IInstance(msg.sender);
86
- instance.getInstanceAdmin().setRoleActive(roleId, active);
87
- }
88
-
89
-
90
- /// @inheritdoc IInstanceService
91
- function grantRole(RoleId roleId, address account)
92
- external
93
- restricted()
94
- onlyInstance()
95
- {
96
- IInstance instance = IInstance(msg.sender);
97
- instance.getInstanceAdmin().grantRole(roleId, account);
98
- }
99
-
100
-
101
- /// @inheritdoc IInstanceService
102
- function revokeRole(RoleId roleId, address account)
103
- external
104
- restricted()
105
- onlyInstance()
106
- {
107
- IInstance instance = IInstance(msg.sender);
108
- instance.getInstanceAdmin().revokeRole(roleId, account);
109
- }
110
-
111
-
112
- /// @inheritdoc IInstanceService
113
- function createTarget(address target, string memory name)
114
- external
115
- restricted()
116
- onlyInstance()
117
- returns (RoleId contractRoleId)
118
- {
119
- IInstance instance = IInstance(msg.sender);
120
- return instance.getInstanceAdmin().createTarget(target, name);
121
- }
122
-
123
-
124
- /// @inheritdoc IInstanceService
125
- function authorizeFunctions(
126
- address target,
127
- RoleId roleId,
128
- IAccess.FunctionInfo[] memory functions
129
- )
130
- external
131
- restricted()
132
- onlyInstance()
133
- {
134
- IInstance instance = IInstance(msg.sender);
135
- return instance.getInstanceAdmin().authorizeFunctions(target, roleId, functions);
59
+ modifier onlyInstanceOwner(NftId instanceNftId) {
60
+ if(msg.sender != getRegistry().ownerOf(instanceNftId)) {
61
+ revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
62
+ }
63
+ _;
136
64
  }
137
65
 
138
66
 
139
- /// @inheritdoc IInstanceService
140
- function unauthorizeFunctions(
141
- address target,
142
- IAccess.FunctionInfo[] memory functions
143
- )
144
- external
145
- restricted()
146
- onlyInstance()
147
- {
148
- IInstance instance = IInstance(msg.sender);
149
- return instance.getInstanceAdmin().unauthorizeFunctions(target, functions);
67
+ // TODO check component - service - instance version match
68
+ modifier onlyComponent() {
69
+ if (! getRegistry().isRegisteredComponent(msg.sender)) {
70
+ revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
71
+ }
72
+ _;
150
73
  }
151
74
 
152
-
153
75
  /// @inheritdoc IInstanceService
154
- function setTargetLocked(address target, bool locked)
76
+ function setInstanceLocked(bool locked)
155
77
  external
156
78
  virtual
157
79
  restricted()
158
80
  onlyInstance()
159
81
  {
160
82
  address instanceAddress = msg.sender;
161
- IInstance(instanceAddress).getInstanceAdmin().setTargetLocked(target, locked);
83
+ IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
162
84
  }
163
85
 
164
86
 
165
- /// @inheritdoc IInstanceService
166
- function setInstanceLocked(bool locked)
87
+ /// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
88
+ function setTargetLocked(address target, bool locked)
167
89
  external
168
90
  virtual
169
91
  restricted()
170
92
  onlyInstance()
171
93
  {
172
94
  address instanceAddress = msg.sender;
173
- IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
95
+ IInstance(instanceAddress).getInstanceAdmin().setTargetLocked(target, locked);
174
96
  }
175
97
 
176
-
177
98
  /// @inheritdoc IInstanceService
178
99
  function createInstance(bool allowAnyToken)
179
100
  external
@@ -199,9 +120,9 @@ contract InstanceService is
199
120
  IAuthorization instanceAuthorization = InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization();
200
121
  instanceAdmin.completeSetup(
201
122
  address(getRegistry()),
123
+ address(instance),
202
124
  address(instanceAuthorization),
203
- getRelease(),
204
- address(instance));
125
+ getRelease());
205
126
 
206
127
  // hard checks for newly cloned instance
207
128
  assert(address(instance.getRegistry()) == address(getRegistry()));
@@ -279,7 +200,7 @@ contract InstanceService is
279
200
  returns (Amount newBalance)
280
201
  {
281
202
  NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
282
- newBalance = _stakingService.withdrawInstanceRewardReserves(
203
+ _stakingService.withdrawInstanceRewardReserves(
283
204
  instanceNftId,
284
205
  dipAmount);
285
206
  }
@@ -353,7 +274,6 @@ contract InstanceService is
353
274
  masterInstanceNftId = info.nftId;
354
275
  }
355
276
 
356
-
357
277
  function upgradeMasterInstanceReader(address instanceReaderAddress)
358
278
  external
359
279
  onlyOwner
@@ -368,14 +288,10 @@ contract InstanceService is
368
288
  _masterInstanceReader = instanceReaderAddress;
369
289
  }
370
290
 
371
- //--- view functions ------------------------------------------------------------//
372
-
373
291
  function getMasterInstanceReader() external view returns (address) {
374
292
  return _masterInstanceReader;
375
293
  }
376
294
 
377
- //--- internal functions --------------------------------------------------------//
378
-
379
295
  /// @dev create new cloned instance admin
380
296
  /// function used to setup a new instance
381
297
  function _cloneNewInstanceAdmin()
@@ -426,7 +342,36 @@ contract InstanceService is
426
342
  }
427
343
 
428
344
 
429
- /// @dev top level initializer (upgradable contract)
345
+ /// all gif targets MUST be children of instanceNftId
346
+ function _createGifTarget(
347
+ NftId instanceNftId,
348
+ address targetAddress,
349
+ string memory targetName,
350
+ RoleId[] memory roles,
351
+ bytes4[][] memory selectors
352
+ )
353
+ internal
354
+ virtual
355
+ {
356
+ // TODO instanceAdmin will check target instance match anyway
357
+ (
358
+ IInstance instance, // or instanceInfo
359
+ // or targetInfo
360
+ ) = _validateInstanceAndComponent(instanceNftId, targetAddress);
361
+
362
+ InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
363
+
364
+ // TODO refactor/implement
365
+ // instanceAdmin.createGifTarget(targetAddress, targetName);
366
+
367
+ // set proposed target config
368
+ for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++) {
369
+ // TODO refactor/implement
370
+ // instanceAdmin.setTargetFunctionRoleByService(targetName, selectors[roleIdx], roles[roleIdx]);
371
+ }
372
+ }
373
+
374
+ /// @dev top level initializer
430
375
  function _initialize(
431
376
  address owner,
432
377
  bytes memory data
@@ -469,9 +414,12 @@ contract InstanceService is
469
414
  }
470
415
 
471
416
  componentNftId = componentInfo.nftId;
417
+ } else {
418
+
472
419
  }
473
420
 
474
- instance = Instance(instanceInfo.objectAddress);
421
+ instance = Instance(instanceInfo.objectAddress);
422
+
475
423
  }
476
424
 
477
425
 
@@ -14,26 +14,10 @@ contract BasicOracleAuthorization
14
14
  is Authorization
15
15
  {
16
16
 
17
- constructor(
18
- string memory componentName,
19
- string memory commitHash
20
- )
21
- Authorization(
22
- componentName,
23
- ORACLE(),
24
- 3,
25
- commitHash,
26
- true,
27
- false)
17
+ constructor(string memory componentName)
18
+ Authorization(componentName, ORACLE(), true, false)
28
19
  {}
29
20
 
30
- function _setupServiceTargets()
31
- internal
32
- virtual override
33
- {
34
- _authorizeServiceDomain(ORACLE(), address(15));
35
- }
36
-
37
21
  function _setupTargetAuthorizations()
38
22
  internal
39
23
  virtual override
@@ -18,21 +18,15 @@ contract BasicPoolAuthorization
18
18
  {
19
19
 
20
20
  constructor(string memory poolName)
21
- Authorization(
22
- poolName,
23
- POOL(),
24
- 3,
25
- COMMIT_HASH,
26
- true,
27
- true)
21
+ Authorization(poolName, POOL(), true, true)
28
22
  {}
29
23
 
30
24
  function _setupServiceTargets()
31
25
  internal
32
26
  virtual override
33
27
  {
34
- _authorizeServiceDomain(COMPONENT(), address(11));
35
- _authorizeServiceDomain(POOL(), address(12));
28
+ _addServiceTargetWithRole(COMPONENT());
29
+ _addServiceTargetWithRole(POOL());
36
30
  }
37
31
 
38
32
  function _setupTokenHandlerAuthorizations() internal virtual override {
@@ -13,19 +13,20 @@ import {InstanceStore} from "../instance/InstanceStore.sol";
13
13
 
14
14
  import {Amount, AmountLib} from "../type/Amount.sol";
15
15
  import {BundleSet} from "../instance/BundleSet.sol";
16
- import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
17
16
  import {Fee} from "../type/Fee.sol";
18
17
  import {InstanceReader} from "../instance/InstanceReader.sol";
19
18
  import {NftId, NftIdLib} from "../type/NftId.sol";
20
19
  import {ObjectType, ACCOUNTING, COMPONENT, POOL, BUNDLE, POLICY, REGISTRY} from "../type/ObjectType.sol";
21
- import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
20
+ import {PoolLib} from "./PoolLib.sol";
22
21
  import {Seconds} from "../type/Seconds.sol";
22
+ import {Service} from "../shared/Service.sol";
23
+ import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
23
24
  import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
24
25
 
25
26
  string constant BUNDLE_SERVICE_NAME = "BundleService";
26
27
 
27
28
  contract BundleService is
28
- ComponentVerifyingService,
29
+ Service,
29
30
  IBundleService
30
31
  {
31
32
 
@@ -69,7 +70,7 @@ contract BundleService is
69
70
  {
70
71
  _checkNftType(bundleNftId, BUNDLE());
71
72
 
72
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
73
+ (NftId poolNftId, IInstance instance) = PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
73
74
  InstanceReader instanceReader = instance.getInstanceReader();
74
75
  IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
75
76
  if(bundleInfo.poolNftId.eqz()) {
@@ -96,7 +97,7 @@ contract BundleService is
96
97
  restricted()
97
98
  returns(NftId bundleNftId)
98
99
  {
99
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
100
+ (NftId poolNftId, IInstance instance) = PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
100
101
 
101
102
  // register bundle with registry
102
103
  bundleNftId = _registryService.registerBundle(
@@ -190,7 +191,7 @@ contract BundleService is
190
191
  // checks
191
192
  _checkNftType(bundleNftId, BUNDLE());
192
193
 
193
- (,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
194
+ (, IInstance instance) = PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
194
195
 
195
196
  // udpate bundle state
196
197
  instance.getInstanceStore().updateBundleState(bundleNftId, PAUSED());
@@ -212,7 +213,7 @@ contract BundleService is
212
213
  // checks
213
214
  _checkNftType(bundleNftId, BUNDLE());
214
215
 
215
- (,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
216
+ (, IInstance instance) = PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
216
217
 
217
218
  // effects
218
219
  // udpate bundle state
@@ -344,7 +345,7 @@ contract BundleService is
344
345
  // checks
345
346
  _checkNftType(bundleNftId, BUNDLE());
346
347
 
347
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
348
+ (NftId poolNftId, IInstance instance) = PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
348
349
  IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
349
350
  StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
350
351
 
@@ -206,50 +206,6 @@ library PoolLib {
206
206
  instance = IInstance(instanceAddress);
207
207
  }
208
208
 
209
-
210
- function getAndVerifyActiveComponent(
211
- IRegistry registry,
212
- address sender,
213
- ObjectType expectedComponentType
214
- )
215
- public
216
- view
217
- returns (
218
- NftId componentNftId,
219
- IInstance instance
220
- )
221
- {
222
- (
223
- IRegistry.ObjectInfo memory info,
224
- address instanceAddress
225
- ) = ContractLib.getAndVerifyComponent(
226
- registry,
227
- sender,
228
- expectedComponentType,
229
- true); // only active components
230
-
231
- componentNftId = info.nftId;
232
- instance = IInstance(instanceAddress);
233
- }
234
-
235
-
236
- function getInstanceForComponent(
237
- IRegistry registry,
238
- NftId componentNftId
239
- )
240
- public
241
- view
242
- returns (
243
- IInstance instance
244
- )
245
- {
246
- NftId productNftId = registry.getParentNftId(componentNftId);
247
- NftId instanceNftId = registry.getParentNftId(productNftId);
248
- address instanceAddress = registry.getObjectAddress(instanceNftId);
249
- return IInstance(instanceAddress);
250
- }
251
-
252
-
253
209
  function checkNftType(
254
210
  IRegistry registry,
255
211
  NftId nftId,
@@ -11,6 +11,7 @@ import {IPricingService} from "./IPricingService.sol";
11
11
  import {IRegistryService} from "../registry/IRegistryService.sol";
12
12
 
13
13
  import {AmountLib} from "../type/Amount.sol";
14
+ import {ContractLib} from "../shared/ContractLib.sol";
14
15
  import {Seconds} from "../type/Seconds.sol";
15
16
  import {zeroTimestamp} from "../type/Timestamp.sol";
16
17
  import {ObjectType, BUNDLE, DISTRIBUTION, PRODUCT, REGISTRY, APPLICATION, POLICY, PRICE} from "../type/ObjectType.sol";
@@ -19,13 +20,13 @@ import {NftId, NftIdLib} from "../type/NftId.sol";
19
20
  import {ReferralId} from "../type/Referral.sol";
20
21
  import {RiskId} from "../type/RiskId.sol";
21
22
  import {Amount, AmountLib} from "../type/Amount.sol";
22
- import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
23
+ import {Service} from "../shared/Service.sol";
23
24
  import {InstanceReader} from "../instance/InstanceReader.sol";
24
25
 
25
26
 
26
27
 
27
28
  contract ApplicationService is
28
- ComponentVerifyingService,
29
+ Service,
29
30
  IApplicationService
30
31
  {
31
32
  IDistributionService private _distributionService;
@@ -155,7 +156,7 @@ contract ApplicationService is
155
156
  {
156
157
  _checkNftType(bundleNftId, BUNDLE());
157
158
 
158
- (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
159
+ (NftId productNftId, IInstance instance) = _getAndVerifyActiveProduct();
159
160
 
160
161
  // check if provided references are valid and linked to calling product contract
161
162
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -265,12 +266,33 @@ contract ApplicationService is
265
266
  {
266
267
  _checkNftType(applicationNftId, POLICY());
267
268
 
268
- (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
269
+ (, IInstance instance) = _getAndVerifyActiveProduct();
269
270
  instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
270
271
  }
271
272
 
272
273
  // internal functions
273
274
 
275
+ function _getAndVerifyActiveProduct()
276
+ internal
277
+ view
278
+ returns (
279
+ NftId productNftId,
280
+ IInstance instance
281
+ )
282
+ {
283
+ (
284
+ IRegistry.ObjectInfo memory info,
285
+ address instanceAddress
286
+ ) = ContractLib.getAndVerifyComponent(
287
+ getRegistry(),
288
+ msg.sender,
289
+ PRODUCT(),
290
+ true); // only active pools
291
+
292
+ productNftId = info.nftId;
293
+ instance = IInstance(instanceAddress);
294
+ }
295
+
274
296
 
275
297
  function _getDomain() internal pure override returns(ObjectType) {
276
298
  return APPLICATION();
@@ -14,22 +14,17 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
14
14
  contract BasicProductAuthorization
15
15
  is Authorization
16
16
  {
17
+
17
18
  constructor(string memory componentName)
18
- Authorization(
19
- componentName,
20
- PRODUCT(),
21
- 3,
22
- COMMIT_HASH,
23
- true,
24
- true)
19
+ Authorization(componentName, PRODUCT(), true, true)
25
20
  {}
26
21
 
27
22
  function _setupServiceTargets()
28
23
  internal
29
24
  virtual override
30
25
  {
31
- _authorizeServiceDomain(COMPONENT(), address(10));
32
- _authorizeServiceDomain(POLICY(), address(11));
26
+ _addServiceTargetWithRole(COMPONENT());
27
+ _addServiceTargetWithRole(POLICY());
33
28
  }
34
29
 
35
30
  function _setupTokenHandlerAuthorizations() internal virtual override {
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.20;
3
3
 
4
4
  import {IClaimService} from "./IClaimService.sol";
5
+ import {IComponents} from "../instance/module/IComponents.sol";
5
6
  import {IInstance} from "../instance/IInstance.sol";
6
7
  import {IPolicy} from "../instance/module/IPolicy.sol";
7
8
  import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
@@ -13,10 +14,11 @@ import {IRegistry} from "../registry/IRegistry.sol";
13
14
  import {Amount, AmountLib} from "../type/Amount.sol";
14
15
  import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
15
16
  import {ContractLib} from "../shared/ContractLib.sol";
17
+ import {FeeLib} from "../type/Fee.sol";
16
18
  import {InstanceReader} from "../instance/InstanceReader.sol";
17
19
  import {InstanceStore} from "../instance/InstanceStore.sol";
18
20
  import {NftId} from "../type/NftId.sol";
19
- import {ObjectType, CLAIM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
21
+ import {ObjectType, COMPONENT, CLAIM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
20
22
  import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
21
23
  import {Service} from "../shared/Service.sol";
22
24
  import {StateId} from "../type/StateId.sol";
@@ -66,7 +68,8 @@ contract ClaimService is
66
68
  {
67
69
  // checks
68
70
  (
69
- ,,,
71
+ ,
72
+ IInstance instance,,
70
73
  InstanceStore instanceStore,
71
74
  IPolicy.PolicyInfo memory policyInfo
72
75
  ) = _verifyCallerWithPolicy(policyNftId);
@@ -167,7 +170,8 @@ contract ClaimService is
167
170
  _checkNftType(policyNftId, POLICY());
168
171
 
169
172
  (
170
- ,,
173
+ ,
174
+ IInstance instance,
171
175
  InstanceReader instanceReader,
172
176
  InstanceStore instanceStore,
173
177
  IPolicy.PolicyInfo memory policyInfo
@@ -197,7 +201,8 @@ contract ClaimService is
197
201
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
198
202
  {
199
203
  (
200
- ,,
204
+ ,
205
+ IInstance instance,
201
206
  InstanceReader instanceReader,
202
207
  InstanceStore instanceStore,
203
208
  IPolicy.PolicyInfo memory policyInfo
@@ -228,9 +233,11 @@ contract ClaimService is
228
233
  _checkNftType(policyNftId, POLICY());
229
234
 
230
235
  (
231
- ,,
236
+ ,
237
+ IInstance instance,
232
238
  InstanceReader instanceReader,
233
239
  InstanceStore instanceStore,
240
+ IPolicy.PolicyInfo memory policyInfo
234
241
  ) = _verifyCallerWithPolicy(policyNftId);
235
242
 
236
243
  // check/update claim info
@@ -318,7 +325,8 @@ contract ClaimService is
318
325
  {
319
326
  // checks
320
327
  (
321
- ,,
328
+ NftId productNftId,,
329
+ // IInstance instance,
322
330
  InstanceReader instanceReader,
323
331
  InstanceStore instanceStore,
324
332
  IPolicy.PolicyInfo memory policyInfo
@@ -350,8 +358,7 @@ contract ClaimService is
350
358
  Amount payoutAmount = payoutInfo.amount;
351
359
  {
352
360
  ClaimId claimId = payoutId.toClaimId();
353
- // TODO cleanup
354
- // IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
361
+ IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
355
362
  claimInfo.paidAmount = claimInfo.paidAmount.add(payoutAmount);
356
363
  claimInfo.openPayoutsCount -= 1;
357
364
 
@@ -396,9 +403,11 @@ contract ClaimService is
396
403
  {
397
404
  // checks
398
405
  (
399
- ,,
406
+ ,
407
+ IInstance instance,
400
408
  InstanceReader instanceReader,
401
409
  InstanceStore instanceStore,
410
+ IPolicy.PolicyInfo memory policyInfo
402
411
  ) = _verifyCallerWithPolicy(policyNftId);
403
412
 
404
413
  StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
@@ -521,7 +530,7 @@ contract ClaimService is
521
530
  IPolicy.PolicyInfo memory policyInfo
522
531
  )
523
532
  {
524
- (productNftId, instance) = _getAndVerifyActiveProduct();
533
+ (productNftId, instance) = _getAndVerifyActiveComponent(PRODUCT());
525
534
  instanceReader = instance.getInstanceReader();
526
535
  instanceStore = instance.getInstanceStore();
527
536
 
@@ -535,7 +544,7 @@ contract ClaimService is
535
544
  }
536
545
 
537
546
 
538
- function _getAndVerifyActiveProduct()
547
+ function _getAndVerifyActiveComponent(ObjectType expectedType)
539
548
  internal
540
549
  view
541
550
  returns (
@@ -205,7 +205,7 @@ contract PolicyService is
205
205
  }
206
206
 
207
207
  // check if premium has already been collected
208
- if (instanceReader.getPremiumState(policyNftId) == PAID()) {
208
+ if (instanceReader.getPremiumInfoState(policyNftId) == PAID()) {
209
209
  revert ErrorPolicyServicePremiumAlreadyPaid(policyNftId);
210
210
  }
211
211
 
@@ -395,7 +395,7 @@ contract PolicyService is
395
395
  RiskId riskId = policyInfo.riskId;
396
396
  NftId bundleNftId = policyInfo.bundleNftId;
397
397
 
398
- if (instanceReader.getPremiumState(policyNftId) != PAID()) {
398
+ if (instanceReader.getPremiumInfoState(policyNftId) != PAID()) {
399
399
  revert ErrorPolicyServicePremiumNotPaid(policyNftId, policyInfo.premiumAmount);
400
400
  }
401
401
 
@@ -10,26 +10,6 @@ import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
10
10
 
11
11
  library PolicyServiceLib {
12
12
 
13
- function policyIsActive(InstanceReader instanceReader, NftId policyNftId)
14
- external
15
- view
16
- returns (bool isActive)
17
- {
18
- // policy not collateralized
19
- if (instanceReader.getPolicyState(policyNftId) != COLLATERALIZED()) {
20
- return false;
21
- }
22
-
23
- IPolicy.PolicyInfo memory info = instanceReader.getPolicyInfo(policyNftId);
24
-
25
- if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
26
- if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
27
- if (info.activatedAt > TimestampLib.blockTimestamp()) { return false; } // not yet active
28
- if (info.expiredAt <= TimestampLib.blockTimestamp()) { return false; } // already expired
29
-
30
- return true;
31
- }
32
-
33
13
  function activate(
34
14
  NftId policyNftId,
35
15
  IPolicy.PolicyInfo memory policyInfo,