@etherisc/gif-next 0.0.2-b9366f5-670 → 0.0.2-b98b2b0-875

Sign up to get free protection for your applications and to get access to all the features.
Files changed (382) 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 +33 -52
  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/Authorization.sol/Authorization.json +2 -2
  7. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +0 -19
  10. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  14. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
  15. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  17. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  18. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +51 -177
  19. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  20. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
  21. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  22. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +21 -147
  23. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  24. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +85 -192
  25. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  26. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +84 -104
  27. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  28. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +21 -0
  29. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  30. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
  31. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
  32. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
  33. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1512 -0
  34. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
  35. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +410 -0
  36. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
  37. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1999 -0
  38. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
  39. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +414 -0
  40. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
  41. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
  42. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
  43. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1432 -0
  44. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
  45. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1192 -0
  46. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
  47. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1566 -0
  48. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
  49. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2001 -0
  50. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  51. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  52. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  53. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  54. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  55. package/artifacts/contracts/instance/Instance.sol/Instance.json +10 -99
  56. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  57. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +95 -98
  58. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  59. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  60. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  61. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +260 -67
  62. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  63. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +39 -146
  64. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  65. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +61 -81
  66. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +71 -51
  68. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  69. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  70. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  71. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  72. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  73. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  74. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  75. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  76. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  77. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  78. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  79. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  80. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  81. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  82. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  83. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  84. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  85. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +41 -167
  86. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  87. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +18 -18
  88. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  89. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  90. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +21 -0
  91. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  92. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  93. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +21 -147
  94. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  95. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +37 -144
  96. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +60 -80
  98. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  99. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +46 -144
  100. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  101. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
  102. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  103. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +138 -181
  104. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  105. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +102 -102
  106. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  107. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +24 -0
  108. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  109. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +49 -0
  110. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  111. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +171 -102
  112. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  113. package/artifacts/contracts/pool/Pool.sol/Pool.json +46 -144
  114. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  115. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +276 -245
  116. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +95 -83
  118. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  119. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +31 -138
  120. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +57 -77
  122. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  123. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +46 -170
  124. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  125. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
  126. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  127. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +154 -194
  128. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  129. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +101 -101
  130. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  131. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  132. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +35 -8
  133. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  134. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +111 -0
  135. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  136. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  137. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +49 -26
  138. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  139. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  140. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +212 -160
  141. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  142. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -88
  143. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  144. package/artifacts/contracts/product/PricingService.sol/PricingService.json +55 -162
  145. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  146. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +68 -88
  147. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  148. package/artifacts/contracts/product/Product.sol/Product.json +46 -170
  149. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  150. package/artifacts/contracts/product/RiskService.sol/RiskService.json +25 -132
  151. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  152. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +54 -74
  153. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  154. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
  155. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  156. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +239 -20
  157. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  158. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  159. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  160. package/artifacts/contracts/registry/Registry.sol/Registry.json +437 -81
  161. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  162. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +244 -132
  163. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  164. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +23 -313
  165. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  166. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +52 -72
  167. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  168. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  169. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  170. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +24 -14
  171. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  172. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  173. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  174. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  175. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  176. package/artifacts/contracts/shared/Component.sol/Component.json +21 -147
  177. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  178. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +75 -182
  179. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  180. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +89 -99
  181. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  182. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -112
  183. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  184. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  185. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  186. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +21 -0
  187. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  188. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  189. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +21 -0
  190. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  191. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  192. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  193. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  194. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
  195. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  196. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  197. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  198. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  199. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -22
  200. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +21 -147
  202. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  203. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  204. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  205. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  206. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  207. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -57
  208. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  209. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
  210. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  211. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -97
  212. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  213. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
  214. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  215. package/artifacts/contracts/shared/Service.sol/Service.json +5 -112
  216. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  217. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  218. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  219. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  220. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  221. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +21 -0
  222. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  223. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  224. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
  225. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  226. package/artifacts/contracts/staking/Staking.sol/Staking.json +65 -191
  227. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  228. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  229. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  230. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +70 -85
  231. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  232. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
  233. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  234. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +31 -138
  235. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  236. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +56 -76
  237. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  238. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  239. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  240. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  241. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  242. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  243. package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
  244. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  245. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  246. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
  247. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  248. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  249. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  250. package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
  251. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  252. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  253. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  255. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  256. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  257. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  258. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
  259. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  260. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
  261. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  262. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  263. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  264. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  265. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  266. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
  267. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  268. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  269. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  270. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  271. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  273. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
  277. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
  279. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  281. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  282. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  283. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +39 -70
  284. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  285. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  286. package/contracts/authorization/AccessAdmin.sol +25 -24
  287. package/contracts/authorization/Authorization.sol +5 -1
  288. package/contracts/authorization/IAccessAdmin.sol +0 -1
  289. package/contracts/distribution/Distribution.sol +1 -1
  290. package/contracts/distribution/DistributionService.sol +9 -9
  291. package/contracts/distribution/DistributionServiceManager.sol +6 -6
  292. package/contracts/examples/fire/DamageLevel.sol +59 -0
  293. package/contracts/examples/fire/FirePool.sol +75 -0
  294. package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
  295. package/contracts/examples/fire/FireProduct.sol +413 -0
  296. package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
  297. package/contracts/examples/fire/FireUSD.sol +26 -0
  298. package/contracts/instance/Instance.sol +2 -2
  299. package/contracts/instance/InstanceAdmin.sol +6 -3
  300. package/contracts/instance/InstanceReader.sol +83 -18
  301. package/contracts/instance/InstanceService.sol +6 -8
  302. package/contracts/instance/InstanceServiceManager.sol +6 -7
  303. package/contracts/instance/module/IComponents.sol +3 -1
  304. package/contracts/instance/module/IPolicy.sol +2 -2
  305. package/contracts/oracle/Oracle.sol +1 -1
  306. package/contracts/oracle/OracleService.sol +10 -8
  307. package/contracts/oracle/OracleServiceManager.sol +6 -6
  308. package/contracts/pool/BundleService.sol +32 -9
  309. package/contracts/pool/BundleServiceManager.sol +6 -6
  310. package/contracts/pool/IBundleService.sol +9 -0
  311. package/contracts/pool/IPoolComponent.sol +18 -8
  312. package/contracts/pool/IPoolService.sol +21 -10
  313. package/contracts/pool/Pool.sol +38 -11
  314. package/contracts/pool/PoolService.sol +81 -27
  315. package/contracts/pool/PoolServiceManager.sol +4 -4
  316. package/contracts/product/ApplicationService.sol +11 -8
  317. package/contracts/product/ApplicationServiceManager.sol +4 -4
  318. package/contracts/product/ClaimService.sol +164 -70
  319. package/contracts/product/ClaimServiceManager.sol +4 -4
  320. package/contracts/product/IClaimService.sol +3 -2
  321. package/contracts/product/IPolicyService.sol +10 -3
  322. package/contracts/product/IProductComponent.sol +17 -3
  323. package/contracts/product/PolicyService.sol +145 -32
  324. package/contracts/product/PolicyServiceManager.sol +4 -4
  325. package/contracts/product/PricingService.sol +4 -5
  326. package/contracts/product/PricingServiceManager.sol +3 -3
  327. package/contracts/product/Product.sol +26 -19
  328. package/contracts/product/RiskService.sol +4 -5
  329. package/contracts/product/RiskServiceManager.sol +4 -4
  330. package/contracts/registry/ChainNft.sol +65 -32
  331. package/contracts/registry/IRegistry.sol +50 -14
  332. package/contracts/registry/IRegistryService.sol +0 -9
  333. package/contracts/registry/Registry.sol +327 -196
  334. package/contracts/registry/RegistryAdmin.sol +140 -50
  335. package/contracts/registry/RegistryService.sol +55 -48
  336. package/contracts/registry/RegistryServiceManager.sol +2 -2
  337. package/contracts/registry/ReleaseRegistry.sol +11 -5
  338. package/contracts/registry/ServiceAuthorizationV3.sol +4 -5
  339. package/contracts/shared/Component.sol +13 -5
  340. package/contracts/shared/ComponentService.sol +6 -6
  341. package/contracts/shared/ComponentServiceManager.sol +8 -5
  342. package/contracts/shared/ComponentVerifyingService.sol +1 -2
  343. package/contracts/shared/ContractLib.sol +38 -0
  344. package/contracts/shared/IComponent.sol +3 -0
  345. package/contracts/shared/IPolicyHolder.sol +12 -22
  346. package/contracts/shared/InitializableERC165.sol +2 -2
  347. package/contracts/shared/InstanceLinkedComponent.sol +4 -5
  348. package/contracts/shared/NftOwnable.sol +4 -4
  349. package/contracts/shared/PolicyHolder.sol +15 -52
  350. package/contracts/shared/Registerable.sol +4 -4
  351. package/contracts/shared/RegistryLinked.sol +3 -2
  352. package/contracts/shared/Service.sol +16 -11
  353. package/contracts/staking/Staking.sol +3 -3
  354. package/contracts/staking/StakingManager.sol +8 -6
  355. package/contracts/staking/StakingReader.sol +12 -5
  356. package/contracts/staking/StakingService.sol +2 -2
  357. package/contracts/staking/StakingServiceManager.sol +2 -2
  358. package/contracts/type/Amount.sol +15 -0
  359. package/contracts/type/ClaimId.sol +6 -1
  360. package/contracts/type/NftId.sol +1 -0
  361. package/contracts/type/ObjectType.sol +1 -0
  362. package/contracts/type/PayoutId.sol +10 -10
  363. package/contracts/type/RiskId.sol +15 -1
  364. package/contracts/type/UFixed.sol +4 -0
  365. package/contracts/upgradeability/ProxyManager.sol +67 -34
  366. package/contracts/upgradeability/Versionable.sol +2 -2
  367. package/package.json +1 -1
  368. package/artifacts/contracts/example_components/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +0 -4
  369. package/artifacts/contracts/example_components/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +0 -1558
  370. package/artifacts/contracts/example_components/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +0 -4
  371. package/artifacts/contracts/example_components/unpermissioned/SimpleOracle.sol/SimpleOracle.json +0 -1318
  372. package/artifacts/contracts/example_components/unpermissioned/SimplePool.sol/SimplePool.dbg.json +0 -4
  373. package/artifacts/contracts/example_components/unpermissioned/SimplePool.sol/SimplePool.json +0 -1664
  374. package/artifacts/contracts/example_components/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +0 -4
  375. package/artifacts/contracts/example_components/unpermissioned/SimpleProduct.sol/SimpleProduct.json +0 -2125
  376. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
  377. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
  378. package/contracts/shared/InitializableCustom.sol +0 -177
  379. /package/contracts/{example_components → examples}/unpermissioned/SimpleDistribution.sol +0 -0
  380. /package/contracts/{example_components → examples}/unpermissioned/SimpleOracle.sol +0 -0
  381. /package/contracts/{example_components → examples}/unpermissioned/SimplePool.sol +0 -0
  382. /package/contracts/{example_components → examples}/unpermissioned/SimpleProduct.sol +0 -0
@@ -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),
@@ -158,7 +174,7 @@ abstract contract Pool is
158
174
  $._bundleService = IBundleService(_getServiceAddress(BUNDLE()));
159
175
  $._componentService = IComponentService(_getServiceAddress(COMPONENT()));
160
176
 
161
- registerInterface(type(IPoolComponent).interfaceId);
177
+ _registerInterface(type(IPoolComponent).interfaceId);
162
178
  }
163
179
 
164
180
  /// @dev increases the staked tokens by the specified amount
@@ -318,6 +334,17 @@ abstract contract Pool is
318
334
  return _getPoolStorage()._bundleService.withdrawBundleFees(bundleNftId, amount);
319
335
  }
320
336
 
337
+ function _processFundedClaim(
338
+ NftId policyNftId,
339
+ ClaimId claimId,
340
+ Amount availableAmount
341
+ )
342
+ internal
343
+ {
344
+ _getPoolStorage()._poolService.processFundedClaim(
345
+ policyNftId, claimId, availableAmount);
346
+ }
347
+
321
348
  function _getPoolStorage() private pure returns (PoolStorage storage $) {
322
349
  assembly {
323
350
  $.slot := POOL_STORAGE_LOCATION_V1
@@ -8,12 +8,14 @@ import {IComponentService} from "../shared/IComponentService.sol";
8
8
  import {IInstance} from "../instance/IInstance.sol";
9
9
  import {IInstanceService} from "../instance/IInstanceService.sol";
10
10
  import {IPolicy} from "../instance/module/IPolicy.sol";
11
+ import {IProductComponent} from "../product/IProductComponent.sol";
11
12
  import {IPoolService} from "./IPoolService.sol";
12
13
  import {IRegistry} from "../registry/IRegistry.sol";
13
14
  import {IRegistryService} from "../registry/IRegistryService.sol";
14
15
  import {IStaking} from "../staking/IStaking.sol";
15
16
 
16
17
  import {Amount, AmountLib} from "../type/Amount.sol";
18
+ import {ClaimId} from "../type/ClaimId.sol";
17
19
  import {Fee, FeeLib} from "../type/Fee.sol";
18
20
  import {NftId} from "../type/NftId.sol";
19
21
  import {ObjectType, POOL, BUNDLE, COMPONENT, INSTANCE, REGISTRY} from "../type/ObjectType.sol";
@@ -21,7 +23,7 @@ import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
21
23
  import {Fee, FeeLib} from "../type/Fee.sol";
22
24
  import {KEEP_STATE} from "../type/StateId.sol";
23
25
  import {Seconds} from "../type/Seconds.sol";
24
- import {UFixed} from "../type/UFixed.sol";
26
+ import {UFixed, UFixedLib} from "../type/UFixed.sol";
25
27
  import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
26
28
  import {InstanceReader} from "../instance/InstanceReader.sol";
27
29
  import {InstanceStore} from "../instance/InstanceStore.sol";
@@ -44,16 +46,15 @@ contract PoolService is
44
46
  bytes memory data
45
47
  )
46
48
  internal
47
- initializer
48
49
  virtual override
50
+ initializer()
49
51
  {
50
52
  (
51
- address registryAddress,,
52
- //address managerAddress
53
+ address registryAddress,
53
54
  address authority
54
- ) = abi.decode(data, (address, address, address));
55
+ ) = abi.decode(data, (address, address));
55
56
 
56
- initializeService(registryAddress, authority, owner);
57
+ _initializeService(registryAddress, authority, owner);
57
58
 
58
59
  _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
59
60
  _bundleService = IBundleService(_getServiceAddress(BUNDLE()));
@@ -62,9 +63,10 @@ contract PoolService is
62
63
 
63
64
  _staking = IStaking(getRegistry().getStakingAddress());
64
65
 
65
- registerInterface(type(IPoolService).interfaceId);
66
+ _registerInterface(type(IPoolService).interfaceId);
66
67
  }
67
68
 
69
+
68
70
  /// @inheritdoc IPoolService
69
71
  function setMaxBalanceAmount(Amount maxBalanceAmount)
70
72
  external
@@ -81,6 +83,7 @@ contract PoolService is
81
83
  emit LogPoolServiceMaxBalanceAmountUpdated(poolNftId, previousMaxBalanceAmount, maxBalanceAmount);
82
84
  }
83
85
 
86
+
84
87
  function setBundleOwnerRole(RoleId bundleOwnerRole)
85
88
  external
86
89
  virtual
@@ -102,6 +105,7 @@ contract PoolService is
102
105
  emit LogPoolServiceBundleOwnerRoleSet(poolNftId, bundleOwnerRole);
103
106
  }
104
107
 
108
+
105
109
  /// @inheritdoc IPoolService
106
110
  function createBundle(
107
111
  address bundleOwner, // initial bundle owner
@@ -128,6 +132,7 @@ contract PoolService is
128
132
  emit LogPoolServiceBundleCreated(instance.getNftId(), poolNftId, bundleNftId);
129
133
  }
130
134
 
135
+
131
136
  function _getStakingFee(InstanceReader instanceReader, NftId poolNftId)
132
137
  internal
133
138
  virtual
@@ -138,6 +143,7 @@ contract PoolService is
138
143
  return instanceReader.getProductInfo(productNftId).stakingFee;
139
144
  }
140
145
 
146
+
141
147
  function closeBundle(NftId bundleNftId)
142
148
  external
143
149
  virtual
@@ -166,6 +172,39 @@ contract PoolService is
166
172
  }
167
173
  }
168
174
 
175
+
176
+ /// @inheritdoc IPoolService
177
+ function processFundedClaim(
178
+ NftId policyNftId,
179
+ ClaimId claimId,
180
+ Amount availableAmount
181
+ )
182
+ external
183
+ virtual
184
+ {
185
+ (NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
186
+ InstanceReader instanceReader = instance.getInstanceReader();
187
+ NftId productNftId = instanceReader.getComponentInfo(poolNftId).productNftId;
188
+
189
+ // check policy matches with calling pool
190
+ IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
191
+ if(policyInfo.productNftId != productNftId) {
192
+ revert ErrorPoolServicePolicyPoolMismatch(
193
+ policyNftId,
194
+ policyInfo.productNftId,
195
+ productNftId);
196
+ }
197
+
198
+ emit LogPoolServiceProcessFundedClaim(policyNftId, claimId, availableAmount);
199
+
200
+ // callback to product component if applicable
201
+ if (instanceReader.getProductInfo(productNftId).isProcessingFundedClaims) {
202
+ address productAddress = getRegistry().getObjectAddress(productNftId);
203
+ IProductComponent(productAddress).processFundedClaim(policyNftId, claimId, availableAmount);
204
+ }
205
+ }
206
+
207
+
169
208
  /// @inheritdoc IPoolService
170
209
  function stake(NftId bundleNftId, Amount amount)
171
210
  external
@@ -189,6 +228,7 @@ contract PoolService is
189
228
  }
190
229
  }
191
230
 
231
+
192
232
  // calculate fees
193
233
  Amount feeAmount;
194
234
  (
@@ -327,13 +367,13 @@ contract PoolService is
327
367
  virtual
328
368
  restricted()
329
369
  returns (
330
- Amount localCollateralAmount,
331
- Amount totalCollateralAmount
370
+ Amount totalCollateralAmount,
371
+ Amount localCollateralAmount
332
372
  )
333
373
  {
334
374
  (
335
- localCollateralAmount,
336
- totalCollateralAmount
375
+ totalCollateralAmount,
376
+ localCollateralAmount
337
377
  ) = calculateRequiredCollateral(
338
378
  instance.getInstanceReader(),
339
379
  productNftId,
@@ -359,8 +399,7 @@ contract PoolService is
359
399
  }
360
400
  }
361
401
 
362
-
363
- function reduceCollateral(
402
+ function processPayout(
364
403
  IInstance instance,
365
404
  address token,
366
405
  NftId policyNftId,
@@ -371,6 +410,22 @@ contract PoolService is
371
410
  virtual
372
411
  restricted()
373
412
  {
413
+ NftId bundleNftId = policyInfo.bundleNftId;
414
+ NftId poolNftId = getRegistry().getObjectInfo(bundleNftId).parentNftId;
415
+ InstanceStore instanceStore = instance.getInstanceStore();
416
+
417
+ _componentService.decreasePoolBalance(
418
+ instanceStore,
419
+ poolNftId,
420
+ payoutAmount,
421
+ AmountLib.zero());
422
+
423
+ _componentService.decreaseBundleBalance(
424
+ instanceStore,
425
+ bundleNftId,
426
+ payoutAmount,
427
+ AmountLib.zero());
428
+
374
429
  _bundleService.releaseCollateral(
375
430
  instance,
376
431
  policyNftId,
@@ -425,16 +480,16 @@ contract PoolService is
425
480
  public
426
481
  view
427
482
  returns(
428
- Amount localCollateralAmount,
429
- Amount totalCollateralAmount
483
+ Amount totalCollateralAmount,
484
+ Amount localCollateralAmount
430
485
  )
431
486
  {
432
487
  NftId poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
433
488
  IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
434
489
 
435
490
  (
436
- localCollateralAmount,
437
- totalCollateralAmount
491
+ totalCollateralAmount,
492
+ localCollateralAmount
438
493
  ) = calculateRequiredCollateral(
439
494
  poolInfo.collateralizationLevel,
440
495
  poolInfo.retentionLevel,
@@ -450,18 +505,17 @@ contract PoolService is
450
505
  public
451
506
  pure
452
507
  returns(
453
- Amount localCollateralAmount,
454
- Amount totalCollateralAmount
508
+ Amount totalCollateralAmount,
509
+ Amount localCollateralAmount
455
510
  )
456
511
  {
457
- // TODO define if only applies to local collateral
458
- // TODO add minimalistic implementation
459
-
460
- // assumptions
461
- // - collateralizationLevel == 1.0
462
- // - retentionLevel == 1.0
463
- localCollateralAmount = sumInsuredAmount;
464
- totalCollateralAmount = localCollateralAmount;
512
+ // collateralization is applied to sum insured
513
+ UFixed totalUFixed = collateralizationLevel * sumInsuredAmount.toUFixed();
514
+ totalCollateralAmount = AmountLib.toAmount(totalUFixed.toInt());
515
+
516
+ // retention level defines how much capital is required locally
517
+ localCollateralAmount = AmountLib.toAmount(
518
+ (retentionLevel * totalUFixed).toInt());
465
519
  }
466
520
 
467
521
 
@@ -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,18 +41,17 @@ 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()));
53
52
  _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
54
53
 
55
- registerInterface(type(IApplicationService).interfaceId);
54
+ _registerInterface(type(IApplicationService).interfaceId);
56
55
  }
57
56
 
58
57
 
@@ -135,6 +134,7 @@ contract ApplicationService is
135
134
  )
136
135
  external
137
136
  virtual
137
+ nonReentrant()
138
138
  returns (NftId applicationNftId)
139
139
  {
140
140
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -209,7 +209,8 @@ contract ApplicationService is
209
209
  NftId bundleNftId // will likely need a newer bundle for underwriting
210
210
  )
211
211
  external
212
- virtual override
212
+ virtual
213
+ nonReentrant()
213
214
  returns (NftId applicationNftId)
214
215
  {
215
216
  // TODO implement
@@ -226,14 +227,16 @@ contract ApplicationService is
226
227
  bytes memory applicationData
227
228
  )
228
229
  external
229
- virtual override
230
+ virtual
231
+ nonReentrant()
230
232
  {
231
233
  // TODO implement
232
234
  }
233
235
 
234
236
  function revoke(NftId applicationNftId)
235
237
  external
236
- virtual override
238
+ virtual
239
+ nonReentrant()
237
240
  {
238
241
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
239
242
  instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
@@ -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);