@etherisc/gif-next 0.0.2-7c8d286-020 → 0.0.2-7d488b3-675

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 (358) hide show
  1. package/README.md +1 -1
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  3. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -48
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  5. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -34
  6. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +246 -361
  9. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +39 -8
  12. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +23 -96
  14. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +184 -278
  17. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  18. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +0 -32
  19. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  20. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  22. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +109 -33
  24. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +41 -96
  26. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +65 -0
  28. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +106 -142
  30. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +53 -61
  32. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  33. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -0
  34. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  35. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +20 -40
  36. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  37. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  38. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +17 -33
  39. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  40. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +41 -96
  41. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  42. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +59 -75
  43. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  44. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +41 -96
  45. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  46. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +118 -42
  48. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  49. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +41 -96
  50. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  51. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +23 -23
  52. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  53. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +27 -43
  54. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  55. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +41 -96
  56. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  57. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +29 -45
  58. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
  59. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +41 -96
  60. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  61. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  62. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  63. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +7 -85
  64. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  65. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +11 -54
  66. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  67. package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -95
  68. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +405 -512
  70. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +41 -96
  72. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
  74. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  75. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +63 -86
  76. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  77. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +36 -26
  78. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  79. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
  80. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  81. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  82. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  83. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  84. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  85. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  86. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  87. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  88. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  89. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  90. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  91. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  92. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
  93. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  94. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  95. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  96. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  97. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  98. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  99. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  100. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -14
  101. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  102. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +30 -93
  103. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  104. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  106. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  107. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  108. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -58
  109. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  110. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -39
  111. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  112. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  113. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +41 -96
  114. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  115. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -74
  116. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -47
  118. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  119. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  120. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  121. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  122. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  123. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +22 -38
  124. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  125. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +74 -106
  126. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  127. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -63
  128. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  129. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +26 -71
  130. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  131. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +23 -35
  132. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  133. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  134. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +41 -96
  135. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  136. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -96
  137. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  138. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -58
  139. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  140. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +0 -21
  141. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  143. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +0 -21
  145. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  146. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  147. package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +0 -21
  148. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  149. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +86 -94
  150. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  151. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +18 -452
  152. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  153. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -57
  154. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  155. package/artifacts/contracts/product/PricingService.sol/PricingService.json +52 -89
  156. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  157. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -44
  158. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  159. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  160. package/artifacts/contracts/product/RiskService.sol/RiskService.json +26 -55
  161. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  162. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +23 -27
  163. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  164. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  165. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  166. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  167. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  168. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  169. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  170. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  171. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +350 -440
  172. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  173. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  174. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  175. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
  176. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  177. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +368 -473
  178. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  179. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  180. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  181. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +124 -128
  182. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  183. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  184. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  185. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  186. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  187. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  188. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +102 -63
  189. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  190. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -41
  191. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  192. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  193. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +4 -60
  194. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  195. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  196. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  197. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  198. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +24 -1
  200. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  202. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  203. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  204. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  205. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  206. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  207. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  208. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  209. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
  210. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  211. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  212. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  213. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  214. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  215. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  216. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  217. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  218. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  219. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  220. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  221. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  222. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  223. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  224. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  225. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  226. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  227. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  228. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  229. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  230. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +9 -74
  231. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  232. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +3 -74
  233. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
  234. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
  235. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  236. package/artifacts/contracts/staking/Staking.sol/Staking.json +57 -141
  237. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  238. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  239. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  240. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +34 -50
  241. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  242. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +57 -30
  243. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  244. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +29 -124
  245. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  246. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +23 -35
  247. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  248. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -142
  249. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  250. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +14 -24
  251. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  252. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  253. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  255. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  256. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  257. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  258. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  259. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  260. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  261. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  262. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
  263. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  264. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  265. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  266. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  267. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  268. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +31 -33
  269. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  270. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  271. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  273. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  275. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
  277. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  279. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  282. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  284. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  286. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
  288. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -56
  290. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  291. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  292. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
  293. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  294. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  295. package/contracts/accounting/AccountingService.sol +3 -2
  296. package/contracts/authorization/AccessAdmin.sol +186 -201
  297. package/contracts/authorization/AccessManagerCloneable.sol +31 -40
  298. package/contracts/authorization/Authorization.sol +33 -61
  299. package/contracts/authorization/IAccessAdmin.sol +36 -63
  300. package/contracts/authorization/IAuthorization.sol +0 -6
  301. package/contracts/distribution/BasicDistribution.sol +3 -5
  302. package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
  303. package/contracts/distribution/Distribution.sol +47 -4
  304. package/contracts/distribution/DistributionService.sol +6 -10
  305. package/contracts/distribution/IDistributionComponent.sol +9 -0
  306. package/contracts/distribution/IDistributionService.sol +5 -3
  307. package/contracts/instance/IInstance.sol +8 -43
  308. package/contracts/instance/IInstanceService.sol +2 -14
  309. package/contracts/instance/Instance.sol +13 -62
  310. package/contracts/instance/InstanceAdmin.sol +107 -120
  311. package/contracts/instance/InstanceAuthorizationV3.sol +21 -43
  312. package/contracts/instance/InstanceReader.sol +1 -1
  313. package/contracts/instance/InstanceService.sol +60 -118
  314. package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
  315. package/contracts/oracle/OracleService.sol +4 -4
  316. package/contracts/pool/BasicPoolAuthorization.sol +1 -1
  317. package/contracts/pool/PoolLib.sol +1 -94
  318. package/contracts/pool/PoolService.sol +89 -91
  319. package/contracts/product/ApplicationService.sol +1 -10
  320. package/contracts/product/BasicProductAuthorization.sol +1 -1
  321. package/contracts/product/ClaimService.sol +0 -8
  322. package/contracts/product/IApplicationService.sol +0 -2
  323. package/contracts/product/IPricingService.sol +0 -1
  324. package/contracts/product/IRiskService.sol +0 -3
  325. package/contracts/product/PolicyService.sol +53 -35
  326. package/contracts/product/PolicyServiceLib.sol +1 -55
  327. package/contracts/product/PricingService.sol +0 -5
  328. package/contracts/product/RiskService.sol +0 -10
  329. package/contracts/registry/RegistryAdmin.sol +229 -133
  330. package/contracts/registry/ReleaseAdmin.sol +22 -30
  331. package/contracts/registry/ReleaseRegistry.sol +33 -39
  332. package/contracts/registry/ServiceAuthorizationV3.sol +3 -88
  333. package/contracts/shared/Component.sol +6 -6
  334. package/contracts/shared/ComponentService.sol +29 -33
  335. package/contracts/shared/ContractLib.sol +0 -28
  336. package/contracts/shared/IComponentService.sol +6 -4
  337. package/contracts/shared/InitializableERC165.sol +1 -9
  338. package/contracts/shared/NftOwnable.sol +1 -2
  339. package/contracts/shared/Registerable.sol +4 -1
  340. package/contracts/shared/TokenHandler.sol +4 -5
  341. package/contracts/staking/IStaking.sol +2 -12
  342. package/contracts/staking/IStakingService.sol +1 -11
  343. package/contracts/staking/{StakingLib.sol → StakeManagerLib.sol} +22 -79
  344. package/contracts/staking/Staking.sol +13 -33
  345. package/contracts/staking/StakingReader.sol +15 -5
  346. package/contracts/staking/StakingService.sol +2 -39
  347. package/contracts/staking/StakingStore.sol +1 -2
  348. package/contracts/type/ObjectType.sol +14 -5
  349. package/contracts/type/Version.sol +0 -39
  350. package/package.json +1 -1
  351. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +0 -4
  352. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +0 -673
  353. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +0 -4
  354. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +0 -878
  355. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +0 -4
  356. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +0 -469
  357. package/contracts/authorization/AccessAdminLib.sol +0 -183
  358. package/contracts/registry/RegistryAuthorization.sol +0 -267
@@ -69,7 +69,6 @@ contract PoolService is
69
69
  function setMaxBalanceAmount(Amount maxBalanceAmount)
70
70
  external
71
71
  virtual
72
- restricted()
73
72
  {
74
73
  (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
75
74
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -85,7 +84,6 @@ contract PoolService is
85
84
 
86
85
  function closeBundle(NftId bundleNftId)
87
86
  external
88
- restricted()
89
87
  virtual
90
88
  {
91
89
  _checkNftType(bundleNftId, BUNDLE());
@@ -121,7 +119,6 @@ contract PoolService is
121
119
  Amount availableAmount
122
120
  )
123
121
  external
124
- restricted()
125
122
  virtual
126
123
  {
127
124
  _checkNftType(policyNftId, POLICY());
@@ -178,7 +175,7 @@ contract PoolService is
178
175
  function stake(NftId bundleNftId, Amount amount)
179
176
  external
180
177
  virtual
181
- restricted()
178
+ // TODO: restricted() (once #462 is done)
182
179
  returns(
183
180
  Amount netAmount
184
181
  )
@@ -225,7 +222,7 @@ contract PoolService is
225
222
 
226
223
  // collect tokens from bundle owner
227
224
  address bundleOwner = getRegistry().ownerOf(bundleNftId);
228
- PoolLib.pullStakingAmount(
225
+ _pullStakingAmount(
229
226
  instanceReader,
230
227
  poolNftId,
231
228
  bundleOwner,
@@ -238,7 +235,7 @@ contract PoolService is
238
235
  function unstake(NftId bundleNftId, Amount amount)
239
236
  external
240
237
  virtual
241
- restricted()
238
+ // TODO: restricted() (once #462 is done)
242
239
  returns(Amount netAmount)
243
240
  {
244
241
  (
@@ -272,7 +269,7 @@ contract PoolService is
272
269
 
273
270
  // transfer amount to bundle owner
274
271
  address bundleOwner = getRegistry().ownerOf(bundleNftId);
275
- PoolLib.pushUnstakingAmount(
272
+ _pushUnstakingAmount(
276
273
  instanceReader,
277
274
  poolNftId,
278
275
  bundleOwner,
@@ -284,7 +281,7 @@ contract PoolService is
284
281
  function fundPoolWallet(Amount amount)
285
282
  external
286
283
  virtual
287
- restricted()
284
+ // restricted()
288
285
  {
289
286
  (
290
287
  NftId poolNftId,
@@ -300,7 +297,7 @@ contract PoolService is
300
297
  address poolOwner = getRegistry().ownerOf(poolNftId);
301
298
  emit LogPoolServiceWalletFunded(poolNftId, poolOwner, amount);
302
299
 
303
- PoolLib.pullStakingAmount(
300
+ _pullStakingAmount(
304
301
  reader,
305
302
  poolNftId,
306
303
  poolOwner,
@@ -311,7 +308,7 @@ contract PoolService is
311
308
  function defundPoolWallet(Amount amount)
312
309
  external
313
310
  virtual
314
- restricted()
311
+ // restricted()
315
312
  {
316
313
  (
317
314
  NftId poolNftId,
@@ -327,7 +324,7 @@ contract PoolService is
327
324
  address poolOwner = getRegistry().ownerOf(poolNftId);
328
325
  emit LogPoolServiceWalletDefunded(poolNftId, poolOwner, amount);
329
326
 
330
- PoolLib.pushUnstakingAmount(
327
+ _pushUnstakingAmount(
331
328
  reader,
332
329
  poolNftId,
333
330
  poolOwner,
@@ -479,8 +476,7 @@ contract PoolService is
479
476
  payoutAmount);
480
477
 
481
478
  // interactions
482
- PoolLib.transferTokenAndNotifyPolicyHolder(
483
- getRegistry(),
479
+ _transferTokenAndNotifyPolicyHolder(
484
480
  instanceReader,
485
481
  poolTokenHandler,
486
482
  productNftId,
@@ -490,49 +486,49 @@ contract PoolService is
490
486
  payoutBeneficiary);
491
487
  }
492
488
 
493
- //function _transferTokenAndNotifyPolicyHolder(
494
- // InstanceReader instanceReader,
495
- // TokenHandler poolTokenHandler,
496
- // NftId productNftId,
497
- // NftId policyNftId,
498
- // PayoutId payoutId,
499
- // Amount payoutAmount,
500
- // address payoutBeneficiary
501
- //)
502
- // internal
503
- //{
504
- // (
505
- // Amount netPayoutAmount,
506
- // Amount processingFeeAmount,
507
- // address beneficiary
508
- // ) = PoolLib.calculatePayoutAmounts(
509
- // getRegistry(),
510
- // instanceReader,
511
- // productNftId,
512
- // policyNftId,
513
- // payoutAmount,
514
- // payoutBeneficiary);
489
+ function _transferTokenAndNotifyPolicyHolder(
490
+ InstanceReader instanceReader,
491
+ TokenHandler poolTokenHandler,
492
+ NftId productNftId,
493
+ NftId policyNftId,
494
+ PayoutId payoutId,
495
+ Amount payoutAmount,
496
+ address payoutBeneficiary
497
+ )
498
+ internal
499
+ {
500
+ (
501
+ Amount netPayoutAmount,
502
+ Amount processingFeeAmount,
503
+ address beneficiary
504
+ ) = PoolLib.calculatePayoutAmounts(
505
+ getRegistry(),
506
+ instanceReader,
507
+ productNftId,
508
+ policyNftId,
509
+ payoutAmount,
510
+ payoutBeneficiary);
515
511
 
516
512
  // 1st token tx to payout to beneficiary
517
- // poolTokenHandler.pushToken(
518
- // beneficiary,
519
- // netPayoutAmount);
513
+ poolTokenHandler.pushToken(
514
+ beneficiary,
515
+ netPayoutAmount);
520
516
 
521
517
  // 2nd token tx to transfer processing fees to product wallet
522
518
  // if processingFeeAmount > 0
523
- // if (processingFeeAmount.gtz()) {
524
- // poolTokenHandler.pushToken(
525
- // instanceReader.getWallet(productNftId),
526
- // processingFeeAmount);
527
- // }
519
+ if (processingFeeAmount.gtz()) {
520
+ poolTokenHandler.pushToken(
521
+ instanceReader.getWallet(productNftId),
522
+ processingFeeAmount);
523
+ }
528
524
 
529
525
  // callback to policy holder if applicable
530
- // _policyHolderPayoutExecuted(
531
- // policyNftId,
532
- // payoutId,
533
- // beneficiary,
534
- // netPayoutAmount);
535
- //}
526
+ _policyHolderPayoutExecuted(
527
+ policyNftId,
528
+ payoutId,
529
+ beneficiary,
530
+ netPayoutAmount);
531
+ }
536
532
 
537
533
 
538
534
  /// @inheritdoc IPoolService
@@ -674,48 +670,50 @@ contract PoolService is
674
670
 
675
671
 
676
672
 
677
- //function _policyHolderPayoutExecuted(
678
- // NftId policyNftId,
679
- // PayoutId payoutId,
680
- // address beneficiary,
681
- // Amount payoutAmount
682
- //)
683
- // internal
684
- //{
685
- // IPolicyHolder policyHolder = PoolLib.getPolicyHolder(getRegistry(), policyNftId);
686
- // if(address(policyHolder) != address(0)) {
687
- // policyHolder.payoutExecuted(policyNftId, payoutId, payoutAmount, beneficiary);
688
- // }
689
- //}
690
-
691
-
692
- //function _pullStakingAmount(
693
- // InstanceReader reader,
694
- // NftId poolNftId,
695
- // address from,
696
- // Amount amount
697
- //)
698
- // internal
699
- //{
700
- // IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
701
- // info.tokenHandler.pullToken(
702
- // from,
703
- // amount);
704
- //}
705
-
706
- //function _pushUnstakingAmount(
707
- // InstanceReader reader,
708
- // NftId poolNftId,
709
- // address to,
710
- // Amount amount
711
- //)
712
- // internal
713
- //{
714
- // IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
715
- // info.tokenHandler.pushToken(
716
- // to,
717
- // amount);
718
- //}
673
+ function _policyHolderPayoutExecuted(
674
+ NftId policyNftId,
675
+ PayoutId payoutId,
676
+ address beneficiary,
677
+ Amount payoutAmount
678
+ )
679
+ internal
680
+ {
681
+ IPolicyHolder policyHolder = PoolLib.getPolicyHolder(getRegistry(), policyNftId);
682
+ if(address(policyHolder) != address(0)) {
683
+ policyHolder.payoutExecuted(policyNftId, payoutId, payoutAmount, beneficiary);
684
+ }
685
+ }
686
+
687
+
688
+ /// @dev Transfers the specified amount from the "from account" to the pool's wallet
689
+ function _pullStakingAmount(
690
+ InstanceReader reader,
691
+ NftId poolNftId,
692
+ address from,
693
+ Amount amount
694
+ )
695
+ internal
696
+ {
697
+ IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
698
+ info.tokenHandler.pullToken(
699
+ from,
700
+ amount);
701
+ }
702
+
703
+ /// @dev Transfers the specified amount from the pool's wallet to the "to account"
704
+ function _pushUnstakingAmount(
705
+ InstanceReader reader,
706
+ NftId poolNftId,
707
+ address to,
708
+ Amount amount
709
+ )
710
+ internal
711
+ {
712
+ IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
713
+ info.tokenHandler.pushToken(
714
+ to,
715
+ amount);
716
+ }
719
717
 
720
718
 
721
719
  function _getAndVerifyActivePool()
@@ -71,11 +71,6 @@ contract ApplicationService is
71
71
  if (!exists) { revert ErrorApplicationServiceRiskUnknown(riskId, productNftId); }
72
72
  if (!active) { revert ErrorApplicationServiceRiskPaused(riskId, productNftId); }
73
73
 
74
- NftId riskProductNftId = instanceReader.getRiskInfo(riskId).productNftId;
75
- if (productNftId != riskProductNftId) {
76
- revert ErrorApplicationServiceRiskProductMismatch(riskId, riskProductNftId, productNftId);
77
- }
78
-
79
74
  // check bundle with pool
80
75
  IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
81
76
  {
@@ -88,7 +83,7 @@ contract ApplicationService is
88
83
  // check referral with distribution
89
84
  {
90
85
  if (productInfo.hasDistribution && ! referralId.eqz()) {
91
- if (!_distributionService.referralIsValid(productInfo.distributionNftId, referralId)) {
86
+ if (!instanceReader.isReferralValid(productInfo.distributionNftId, referralId)) {
92
87
  revert ErrorApplicationServiceReferralInvalid(productNftId, productInfo.distributionNftId, referralId);
93
88
  }
94
89
  }
@@ -149,7 +144,6 @@ contract ApplicationService is
149
144
  )
150
145
  external
151
146
  virtual
152
- restricted()
153
147
  nonReentrant()
154
148
  returns (NftId applicationNftId)
155
149
  {
@@ -228,7 +222,6 @@ contract ApplicationService is
228
222
  )
229
223
  external
230
224
  virtual
231
- restricted()
232
225
  nonReentrant()
233
226
  returns (NftId applicationNftId)
234
227
  {
@@ -249,7 +242,6 @@ contract ApplicationService is
249
242
  )
250
243
  external
251
244
  virtual
252
- restricted()
253
245
  nonReentrant()
254
246
  {
255
247
  _checkNftType(applicationNftId, POLICY());
@@ -260,7 +252,6 @@ contract ApplicationService is
260
252
  function revoke(NftId applicationNftId)
261
253
  external
262
254
  virtual
263
- restricted()
264
255
  nonReentrant()
265
256
  {
266
257
  _checkNftType(applicationNftId, POLICY());
@@ -16,7 +16,7 @@ contract BasicProductAuthorization
16
16
  {
17
17
 
18
18
  constructor(string memory componentName)
19
- Authorization(componentName, PRODUCT(), true, true)
19
+ Authorization(componentName, PRODUCT())
20
20
  {}
21
21
 
22
22
  function _setupServiceTargets()
@@ -114,7 +114,6 @@ contract ClaimService is
114
114
  )
115
115
  external
116
116
  virtual
117
- restricted()
118
117
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
119
118
  {
120
119
  // checks
@@ -164,7 +163,6 @@ contract ClaimService is
164
163
  )
165
164
  external
166
165
  virtual
167
- restricted()
168
166
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
169
167
  {
170
168
  _checkNftType(policyNftId, POLICY());
@@ -197,7 +195,6 @@ contract ClaimService is
197
195
  )
198
196
  external
199
197
  virtual
200
- restricted()
201
198
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
202
199
  {
203
200
  (
@@ -227,7 +224,6 @@ contract ClaimService is
227
224
  )
228
225
  external
229
226
  virtual
230
- restricted()
231
227
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
232
228
  {
233
229
  _checkNftType(policyNftId, POLICY());
@@ -274,7 +270,6 @@ contract ClaimService is
274
270
  )
275
271
  external
276
272
  virtual
277
- restricted()
278
273
  // nonReentrant() // prevents creating a reinsurance claim in a single tx
279
274
  returns (PayoutId payoutId)
280
275
  {
@@ -299,7 +294,6 @@ contract ClaimService is
299
294
  )
300
295
  external
301
296
  virtual
302
- restricted()
303
297
  // nonReentrant() // prevents creating a reinsurance payout in a single tx
304
298
  returns (PayoutId payoutId)
305
299
  {
@@ -320,7 +314,6 @@ contract ClaimService is
320
314
  )
321
315
  external
322
316
  virtual
323
- restricted()
324
317
  // nonReentrant() // prevents creating a reinsurance payout in a single tx
325
318
  {
326
319
  // checks
@@ -399,7 +392,6 @@ contract ClaimService is
399
392
  )
400
393
  external
401
394
  virtual
402
- restricted()
403
395
  {
404
396
  // checks
405
397
  (
@@ -16,13 +16,11 @@ import {Seconds} from "../type/Seconds.sol";
16
16
  interface IApplicationService is IService {
17
17
 
18
18
  // _checkLinkedApplicationParameters
19
- error ErrorApplicationServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
20
19
  error ErrorApplicationServiceRiskUnknown(RiskId riskId, NftId productNftId);
21
20
  error ErrorApplicationServiceRiskPaused(RiskId riskId, NftId productNftId);
22
21
  error ErrorApplicationServiceBundleUnknown(NftId bundleNftId, NftId poolNftId);
23
22
  error ErrorApplicationServiceBundleLocked(NftId bundleNftId, NftId poolNftId);
24
23
  error ErrorApplicationServiceReferralInvalid(NftId productNftId, NftId distributionNftId, ReferralId referralId);
25
-
26
24
 
27
25
  /// @dev creates a new application based on the specified attributes
28
26
  /// may only be called by a product component
@@ -14,7 +14,6 @@ interface IPricingService is IService
14
14
  {
15
15
 
16
16
  error ErrorPricingServiceTargetWalletAmountsMismatch();
17
- error ErrorPricingServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
18
17
  error ErrorPricingServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
19
18
  error ErrorPricingServiceFeeCalculationMismatch(
20
19
  Amount distributionFeeFixAmount,
@@ -3,14 +3,11 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {IService} from "../shared/IService.sol";
5
5
 
6
- import {NftId} from "../type/NftId.sol";
7
6
  import {RiskId} from "../type/RiskId.sol";
8
7
  import {StateId} from "../type/StateId.sol";
9
8
 
10
9
  interface IRiskService is IService {
11
10
 
12
- error ErrorRiskServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
13
-
14
11
  /// @dev Create a new risk with the given id and provided data.
15
12
  /// The key of the risk derived from the risk id in comination with the product NftId.
16
13
  /// Risk data is stored in the instance store.
@@ -73,7 +73,6 @@ contract PolicyService is
73
73
  )
74
74
  external
75
75
  virtual
76
- restricted()
77
76
  nonReentrant()
78
77
  {
79
78
  // checks
@@ -101,7 +100,6 @@ contract PolicyService is
101
100
  )
102
101
  external
103
102
  virtual
104
- restricted()
105
103
  nonReentrant()
106
104
  returns (Amount premiumAmount)
107
105
  {
@@ -130,7 +128,7 @@ contract PolicyService is
130
128
 
131
129
  // optional activation of policy
132
130
  if(activateAt.gtz()) {
133
- applicationInfo = PolicyServiceLib.activate(applicationNftId, applicationInfo, activateAt);
131
+ applicationInfo = _activate(applicationNftId, applicationInfo, activateAt);
134
132
  }
135
133
 
136
134
  // update policy and set state to collateralized
@@ -188,7 +186,6 @@ contract PolicyService is
188
186
  )
189
187
  external
190
188
  virtual
191
- restricted()
192
189
  nonReentrant()
193
190
  {
194
191
  // checks
@@ -235,7 +232,7 @@ contract PolicyService is
235
232
 
236
233
  // optionally activate policy
237
234
  if(activateAt.gtz()) {
238
- policyInfo = PolicyServiceLib.activate(policyNftId, policyInfo, activateAt);
235
+ policyInfo = _activate(policyNftId, policyInfo, activateAt);
239
236
  }
240
237
 
241
238
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
@@ -253,7 +250,6 @@ contract PolicyService is
253
250
  function activate(NftId policyNftId, Timestamp activateAt)
254
251
  external
255
252
  virtual
256
- restricted()
257
253
  nonReentrant()
258
254
  {
259
255
  // checks
@@ -263,7 +259,7 @@ contract PolicyService is
263
259
  ) = _getAndVerifyCallerForPolicy(policyNftId);
264
260
 
265
261
  // effects
266
- policyInfo = PolicyServiceLib.activate(policyNftId, policyInfo, activateAt);
262
+ policyInfo = _activate(policyNftId, policyInfo, activateAt);
267
263
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
268
264
 
269
265
  // log policy activation before interactions with policy holder
@@ -281,7 +277,6 @@ contract PolicyService is
281
277
  )
282
278
  external
283
279
  virtual
284
- restricted()
285
280
  nonReentrant()
286
281
  {
287
282
  // checks
@@ -322,7 +317,6 @@ contract PolicyService is
322
317
  )
323
318
  external
324
319
  virtual
325
- restricted()
326
320
  nonReentrant()
327
321
  returns (Timestamp expiredAt)
328
322
  {
@@ -350,7 +344,6 @@ contract PolicyService is
350
344
  )
351
345
  external
352
346
  virtual
353
- restricted()
354
347
  nonReentrant()
355
348
  returns (Timestamp expiredAt)
356
349
  {
@@ -375,7 +368,6 @@ contract PolicyService is
375
368
  )
376
369
  external
377
370
  virtual
378
- restricted()
379
371
  nonReentrant()
380
372
  {
381
373
  // checks
@@ -430,12 +422,19 @@ contract PolicyService is
430
422
  internal
431
423
  returns (Timestamp)
432
424
  {
433
- policyInfo = PolicyServiceLib.expire(
434
- instance.getInstanceReader(),
425
+ PolicyServiceLib.checkExpiration(
426
+ expireAt,
435
427
  policyNftId,
436
- policyInfo,
437
- expireAt);
428
+ instance.getInstanceReader().getPolicyState(policyNftId),
429
+ policyInfo);
438
430
 
431
+ // effects
432
+ // update policyInfo with new expiredAt timestamp
433
+ if (expireAt.gtz()) {
434
+ policyInfo.expiredAt = expireAt;
435
+ } else {
436
+ policyInfo.expiredAt = TimestampLib.blockTimestamp();
437
+ }
439
438
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
440
439
 
441
440
  emit LogPolicyServicePolicyExpirationUpdated(policyNftId, policyInfo.expiredAt);
@@ -446,31 +445,32 @@ contract PolicyService is
446
445
  return policyInfo.expiredAt;
447
446
  }
448
447
 
449
- //function _activate(
450
- // NftId policyNftId,
451
- // IPolicy.PolicyInfo memory policyInfo,
452
- // Timestamp activateAt
453
- //)
454
- // internal
455
- // virtual
456
- // view
457
- // returns (IPolicy.PolicyInfo memory)
458
- //{
448
+
449
+ function _activate(
450
+ NftId policyNftId,
451
+ IPolicy.PolicyInfo memory policyInfo,
452
+ Timestamp activateAt
453
+ )
454
+ internal
455
+ virtual
456
+ view
457
+ returns (IPolicy.PolicyInfo memory)
458
+ {
459
459
  // fail if policy has already been activated and activateAt is different
460
- // if(! policyInfo.activatedAt.eqz() && activateAt != policyInfo.activatedAt) {
461
- // revert ErrorPolicyServicePolicyAlreadyActivated(policyNftId);
462
- // }
460
+ if(! policyInfo.activatedAt.eqz() && activateAt != policyInfo.activatedAt) {
461
+ revert ErrorPolicyServicePolicyAlreadyActivated(policyNftId);
462
+ }
463
463
 
464
464
  // ignore if policy has already been activated and activateAt is the same
465
- // if (policyInfo.activatedAt == activateAt) {
466
- // return policyInfo;
467
- // }
465
+ if (policyInfo.activatedAt == activateAt) {
466
+ return policyInfo;
467
+ }
468
468
 
469
- // policyInfo.activatedAt = activateAt;
470
- // policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
469
+ policyInfo.activatedAt = activateAt;
470
+ policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
471
471
 
472
- // return policyInfo;
473
- //}
472
+ return policyInfo;
473
+ }
474
474
 
475
475
  /// @dev update counters by calling the involved services
476
476
  function _processSale(
@@ -544,6 +544,24 @@ contract PolicyService is
544
544
  tokenHandler.pushToken(poolWallet, premium.poolPremiumAndFeeAmount);
545
545
  }
546
546
  }
547
+
548
+
549
+ /// @dev checks that policy has been collateralized and has been activated.
550
+ /// does not check if policy has been expired or closed.
551
+ function _policyHasBeenActivated(
552
+ StateId policyState,
553
+ IPolicy.PolicyInfo memory policyInfo
554
+ )
555
+ internal
556
+ view
557
+ returns (bool)
558
+ {
559
+ if (policyState != COLLATERALIZED()) { return false; }
560
+ if (TimestampLib.blockTimestamp() < policyInfo.activatedAt) { return false; }
561
+ return true;
562
+ }
563
+
564
+
547
565
  function _policyHolderPolicyActivated(
548
566
  NftId policyNftId,
549
567
  Timestamp activateAt