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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/README.md +1 -1
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +26 -45
  4. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  5. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +0 -19
  9. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  14. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  15. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +2 -2
  16. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  17. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
  18. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  20. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +9 -4
  21. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  22. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +92 -61
  23. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  24. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  25. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  26. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +2 -2
  27. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  28. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
  29. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  30. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +60 -32
  31. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  32. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +33 -28
  33. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  34. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  35. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  36. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  37. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  38. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  39. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  40. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +88 -91
  41. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  42. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  43. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  44. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +70 -60
  45. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  46. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +11 -6
  47. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  48. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -38
  49. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  50. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +32 -12
  51. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  52. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  53. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  54. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  55. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  56. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  57. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  58. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  59. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  60. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  61. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  63. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  64. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  65. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
  66. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  67. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  68. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  69. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  70. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  71. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  72. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  73. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +9 -4
  74. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  75. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +68 -37
  76. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  77. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +28 -0
  78. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  79. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
  80. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  81. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +15 -10
  82. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -59
  84. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  85. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  86. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +28 -0
  87. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  88. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  89. package/artifacts/contracts/pool/Pool.sol/Pool.json +28 -0
  90. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  91. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +35 -30
  92. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  93. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +71 -40
  94. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  95. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +17 -12
  96. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +65 -34
  98. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  99. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +5 -0
  100. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  101. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  102. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  103. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +91 -70
  104. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  105. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +97 -58
  106. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  107. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  108. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  109. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +82 -0
  110. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  111. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  112. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +5 -0
  113. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  114. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  115. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +167 -48
  116. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -45
  118. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  119. package/artifacts/contracts/product/PricingService.sol/PricingService.json +39 -34
  120. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -45
  122. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  123. package/artifacts/contracts/product/Product.sol/Product.json +5 -0
  124. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  125. package/artifacts/contracts/product/RiskService.sol/RiskService.json +11 -6
  126. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  127. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +62 -31
  128. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  129. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  130. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  131. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  132. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  133. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  134. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  135. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +108 -111
  136. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  137. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +9 -4
  138. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  139. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +60 -29
  140. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  141. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  142. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  143. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  144. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
  145. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  146. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  147. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  148. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  149. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +39 -34
  150. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  151. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +97 -56
  152. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  153. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -0
  154. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
  155. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
  156. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  157. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  158. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  159. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  160. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  161. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  162. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  163. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -5
  164. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  165. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  166. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  167. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  168. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  169. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  170. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  171. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  172. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  173. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  174. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  175. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +17 -7
  176. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  177. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  178. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  179. package/artifacts/contracts/shared/Service.sol/Service.json +5 -0
  180. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  181. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  182. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  183. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  184. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  185. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
  186. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  187. package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
  188. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  189. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  190. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +78 -42
  191. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  192. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  193. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  194. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +11 -6
  195. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  196. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +64 -33
  197. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  198. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  199. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  200. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  201. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  202. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  203. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  204. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  205. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  206. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  207. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  208. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  209. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  210. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  211. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  212. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  213. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  214. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  215. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  216. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  217. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  218. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  219. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  220. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  221. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  222. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  223. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  224. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  225. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  226. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  227. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  228. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +47 -27
  229. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  230. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  231. package/contracts/authorization/AccessAdmin.sol +24 -21
  232. package/contracts/authorization/IAccessAdmin.sol +0 -1
  233. package/contracts/distribution/DistributionService.sol +6 -6
  234. package/contracts/distribution/DistributionServiceManager.sol +6 -6
  235. package/contracts/instance/InstanceService.sol +2 -3
  236. package/contracts/instance/InstanceServiceManager.sol +6 -7
  237. package/contracts/instance/module/IComponents.sol +3 -1
  238. package/contracts/oracle/OracleService.sol +6 -4
  239. package/contracts/oracle/OracleServiceManager.sol +6 -6
  240. package/contracts/pool/BundleService.sol +6 -6
  241. package/contracts/pool/BundleServiceManager.sol +6 -6
  242. package/contracts/pool/IPoolComponent.sol +18 -8
  243. package/contracts/pool/Pool.sol +26 -10
  244. package/contracts/pool/PoolService.sol +2 -3
  245. package/contracts/pool/PoolServiceManager.sol +4 -4
  246. package/contracts/product/ApplicationService.sol +3 -4
  247. package/contracts/product/ApplicationServiceManager.sol +4 -4
  248. package/contracts/product/ClaimService.sol +147 -61
  249. package/contracts/product/ClaimServiceManager.sol +4 -4
  250. package/contracts/product/IPolicyService.sol +7 -3
  251. package/contracts/product/PolicyService.sol +93 -20
  252. package/contracts/product/PolicyServiceManager.sol +4 -4
  253. package/contracts/product/PricingService.sol +2 -3
  254. package/contracts/product/PricingServiceManager.sol +3 -3
  255. package/contracts/product/Product.sol +1 -0
  256. package/contracts/product/RiskService.sol +2 -3
  257. package/contracts/product/RiskServiceManager.sol +4 -4
  258. package/contracts/registry/RegistryServiceManager.sol +2 -2
  259. package/contracts/shared/ComponentService.sol +5 -5
  260. package/contracts/shared/ComponentServiceManager.sol +8 -5
  261. package/contracts/shared/ContractLib.sol +38 -0
  262. package/contracts/shared/IPolicyHolder.sol +12 -13
  263. package/contracts/shared/PolicyHolder.sol +7 -5
  264. package/contracts/shared/Service.sol +12 -7
  265. package/contracts/staking/Staking.sol +1 -1
  266. package/contracts/staking/StakingManager.sol +8 -6
  267. package/contracts/staking/StakingServiceManager.sol +2 -2
  268. package/contracts/upgradeability/ProxyManager.sol +67 -34
  269. package/contracts/upgradeability/Versionable.sol +2 -2
  270. package/package.json +1 -1
@@ -10,6 +10,13 @@ import {Timestamp} from "../type/Timestamp.sol";
10
10
 
11
11
  interface IPolicyService is IService {
12
12
 
13
+ event LogPolicyServicePolicyCreated(NftId policyNftId, Amount premiumAmount, Timestamp activatedAt);
14
+ event LogPolicyServicePolicyDeclined(NftId policyNftId);
15
+ event LogPolicyServicePolicyPremiumCollected(NftId policyNftId, Amount premiumAmount);
16
+ event LogPolicyServicePolicyActivated(NftId policyNftId, Timestamp activatedAt);
17
+ event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp originalExpiredAt, Timestamp expiredAt);
18
+ event LogPolicyServicePolicyClosed(NftId policyNftId);
19
+
13
20
  error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
14
21
  error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
15
22
  error ErrorPolicyServicePolicyStateNotCollateralized(NftId applicationNftId);
@@ -32,9 +39,6 @@ interface IPolicyService is IService {
32
39
  error ErrorPolicyServicePremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount recalculatedPremiumAmount);
33
40
  error ErrorPolicyServiceTransferredPremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount transferredPremiumAmount);
34
41
 
35
- event LogPolicyServicePolicyDeclined(NftId policyNftId);
36
- event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt);
37
-
38
42
  /// @dev creates the policy from {applicationNftId}.
39
43
  /// After successful completion of the function the policy can be referenced using the application NftId.
40
44
  /// Locks the sum insured amount in the pool, but does not transfer tokens. Call collectPremium to transfer tokens.
@@ -21,6 +21,7 @@ import {StateId} from "../type/StateId.sol";
21
21
  import {VersionPart} from "../type/Version.sol";
22
22
 
23
23
  import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
24
+ import {ContractLib} from "../shared/ContractLib.sol";
24
25
  import {IApplicationService} from "./IApplicationService.sol";
25
26
  import {IBundleService} from "../pool/IBundleService.sol";
26
27
  import {IClaimService} from "./IClaimService.sol";
@@ -28,6 +29,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
28
29
  import {IDistributionService} from "../distribution/IDistributionService.sol";
29
30
  import {InstanceReader} from "../instance/InstanceReader.sol";
30
31
  import {InstanceStore} from "../instance/InstanceStore.sol";
32
+ import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
31
33
  import {IPolicyService} from "./IPolicyService.sol";
32
34
  import {IPoolService} from "../pool/IPoolService.sol";
33
35
  import {IPricingService} from "./IPricingService.sol";
@@ -56,10 +58,9 @@ contract PolicyService is
56
58
  initializer
57
59
  {
58
60
  (
59
- address registryAddress,,
60
- //address managerAddress
61
+ address registryAddress,
61
62
  address authority
62
- ) = abi.decode(data, (address, address, address));
63
+ ) = abi.decode(data, (address, address));
63
64
 
64
65
  _initializeService(registryAddress, authority, owner);
65
66
 
@@ -80,7 +81,8 @@ contract PolicyService is
80
81
  NftId applicationNftId // = policyNftId
81
82
  )
82
83
  external
83
- virtual override
84
+ virtual
85
+ nonReentrant()
84
86
  {
85
87
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
86
88
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -115,7 +117,8 @@ contract PolicyService is
115
117
  Timestamp activateAt
116
118
  )
117
119
  external
118
- virtual override
120
+ virtual
121
+ nonReentrant()
119
122
  {
120
123
  // check caller is registered product
121
124
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -179,12 +182,14 @@ contract PolicyService is
179
182
  productInfo.distributionNftId,
180
183
  applicationInfo.referralId);
181
184
  }
182
-
183
- // TODO add calling pool contract if it needs to validate application
184
185
 
185
- // TODO: add logging
186
+ // log policy creation before interactions with token and policy holder
187
+ emit LogPolicyServicePolicyCreated(applicationNftId, premium.premiumAmount, activateAt);
186
188
 
187
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
189
+ // TODO add calling pool contract if it needs to validate application
190
+
191
+ // callback to policy holder if applicable
192
+ _policyHolderPolicyActivated(applicationNftId, activateAt);
188
193
  }
189
194
 
190
195
 
@@ -195,6 +200,7 @@ contract PolicyService is
195
200
  )
196
201
  external
197
202
  virtual
203
+ nonReentrant()
198
204
  {
199
205
  // check caller is registered product
200
206
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -228,15 +234,18 @@ contract PolicyService is
228
234
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
229
235
  instance.getInstanceStore().updatePremiumState(policyNftId, PAID());
230
236
 
231
- // TODO: add logging
237
+ // log premium collection before interactions with token
238
+ emit LogPolicyServicePolicyPremiumCollected(policyNftId, premium.premiumAmount);
232
239
 
233
240
  _transferFunds(instanceReader, policyNftId, policyInfo.productNftId, premium);
234
-
235
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
236
241
  }
237
242
 
238
243
  /// @inheritdoc IPolicyService
239
- function activate(NftId policyNftId, Timestamp activateAt) public override {
244
+ function activate(NftId policyNftId, Timestamp activateAt)
245
+ external
246
+ virtual
247
+ nonReentrant()
248
+ {
240
249
  // check caller is registered product
241
250
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
242
251
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -246,9 +255,11 @@ contract PolicyService is
246
255
 
247
256
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
248
257
 
249
- // TODO: add logging
258
+ // log policy activation before interactions with policy holder
259
+ emit LogPolicyServicePolicyActivated(policyNftId, activateAt);
250
260
 
251
- // TODO: add callback IPolicyHolder.policyActivated() if applicable
261
+ // callback to policy holder if applicable
262
+ _policyHolderPolicyActivated(policyNftId, activateAt);
252
263
  }
253
264
 
254
265
 
@@ -258,8 +269,8 @@ contract PolicyService is
258
269
  Timestamp expireAt
259
270
  )
260
271
  external
261
- override
262
272
  virtual
273
+ nonReentrant()
263
274
  returns (Timestamp expiredAt)
264
275
  {
265
276
  (NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
@@ -297,12 +308,14 @@ contract PolicyService is
297
308
  }
298
309
 
299
310
  // update policyInfo with new expiredAt timestamp
311
+ Timestamp originalExpiredAt = policyInfo.expiredAt;
300
312
  policyInfo.expiredAt = expiredAt;
301
313
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
302
314
 
303
- emit LogPolicyServicePolicyExpirationUpdated(policyNftId, expiredAt);
315
+ emit LogPolicyServicePolicyExpirationUpdated(policyNftId, originalExpiredAt, expiredAt);
304
316
 
305
- // TODO: add callback IPolicyHolder.policyExpired() if applicable
317
+ // callback to policy holder if applicable
318
+ _policyHolderPolicyExpired(policyNftId, expiredAt);
306
319
  }
307
320
 
308
321
 
@@ -310,7 +323,8 @@ contract PolicyService is
310
323
  NftId policyNftId
311
324
  )
312
325
  external
313
- override
326
+ virtual
327
+ nonReentrant()
314
328
  {
315
329
  (,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
316
330
  InstanceReader instanceReader = instance.getInstanceReader();
@@ -351,7 +365,7 @@ contract PolicyService is
351
365
  policyInfo.closedAt = TimestampLib.blockTimestamp();
352
366
  instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, CLOSED());
353
367
 
354
- // TODO add logging
368
+ emit LogPolicyServicePolicyClosed(policyNftId);
355
369
  }
356
370
 
357
371
 
@@ -525,6 +539,64 @@ contract PolicyService is
525
539
  }
526
540
 
527
541
 
542
+ function _policyHolderPolicyActivated(
543
+ NftId policyNftId,
544
+ Timestamp activateAt
545
+ )
546
+ internal
547
+ virtual
548
+ {
549
+ // immediately return if policy is not activated
550
+ if (activateAt.eqz()) {
551
+ return;
552
+ }
553
+
554
+ // get policy holder address
555
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
556
+
557
+ // execute callback if policy holder implements IPolicyHolder
558
+ if (address(policyHolder) != address(0)) {
559
+ policyHolder.policyActivated(policyNftId, activateAt);
560
+ }
561
+ }
562
+
563
+
564
+ function _policyHolderPolicyExpired(
565
+ NftId policyNftId,
566
+ Timestamp expiredAt
567
+ )
568
+ internal
569
+ virtual
570
+ {
571
+ // immediately return if policy is not activated
572
+ if (expiredAt.eqz()) {
573
+ return;
574
+ }
575
+
576
+ // get policy holder address
577
+ IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
578
+
579
+ // execute callback if policy holder implements IPolicyHolder
580
+ if (address(policyHolder) != address(0)) {
581
+ policyHolder.policyExpired(policyNftId, expiredAt);
582
+ }
583
+ }
584
+
585
+
586
+ function _getPolicyHolder(NftId policyNftId)
587
+ internal
588
+ view
589
+ returns (IPolicyHolder policyHolder)
590
+ {
591
+ address policyHolderAddress = getRegistry().ownerOf(policyNftId);
592
+ policyHolder = IPolicyHolder(policyHolderAddress);
593
+
594
+ if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
595
+ policyHolder = IPolicyHolder(address(0));
596
+ }
597
+ }
598
+
599
+
528
600
  function _getTokenHandler(
529
601
  InstanceReader instanceReader,
530
602
  NftId productNftId
@@ -539,6 +611,7 @@ contract PolicyService is
539
611
  tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
540
612
  }
541
613
 
614
+
542
615
  function _getDistributionNftAndWallets(
543
616
  InstanceReader instanceReader,
544
617
  NftId productNftId
@@ -12,14 +12,14 @@ contract PolicyServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with product 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
  PolicyService svc = new PolicyService{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);
@@ -45,10 +45,9 @@ contract PricingService is
45
45
  initializer()
46
46
  {
47
47
  (
48
- address registryAddress,,
49
- //address managerAddress
48
+ address registryAddress,
50
49
  address authority
51
- ) = abi.decode(data, (address, address, address));
50
+ ) = abi.decode(data, (address, address));
52
51
 
53
52
  _initializeService(registryAddress, authority, owner);
54
53
  _registerInterface(type(IPricingService).interfaceId);
@@ -15,11 +15,11 @@ contract PricingServiceManager is ProxyManager {
15
15
  address registryAddress,
16
16
  bytes32 salt
17
17
  )
18
- ProxyManager(registryAddress)
19
18
  {
20
19
  PricingService pricingSrv = new PricingService{salt: salt}();
21
- bytes memory data = abi.encode(registryAddress, address(this), authority);
22
- IVersionable versionable = deployDetermenistic(
20
+ bytes memory data = abi.encode(registryAddress, authority);
21
+ IVersionable versionable = initialize(
22
+ registryAddress,
23
23
  address(pricingSrv),
24
24
  data,
25
25
  salt);
@@ -112,6 +112,7 @@ abstract contract Product is
112
112
  return IComponents.ProductInfo({
113
113
  distributionNftId: $._distributionNftId,
114
114
  poolNftId: $._poolNftId,
115
+ isProcessingFundedClaims: false,
115
116
  productFee: FeeLib.zero(),
116
117
  processingFee: FeeLib.zero(),
117
118
  distributionFee: FeeLib.zero(),
@@ -33,10 +33,9 @@ contract RiskService is
33
33
  virtual override
34
34
  {
35
35
  (
36
- address registryAddress,,
37
- //address managerAddress
36
+ address registryAddress,
38
37
  address authority
39
- ) = abi.decode(data, (address, address, address));
38
+ ) = abi.decode(data, (address, address));
40
39
 
41
40
  _initializeService(registryAddress, authority, owner);
42
41
 
@@ -12,14 +12,14 @@ contract RiskServiceManager is ProxyManager {
12
12
  /// @dev initializes proxy manager with product 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
  RiskService svc = new RiskService{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);
@@ -21,7 +21,6 @@ contract RegistryServiceManager is
21
21
  address registry, // used by implementation
22
22
  bytes32 salt
23
23
  )
24
- ProxyManager(registry)
25
24
  {
26
25
  if(authority == address(0)) {
27
26
  revert ErrorRegistryAccessManagerAuthorityZero();
@@ -33,7 +32,8 @@ contract RegistryServiceManager is
33
32
 
34
33
  RegistryService srv = new RegistryService{ salt: salt }();
35
34
  bytes memory data = abi.encode(registry, authority);
36
- IVersionable versionable = deployDetermenistic(
35
+ IVersionable versionable = initialize(
36
+ registry,
37
37
  address(srv),
38
38
  data,
39
39
  salt);
@@ -48,12 +48,12 @@ contract ComponentService is
48
48
  virtual override
49
49
  initializer()
50
50
  {
51
- // TODO check this, might no longer be the way, refactor if necessary
52
- address registryAddress;
53
- address initialOwner;
54
- (registryAddress, initialOwner) = abi.decode(data, (address, address));
51
+ (
52
+ address registryAddress,
53
+ address authority
54
+ ) = abi.decode(data, (address, address));
55
55
 
56
- _initializeService(registryAddress, address(0), owner);
56
+ _initializeService(registryAddress, authority, owner);
57
57
 
58
58
  _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
59
59
  _instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
@@ -11,15 +11,18 @@ contract ComponentServiceManager is ProxyManager {
11
11
 
12
12
  /// @dev initializes proxy manager with service implementation
13
13
  constructor(
14
- address registryAddress
14
+ address authority,
15
+ address registry,
16
+ bytes32 salt
15
17
  )
16
- ProxyManager(registryAddress)
17
18
  {
18
19
  ComponentService svc = new ComponentService();
19
- bytes memory data = abi.encode(registryAddress, address(this));
20
- IVersionable versionable = deploy(
20
+ bytes memory data = abi.encode(registry, authority);
21
+ IVersionable versionable = initialize(
22
+ registry,
21
23
  address(svc),
22
- data);
24
+ data,
25
+ salt);
23
26
 
24
27
  _componentService = ComponentService(address(versionable));
25
28
  }
@@ -0,0 +1,38 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
5
+ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
6
+
7
+ import {IPolicyHolder} from "./IPolicyHolder.sol";
8
+
9
+ library ContractLib {
10
+
11
+ function isPolicyHolder(address target) external view returns (bool) {
12
+ return ERC165Checker.supportsInterface(target, type(IPolicyHolder).interfaceId);
13
+ }
14
+
15
+ function isAccessManaged(address target) external view returns (bool) {
16
+ if (!isContract(target)) {
17
+ return false;
18
+ }
19
+
20
+ (bool success, ) = target.staticcall(
21
+ abi.encodeWithSelector(
22
+ IAccessManaged.authority.selector));
23
+
24
+ return success;
25
+ }
26
+
27
+ function isContract(address target) public view returns (bool) {
28
+ uint256 size;
29
+ assembly {
30
+ size := extcodesize(target)
31
+ }
32
+ return size > 0;
33
+ }
34
+
35
+ function supportsInterface(address target, bytes4 interfaceId) external view returns (bool) {
36
+ return ERC165Checker.supportsInterface(target, interfaceId);
37
+ }
38
+ }
@@ -9,28 +9,27 @@ import {ClaimId} from "../type/ClaimId.sol";
9
9
  import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
10
10
  import {NftId} from "../type/NftId.sol";
11
11
  import {PayoutId} from "../type/PayoutId.sol";
12
+ import {Timestamp} from "../type/Timestamp.sol";
12
13
 
13
- /// @dev generic interface for contracts that need to hold policies and receive payouts
14
- /// GIF will notify policy holder contracts for policy creation and payout execution
14
+ /// @dev Generic interface for contracts that need to hold policies and receive payouts.
15
+ /// The framework notifies policy holder contracts for policy creation/expiry, claim confirmation and payout execution
15
16
  interface IPolicyHolder is
16
17
  IERC165,
17
18
  IERC721Receiver,
18
19
  IRegistryLinked
19
20
  {
20
21
 
21
- /// @dev callback function that will be called after successful policy activation
22
- /// active policies may open claims under the activated policy
23
- function policyActivated(NftId policyNftId) external;
22
+ /// @dev Callback function that will be called after successful policy activation.
23
+ /// Active policies may open claims under the activated policy.
24
+ function policyActivated(NftId policyNftId, Timestamp activatedAt) external;
24
25
 
25
- /// @dev callback function to indicate the specified policy has expired
26
- /// expired policies may no longer open claims
27
- /// it is optional for products to notifiy policy holder of expired claims
28
- function policyExpired(NftId policyNftId) external;
26
+ /// @dev Callback function to indicate the specified policy has expired.
27
+ /// expired policies no longer accept new claims.
28
+ function policyExpired(NftId policyNftId, Timestamp expiredAt) external;
29
29
 
30
- /// @dev callback function to notify the confirmation of the specified claim
31
- /// active policies may open claims under the activated policy
30
+ /// @dev Callback function to notify the confirmation of the specified claim.
32
31
  function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external;
33
32
 
34
- /// @dev callback function that will be called after a successful payout
35
- function payoutExecuted(NftId policyNftId, PayoutId payoutId, address beneficiary, Amount amount) external;
33
+ /// @dev Callback function to notify the successful payout.
34
+ function payoutExecuted(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary) external;
36
35
  }
@@ -10,11 +10,12 @@ import {IPolicyHolder} from "./IPolicyHolder.sol";
10
10
  import {NftId} from "../type/NftId.sol";
11
11
  import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
12
12
  import {RegistryLinked} from "./RegistryLinked.sol";
13
+ import {Timestamp} from "../type/Timestamp.sol";
13
14
 
14
15
  /// @dev template implementation for IPolicyHolder
15
16
  contract PolicyHolder is
16
17
  InitializableERC165,
17
- RegistryLinked, // TODO need upgradeable version
18
+ RegistryLinked,
18
19
  IPolicyHolder
19
20
  {
20
21
  function _initializePolicyHolder(
@@ -25,20 +26,21 @@ contract PolicyHolder is
25
26
  onlyInitializing()
26
27
  {
27
28
  _initializeRegistryLinked(registryAddress);
29
+ _initializeERC165();
28
30
  _registerInterface(type(IPolicyHolder).interfaceId);
29
31
  }
30
32
 
31
33
  /// @dev empty default implementation
32
- function policyActivated(NftId policyNftId) external {}
34
+ function policyActivated(NftId policyNftId, Timestamp activatedAt) external virtual {}
33
35
 
34
36
  /// @dev empty default implementation
35
- function policyExpired(NftId policyNftId) external {}
37
+ function policyExpired(NftId policyNftId, Timestamp expiredAt) external virtual {}
36
38
 
37
39
  /// @dev empty default implementation
38
- function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external {}
40
+ function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external virtual {}
39
41
 
40
42
  /// @dev empty default implementation
41
- function payoutExecuted(NftId policyNftId, PayoutId payoutId, address beneficiary, Amount amount) external {}
43
+ function payoutExecuted(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary) external virtual {}
42
44
 
43
45
  //--- IERC165 functions ---------------//
44
46
  function onERC721Received(
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
5
5
  import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
6
+ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
6
7
 
7
8
  import {IRegistry} from "../registry/IRegistry.sol";
8
9
  import {IService} from "./IService.sol";
@@ -19,6 +20,7 @@ abstract contract Service is
19
20
  Registerable,
20
21
  Versionable,
21
22
  AccessManagedUpgradeable,
23
+ ReentrancyGuardUpgradeable,
22
24
  IService
23
25
  {
24
26
 
@@ -34,13 +36,7 @@ abstract contract Service is
34
36
  virtual
35
37
  onlyInitializing()
36
38
  {
37
- _initializeRegisterable(
38
- registry,
39
- IRegistry(registry).getNftId(),
40
- SERVICE(),
41
- false, // is interceptor
42
- initialOwner,
43
- ""); // data
39
+ __ReentrancyGuard_init();
44
40
 
45
41
  // externally provided authority
46
42
  if(authority != address(0)) {
@@ -52,6 +48,15 @@ abstract contract Service is
52
48
  __AccessManaged_init(IAccessManaged(registryServiceAddress).authority());
53
49
  }
54
50
 
51
+ _initializeRegisterable(
52
+ registry,
53
+ IRegistry(registry).getNftId(),
54
+ SERVICE(),
55
+ false, // is interceptor
56
+ initialOwner,
57
+ ""); // data
58
+
59
+
55
60
  _registerInterface(type(IAccessManaged).interfaceId);
56
61
  _registerInterface(type(IService).interfaceId);
57
62
  }
@@ -451,7 +451,7 @@ contract Staking is
451
451
  )
452
452
  internal
453
453
  virtual override
454
- initializer
454
+ initializer()
455
455
  {
456
456
  (
457
457
  address registryAddress,
@@ -18,9 +18,9 @@ contract StakingManager is
18
18
  address registry,
19
19
  address tokenRegistry,
20
20
  address stakingStore,
21
- address initialOwner
21
+ address initialOwner,
22
+ bytes32 salt
22
23
  )
23
- ProxyManager(registry)
24
24
  {
25
25
  Staking stakingImplementation = new Staking();
26
26
 
@@ -30,10 +30,12 @@ contract StakingManager is
30
30
  tokenRegistry,
31
31
  stakingStore,
32
32
  initialOwner);
33
-
34
- IVersionable versionable = deploy(
35
- _initialImplementation,
36
- _initializationData);
33
+
34
+ IVersionable versionable = initialize(
35
+ registry,
36
+ _initialImplementation,
37
+ _initializationData,
38
+ salt);
37
39
 
38
40
  _staking = Staking(address(versionable));
39
41
  }
@@ -18,14 +18,14 @@ contract StakingServiceManager is
18
18
  address registryAddress,
19
19
  bytes32 salt
20
20
  )
21
- ProxyManager(registryAddress)
22
21
  {
23
22
  StakingService svc = new StakingService();
24
23
  bytes memory data = abi.encode(
25
24
  authority,
26
25
  registryAddress,
27
26
  IRegistry(registryAddress).getStakingAddress());
28
- IVersionable versionable = deployDetermenistic(
27
+ IVersionable versionable = initialize(
28
+ registryAddress,
29
29
  address(svc),
30
30
  data,
31
31
  salt);