@etherisc/gif-next 0.0.2-f2df3e2-873 → 0.0.2-f398177-971

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  2. package/artifacts/contracts/components/Component.sol/Component.json +37 -6
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +44 -13
  5. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.json +37 -6
  7. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +44 -13
  9. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +55 -24
  11. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +52 -21
  13. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  14. package/artifacts/contracts/components/Pool.sol/Pool.json +55 -24
  15. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  16. package/artifacts/contracts/components/Product.sol/Product.json +52 -21
  17. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  18. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  19. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  20. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  21. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +252 -2210
  22. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  23. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +21 -38
  24. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  25. package/artifacts/contracts/instance/Instance.sol/Instance.json +346 -2685
  26. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  27. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +67 -49
  28. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
  29. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
  30. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  31. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +219 -53
  32. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  33. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +59 -220
  34. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  35. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +32 -117
  36. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
  37. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -0
  38. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  39. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  40. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  41. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +37 -13
  42. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  43. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  44. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  45. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  46. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  47. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  48. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  49. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  50. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  51. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  52. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  53. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  54. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  55. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  56. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  57. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +75 -217
  58. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  59. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +33 -66
  60. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  61. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +155 -133
  62. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  63. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +35 -64
  64. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
  65. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +463 -119
  66. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  67. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +109 -42
  68. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  69. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +181 -399
  70. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  71. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +81 -94
  72. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  73. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +11 -145
  74. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  75. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +79 -30
  76. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +229 -88
  78. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +23 -273
  80. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +40 -326
  82. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +265 -32
  84. package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +510 -0
  86. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +5 -13
  88. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +213 -443
  90. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  91. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +74 -75
  92. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +439 -54
  94. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +84 -37
  96. package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
  97. package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +1004 -0
  98. package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
  99. package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +688 -0
  100. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +55 -31
  102. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +22 -35
  104. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  105. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  106. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  107. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +5 -13
  108. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  109. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  110. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  111. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  112. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  113. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  114. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +17 -25
  115. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  116. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +21 -34
  117. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  118. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +2 -2
  119. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  120. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +10 -23
  121. package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
  122. package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
  123. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  124. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  125. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  126. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +0 -13
  127. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  128. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
  129. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
  131. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  132. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
  133. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  134. package/artifacts/contracts/shared/IService.sol/IService.json +5 -13
  135. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  136. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  137. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -19
  138. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  139. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
  140. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  141. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -27
  142. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  143. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +6 -19
  144. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  145. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
  146. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  147. package/artifacts/contracts/shared/Service.sol/Service.json +5 -13
  148. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  149. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
  150. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  151. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  152. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
  154. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  155. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +6 -19
  156. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  157. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  158. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  159. package/artifacts/contracts/test/TestService.sol/TestService.json +17 -25
  160. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  161. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  162. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  163. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  164. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  165. package/artifacts/contracts/types/Amount.sol/AmountLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/Amount.sol/AmountLib.json +100 -4
  167. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  168. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  169. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  170. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +2 -2
  171. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  173. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/Fee.sol/FeeLib.json +42 -18
  175. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  176. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  177. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  178. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  179. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  180. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  181. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  184. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  185. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +2 -2
  186. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  187. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  188. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  189. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  190. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  191. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  192. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  195. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  196. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  197. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  198. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  199. package/contracts/components/Component.sol +21 -2
  200. package/contracts/components/Distribution.sol +5 -4
  201. package/contracts/components/IComponent.sol +16 -2
  202. package/contracts/components/IPoolComponent.sol +7 -6
  203. package/contracts/components/IProductComponent.sol +5 -4
  204. package/contracts/components/Pool.sol +8 -8
  205. package/contracts/components/Product.sol +21 -17
  206. package/contracts/instance/IInstance.sol +28 -53
  207. package/contracts/instance/IInstanceService.sol +15 -10
  208. package/contracts/instance/Instance.sol +90 -171
  209. package/contracts/instance/InstanceAccessManager.sol +35 -21
  210. package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
  211. package/contracts/instance/InstanceReader.sol +56 -5
  212. package/contracts/instance/InstanceService.sol +96 -266
  213. package/contracts/instance/InstanceStore.sol +212 -0
  214. package/contracts/instance/ObjectManager.sol +1 -1
  215. package/contracts/instance/base/ComponentService.sol +47 -20
  216. package/contracts/instance/base/KeyValueStore.sol +0 -31
  217. package/contracts/instance/base/Lifecycle.sol +7 -4
  218. package/contracts/instance/module/IComponents.sol +3 -3
  219. package/contracts/instance/module/IDistribution.sol +3 -2
  220. package/contracts/instance/module/IPolicy.sol +5 -5
  221. package/contracts/instance/service/ApplicationService.sol +58 -227
  222. package/contracts/instance/service/BundleService.sol +65 -119
  223. package/contracts/instance/service/ClaimService.sol +232 -34
  224. package/contracts/instance/service/DistributionService.sol +51 -134
  225. package/contracts/instance/service/IApplicationService.sol +5 -21
  226. package/contracts/instance/service/IBundleService.sol +32 -10
  227. package/contracts/instance/service/IClaimService.sol +37 -39
  228. package/contracts/instance/service/IDistributionService.sol +10 -22
  229. package/contracts/instance/service/IPolicyService.sol +15 -72
  230. package/contracts/instance/service/IPoolService.sol +18 -3
  231. package/contracts/instance/service/IPricingService.sol +37 -0
  232. package/contracts/instance/service/PolicyService.sol +112 -277
  233. package/contracts/instance/service/PoolService.sol +121 -21
  234. package/contracts/instance/service/PricingService.sol +275 -0
  235. package/contracts/instance/service/PricingServiceManager.sol +51 -0
  236. package/contracts/instance/service/ProductService.sol +10 -10
  237. package/contracts/registry/IRegistryService.sol +0 -2
  238. package/contracts/registry/RegistryService.sol +14 -10
  239. package/contracts/shared/IPolicyHolder.sol +23 -9
  240. package/contracts/shared/IRegistryLinked.sol +0 -1
  241. package/contracts/shared/IService.sol +2 -0
  242. package/contracts/shared/NftOwnable.sol +0 -2
  243. package/contracts/shared/PolicyHolder.sol +30 -17
  244. package/contracts/shared/Registerable.sol +10 -9
  245. package/contracts/shared/RegistryLinked.sol +0 -5
  246. package/contracts/shared/TokenHandler.sol +4 -2
  247. package/contracts/types/Amount.sol +44 -0
  248. package/contracts/types/Fee.sol +7 -6
  249. package/contracts/types/ObjectType.sol +5 -1
  250. package/package.json +1 -1
  251. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  252. /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
@@ -18,41 +18,28 @@ import {Fee} from "../../types/Fee.sol";
18
18
 
19
19
  interface IPolicyService is IService {
20
20
 
21
- event LogPolicyServiceClaimSubmitted(NftId policyNftId, ClaimId claimId, Amount claimAmount);
22
- event LogPolicyServiceClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount);
23
- event LogPolicyServiceClaimDeclined(NftId policyNftId, ClaimId claimId);
24
- event LogPolicyServiceClaimClosed(NftId policyNftId, ClaimId claimId);
25
-
26
- event LogPolicyServicePayoutCreated(NftId policyNftId, PayoutId payoutId, Amount amount);
27
- event LogPolicyServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount);
28
-
29
- error ErrorPolicyServicePolicyProductMismatch(NftId policyNftId, NftId expectedProduct, NftId actualProduct);
30
- error ErrorPolicyServicePolicyNotOpen(NftId policyNftId);
31
- error ErrorPolicyServiceClaimExceedsSumInsured(NftId policyNftId, Amount sumInsured, Amount payoutsIncludingClaimAmount);
21
+ error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
22
+ error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
32
23
 
33
24
  error ErrorIPolicyServiceInsufficientAllowance(address customer, address tokenHandlerAddress, uint256 amount);
34
- error ErrorIPolicyServicePremiumAlreadyPaid(NftId policyNftId, uint256 premiumPaidAmount);
25
+ error ErrorPolicyServicePremiumAlreadyPaid(NftId policyNftId, Amount premiumPaidAmount);
35
26
  error ErrorIPolicyServicePolicyNotActivated(NftId policyNftId);
36
27
  error ErrorIPolicyServicePolicyAlreadyClosed(NftId policyNftId);
37
28
  error ErrorIPolicyServicePolicyNotActive(NftId policyNftId, StateId state);
38
- error ErrorIPolicyServicePremiumNotFullyPaid(NftId policyNftId, uint256 premiumAmount, uint256 premiumPaidAmount);
29
+ error ErrorPolicyServicePremiumNotFullyPaid(NftId policyNftId, Amount premiumAmount, Amount premiumPaidAmount);
39
30
  error ErrorIPolicyServiceOpenClaims(NftId policyNftId, uint16 openClaimsCount);
40
31
  error ErrorIPolicyServicePolicyHasNotExpired(NftId policyNftId, Timestamp expiredAt);
41
32
 
42
- error ErrorIPolicyServicePremiumMismatch(NftId policyNftId, uint256 expectedPremiumAmount, uint256 recalculatedPremiumAmount);
43
-
44
- /// @dev declines an application represented by {policyNftId}
45
- /// an application can only be declined in applied state
46
- /// only the related product may decline an application
47
- function decline(NftId policyNftId) external;
33
+ error ErrorPolicyServicePremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount recalculatedPremiumAmount);
34
+ error ErrorPolicyServiceTransferredPremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount transferredPremiumAmount);
48
35
 
49
36
  /// @dev collateralizes the policy represented by {policyNftId}
50
- /// sets the policy state to underwritten
37
+ /// sets the policy state to collateralized
51
38
  /// may set the policy state to activated and set the activation date
52
39
  /// optionally collects premiums and activates the policy.
53
40
  /// - premium payment is only attempted if requirePremiumPayment is set to true
54
41
  /// - activation is only done if activateAt is a non-zero timestamp
55
- /// an application can only be underwritten in applied state
42
+ /// an application can only be collateralized in applied state
56
43
  /// only the related product may collateralize an application
57
44
  function collateralize(
58
45
  NftId policyNftId,
@@ -60,6 +47,11 @@ interface IPolicyService is IService {
60
47
  Timestamp activateAt
61
48
  ) external;
62
49
 
50
+ /// @dev declines an application represented by {policyNftId}
51
+ /// an application can only be declined in applied state
52
+ /// only the related product may decline an application
53
+ function decline(NftId policyNftId) external;
54
+
63
55
  /// @dev collects the premium token for the specified policy
64
56
  function collectPremium(NftId policyNftId, Timestamp activateAt) external;
65
57
 
@@ -78,60 +70,11 @@ interface IPolicyService is IService {
78
70
  /// this function can only be called by a product. the policy needs to match with the calling product
79
71
  function close(NftId policyNftId) external;
80
72
 
81
- /// @dev create a new claim for the specified policy
82
- /// returns the id of the newly created claim
83
- /// function can only be called by product, policy needs to match with calling product
84
- function submitClaim(
85
- NftId policyNftId,
86
- Amount claimAmount,
87
- bytes memory claimData
88
- ) external returns (ClaimId claimId);
89
-
90
- /// @dev declines the specified claim
91
- /// function can only be called by product, policy needs to match with calling product
92
- function declineClaim(
93
- NftId policyNftId,
94
- ClaimId claimId) external;
95
-
96
- /// @dev confirms the specified claim and specifies the payout amount
97
- /// function can only be called by product, policy needs to match with calling product
98
- function confirmClaim(
99
- NftId policyNftId,
100
- ClaimId claimId,
101
- Amount confirmedAmount
102
- ) external;
103
-
104
- /// @dev closes the specified claim
105
- /// function can only be called by product, policy needs to match with calling product
106
- function closeClaim(
107
- NftId policyNftId,
108
- ClaimId claimId
109
- ) external;
110
-
111
- /// @dev creates a new payout for the specified claim
112
- /// returns the id of the newly created payout, this id is unique for the specified policy
113
- /// function can only be called by product, policy needs to match with calling product
114
- function createPayout(
115
- NftId policyNftId,
116
- ClaimId claimId,
117
- Amount amount,
118
- bytes memory data
119
- )
120
- external
121
- returns (PayoutId payoutId);
122
-
123
- /// @dev processes the specified payout
124
- /// this includes moving the payout token to the beneficiary (default: policy holder)
125
- /// function can only be called by product, policy needs to match with calling product
126
- function processPayout(
127
- NftId policyNftId,
128
- PayoutId payoutId
129
- ) external;
130
73
 
131
74
  // TODO move function to pool service
132
75
  function calculateRequiredCollateral(
133
76
  UFixed collateralizationLevel,
134
- uint256 sumInsuredAmount
135
- ) external pure returns(uint256 collateralAmount);
77
+ Amount sumInsuredAmount
78
+ ) external pure returns(Amount collateralAmount);
136
79
 
137
80
  }
@@ -4,6 +4,7 @@ pragma solidity ^0.8.19;
4
4
  import {Amount} from "../../types/Amount.sol";
5
5
  import {Fee} from "../../types/Fee.sol";
6
6
  import {NftId} from "../../types/NftId.sol";
7
+ import {PayoutId} from "../../types/PayoutId.sol";
7
8
  import {IBundle} from "../module/IBundle.sol";
8
9
  import {IInstance} from "../../instance/IInstance.sol";
9
10
  import {IPolicy} from "../module/IPolicy.sol";
@@ -14,7 +15,7 @@ import {StateId} from "../../types/StateId.sol";
14
15
 
15
16
  interface IPoolService is IService {
16
17
 
17
- event LogPoolServiceMaxCapitalAmountUpdated(NftId poolNftId, uint256 previousMaxCapitalAmount, uint256 currentMaxCapitalAmount);
18
+ event LogPoolServiceMaxCapitalAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount);
18
19
  event LogPoolServiceBundleOwnerRoleSet(NftId poolNftId, RoleId bundleOwnerRole);
19
20
 
20
21
  event LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId);
@@ -22,6 +23,7 @@ interface IPoolService is IService {
22
23
 
23
24
  error ErrorPoolServiceBundleOwnerRoleAlreadySet(NftId poolNftId);
24
25
  error ErrorPoolServiceBundlePoolMismatch(NftId bundlePoolNftId, NftId productPoolNftId);
26
+ error ErrorPoolServiceInvalidTransferAmount(Amount expectedAmount, Amount actualAmount);
25
27
 
26
28
  /// @dev registers a new pool with the registry service
27
29
  function register(address poolAddress) external returns(NftId);
@@ -31,7 +33,7 @@ interface IPoolService is IService {
31
33
  function setBundleOwnerRole(RoleId bundleOwnerRole) external;
32
34
 
33
35
  /// @dev sets the max capital amount for the calling pool
34
- function setMaxCapitalAmount(uint256 maxCapitalAmount) external;
36
+ function setMaxCapitalAmount(Amount maxCapitalAmount) external;
35
37
 
36
38
  /// @dev set pool sepecific fees
37
39
  function setFees(
@@ -51,7 +53,7 @@ interface IPoolService is IService {
51
53
  NftId productNftId,
52
54
  NftId applicationNftId,
53
55
  IPolicy.PolicyInfo memory applicationInfo,
54
- uint256 premiumAmount
56
+ Amount premiumAmount
55
57
  ) external;
56
58
 
57
59
 
@@ -64,6 +66,17 @@ interface IPoolService is IService {
64
66
  ) external;
65
67
 
66
68
 
69
+ /// @dev reduces the locked collateral in the bundle associated with the specified policy
70
+ /// every payout of a policy reduces the collateral by the payout amount
71
+ /// may only be called by the claim service for unlocked pool components
72
+ function reduceCollateral(
73
+ IInstance instance,
74
+ NftId policyNftId,
75
+ IPolicy.PolicyInfo memory policyInfo,
76
+ Amount payoutAmount
77
+ ) external;
78
+
79
+
67
80
  /// @dev create a new bundle for the provided parameters
68
81
  /// staking fees will be deducted by the pool service from the staking amount
69
82
  /// may only be called by registered and unlocked pool components
@@ -85,6 +98,8 @@ interface IPoolService is IService {
85
98
  /// may only be called by registered and unlocked pool components
86
99
  function closeBundle(NftId bundleNftId) external;
87
100
 
101
+ /// @dev processes the sale of a bundle and track the pool fee and bundle fee amounts
102
+ function processSale(NftId bundleNftId, IPolicy.Premium memory premium, Amount actualAmountTransferred) external;
88
103
 
89
104
  /// @dev increase stakes for bundle
90
105
  /// staking fees will be deducted by the pool service from the staking amount
@@ -0,0 +1,37 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.19;
3
+
4
+ import {Seconds} from "../../types/Seconds.sol";
5
+ import {NftId} from "../../types/NftId.sol";
6
+ import {ReferralId} from "../../types/Referral.sol";
7
+ import {RiskId} from "../../types/RiskId.sol";
8
+ import {Amount} from "../../types/Amount.sol";
9
+
10
+ import {IService} from "./IApplicationService.sol";
11
+ import {IPolicy} from "../module/IPolicy.sol";
12
+
13
+ interface IPricingService is IService
14
+ {
15
+ error ErrorIPricingServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
16
+ error ErrorIPricingServiceFeeCalculationMismatch(
17
+ uint256 distributionFeeFixAmount,
18
+ uint256 distributionFeeVarAmount,
19
+ uint256 distributionOwnerFeeFixAmount,
20
+ uint256 distributionOwnerFeeVarAmount,
21
+ uint256 commissionAmount,
22
+ uint256 discountAmount
23
+ );
24
+
25
+ function calculatePremium(
26
+ NftId productNftId,
27
+ RiskId riskId,
28
+ Amount sumInsuredAmount,
29
+ Seconds lifetime,
30
+ bytes memory applicationData,
31
+ NftId bundleNftId,
32
+ ReferralId referralId
33
+ )
34
+ external
35
+ view
36
+ returns (IPolicy.Premium memory premium);
37
+ }