@etherisc/gif-next 0.0.2-b2910e7-757 → 0.0.2-b312c9a-831

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 (352) hide show
  1. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1000 -0
  3. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +746 -0
  5. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
  6. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +767 -0
  7. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +2 -2
  9. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
  10. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
  11. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
  14. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  17. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  18. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +1 -1
  19. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  20. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  21. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  22. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +24 -42
  23. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  24. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
  25. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  26. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +0 -18
  27. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  28. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +58 -58
  29. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  30. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +30 -30
  31. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  32. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -18
  33. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  34. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  35. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  36. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +40 -14
  37. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  38. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +24 -24
  39. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  40. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +86 -60
  41. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  42. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +17 -17
  43. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  44. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  45. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +39 -26
  46. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
  47. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
  48. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  49. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +16 -34
  50. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  51. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +33 -20
  52. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
  53. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
  54. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  55. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +50 -24
  56. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
  57. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
  58. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  59. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
  60. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  61. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +46 -0
  62. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  63. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +22 -2
  64. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  65. package/artifacts/contracts/instance/Instance.sol/Instance.json +64 -13
  66. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +83 -70
  68. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +40 -27
  70. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +298 -65
  72. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +44 -24
  74. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  75. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +12 -12
  76. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  77. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
  78. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
  79. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
  80. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  81. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  82. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  83. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  84. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  85. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  86. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  87. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  88. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  89. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  90. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  91. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  92. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  93. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  94. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  95. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  96. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  97. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -32
  98. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  99. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  100. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  101. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  102. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -18
  103. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  104. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -18
  106. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  107. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +70 -62
  108. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  109. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +36 -16
  110. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  111. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -18
  112. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  113. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
  114. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  115. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +68 -177
  116. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +35 -63
  118. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  119. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +0 -42
  120. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  121. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +0 -18
  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/Pool.sol/Pool.json +0 -18
  125. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  126. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -78
  127. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  128. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +32 -24
  129. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  130. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +44 -25
  131. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  132. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +6 -10
  133. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  134. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -18
  135. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  136. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  137. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  138. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +2 -2
  139. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  140. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
  141. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +34 -7
  143. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  145. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +31 -18
  146. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  147. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  148. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +0 -18
  149. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  150. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  151. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +119 -122
  152. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  153. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -37
  154. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  155. package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
  156. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  157. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
  158. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  159. package/artifacts/contracts/product/Product.sol/Product.json +0 -18
  160. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  161. package/artifacts/contracts/product/RiskService.sol/RiskService.json +20 -20
  162. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  163. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +11 -11
  164. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  165. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  166. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  167. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  168. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  169. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  170. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  171. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +58 -58
  172. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  173. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
  174. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  175. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
  176. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  177. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  178. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  179. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  180. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  181. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  182. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  183. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  184. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  185. package/artifacts/contracts/shared/Component.sol/Component.json +0 -18
  186. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  187. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +70 -428
  188. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  189. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +36 -64
  190. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  191. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  192. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +383 -6
  193. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
  194. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
  195. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
  196. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
  197. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  198. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -18
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  200. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +0 -270
  201. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  202. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -18
  203. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  204. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  205. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  206. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  207. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  208. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  209. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  210. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  211. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  212. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -18
  213. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  214. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  215. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  216. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  217. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  218. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  219. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  220. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  221. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  222. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  223. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  224. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  225. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  226. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  227. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  228. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  229. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  230. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  231. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  232. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  233. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +0 -18
  234. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  235. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  236. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
  237. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  238. package/artifacts/contracts/staking/Staking.sol/Staking.json +26 -26
  239. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  240. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  241. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  242. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +14 -14
  243. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  244. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  245. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  246. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
  247. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  248. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +2 -2
  249. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  250. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  251. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  252. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  253. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  254. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  255. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  256. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  257. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  258. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  259. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  260. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  261. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  262. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  263. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
  264. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
  265. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  266. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
  267. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  268. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  269. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  270. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
  271. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  273. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  275. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  277. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +43 -5
  279. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  281. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  282. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  284. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  286. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  288. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  290. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  291. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  292. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  293. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
  294. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  295. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  296. package/contracts/accounting/AccountingService.sol +264 -0
  297. package/contracts/accounting/AccountingServiceManager.sol +38 -0
  298. package/contracts/accounting/IAccountingService.sol +45 -0
  299. package/contracts/authorization/AccessAdmin.sol +21 -1
  300. package/contracts/distribution/BasicDistribution.sol +4 -4
  301. package/contracts/distribution/Distribution.sol +27 -24
  302. package/contracts/distribution/DistributionService.sol +10 -7
  303. package/contracts/examples/fire/FirePool.sol +6 -2
  304. package/contracts/examples/fire/FirePoolAuthorization.sol +1 -0
  305. package/contracts/examples/fire/FireProduct.sol +5 -0
  306. package/contracts/examples/fire/FireProductAuthorization.sol +1 -0
  307. package/contracts/examples/unpermissioned/SimpleDistribution.sol +6 -7
  308. package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
  309. package/contracts/examples/unpermissioned/SimplePool.sol +7 -8
  310. package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
  311. package/contracts/examples/unpermissioned/SimpleProduct.sol +7 -0
  312. package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
  313. package/contracts/instance/BundleSet.sol +38 -34
  314. package/contracts/instance/IInstance.sol +6 -0
  315. package/contracts/instance/IInstanceService.sol +5 -1
  316. package/contracts/instance/Instance.sol +14 -5
  317. package/contracts/instance/InstanceAdmin.sol +3 -1
  318. package/contracts/instance/InstanceAuthorizationV3.sol +42 -14
  319. package/contracts/instance/InstanceReader.sol +85 -1
  320. package/contracts/instance/InstanceService.sol +18 -7
  321. package/contracts/instance/RiskSet.sol +119 -0
  322. package/contracts/instance/base/ObjectSet.sol +24 -25
  323. package/contracts/instance/module/IRisk.sol +1 -0
  324. package/contracts/oracle/OracleService.sol +87 -70
  325. package/contracts/pool/BundleService.sol +9 -69
  326. package/contracts/pool/IBundleService.sol +0 -19
  327. package/contracts/pool/IPoolService.sol +0 -19
  328. package/contracts/pool/PoolService.sol +49 -54
  329. package/contracts/product/ApplicationService.sol +12 -12
  330. package/contracts/product/BasicProductAuthorization.sol +1 -2
  331. package/contracts/product/IApplicationService.sol +5 -2
  332. package/contracts/product/IPolicyService.sol +14 -6
  333. package/contracts/product/PolicyService.sol +233 -192
  334. package/contracts/product/Product.sol +2 -7
  335. package/contracts/product/RiskService.sol +14 -3
  336. package/contracts/registry/RegistryAdmin.sol +7 -12
  337. package/contracts/registry/ServiceAuthorizationV3.sol +43 -39
  338. package/contracts/shared/Component.sol +5 -20
  339. package/contracts/shared/ComponentService.sol +79 -205
  340. package/contracts/shared/ContractLib.sol +181 -11
  341. package/contracts/shared/IComponent.sol +0 -5
  342. package/contracts/shared/IComponentService.sol +1 -19
  343. package/contracts/shared/InstanceLinkedComponent.sol +1 -1
  344. package/contracts/shared/TokenHandler.sol +1 -9
  345. package/contracts/staking/Staking.sol +10 -0
  346. package/contracts/staking/StakingService.sol +0 -13
  347. package/contracts/type/Key32.sol +2 -2
  348. package/contracts/type/Key32Set.sol +62 -0
  349. package/contracts/type/NftId.sol +6 -0
  350. package/contracts/type/ObjectType.sol +10 -0
  351. package/contracts/type/RiskId.sol +18 -6
  352. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IAccountingService} from "../accounting/IAccountingService.sol";
4
5
  import {IBundle} from "../instance/module/IBundle.sol";
5
6
  import {IBundleService} from "./IBundleService.sol";
6
7
  import {IComponents} from "../instance/module/IComponents.sol";
@@ -15,23 +16,24 @@ import {IStaking} from "../staking/IStaking.sol";
15
16
 
16
17
  import {Amount, AmountLib} from "../type/Amount.sol";
17
18
  import {ClaimId} from "../type/ClaimId.sol";
19
+ import {ContractLib} from "../shared/ContractLib.sol";
18
20
  import {Fee, FeeLib} from "../type/Fee.sol";
19
21
  import {NftId} from "../type/NftId.sol";
20
- import {ObjectType, POOL, BUNDLE, PRODUCT, POLICY, COMPONENT} from "../type/ObjectType.sol";
22
+ import {ObjectType, ACCOUNTING, POOL, BUNDLE, PRODUCT, POLICY, COMPONENT} from "../type/ObjectType.sol";
21
23
  import {Fee, FeeLib} from "../type/Fee.sol";
22
24
  import {KEEP_STATE} from "../type/StateId.sol";
23
- import {Seconds} from "../type/Seconds.sol";
24
25
  import {UFixed} from "../type/UFixed.sol";
25
- import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
26
+ import {Service} from "../shared/Service.sol";
26
27
  import {InstanceReader} from "../instance/InstanceReader.sol";
27
28
  import {InstanceStore} from "../instance/InstanceStore.sol";
28
29
 
29
30
  string constant POOL_SERVICE_NAME = "PoolService";
30
31
 
31
32
  contract PoolService is
32
- ComponentVerifyingService,
33
+ Service,
33
34
  IPoolService
34
35
  {
36
+ IAccountingService private _accountingService;
35
37
  IBundleService internal _bundleService;
36
38
  IComponentService internal _componentService;
37
39
  IStaking private _staking;
@@ -51,6 +53,7 @@ contract PoolService is
51
53
 
52
54
  _initializeService(registryAddress, authority, owner);
53
55
 
56
+ _accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
54
57
  _bundleService = IBundleService(_getServiceAddress(BUNDLE()));
55
58
  _componentService = IComponentService(_getServiceAddress(COMPONENT()));
56
59
  _staking = IStaking(getRegistry().getStakingAddress());
@@ -64,7 +67,7 @@ contract PoolService is
64
67
  external
65
68
  virtual
66
69
  {
67
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
70
+ (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
68
71
  InstanceReader instanceReader = instance.getInstanceReader();
69
72
  IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
70
73
 
@@ -75,32 +78,6 @@ contract PoolService is
75
78
  emit LogPoolServiceMaxBalanceAmountUpdated(poolNftId, previousMaxBalanceAmount, maxBalanceAmount);
76
79
  }
77
80
 
78
- // TODO cleanup
79
- // /// @inheritdoc IPoolService
80
- // function createBundle(
81
- // address bundleOwner, // initial bundle owner
82
- // Fee memory fee, // fees deducted from premium that go to bundle owner
83
- // Seconds lifetime, // initial duration for which new policies are covered
84
- // bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
85
- // )
86
- // external
87
- // virtual
88
- // returns(NftId bundleNftId)
89
- // {
90
- // (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
91
-
92
- // // create the empty bundle
93
- // bundleNftId = _bundleService.create(
94
- // instance,
95
- // poolNftId,
96
- // bundleOwner,
97
- // fee,
98
- // lifetime,
99
- // filter);
100
-
101
- // emit LogPoolServiceBundleCreated(instance.getNftId(), poolNftId, bundleNftId);
102
- // }
103
-
104
81
 
105
82
  function closeBundle(NftId bundleNftId)
106
83
  external
@@ -108,14 +85,14 @@ contract PoolService is
108
85
  {
109
86
  _checkNftType(bundleNftId, BUNDLE());
110
87
 
111
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
88
+ (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
112
89
 
113
90
  // TODO get performance fee for pool (#477)
114
91
 
115
92
  // releasing collateral in bundle
116
93
  (Amount unstakedAmount, Amount feeAmount) = _bundleService.close(instance, bundleNftId);
117
94
 
118
- _componentService.decreasePoolBalance(
95
+ _accountingService.decreasePoolBalance(
119
96
  instance.getInstanceStore(),
120
97
  poolNftId,
121
98
  unstakedAmount + feeAmount,
@@ -144,9 +121,9 @@ contract PoolService is
144
121
  {
145
122
  _checkNftType(policyNftId, POLICY());
146
123
 
147
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
124
+ (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
148
125
  InstanceReader instanceReader = instance.getInstanceReader();
149
- NftId productNftId = _getProductNftId(poolNftId);
126
+ NftId productNftId = getRegistry().getObjectInfo(poolNftId).parentNftId;
150
127
 
151
128
  // check policy matches with calling pool
152
129
  IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
@@ -176,7 +153,7 @@ contract PoolService is
176
153
  {
177
154
  _checkNftType(bundleNftId, BUNDLE());
178
155
 
179
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
156
+ (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
180
157
  InstanceReader instanceReader = instance.getInstanceReader();
181
158
  IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
182
159
  IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
@@ -208,7 +185,7 @@ contract PoolService is
208
185
  }
209
186
 
210
187
  // do all the book keeping
211
- _componentService.increasePoolBalance(
188
+ _accountingService.increasePoolBalance(
212
189
  instance.getInstanceStore(),
213
190
  poolNftId,
214
191
  netAmount,
@@ -241,7 +218,7 @@ contract PoolService is
241
218
  {
242
219
  _checkNftType(bundleNftId, BUNDLE());
243
220
 
244
- (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
221
+ (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
245
222
  InstanceReader instanceReader = instance.getInstanceReader();
246
223
  InstanceStore instanceStore = instance.getInstanceStore();
247
224
  IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
@@ -260,7 +237,7 @@ contract PoolService is
260
237
  netAmount = unstakedAmount;
261
238
 
262
239
  // update pool bookkeeping - performance fees stay in the pool, but as fees
263
- _componentService.decreasePoolBalance(
240
+ _accountingService.decreasePoolBalance(
264
241
  instanceStore,
265
242
  poolNftId,
266
243
  unstakedAmount,
@@ -289,9 +266,9 @@ contract PoolService is
289
266
  // restricted()
290
267
  {
291
268
  (
292
- NftId poolNftId,,
269
+ NftId poolNftId,
293
270
  IInstance instance
294
- ) = _getAndVerifyActiveComponent(POOL());
271
+ ) = _getAndVerifyActivePool();
295
272
 
296
273
  // check that pool is externally managed
297
274
  InstanceReader reader = instance.getInstanceReader();
@@ -316,9 +293,9 @@ contract PoolService is
316
293
  // restricted()
317
294
  {
318
295
  (
319
- NftId poolNftId,,
296
+ NftId poolNftId,
320
297
  IInstance instance
321
- ) = _getAndVerifyActiveComponent(POOL());
298
+ ) = _getAndVerifyActivePool();
322
299
 
323
300
  // check that pool is externally managed
324
301
  InstanceReader reader = instance.getInstanceReader();
@@ -349,22 +326,21 @@ contract PoolService is
349
326
 
350
327
  IRegistry registry = getRegistry();
351
328
  NftId poolNftId = registry.getObjectInfo(bundleNftId).parentNftId;
352
- IInstance instance = _getInstanceForComponent(
353
- registry,
354
- registry.getObjectInfo(poolNftId).parentNftId);
329
+ (, address instanceAddress) = ContractLib.getInfoAndInstance(registry, poolNftId, true);
330
+ IInstance instance = IInstance(instanceAddress);
355
331
 
356
332
  Amount poolFeeAmount = premium.poolFeeFixAmount + premium.poolFeeVarAmount;
357
333
  Amount bundleFeeAmount = premium.bundleFeeFixAmount + premium.bundleFeeVarAmount;
358
334
  Amount bundleNetAmount = premium.netPremiumAmount;
359
335
 
360
336
  InstanceStore instanceStore = instance.getInstanceStore();
361
- _componentService.increasePoolBalance(
337
+ _accountingService.increasePoolBalance(
362
338
  instanceStore,
363
339
  poolNftId,
364
340
  bundleNetAmount + bundleFeeAmount,
365
341
  poolFeeAmount);
366
342
 
367
- _componentService.increaseBundleBalance(
343
+ _accountingService.increaseBundleBalanceForPool(
368
344
  instanceStore,
369
345
  bundleNftId,
370
346
  bundleNetAmount,
@@ -450,13 +426,13 @@ contract PoolService is
450
426
  NftId poolNftId = getRegistry().getObjectInfo(bundleNftId).parentNftId;
451
427
  InstanceStore instanceStore = instance.getInstanceStore();
452
428
 
453
- _componentService.decreasePoolBalance(
429
+ _accountingService.decreasePoolBalance(
454
430
  instanceStore,
455
431
  poolNftId,
456
432
  payoutAmount,
457
433
  AmountLib.zero());
458
434
 
459
- _componentService.decreaseBundleBalance(
435
+ _accountingService.decreaseBundleBalanceForPool(
460
436
  instanceStore,
461
437
  bundleNftId,
462
438
  payoutAmount,
@@ -498,10 +474,6 @@ contract PoolService is
498
474
  policyInfo.bundleNftId,
499
475
  remainingCollateralAmount);
500
476
 
501
- _bundleService.unlinkPolicy(
502
- instance,
503
- policyNftId);
504
-
505
477
  // update value locked with staking service
506
478
  _staking.decreaseTotalValueLocked(
507
479
  instance.getNftId(),
@@ -614,6 +586,29 @@ contract PoolService is
614
586
  }
615
587
 
616
588
 
589
+ function _getAndVerifyActivePool()
590
+ internal
591
+ virtual
592
+ view
593
+ returns (
594
+ NftId poolNftId,
595
+ IInstance instance
596
+ )
597
+ {
598
+ (
599
+ IRegistry.ObjectInfo memory info,
600
+ address instanceAddress
601
+ ) = ContractLib.getAndVerifyComponent(
602
+ getRegistry(),
603
+ msg.sender,
604
+ POOL(),
605
+ true); // only active pools
606
+
607
+ poolNftId = info.nftId;
608
+ instance = IInstance(instanceAddress);
609
+ }
610
+
611
+
617
612
  function _getDomain() internal pure override returns(ObjectType) {
618
613
  return POOL();
619
614
  }
@@ -55,10 +55,10 @@ contract ApplicationService is
55
55
  }
56
56
 
57
57
 
58
- function _checkLinkedpplicationParameters(
58
+ function _checkLinkedApplicationParameters(
59
59
  InstanceReader instanceReader,
60
60
  NftId productNftId,
61
- RiskId rirskId,
61
+ RiskId riskId,
62
62
  ReferralId referralId,
63
63
  NftId bundleNftId
64
64
  )
@@ -66,18 +66,18 @@ contract ApplicationService is
66
66
  virtual
67
67
  view
68
68
  {
69
- IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
69
+ // check risk with product
70
+ (bool exists, bool active) = instanceReader.getRiskSet().checkRisk(productNftId, riskId);
71
+ if (!exists) { revert ErrorApplicationServiceRiskUnknown(riskId, productNftId); }
72
+ if (!active) { revert ErrorApplicationServiceRiskPaused(riskId, productNftId); }
70
73
 
71
- // TODO check riskId with product
74
+ // check bundle with pool
75
+ NftId poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
76
+ (exists, active) = instanceReader.getBundleSet().checkBundle(poolNftId, bundleNftId);
77
+ if (!exists) { revert ErrorApplicationServiceBundleUnknown(bundleNftId, poolNftId); }
78
+ if (!active) { revert ErrorApplicationServiceBundleLocked(bundleNftId, poolNftId); }
72
79
 
73
80
  // TODO check referral with distribution
74
-
75
- // check bundle with pool
76
- NftId productPoolNftId = productInfo.poolNftId;
77
- NftId bundlePoolNftId = instanceReader.getBundleInfo(bundleNftId).poolNftId;
78
- if(bundlePoolNftId != productPoolNftId) {
79
- revert ErrorApplicationServiceBundlePoolMismatch(bundleNftId, productPoolNftId, bundlePoolNftId);
80
- }
81
81
  }
82
82
 
83
83
 
@@ -143,7 +143,7 @@ contract ApplicationService is
143
143
 
144
144
  // check if provided references are valid and linked to calling product contract
145
145
  InstanceReader instanceReader = instance.getInstanceReader();
146
- _checkLinkedpplicationParameters(
146
+ _checkLinkedApplicationParameters(
147
147
  instanceReader,
148
148
  productNftId,
149
149
  riskId,
@@ -6,8 +6,7 @@ import {BasicProduct} from "./BasicProduct.sol";
6
6
  import {PRODUCT} from "../type/ObjectType.sol";
7
7
  import {IAccess} from "../authorization/IAccess.sol";
8
8
  import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
9
- import {PUBLIC_ROLE} from "../../contracts/type/RoleId.sol";
10
- import {RoleId} from "../type/RoleId.sol";
9
+ import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
11
10
 
12
11
 
13
12
  contract BasicProductAuthorization
@@ -15,8 +15,11 @@ import {Seconds} from "../type/Seconds.sol";
15
15
  /// only product components may call transaction functions
16
16
  interface IApplicationService is IService {
17
17
 
18
- error ErrorApplicationServiceNotProduct(NftId callerNftId, ObjectType callerType);
19
- error ErrorApplicationServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
18
+ // _checkLinkedApplicationParameters
19
+ error ErrorApplicationServiceRiskUnknown(RiskId riskId, NftId productNftId);
20
+ error ErrorApplicationServiceRiskPaused(RiskId riskId, NftId productNftId);
21
+ error ErrorApplicationServiceBundleUnknown(NftId bundleNftId, NftId poolNftId);
22
+ error ErrorApplicationServiceBundleLocked(NftId bundleNftId, NftId poolNftId);
20
23
 
21
24
  /// @dev creates a new application based on the specified attributes
22
25
  /// may only be called by a product component
@@ -5,6 +5,7 @@ import {IService} from "../shared/IService.sol";
5
5
 
6
6
  import {Amount} from "../type/Amount.sol";
7
7
  import {IInstance} from "../instance/IInstance.sol";
8
+ import {InstanceReader} from "../instance/InstanceReader.sol";
8
9
  import {NftId} from "../type/NftId.sol";
9
10
  import {StateId} from "../type/StateId.sol";
10
11
  import {Timestamp} from "../type/Timestamp.sol";
@@ -28,8 +29,9 @@ interface IPolicyService is IService {
28
29
 
29
30
  error ErrorPolicyServiceInsufficientAllowance(address customer, address tokenHandlerAddress, uint256 amount);
30
31
  error ErrorPolicyServicePremiumAlreadyPaid(NftId policyNftId);
31
- error ErrorPolicyServicePolicyNotActivated(NftId policyNftId);
32
- error ErrorPolicyServicePolicyAlreadyClosed(NftId policyNftId);
32
+
33
+ error ErrorPolicyServicePolicyNotCloseable(NftId policyNftId);
34
+
33
35
  error ErrorPolicyServicePolicyNotActive(NftId policyNftId, StateId state);
34
36
  error ErrorPolicyServicePremiumNotPaid(NftId policyNftId, Amount premiumAmount);
35
37
  error ErrorPolicyServiceOpenClaims(NftId policyNftId, uint16 openClaimsCount);
@@ -65,18 +67,24 @@ interface IPolicyService is IService {
65
67
  /// to activate a policy it needs to be in underwritten state
66
68
  function activate(NftId policyNftId, Timestamp activateAt) external;
67
69
 
68
- /// @dev expires the specified policy and sets the expiry date in the policy metadata. If expiry date is set to 0, then the earliest possible expiry date (current blocktime) is set
70
+ /// @dev Expires the specified policy and sets the expiry date in the policy metadata.
71
+ /// Function consumers are products.
72
+ /// If expiry date is set to 0, then the earliest possible expiry date (current blocktime) is set
69
73
  /// to expire a policy it must be in active state, policies may be expired even when the predefined expiry date is still in the future
70
74
  /// a policy can only be closed when it has been expired. in addition, it must not have any open claims
71
75
  /// this function can only be called by a product. the policy needs to match with the calling product
72
76
  /// @return expiredAt the effective expiry date
73
77
  function expire(NftId policyNftId, Timestamp expireAt) external returns (Timestamp expiredAt);
74
78
 
75
- function expirePolicy(IInstance instance, NftId policyNftId, Timestamp expireAt) external returns (Timestamp expiredAt);
76
-
77
- /// @dev closes the specified policy and sets the closed data in the policy metadata
79
+ /// @dev Closes the specified policy and sets the closed data in the policy metadata
78
80
  /// a policy can only be closed when it has been expired. in addition, it must not have any open claims
79
81
  /// this function can only be called by a product. the policy needs to match with the calling product
80
82
  function close(NftId policyNftId) external;
81
83
 
84
+ /// @dev Expires the specified policy and sets the expiry date in the policy metadata.
85
+ /// Function consumers is claim service.
86
+ function expirePolicy(IInstance instance, NftId policyNftId, Timestamp expireAt) external returns (Timestamp expiredAt);
87
+
88
+ /// @dev Returns true iff policy is closeable
89
+ function policyIsCloseable(InstanceReader instanceReader, NftId policyNftId) external view returns (bool isCloseable);
82
90
  }