@etherisc/gif-next 0.0.2-de7c770-422 → 0.0.2-df73b56-462

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 (270) hide show
  1. package/README.md +1 -1
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +26 -45
  4. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  5. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +0 -19
  9. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  14. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  15. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +2 -2
  16. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  17. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
  18. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  20. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +9 -4
  21. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  22. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +92 -61
  23. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  24. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  25. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  26. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +2 -2
  27. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  28. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
  29. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  30. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +60 -32
  31. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  32. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +33 -28
  33. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  34. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  35. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  36. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  37. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  38. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  39. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  40. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +88 -91
  41. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  42. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  43. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  44. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +70 -60
  45. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  46. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +11 -6
  47. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  48. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -38
  49. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  50. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +32 -12
  51. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  52. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  53. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  54. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  55. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  56. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  57. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  58. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  59. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  60. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  61. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  63. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  64. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  65. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
  66. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  67. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  68. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  69. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  70. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  71. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  72. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  73. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +9 -4
  74. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  75. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +68 -37
  76. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  77. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +28 -0
  78. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  79. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
  80. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  81. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +15 -10
  82. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -59
  84. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  85. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  86. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +28 -0
  87. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  88. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  89. package/artifacts/contracts/pool/Pool.sol/Pool.json +28 -0
  90. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  91. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +35 -30
  92. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  93. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +71 -40
  94. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  95. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +17 -12
  96. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +65 -34
  98. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  99. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +5 -0
  100. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  101. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  102. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  103. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +91 -70
  104. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  105. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +97 -58
  106. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  107. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  108. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  109. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +82 -0
  110. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  111. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  112. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +5 -0
  113. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  114. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  115. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +167 -48
  116. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -45
  118. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  119. package/artifacts/contracts/product/PricingService.sol/PricingService.json +39 -34
  120. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -45
  122. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  123. package/artifacts/contracts/product/Product.sol/Product.json +5 -0
  124. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  125. package/artifacts/contracts/product/RiskService.sol/RiskService.json +11 -6
  126. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  127. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +62 -31
  128. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  129. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  130. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  131. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  132. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  133. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  134. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  135. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +108 -111
  136. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  137. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +9 -4
  138. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  139. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +60 -29
  140. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  141. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  142. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  143. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  144. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
  145. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  146. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  147. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  148. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  149. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +39 -34
  150. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  151. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +97 -56
  152. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  153. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -0
  154. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  155. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  156. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  157. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  158. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  159. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  160. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  161. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  162. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  163. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -5
  164. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  165. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  166. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  167. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  168. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  169. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  170. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  171. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  172. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  173. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  174. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  175. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +17 -7
  176. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  177. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  178. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  179. package/artifacts/contracts/shared/Service.sol/Service.json +5 -0
  180. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  181. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  182. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  183. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  184. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  185. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
  186. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  187. package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
  188. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  189. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  190. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +78 -42
  191. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  192. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  193. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  194. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +11 -6
  195. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  196. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +64 -33
  197. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  198. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  199. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  200. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  201. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  202. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  203. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  204. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  205. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  206. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  207. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  208. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  209. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  210. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  211. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  212. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  213. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  214. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  215. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  216. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  217. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  218. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  219. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  220. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  221. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  222. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  223. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  224. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  225. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  226. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  227. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  228. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +47 -27
  229. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  230. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  231. package/contracts/authorization/AccessAdmin.sol +24 -21
  232. package/contracts/authorization/IAccessAdmin.sol +0 -1
  233. package/contracts/distribution/DistributionService.sol +6 -6
  234. package/contracts/distribution/DistributionServiceManager.sol +6 -6
  235. package/contracts/instance/InstanceService.sol +2 -3
  236. package/contracts/instance/InstanceServiceManager.sol +6 -7
  237. package/contracts/instance/module/IComponents.sol +3 -1
  238. package/contracts/oracle/OracleService.sol +6 -4
  239. package/contracts/oracle/OracleServiceManager.sol +6 -6
  240. package/contracts/pool/BundleService.sol +6 -6
  241. package/contracts/pool/BundleServiceManager.sol +6 -6
  242. package/contracts/pool/IPoolComponent.sol +18 -8
  243. package/contracts/pool/Pool.sol +26 -10
  244. package/contracts/pool/PoolService.sol +2 -3
  245. package/contracts/pool/PoolServiceManager.sol +4 -4
  246. package/contracts/product/ApplicationService.sol +3 -4
  247. package/contracts/product/ApplicationServiceManager.sol +4 -4
  248. package/contracts/product/ClaimService.sol +147 -61
  249. package/contracts/product/ClaimServiceManager.sol +4 -4
  250. package/contracts/product/IPolicyService.sol +7 -3
  251. package/contracts/product/PolicyService.sol +93 -20
  252. package/contracts/product/PolicyServiceManager.sol +4 -4
  253. package/contracts/product/PricingService.sol +2 -3
  254. package/contracts/product/PricingServiceManager.sol +3 -3
  255. package/contracts/product/Product.sol +1 -0
  256. package/contracts/product/RiskService.sol +2 -3
  257. package/contracts/product/RiskServiceManager.sol +4 -4
  258. package/contracts/registry/RegistryServiceManager.sol +2 -2
  259. package/contracts/shared/ComponentService.sol +5 -5
  260. package/contracts/shared/ComponentServiceManager.sol +8 -5
  261. package/contracts/shared/ContractLib.sol +38 -0
  262. package/contracts/shared/IPolicyHolder.sol +12 -13
  263. package/contracts/shared/PolicyHolder.sol +7 -5
  264. package/contracts/shared/Service.sol +12 -7
  265. package/contracts/staking/Staking.sol +1 -1
  266. package/contracts/staking/StakingManager.sol +8 -6
  267. package/contracts/staking/StakingServiceManager.sol +2 -2
  268. package/contracts/upgradeability/ProxyManager.sol +67 -34
  269. package/contracts/upgradeability/Versionable.sol +2 -2
  270. package/package.json +1 -1
@@ -24,6 +24,7 @@ interface IComponents {
24
24
  struct ProductInfo {
25
25
  NftId distributionNftId;
26
26
  NftId poolNftId;
27
+ bool isProcessingFundedClaims; // custom logic to react to pool events for funded claims
27
28
  Fee productFee; // product fee on net premium
28
29
  Fee processingFee; // product fee on payout amounts
29
30
  Fee distributionFee; // distribution fee for sales that do not include commissions
@@ -37,7 +38,8 @@ interface IComponents {
37
38
  struct PoolInfo {
38
39
  Amount maxBalanceAmount; // max balance amount allowed for pool
39
40
  RoleId bundleOwnerRole; // the required role for bundle owners
40
- bool isInterceptingBundleTransfers; // intercepts nft transfers for bundles
41
+ bool isInterceptingBundleTransfers; // custom logic for bundle nft transfers
42
+ bool isProcessingConfirmedClaims; // custom logic for claims confirmation
41
43
  bool isExternallyManaged; // funding bundles is restricted to book keeping, actual funds may be provided as needed to support payouts
42
44
  bool isVerifyingApplications; // underwriting requires the pool component checks/confirms the applications
43
45
  UFixed collateralizationLevel; // factor to calculate collateral for sum insurance (default 100%)
@@ -30,10 +30,12 @@ contract OracleService is
30
30
  virtual override
31
31
  initializer()
32
32
  {
33
- address initialOwner;
34
- address registryAddress;
35
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
36
- _initializeService(registryAddress, address(0), owner);
33
+ (
34
+ address registryAddress,
35
+ address authority
36
+ ) = abi.decode(data, (address, address));
37
+
38
+ _initializeService(registryAddress, authority, owner);
37
39
  _registerInterface(type(IOracleService).interfaceId);
38
40
  }
39
41
 
@@ -12,15 +12,15 @@ contract OracleServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with service implementation and deploys instance
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
- OracleService orclSrv = new OracleService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
23
- address(orclSrv),
19
+ OracleService svc = new OracleService{salt: salt}();
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
+ address(svc),
24
24
  data,
25
25
  salt);
26
26
 
@@ -43,12 +43,12 @@ contract BundleService is
43
43
  virtual override
44
44
  initializer()
45
45
  {
46
- address registryAddress;
47
- address initialOwner;
48
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
49
- // TODO while PoolService is not deployed in PoolServiceManager constructor
50
- // owner is PoolServiceManager deployer
51
- _initializeService(registryAddress, address(0), owner);
46
+ (
47
+ address registryAddress,
48
+ address authority
49
+ ) = abi.decode(data, (address, address));
50
+
51
+ _initializeService(registryAddress, authority, owner);
52
52
 
53
53
  _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
54
54
  _componentService = IComponentService(_getServiceAddress(COMPONENT()));
@@ -12,15 +12,15 @@ contract BundleServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with pool service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
- BundleService bundleSrv = new BundleService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
23
- address(bundleSrv),
19
+ BundleService svc = new BundleService{salt: salt}();
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
+ address(svc),
24
24
  data,
25
25
  salt);
26
26
 
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.20;
3
3
 
4
4
  import {Amount} from "../type/Amount.sol";
5
+ import {ClaimId} from "../type/ClaimId.sol";
5
6
  import {Fee} from "../type/Fee.sol";
6
7
  import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
7
8
  import {IComponents} from "../instance/module/IComponents.sol";
@@ -20,10 +21,10 @@ interface IPoolComponent is IInstanceLinkedComponent {
20
21
 
21
22
  event LogPoolVerifiedByPool(address pool, NftId applicationNftId, Amount collateralizationAmount);
22
23
 
23
- /// @dev this is a callback function that is called by the product service when underwriting a policy.
24
- /// the pool has the option to check the details and object to underwriting by reverting.
25
- /// the function is only called for "active" pools that ask to be involved/notified
26
- /// by product related state changes.
24
+ /// @dev This is a callback function that is called by the product service when underwriting a policy.
25
+ /// The pool has the option to check the details and object to underwriting by reverting.
26
+ /// The function is only called for "active" pools that ask to be involved/notified.
27
+ /// The default implementation is empty.
27
28
  function verifyApplication(
28
29
  NftId applicationNftId,
29
30
  bytes memory applicationData,
@@ -32,9 +33,9 @@ interface IPoolComponent is IInstanceLinkedComponent {
32
33
  Amount collateralizationAmount
33
34
  ) external;
34
35
 
35
- /// @dev returns true iff the application matches with the bundle
36
- /// this is a callback function that is only called if a pool declares itself as a verifying pool
37
- /// default implementation returns true
36
+ /// @dev Returns true iff the application matches with the bundle.
37
+ /// This is a callback function that is only called if a pool declares itself as a verifying pool
38
+ /// The default implementation returns true.
38
39
  function applicationMatchesBundle(
39
40
  NftId applicationNftId,
40
41
  bytes memory applicationData,
@@ -46,13 +47,22 @@ interface IPoolComponent is IInstanceLinkedComponent {
46
47
  view
47
48
  returns (bool isMatching);
48
49
 
50
+ /// @dev This is a callback function that is called by the claim service when a claim is confirmed.
51
+ /// The pool has the option to implement custom behavirous such as triggering a reinsurance claim or blocking the claim confirmaation.
52
+ /// The default implementation is empty.
53
+ function processConfirmedClaim(
54
+ NftId policyNftId,
55
+ ClaimId claimId,
56
+ Amount amount
57
+ ) external;
58
+
49
59
  /// @dev Withdraw bundle feeds for the given bundle
50
60
  /// @param bundleNftId the bundle Nft Id
51
61
  /// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
52
62
  /// @return withdrawnAmount the effective withdrawn amount
53
63
  function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
54
64
 
55
- /// @dev returns initial pool specific infos for this pool
65
+ /// @dev Returns initial pool specific infos for this pool
56
66
  function getInitialPoolInfo() external view returns (IComponents.PoolInfo memory info);
57
67
 
58
68
  }
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {Amount, AmountLib} from "../type/Amount.sol";
5
5
  import {BUNDLE, COMPONENT, POOL} from "../type/ObjectType.sol";
6
+ import {ClaimId} from "../type/ClaimId.sol";
6
7
  import {IBundleService} from "./IBundleService.sol";
7
8
  import {IAuthorization} from "../authorization/IAuthorization.sol";
8
9
  import {IPoolComponent} from "./IPoolComponent.sol";
@@ -40,6 +41,16 @@ abstract contract Pool is
40
41
  }
41
42
 
42
43
 
44
+ function register()
45
+ external
46
+ virtual
47
+ onlyOwner()
48
+ {
49
+ _getPoolStorage()._componentService.registerPool();
50
+ _approveTokenHandler(type(uint256).max);
51
+ }
52
+
53
+
43
54
  /// @dev see {IPoolComponent.verifyApplication}
44
55
  function verifyApplication(
45
56
  NftId applicationNftId,
@@ -67,6 +78,20 @@ abstract contract Pool is
67
78
  }
68
79
 
69
80
 
81
+ /// @dev see {IPoolComponent.processConfirmedClaim}
82
+ function processConfirmedClaim(
83
+ NftId policyNftId,
84
+ ClaimId claimId,
85
+ Amount amount
86
+ )
87
+ public
88
+ virtual
89
+ restricted()
90
+ {
91
+ // default implementation is empty
92
+ }
93
+
94
+
70
95
  /// @dev see {IPoolComponent.applicationMatchesBundle}
71
96
  /// Override this function to implement any custom application verification
72
97
  /// Default implementation always returns true
@@ -85,16 +110,6 @@ abstract contract Pool is
85
110
  return true;
86
111
  }
87
112
 
88
-
89
- function register()
90
- external
91
- virtual
92
- onlyOwner()
93
- {
94
- _getPoolStorage()._componentService.registerPool();
95
- _approveTokenHandler(type(uint256).max);
96
- }
97
-
98
113
  /// @inheritdoc IPoolComponent
99
114
  function withdrawBundleFees(NftId bundleNftId, Amount amount)
100
115
  external
@@ -117,6 +132,7 @@ abstract contract Pool is
117
132
  maxBalanceAmount: AmountLib.max(),
118
133
  bundleOwnerRole: PUBLIC_ROLE(),
119
134
  isInterceptingBundleTransfers: isNftInterceptor(),
135
+ isProcessingConfirmedClaims: false,
120
136
  isExternallyManaged: false,
121
137
  isVerifyingApplications: false,
122
138
  collateralizationLevel: UFixedLib.toUFixed(1),
@@ -48,10 +48,9 @@ contract PoolService is
48
48
  initializer()
49
49
  {
50
50
  (
51
- address registryAddress,,
52
- //address managerAddress
51
+ address registryAddress,
53
52
  address authority
54
- ) = abi.decode(data, (address, address, address));
53
+ ) = abi.decode(data, (address, address));
55
54
 
56
55
  _initializeService(registryAddress, authority, owner);
57
56
 
@@ -12,14 +12,14 @@ contract PoolServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with pool service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  PoolService poolSrv = new PoolService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
23
  address(poolSrv),
24
24
  data,
25
25
  salt);
@@ -41,12 +41,11 @@ contract ApplicationService is
41
41
  initializer()
42
42
  {
43
43
  (
44
- address registryAddress,,
45
- //address managerAddress
44
+ address registryAddress,
46
45
  address authority
47
- ) = abi.decode(data, (address, address, address));
46
+ ) = abi.decode(data, (address, address));
48
47
 
49
- _initializeService(registryAddress, address(0), owner);
48
+ _initializeService(registryAddress, authority, owner);
50
49
 
51
50
  _distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
52
51
  _pricingService = IPricingService(_getServiceAddress(PRICE()));
@@ -12,14 +12,14 @@ contract ApplicationServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  ApplicationService svc = new ApplicationService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
23
  address(svc),
24
24
  data,
25
25
  salt);
@@ -1,9 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IComponents} from "../instance/module/IComponents.sol";
5
- import {IInstance} from "../instance/IInstance.sol";
6
- import {IPolicy} from "../instance/module/IPolicy.sol";
7
4
  import {Amount, AmountLib} from "../type/Amount.sol";
8
5
  import {TimestampLib} from "../type/Timestamp.sol";
9
6
  import {ObjectType, CLAIM, PRODUCT, POOL} from "../type/ObjectType.sol";
@@ -14,8 +11,14 @@ import {StateId} from "../type/StateId.sol";
14
11
  import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
15
12
  import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
16
13
  import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
14
+ import {ContractLib} from "../shared/ContractLib.sol";
17
15
  import {InstanceReader} from "../instance/InstanceReader.sol";
18
16
  import {IClaimService} from "./IClaimService.sol";
17
+ import {IComponents} from "../instance/module/IComponents.sol";
18
+ import {IInstance} from "../instance/IInstance.sol";
19
+ import {IPolicy} from "../instance/module/IPolicy.sol";
20
+ import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
21
+ import {IPoolComponent} from "../pool/IPoolComponent.sol";
19
22
  import {IPoolService} from "../pool/IPoolService.sol";
20
23
 
21
24
 
@@ -35,10 +38,9 @@ contract ClaimService is
35
38
  initializer()
36
39
  {
37
40
  (
38
- address registryAddress,,
39
- //address managerAddress
41
+ address registryAddress,
40
42
  address authority
41
- ) = abi.decode(data, (address, address, address));
43
+ ) = abi.decode(data, (address, address));
42
44
 
43
45
  _initializeService(registryAddress, authority, owner);
44
46
 
@@ -54,9 +56,11 @@ contract ClaimService is
54
56
  )
55
57
  external
56
58
  virtual
59
+ nonReentrant()
57
60
  returns (ClaimId claimId)
58
61
  {
59
62
  (
63
+ ,
60
64
  IInstance instance,
61
65
  InstanceReader instanceReader,
62
66
  IPolicy.PolicyInfo memory policyInfo
@@ -108,8 +112,10 @@ contract ClaimService is
108
112
  )
109
113
  external
110
114
  virtual
115
+ nonReentrant()
111
116
  {
112
117
  (
118
+ NftId productNftId,
113
119
  IInstance instance,
114
120
  InstanceReader instanceReader,
115
121
  IPolicy.PolicyInfo memory policyInfo
@@ -131,8 +137,15 @@ contract ClaimService is
131
137
  instance.getInstanceStore().updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
132
138
 
133
139
  emit LogClaimServiceClaimConfirmed(policyNftId, claimId, confirmedAmount);
140
+
141
+ // callback to pool if applicable
142
+ _processConfirmedClaimByPool(instanceReader, productNftId, policyNftId, claimId, confirmedAmount);
143
+
144
+ // callback to policy holder if applicable
145
+ _policyHolderClaimConfirmed(policyNftId, claimId, confirmedAmount);
134
146
  }
135
147
 
148
+
136
149
  function decline(
137
150
  NftId policyNftId,
138
151
  ClaimId claimId,
@@ -140,8 +153,10 @@ contract ClaimService is
140
153
  )
141
154
  external
142
155
  virtual
156
+ nonReentrant()
143
157
  {
144
158
  (
159
+ ,
145
160
  IInstance instance,
146
161
  InstanceReader instanceReader,
147
162
  IPolicy.PolicyInfo memory policyInfo
@@ -168,8 +183,10 @@ contract ClaimService is
168
183
  )
169
184
  external
170
185
  virtual
186
+ nonReentrant()
171
187
  {
172
188
  (
189
+ ,
173
190
  IInstance instance,
174
191
  InstanceReader instanceReader,
175
192
  IPolicy.PolicyInfo memory policyInfo
@@ -194,8 +211,10 @@ contract ClaimService is
194
211
  )
195
212
  external
196
213
  virtual
214
+ nonReentrant()
197
215
  {
198
216
  (
217
+ ,
199
218
  IInstance instance,
200
219
  InstanceReader instanceReader,
201
220
  IPolicy.PolicyInfo memory policyInfo
@@ -225,7 +244,7 @@ contract ClaimService is
225
244
  instance.getInstanceStore().updateClaim(policyNftId, claimId, claimInfo, CLOSED());
226
245
  }
227
246
 
228
- // TODO add test
247
+
229
248
  function createPayoutForBeneficiary(
230
249
  NftId policyNftId,
231
250
  ClaimId claimId,
@@ -235,6 +254,7 @@ contract ClaimService is
235
254
  )
236
255
  external
237
256
  virtual
257
+ nonReentrant()
238
258
  returns (PayoutId payoutId)
239
259
  {
240
260
  if (beneficiary == address(0)) {
@@ -258,6 +278,7 @@ contract ClaimService is
258
278
  )
259
279
  external
260
280
  virtual
281
+ nonReentrant()
261
282
  returns (PayoutId payoutId)
262
283
  {
263
284
  return _createPayout(
@@ -268,56 +289,6 @@ contract ClaimService is
268
289
  data);
269
290
  }
270
291
 
271
- function _createPayout(
272
- NftId policyNftId,
273
- ClaimId claimId,
274
- Amount amount,
275
- address beneficiary,
276
- bytes memory data
277
- )
278
- internal
279
- virtual
280
- returns (PayoutId payoutId)
281
- {
282
- (
283
- IInstance instance,
284
- InstanceReader instanceReader,
285
- IPolicy.PolicyInfo memory policyInfo
286
- ) = _verifyCallerWithPolicy(policyNftId);
287
-
288
- IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
289
- StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
290
-
291
- // TODO add checks
292
- // claim needs to be open
293
- // claim.paidAmount + amount <= claim.claimAmount
294
-
295
- // check/update claim info
296
- // create payout info with instance
297
- uint8 claimNo = claimInfo.payoutsCount + 1;
298
- payoutId = PayoutIdLib.toPayoutId(claimId, claimNo);
299
- instance.getInstanceStore().createPayout(
300
- policyNftId,
301
- payoutId,
302
- IPolicy.PayoutInfo({
303
- claimId: payoutId.toClaimId(),
304
- amount: amount,
305
- beneficiary: beneficiary,
306
- data: data,
307
- paidAt: TimestampLib.zero()}));
308
-
309
- // update and save claim info with instance
310
- claimInfo.payoutsCount += 1;
311
- claimInfo.openPayoutsCount += 1;
312
- instance.getInstanceStore().updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
313
-
314
- // update and save policy info with instance
315
- policyInfo.payoutAmount.add(amount);
316
- instance.getInstanceStore().updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
317
-
318
- emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount);
319
- }
320
-
321
292
 
322
293
  function processPayout(
323
294
  NftId policyNftId,
@@ -325,8 +296,10 @@ contract ClaimService is
325
296
  )
326
297
  external
327
298
  virtual
299
+ nonReentrant()
328
300
  {
329
301
  (
302
+ ,
330
303
  IInstance instance,
331
304
  InstanceReader instanceReader,
332
305
  IPolicy.PolicyInfo memory policyInfo
@@ -339,7 +312,6 @@ contract ClaimService is
339
312
  payoutInfo.paidAt = TimestampLib.blockTimestamp();
340
313
  instance.getInstanceStore().updatePayout(policyNftId, payoutId, payoutInfo, PAID());
341
314
 
342
- // TODO update and save claim info with instance
343
315
  ClaimId claimId = payoutId.toClaimId();
344
316
  Amount payoutAmount = payoutInfo.amount;
345
317
  IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
@@ -390,9 +362,65 @@ contract ClaimService is
390
362
  // TODO add 2nd token tx if processingFeeAmount > 0
391
363
  }
392
364
 
393
- // TODO callback IPolicyHolder
365
+ // callback to policy holder if applicable
366
+ _policyHolderPayoutExecuted(policyNftId, payoutId, beneficiary, payoutAmount);
394
367
  }
395
368
 
369
+ // internal functions
370
+
371
+
372
+ function _createPayout(
373
+ NftId policyNftId,
374
+ ClaimId claimId,
375
+ Amount amount,
376
+ address beneficiary,
377
+ bytes memory data
378
+ )
379
+ internal
380
+ virtual
381
+ returns (PayoutId payoutId)
382
+ {
383
+ (
384
+ ,
385
+ IInstance instance,
386
+ InstanceReader instanceReader,
387
+ IPolicy.PolicyInfo memory policyInfo
388
+ ) = _verifyCallerWithPolicy(policyNftId);
389
+
390
+ IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
391
+ StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
392
+
393
+ // TODO add checks
394
+ // claim needs to be open
395
+ // claim.paidAmount + amount <= claim.claimAmount
396
+
397
+ // check/update claim info
398
+ // create payout info with instance
399
+ uint8 claimNo = claimInfo.payoutsCount + 1;
400
+ payoutId = PayoutIdLib.toPayoutId(claimId, claimNo);
401
+ instance.getInstanceStore().createPayout(
402
+ policyNftId,
403
+ payoutId,
404
+ IPolicy.PayoutInfo({
405
+ claimId: payoutId.toClaimId(),
406
+ amount: amount,
407
+ beneficiary: beneficiary,
408
+ data: data,
409
+ paidAt: TimestampLib.zero()}));
410
+
411
+ // update and save claim info with instance
412
+ claimInfo.payoutsCount += 1;
413
+ claimInfo.openPayoutsCount += 1;
414
+ instance.getInstanceStore().updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
415
+
416
+ // update and save policy info with instance
417
+ policyInfo.payoutAmount.add(amount);
418
+ instance.getInstanceStore().updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
419
+
420
+ emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount);
421
+ }
422
+
423
+
396
424
  function _calculatePayoutAmount(
397
425
  InstanceReader instanceReader,
398
426
  NftId policyNftId,
@@ -430,7 +458,6 @@ contract ClaimService is
430
458
  }
431
459
  }
432
460
 
433
- // internal functions
434
461
 
435
462
  function _verifyCallerWithPolicy(
436
463
  NftId policyNftId
@@ -439,12 +466,12 @@ contract ClaimService is
439
466
  view
440
467
  virtual
441
468
  returns (
469
+ NftId productNftId,
442
470
  IInstance instance,
443
471
  InstanceReader instanceReader,
444
472
  IPolicy.PolicyInfo memory policyInfo
445
473
  )
446
474
  {
447
- NftId productNftId;
448
475
  (productNftId,, instance) = _getAndVerifyActiveComponent(PRODUCT());
449
476
  instanceReader = instance.getInstanceReader();
450
477
 
@@ -480,6 +507,65 @@ contract ClaimService is
480
507
  claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
481
508
  }
482
509
 
510
+ function _processConfirmedClaimByPool(
511
+ InstanceReader instanceReader,
512
+ NftId productNftId,
513
+ NftId policyNftId,
514
+ ClaimId claimId,
515
+ Amount amount
516
+ )
517
+ internal
518
+ {
519
+ NftId poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
520
+ if (instanceReader.getPoolInfo(poolNftId).isProcessingConfirmedClaims) {
521
+ address poolAddress = getRegistry().getObjectInfo(poolNftId).objectAddress;
522
+ IPoolComponent(poolAddress).processConfirmedClaim(policyNftId, claimId, amount);
523
+ }
524
+ }
525
+
526
+
527
+ function _policyHolderClaimConfirmed(
528
+ NftId policyNftId,
529
+ ClaimId claimId,
530
+ Amount confirmedAmount
531
+ )
532
+ internal
533
+ {
534
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
535
+ if(address(policyHolder) != address(0)) {
536
+ policyHolder.claimConfirmed(policyNftId, claimId, confirmedAmount);
537
+ }
538
+ }
539
+
540
+
541
+ function _policyHolderPayoutExecuted(
542
+ NftId policyNftId,
543
+ PayoutId payoutId,
544
+ address beneficiary,
545
+ Amount payoutAmount
546
+ )
547
+ internal
548
+ {
549
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
550
+ if(address(policyHolder) != address(0)) {
551
+ policyHolder.payoutExecuted(policyNftId, payoutId, payoutAmount, beneficiary);
552
+ }
553
+ }
554
+
555
+
556
+ function _getPolicyHolder(NftId policyNftId)
557
+ internal
558
+ view
559
+ returns (IPolicyHolder policyHolder)
560
+ {
561
+ address policyHolderAddress = getRegistry().ownerOf(policyNftId);
562
+ policyHolder = IPolicyHolder(policyHolderAddress);
563
+
564
+ if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
565
+ policyHolder = IPolicyHolder(address(0));
566
+ }
567
+ }
568
+
483
569
 
484
570
  function _getDomain() internal pure override returns(ObjectType) {
485
571
  return CLAIM();
@@ -12,14 +12,14 @@ contract ClaimServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with service implementation
13
13
  constructor(
14
14
  address authority,
15
- address registryAddress,
15
+ address registry,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  ClaimService svc = new ClaimService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
23
23
  address(svc),
24
24
  data,
25
25
  salt);