@etherisc/gif-next 0.0.2-f30e0eb-805 → 0.0.2-f398177-971
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -83
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +47 -6
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +70 -13
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +137 -6
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +144 -13
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +161 -20
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +151 -20
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +71 -20
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +62 -21
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +310 -2004
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +101 -52
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +425 -2757
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +95 -58
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +124 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +348 -58
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +153 -207
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +38 -83
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2788 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +113 -34
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +8 -8
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +6 -6
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +6 -6
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +186 -236
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +38 -55
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +377 -182
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +74 -39
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +713 -83
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +147 -32
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +266 -442
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +82 -107
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +111 -174
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +233 -128
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +385 -51
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +109 -282
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +210 -99
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +682 -33
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPricingService.sol/IPricingService.json +510 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +85 -27
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +420 -160
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +104 -53
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +880 -82
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +90 -39
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingService.sol/PricingService.json +1004 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PricingServiceManager.sol/PricingServiceManager.json +688 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +144 -57
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +28 -37
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +5 -37
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +22 -49
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +21 -34
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +23 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +10 -23
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +0 -13
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +85 -27
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -19
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -27
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +6 -19
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +91 -28
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +24 -6
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +6 -19
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +106 -39
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +281 -0
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +83 -4
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +74 -19
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +116 -7
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/components/Component.sol +25 -4
- package/contracts/components/Distribution.sol +11 -6
- package/contracts/components/IComponent.sol +19 -3
- package/contracts/components/IPoolComponent.sol +8 -7
- package/contracts/components/IProductComponent.sol +5 -4
- package/contracts/components/Pool.sol +17 -14
- package/contracts/components/Product.sol +144 -62
- package/contracts/instance/BundleManager.sol +3 -4
- package/contracts/instance/IInstance.sol +32 -53
- package/contracts/instance/IInstanceService.sol +15 -14
- package/contracts/instance/Instance.sol +107 -205
- package/contracts/instance/InstanceAccessManager.sol +44 -25
- package/contracts/instance/InstanceAuthorizationsLib.sol +308 -0
- package/contracts/instance/InstanceReader.sol +85 -7
- package/contracts/instance/InstanceService.sol +102 -289
- package/contracts/instance/InstanceStore.sol +212 -0
- package/contracts/instance/ObjectManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +53 -39
- package/contracts/instance/base/KeyValueStore.sol +8 -34
- package/contracts/instance/base/Lifecycle.sol +15 -4
- package/contracts/instance/module/IAccess.sol +2 -2
- package/contracts/instance/module/IBundle.sol +6 -4
- package/contracts/instance/module/IComponents.sol +7 -1
- package/contracts/instance/module/IDistribution.sol +3 -2
- package/contracts/instance/module/IPolicy.sol +13 -8
- package/contracts/instance/service/ApplicationService.sol +62 -226
- package/contracts/instance/service/BundleService.sol +172 -126
- package/contracts/instance/service/ClaimService.sol +318 -32
- package/contracts/instance/service/DistributionService.sol +71 -190
- package/contracts/instance/service/IApplicationService.sol +8 -28
- package/contracts/instance/service/IBundleService.sol +82 -26
- package/contracts/instance/service/IClaimService.sol +52 -23
- package/contracts/instance/service/IDistributionService.sol +11 -22
- package/contracts/instance/service/IPolicyService.sol +24 -16
- package/contracts/instance/service/IPoolService.sol +82 -3
- package/contracts/instance/service/IPricingService.sol +37 -0
- package/contracts/instance/service/PolicyService.sol +152 -179
- package/contracts/instance/service/PoolService.sol +239 -56
- package/contracts/instance/service/PricingService.sol +275 -0
- package/contracts/instance/service/PricingServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +27 -58
- package/contracts/registry/IRegistryService.sol +2 -3
- package/contracts/registry/RegistryService.sol +24 -21
- package/contracts/registry/ReleaseManager.sol +20 -18
- package/contracts/shared/IPolicyHolder.sol +23 -9
- package/contracts/shared/IRegistryLinked.sol +0 -1
- package/contracts/shared/IService.sol +6 -6
- package/contracts/shared/NftOwnable.sol +0 -2
- package/contracts/shared/PolicyHolder.sol +30 -17
- package/contracts/shared/Registerable.sol +10 -9
- package/contracts/shared/RegistryLinked.sol +0 -5
- package/contracts/shared/Service.sol +21 -7
- package/contracts/shared/TokenHandler.sol +4 -2
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Amount.sol +109 -0
- package/contracts/types/ClaimId.sol +25 -2
- package/contracts/types/Fee.sol +16 -8
- package/contracts/types/ObjectType.sol +9 -5
- package/contracts/types/PayoutId.sol +33 -5
- package/contracts/types/StateId.sol +6 -2
- package/contracts/types/Timestamp.sol +5 -0
- package/package.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IInstance} from "../IInstance.sol";
|
5
|
+
import {InstanceReader} from "../InstanceReader.sol";
|
5
6
|
import {IService} from "../../shared/IService.sol";
|
6
7
|
|
8
|
+
import {Amount} from "../../types/Amount.sol";
|
7
9
|
import {ClaimId} from "../../types/ClaimId.sol";
|
8
10
|
import {PayoutId} from "../../types/PayoutId.sol";
|
9
11
|
import {NftId} from "../../types/NftId.sol";
|
10
|
-
import {ReferralId} from "../../types/Referral.sol";
|
11
|
-
import {RiskId} from "../../types/RiskId.sol";
|
12
12
|
import {StateId} from "../../types/StateId.sol";
|
13
13
|
import {Timestamp} from "../../types/Timestamp.sol";
|
14
14
|
import {UFixed} from "../../types/UFixed.sol";
|
@@ -20,42 +20,71 @@ interface IClaimService is
|
|
20
20
|
IService
|
21
21
|
{
|
22
22
|
|
23
|
+
event LogClaimServiceClaimSubmitted(NftId policyNftId, ClaimId claimId, Amount claimAmount);
|
24
|
+
event LogClaimServiceClaimConfirmed(NftId policyNftId, ClaimId claimId, Amount confirmedAmount);
|
25
|
+
event LogClaimServiceClaimDeclined(NftId policyNftId, ClaimId claimId);
|
26
|
+
event LogClaimServiceClaimClosed(NftId policyNftId, ClaimId claimId);
|
27
|
+
|
28
|
+
event LogClaimServicePayoutCreated(NftId policyNftId, PayoutId payoutId, Amount amount);
|
29
|
+
event LogClaimServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary, Amount netAmount);
|
30
|
+
|
31
|
+
error ErrorClaimServicePolicyProductMismatch(NftId policyNftId, NftId expectedProduct, NftId actualProduct);
|
32
|
+
error ErrorClaimServicePolicyNotOpen(NftId policyNftId);
|
33
|
+
error ErrorClaimServiceClaimExceedsSumInsured(NftId policyNftId, Amount sumInsured, Amount payoutsIncludingClaimAmount);
|
34
|
+
|
35
|
+
error ErrorClaimServiceClaimWithOpenPayouts(NftId policyNftId, ClaimId claimId, uint8 openPayouts);
|
36
|
+
error ErrorClaimServiceClaimWithMissingPayouts(NftId policyNftId, ClaimId claimId, Amount claimAmount, Amount paidAmount);
|
37
|
+
error ErrorClaimServiceClaimNotInExpectedState(NftId policyNftId, ClaimId claimId, StateId expectedState, StateId actualState);
|
38
|
+
|
23
39
|
/// @dev create a new claim for the specified policy
|
40
|
+
/// returns the id of the newly created claim
|
24
41
|
/// function can only be called by product, policy needs to match with calling product
|
25
|
-
function
|
42
|
+
function submit(
|
26
43
|
NftId policyNftId,
|
27
|
-
|
44
|
+
Amount claimAmount,
|
28
45
|
bytes memory claimData
|
29
|
-
) external returns (ClaimId);
|
46
|
+
) external returns (ClaimId claimId);
|
30
47
|
|
31
|
-
/// @dev
|
48
|
+
/// @dev declines the specified claim
|
32
49
|
/// function can only be called by product, policy needs to match with calling product
|
33
|
-
function
|
50
|
+
function decline(
|
51
|
+
NftId policyNftId,
|
52
|
+
ClaimId claimId) external;
|
34
53
|
|
35
|
-
/// @dev
|
54
|
+
/// @dev confirms the specified claim and specifies the payout amount
|
36
55
|
/// function can only be called by product, policy needs to match with calling product
|
37
|
-
function
|
56
|
+
function confirm(
|
57
|
+
NftId policyNftId,
|
58
|
+
ClaimId claimId,
|
59
|
+
Amount confirmedAmount
|
60
|
+
) external;
|
38
61
|
|
39
|
-
/// @dev closes the claim
|
40
|
-
/// a claim may only be closed once all existing payouts have been executed and the sum of the paid out amounts has reached the claim amount
|
62
|
+
/// @dev closes the specified claim
|
41
63
|
/// function can only be called by product, policy needs to match with calling product
|
42
|
-
function
|
64
|
+
function close(
|
65
|
+
NftId policyNftId,
|
66
|
+
ClaimId claimId
|
67
|
+
) external;
|
43
68
|
|
44
|
-
|
69
|
+
|
70
|
+
/// @dev creates a new payout for the specified claim
|
71
|
+
/// returns the id of the newly created payout, this id is unique for the specified policy
|
45
72
|
/// function can only be called by product, policy needs to match with calling product
|
46
73
|
function createPayout(
|
47
74
|
NftId policyNftId,
|
48
75
|
ClaimId claimId,
|
49
|
-
|
50
|
-
bytes
|
51
|
-
)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
76
|
+
Amount amount,
|
77
|
+
bytes memory data
|
78
|
+
)
|
79
|
+
external
|
80
|
+
returns (PayoutId payoutId);
|
81
|
+
|
82
|
+
|
83
|
+
/// @dev processes the specified payout
|
84
|
+
/// this includes moving the payout token to the beneficiary (default: policy holder)
|
85
|
+
/// function can only be called by product, policy needs to match with calling product
|
86
|
+
function processPayout(
|
57
87
|
NftId policyNftId,
|
58
88
|
PayoutId payoutId
|
59
89
|
) external;
|
60
|
-
|
61
90
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
+
import {Amount} from "../../types/Amount.sol";
|
4
5
|
import {NftId} from "../../types/NftId.sol";
|
5
6
|
import {Fee} from "../../types/Fee.sol";
|
6
7
|
import {IPolicy} from "../module/IPolicy.sol";
|
@@ -12,6 +13,7 @@ import {Timestamp} from "../../types/Timestamp.sol";
|
|
12
13
|
|
13
14
|
|
14
15
|
interface IDistributionService is IService {
|
16
|
+
error ErrorDistributionServiceCallerNotRegistered(address caller);
|
15
17
|
error ErrorIDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
|
16
18
|
error ErrorIDistributionServiceCallerNotDistributor(address caller);
|
17
19
|
error ErrorIDistributionServiceInvalidReferralId(ReferralId referralId);
|
@@ -24,16 +26,8 @@ interface IDistributionService is IService {
|
|
24
26
|
error ErrorIDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
|
25
27
|
error ErrorIDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
|
26
28
|
error ErrorIDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
|
27
|
-
error ErrorIDistributionServiceFeeCalculationMismatch(
|
28
|
-
uint256 distributionFeeFixAmount,
|
29
|
-
uint256 distributionFeeVarAmount,
|
30
|
-
uint256 distributionOwnerFeeFixAmount,
|
31
|
-
uint256 distributionOwnerFeeVarAmount,
|
32
|
-
uint256 commissionAmount,
|
33
|
-
uint256 discountAmount
|
34
|
-
);
|
35
29
|
error ErrorIDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
|
36
|
-
error
|
30
|
+
error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
|
37
31
|
|
38
32
|
function setFees(
|
39
33
|
Fee memory minDistributionOwnerFee,
|
@@ -60,11 +54,12 @@ interface IDistributionService is IService {
|
|
60
54
|
bytes memory data
|
61
55
|
) external returns (NftId distributorNftId);
|
62
56
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
// TODO re-enable and reorganize (service contract too large)
|
58
|
+
// function updateDistributorType(
|
59
|
+
// NftId distributorNftId,
|
60
|
+
// DistributorType distributorType,
|
61
|
+
// bytes memory data
|
62
|
+
// ) external;
|
68
63
|
|
69
64
|
function createReferral(
|
70
65
|
NftId distributorNftId,
|
@@ -82,17 +77,11 @@ interface IDistributionService is IService {
|
|
82
77
|
NftId distributionNftId,
|
83
78
|
ReferralId referralId,
|
84
79
|
IPolicy.Premium memory premium,
|
85
|
-
|
80
|
+
Amount transferredDistributionFeeAmount
|
86
81
|
) external;
|
87
82
|
|
88
|
-
function calculateFeeAmount(
|
89
|
-
NftId distributionNftId,
|
90
|
-
ReferralId referralId,
|
91
|
-
IPolicy.Premium memory premium
|
92
|
-
) external view returns (IPolicy.Premium memory finalPremium);
|
93
|
-
|
94
83
|
function referralIsValid(
|
95
84
|
NftId distributorNftId,
|
96
85
|
ReferralId referralId
|
97
86
|
) external view returns (bool isValid);
|
98
|
-
}
|
87
|
+
}
|
@@ -4,7 +4,10 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IRisk} from "../module/IRisk.sol";
|
5
5
|
import {IService} from "../../shared/IService.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../../types/Amount.sol";
|
8
|
+
import {ClaimId} from "../../types/ClaimId.sol";
|
7
9
|
import {NftId} from "../../types/NftId.sol";
|
10
|
+
import {PayoutId} from "../../types/PayoutId.sol";
|
8
11
|
import {ReferralId} from "../../types/Referral.sol";
|
9
12
|
import {RiskId} from "../../types/RiskId.sol";
|
10
13
|
import {Seconds} from "../../types/Seconds.sol";
|
@@ -14,37 +17,41 @@ import {UFixed} from "../../types/UFixed.sol";
|
|
14
17
|
import {Fee} from "../../types/Fee.sol";
|
15
18
|
|
16
19
|
interface IPolicyService is IService {
|
17
|
-
|
20
|
+
|
21
|
+
error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
|
22
|
+
error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
|
23
|
+
|
18
24
|
error ErrorIPolicyServiceInsufficientAllowance(address customer, address tokenHandlerAddress, uint256 amount);
|
19
|
-
error
|
25
|
+
error ErrorPolicyServicePremiumAlreadyPaid(NftId policyNftId, Amount premiumPaidAmount);
|
20
26
|
error ErrorIPolicyServicePolicyNotActivated(NftId policyNftId);
|
21
27
|
error ErrorIPolicyServicePolicyAlreadyClosed(NftId policyNftId);
|
22
28
|
error ErrorIPolicyServicePolicyNotActive(NftId policyNftId, StateId state);
|
23
|
-
error
|
29
|
+
error ErrorPolicyServicePremiumNotFullyPaid(NftId policyNftId, Amount premiumAmount, Amount premiumPaidAmount);
|
24
30
|
error ErrorIPolicyServiceOpenClaims(NftId policyNftId, uint16 openClaimsCount);
|
25
31
|
error ErrorIPolicyServicePolicyHasNotExpired(NftId policyNftId, Timestamp expiredAt);
|
26
32
|
|
27
|
-
error
|
28
|
-
|
29
|
-
/// @dev declines an application represented by {policyNftId}
|
30
|
-
/// an application can only be declined in applied state
|
31
|
-
/// only the related product may decline an application
|
32
|
-
function decline(NftId policyNftId) external;
|
33
|
+
error ErrorPolicyServicePremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount recalculatedPremiumAmount);
|
34
|
+
error ErrorPolicyServiceTransferredPremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount transferredPremiumAmount);
|
33
35
|
|
34
|
-
/// @dev
|
35
|
-
/// sets the policy state to
|
36
|
+
/// @dev collateralizes the policy represented by {policyNftId}
|
37
|
+
/// sets the policy state to collateralized
|
36
38
|
/// may set the policy state to activated and set the activation date
|
37
39
|
/// optionally collects premiums and activates the policy.
|
38
40
|
/// - premium payment is only attempted if requirePremiumPayment is set to true
|
39
41
|
/// - activation is only done if activateAt is a non-zero timestamp
|
40
|
-
/// an application can only be
|
41
|
-
/// only the related product may
|
42
|
-
function
|
42
|
+
/// an application can only be collateralized in applied state
|
43
|
+
/// only the related product may collateralize an application
|
44
|
+
function collateralize(
|
43
45
|
NftId policyNftId,
|
44
46
|
bool requirePremiumPayment,
|
45
47
|
Timestamp activateAt
|
46
48
|
) external;
|
47
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
|
+
|
48
55
|
/// @dev collects the premium token for the specified policy
|
49
56
|
function collectPremium(NftId policyNftId, Timestamp activateAt) external;
|
50
57
|
|
@@ -63,10 +70,11 @@ interface IPolicyService is IService {
|
|
63
70
|
/// this function can only be called by a product. the policy needs to match with the calling product
|
64
71
|
function close(NftId policyNftId) external;
|
65
72
|
|
73
|
+
|
66
74
|
// TODO move function to pool service
|
67
75
|
function calculateRequiredCollateral(
|
68
76
|
UFixed collateralizationLevel,
|
69
|
-
|
70
|
-
) external pure returns(
|
77
|
+
Amount sumInsuredAmount
|
78
|
+
) external pure returns(Amount collateralAmount);
|
71
79
|
|
72
80
|
}
|
@@ -1,20 +1,29 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
+
import {Amount} from "../../types/Amount.sol";
|
4
5
|
import {Fee} from "../../types/Fee.sol";
|
5
6
|
import {NftId} from "../../types/NftId.sol";
|
6
|
-
import {
|
7
|
+
import {PayoutId} from "../../types/PayoutId.sol";
|
7
8
|
import {IBundle} from "../module/IBundle.sol";
|
8
9
|
import {IInstance} from "../../instance/IInstance.sol";
|
10
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
11
|
+
import {IService} from "../../shared/IService.sol";
|
9
12
|
import {RoleId} from "../../types/RoleId.sol";
|
13
|
+
import {Seconds} from "../../types/Seconds.sol";
|
10
14
|
import {StateId} from "../../types/StateId.sol";
|
11
15
|
|
12
16
|
interface IPoolService is IService {
|
13
17
|
|
14
|
-
event LogPoolServiceMaxCapitalAmountUpdated(NftId poolNftId,
|
18
|
+
event LogPoolServiceMaxCapitalAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount);
|
15
19
|
event LogPoolServiceBundleOwnerRoleSet(NftId poolNftId, RoleId bundleOwnerRole);
|
16
20
|
|
21
|
+
event LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId);
|
22
|
+
event LogPoolServiceBundleClosed(NftId instanceNftId, NftId poolNftId, NftId bundleNftId);
|
23
|
+
|
17
24
|
error ErrorPoolServiceBundleOwnerRoleAlreadySet(NftId poolNftId);
|
25
|
+
error ErrorPoolServiceBundlePoolMismatch(NftId bundlePoolNftId, NftId productPoolNftId);
|
26
|
+
error ErrorPoolServiceInvalidTransferAmount(Amount expectedAmount, Amount actualAmount);
|
18
27
|
|
19
28
|
/// @dev registers a new pool with the registry service
|
20
29
|
function register(address poolAddress) external returns(NftId);
|
@@ -24,7 +33,7 @@ interface IPoolService is IService {
|
|
24
33
|
function setBundleOwnerRole(RoleId bundleOwnerRole) external;
|
25
34
|
|
26
35
|
/// @dev sets the max capital amount for the calling pool
|
27
|
-
function setMaxCapitalAmount(
|
36
|
+
function setMaxCapitalAmount(Amount maxCapitalAmount) external;
|
28
37
|
|
29
38
|
/// @dev set pool sepecific fees
|
30
39
|
function setFees(
|
@@ -32,4 +41,74 @@ interface IPoolService is IService {
|
|
32
41
|
Fee memory stakingFee,
|
33
42
|
Fee memory performanceFee
|
34
43
|
) external;
|
44
|
+
|
45
|
+
|
46
|
+
/// @dev locks required collateral to cover the specified application (and turn it into a policy)
|
47
|
+
/// - retention level == 1: the full collateral amount will be locked by the specified bundle
|
48
|
+
/// - retention level < 1: a part of the coverage is provided by the specified bundle, the rest by the pool component
|
49
|
+
/// in which case the pool component might hold a re-insurance policy
|
50
|
+
/// may only be called by the policy service for unlocked pool components
|
51
|
+
function lockCollateral(
|
52
|
+
IInstance instance,
|
53
|
+
NftId productNftId,
|
54
|
+
NftId applicationNftId,
|
55
|
+
IPolicy.PolicyInfo memory applicationInfo,
|
56
|
+
Amount premiumAmount
|
57
|
+
) external;
|
58
|
+
|
59
|
+
|
60
|
+
/// @dev releases the remaining collateral linked to the specified policy
|
61
|
+
/// may only be called by the policy service for unlocked pool components
|
62
|
+
function releaseCollateral(
|
63
|
+
IInstance instance,
|
64
|
+
NftId policyNftId,
|
65
|
+
IPolicy.PolicyInfo memory policyInfo
|
66
|
+
) external;
|
67
|
+
|
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
|
+
|
80
|
+
/// @dev create a new bundle for the provided parameters
|
81
|
+
/// staking fees will be deducted by the pool service from the staking amount
|
82
|
+
/// may only be called by registered and unlocked pool components
|
83
|
+
function createBundle(
|
84
|
+
address owner, // initial bundle owner
|
85
|
+
Fee memory fee, // fees deducted from premium that go to bundle owner
|
86
|
+
Amount stakingAmount, // staking amount - staking fees result in initial bundle capital
|
87
|
+
Seconds lifetime, // initial duration for which new policies are covered
|
88
|
+
bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
89
|
+
)
|
90
|
+
external
|
91
|
+
returns(NftId bundleNftId); // the nft id of the newly created bundle
|
92
|
+
|
93
|
+
|
94
|
+
/// @dev closes the specified bundle
|
95
|
+
/// only open bundles (active or locked) may be closed
|
96
|
+
/// to close a bundle it may not have any non-closed polices attached to it
|
97
|
+
/// bundle fees and remaining capital (after deduction of the performance fee) will be transferred to the bundle owner
|
98
|
+
/// may only be called by registered and unlocked pool components
|
99
|
+
function closeBundle(NftId bundleNftId) external;
|
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;
|
103
|
+
|
104
|
+
/// @dev increase stakes for bundle
|
105
|
+
/// staking fees will be deducted by the pool service from the staking amount
|
106
|
+
/// may only be called by registered and unlocked pool components
|
107
|
+
// function stake(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
108
|
+
|
109
|
+
|
110
|
+
/// @dev decrease stakes for bundle
|
111
|
+
/// performance fees will be deducted by the pool service from the staking amount
|
112
|
+
/// may only be called by registered and unlocked pool components
|
113
|
+
// function unstake(NftId bundleNftId, uint256 amount) external returns(uint256 netAmount);
|
35
114
|
}
|
@@ -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
|
+
}
|