@etherisc/gif-next 0.0.2-7dad245-860 → 0.0.2-7e48d89-379
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.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +13 -2
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +11 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +2 -2
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +2 -2
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +11 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2 -2
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- 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/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +13 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +11 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +11 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +11 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +2 -2
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +11 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +0 -36
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +11 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +44 -80
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +23 -23
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +2 -2
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +11 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +2 -2
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +11 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/product/{IRiskService.sol/IRiskService.json → IProductService.sol/IProductService.json} +2 -2
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +15 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +11 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/product/{RiskService.sol/RiskService.json → ProductService.sol/ProductService.json} +17 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/{RiskServiceManager.sol/RiskServiceManager.json → ProductServiceManager.sol/ProductServiceManager.json} +12 -12
- 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/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/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +2 -2
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +2 -2
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +11 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +11 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +2 -2
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +2 -2
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/instance/IInstance.sol +30 -7
- package/contracts/instance/Instance.sol +33 -8
- package/contracts/pool/IPoolService.sol +10 -26
- package/contracts/pool/PoolService.sol +1 -23
- package/contracts/product/{IRiskService.sol → IProductService.sol} +2 -1
- package/contracts/product/PolicyService.sol +11 -3
- package/contracts/product/Product.sol +12 -9
- package/contracts/product/{RiskService.sol → ProductService.sol} +6 -4
- package/contracts/product/{RiskServiceManager.sol → ProductServiceManager.sol} +8 -8
- package/contracts/shared/IInstanceLinkedComponent.sol +7 -0
- package/package.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +0 -4
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +0 -4
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +0 -4
@@ -4,16 +4,39 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
6
|
import {Amount} from "../type/Amount.sol";
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
7
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
8
|
+
import {DistributorType} from "../type/DistributorType.sol";
|
9
|
+
import {PayoutId} from "../type/PayoutId.sol";
|
10
|
+
import {NftId} from "../type/NftId.sol";
|
11
|
+
import {StateId} from "../type/StateId.sol";
|
12
|
+
import {ReferralId} from "../type/Referral.sol";
|
13
|
+
import {RiskId} from "../type/RiskId.sol";
|
14
|
+
import {VersionPart} from "../type/Version.sol";
|
15
|
+
import {Key32} from "../type/Key32.sol";
|
13
16
|
import {RoleId} from "../type/RoleId.sol";
|
14
17
|
import {Seconds} from "../type/Seconds.sol";
|
15
18
|
import {UFixed} from "../type/UFixed.sol";
|
16
|
-
|
19
|
+
|
20
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
21
|
+
|
22
|
+
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
23
|
+
|
24
|
+
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
25
|
+
import {BundleSet} from "./BundleSet.sol";
|
26
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
27
|
+
import {InstanceStore} from "./InstanceStore.sol";
|
28
|
+
|
29
|
+
import {IKeyValueStore} from "../shared/IKeyValueStore.sol";
|
30
|
+
|
31
|
+
import {IAccess} from "./module/IAccess.sol";
|
32
|
+
|
33
|
+
import {IBundleService} from "../pool/IBundleService.sol";
|
34
|
+
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
35
|
+
import {IPolicyService} from "../product/IPolicyService.sol";
|
36
|
+
import {IPoolService} from "../pool/IPoolService.sol";
|
37
|
+
import {IProductService} from "../product/IProductService.sol";
|
38
|
+
import {IPolicyService} from "../product/IPolicyService.sol";
|
39
|
+
import {IBundleService} from "../pool/IBundleService.sol";
|
17
40
|
|
18
41
|
|
19
42
|
interface IInstance is
|
@@ -4,19 +4,44 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
|
6
6
|
import {Amount} from "../type/Amount.sol";
|
7
|
-
import {
|
7
|
+
import {Key32} from "../type/Key32.sol";
|
8
|
+
import {NftId} from "../type/NftId.sol";
|
9
|
+
import {RiskId} from "../type/RiskId.sol";
|
10
|
+
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../type/ObjectType.sol";
|
11
|
+
import {RoleId} from "../type/RoleId.sol";
|
12
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
13
|
+
import {ReferralId} from "../type/Referral.sol";
|
14
|
+
import {PayoutId} from "../type/PayoutId.sol";
|
15
|
+
import {DistributorType} from "../type/DistributorType.sol";
|
16
|
+
import {Seconds} from "../type/Seconds.sol";
|
17
|
+
import {UFixed} from "../type/UFixed.sol";
|
18
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
19
|
+
|
20
|
+
import {Registerable} from "../shared/Registerable.sol";
|
21
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
22
|
+
|
23
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
24
|
+
|
8
25
|
import {IInstance} from "./IInstance.sol";
|
9
26
|
import {IInstanceService} from "./IInstanceService.sol";
|
10
27
|
import {InstanceReader} from "./InstanceReader.sol";
|
11
28
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
29
|
+
import {BundleSet} from "./BundleSet.sol";
|
12
30
|
import {InstanceStore} from "./InstanceStore.sol";
|
13
|
-
|
14
|
-
import {
|
15
|
-
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import {
|
19
|
-
import {
|
31
|
+
|
32
|
+
import {KeyValueStore} from "../shared/KeyValueStore.sol";
|
33
|
+
|
34
|
+
import {IBundle} from "./module/IBundle.sol";
|
35
|
+
import {IComponents} from "./module/IComponents.sol";
|
36
|
+
import {IDistribution} from "./module/IDistribution.sol";
|
37
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
38
|
+
import {IRisk} from "./module/IRisk.sol";
|
39
|
+
|
40
|
+
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
41
|
+
import {IPoolService} from "../pool/IPoolService.sol";
|
42
|
+
import {IProductService} from "../product/IProductService.sol";
|
43
|
+
import {IPolicyService} from "../product/IPolicyService.sol";
|
44
|
+
import {IBundleService} from "../pool/IBundleService.sol";
|
20
45
|
|
21
46
|
contract Instance is
|
22
47
|
IInstance,
|
@@ -95,18 +95,6 @@ interface IPoolService is IService {
|
|
95
95
|
returns(NftId bundleNftId, Amount netStakedAmount); // the nft id of the newly created bundle
|
96
96
|
|
97
97
|
|
98
|
-
/// @dev increase stakes for bundle
|
99
|
-
/// staking fees will be deducted by the pool service from the staking amount
|
100
|
-
/// may only be called by registered and unlocked pool components
|
101
|
-
function stake(NftId bundleNftId, Amount amount) external returns(Amount netAmount);
|
102
|
-
|
103
|
-
|
104
|
-
/// @dev decrease stakes for bundle
|
105
|
-
/// performance 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 unstake(NftId bundleNftId, Amount amount) external returns(Amount netAmount);
|
108
|
-
|
109
|
-
|
110
98
|
/// @dev closes the specified bundle
|
111
99
|
/// only open bundles (active or locked) may be closed
|
112
100
|
/// to close a bundle it may not have any non-closed polices attached to it
|
@@ -115,23 +103,19 @@ interface IPoolService is IService {
|
|
115
103
|
function closeBundle(NftId bundleNftId) external;
|
116
104
|
|
117
105
|
|
118
|
-
/// @dev Fund the specified pool wallet with the provided amount.
|
119
|
-
/// This function will collect the amount from the sender address and transfers it to the pool wallet.
|
120
|
-
/// The function will not update balance amounts managed by the framework.
|
121
|
-
/// Only available for externally managed pools.
|
122
|
-
function fundPoolWallet(NftId poolNftId, Amount amount) external;
|
123
|
-
|
124
|
-
|
125
|
-
/// @dev Defund the specified pool wallet with the provided amount.
|
126
|
-
/// This function will transfer the amount from the pool wallet to the sender address.
|
127
|
-
/// The function will not update balance amounts managed by the framework.
|
128
|
-
/// Only available for externally managed pools.
|
129
|
-
function defundPoolWallet(NftId poolNftId, Amount amount) external;
|
130
|
-
|
131
|
-
|
132
106
|
/// @dev processes the sale of a bundle and track the pool fee and bundle fee amounts
|
133
107
|
function processSale(NftId bundleNftId, IPolicy.Premium memory premium) external;
|
134
108
|
|
109
|
+
/// @dev increase stakes for bundle
|
110
|
+
/// staking fees will be deducted by the pool service from the staking amount
|
111
|
+
/// may only be called by registered and unlocked pool components
|
112
|
+
function stake(NftId bundleNftId, Amount amount) external returns(Amount netAmount);
|
113
|
+
|
114
|
+
/// @dev decrease stakes for bundle
|
115
|
+
/// performance fees will be deducted by the pool service from the staking amount
|
116
|
+
/// may only be called by registered and unlocked pool components
|
117
|
+
function unstake(NftId bundleNftId, Amount amount) external returns(Amount netAmount);
|
118
|
+
|
135
119
|
|
136
120
|
/// @dev calulate required collateral for the provided parameters
|
137
121
|
function calculateRequiredCollateral(
|
@@ -107,6 +107,7 @@ contract PoolService is
|
|
107
107
|
function createBundle(
|
108
108
|
address bundleOwner, // initial bundle owner
|
109
109
|
Fee memory fee, // fees deducted from premium that go to bundle owner
|
110
|
+
// TODO: remove stakingAmount and just create an empty bundle without tokens
|
110
111
|
Amount stakingAmount, // staking amount - staking fees result in initial bundle capital
|
111
112
|
Seconds lifetime, // initial duration for which new policies are covered
|
112
113
|
bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
@@ -149,7 +150,6 @@ contract PoolService is
|
|
149
150
|
netStakedAmount,
|
150
151
|
stakingFeeAmount);
|
151
152
|
|
152
|
-
// TODO only collect staking token when pool is not externally managed
|
153
153
|
// pool bookkeeping and collect tokens from bundle owner
|
154
154
|
_collectStakingAmount(
|
155
155
|
instance.getInstanceReader(),
|
@@ -242,8 +242,6 @@ contract PoolService is
|
|
242
242
|
// collect tokens from bundle owner
|
243
243
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
244
244
|
emit LogPoolServiceBundleStaked(instance.getNftId(), poolNftId, bundleNftId, amount, netAmount);
|
245
|
-
|
246
|
-
// TODO only collect staking token when pool is not externally managed
|
247
245
|
_collectStakingAmount(
|
248
246
|
instanceReader,
|
249
247
|
poolNftId,
|
@@ -294,26 +292,6 @@ contract PoolService is
|
|
294
292
|
return unstakedAmount;
|
295
293
|
}
|
296
294
|
|
297
|
-
|
298
|
-
function fundPoolWallet(NftId poolNftId, Amount amount)
|
299
|
-
external
|
300
|
-
virtual
|
301
|
-
restricted()
|
302
|
-
{
|
303
|
-
// TODO check that poolNftId is externally managed
|
304
|
-
// TODO implement
|
305
|
-
}
|
306
|
-
|
307
|
-
|
308
|
-
function defundPoolWallet(NftId poolNftId, Amount amount)
|
309
|
-
external
|
310
|
-
virtual
|
311
|
-
restricted()
|
312
|
-
{
|
313
|
-
// TODO check that poolNftId is externally managed
|
314
|
-
// TODO implement
|
315
|
-
}
|
316
|
-
|
317
295
|
function processSale(
|
318
296
|
NftId bundleNftId,
|
319
297
|
IPolicy.Premium memory premium
|
@@ -12,7 +12,8 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
12
12
|
import {UFixed} from "../type/UFixed.sol";
|
13
13
|
import {Fee} from "../type/Fee.sol";
|
14
14
|
|
15
|
-
|
15
|
+
// TODO consider renaming to IRiskService
|
16
|
+
interface IProductService is IService {
|
16
17
|
|
17
18
|
function createRisk(
|
18
19
|
RiskId riskId,
|
@@ -47,6 +47,8 @@ contract PolicyService is
|
|
47
47
|
IPoolService internal _poolService;
|
48
48
|
IPricingService internal _pricingService;
|
49
49
|
|
50
|
+
event LogProductServiceSender(address sender);
|
51
|
+
|
50
52
|
function _initialize(
|
51
53
|
address owner,
|
52
54
|
bytes memory data
|
@@ -112,7 +114,7 @@ contract PolicyService is
|
|
112
114
|
/// @inheritdoc IPolicyService
|
113
115
|
function createPolicy(
|
114
116
|
NftId applicationNftId, // = policyNftId
|
115
|
-
bool requirePremiumPayment,
|
117
|
+
bool requirePremiumPayment, // TODO: remove this and never collect tokens (use collectPremium instead)
|
116
118
|
Timestamp activateAt
|
117
119
|
)
|
118
120
|
external
|
@@ -158,13 +160,17 @@ contract PolicyService is
|
|
158
160
|
|
159
161
|
IPolicy.Premium memory premium;
|
160
162
|
|
163
|
+
// TODO: always calculate and then store premium object (in separate object)
|
164
|
+
// TODO: update referral counter during create policy
|
165
|
+
// TODO: no balances are updated during create policy
|
166
|
+
|
161
167
|
// optional: calculate the premium and update counters for collection at the end of this function
|
162
168
|
if(requirePremiumPayment) {
|
163
169
|
premium = _calculateAndProcessPremium(
|
164
170
|
instance,
|
165
171
|
applicationNftId,
|
166
172
|
applicationInfo);
|
167
|
-
|
173
|
+
// TODO: store premium in separate object
|
168
174
|
applicationInfo.premiumPaidAmount = AmountLib.toAmount(premium.premiumAmount);
|
169
175
|
}
|
170
176
|
|
@@ -212,12 +218,14 @@ contract PolicyService is
|
|
212
218
|
revert ErrorPolicyServicePremiumAlreadyPaid(policyNftId, policyInfo.premiumPaidAmount);
|
213
219
|
}
|
214
220
|
|
221
|
+
// TODO: update all balances except referral counter as those are already updated
|
222
|
+
|
215
223
|
// calculate premium
|
216
224
|
IPolicy.Premium memory premium = _calculateAndProcessPremium(
|
217
225
|
instance,
|
218
226
|
policyNftId,
|
219
227
|
policyInfo);
|
220
|
-
|
228
|
+
|
221
229
|
policyInfo.premiumPaidAmount = AmountLib.toAmount(premium.premiumAmount);
|
222
230
|
|
223
231
|
// optionally activate policy
|
@@ -12,11 +12,11 @@ import {IApplicationService} from "./IApplicationService.sol";
|
|
12
12
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
13
13
|
import {IComponentService} from "../shared/IComponentService.sol";
|
14
14
|
import {IPolicyService} from "./IPolicyService.sol";
|
15
|
-
import {
|
15
|
+
import {IProductService} from "./IProductService.sol";
|
16
16
|
import {IClaimService} from "./IClaimService.sol";
|
17
17
|
import {IPricingService} from "./IPricingService.sol";
|
18
18
|
import {IProductComponent} from "./IProductComponent.sol";
|
19
|
-
import {NftId} from "../type/NftId.sol";
|
19
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
20
20
|
import {PayoutId} from "../type/PayoutId.sol";
|
21
21
|
import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
22
22
|
import {ReferralId} from "../type/Referral.sol";
|
@@ -25,6 +25,9 @@ import {Seconds} from "../type/Seconds.sol";
|
|
25
25
|
import {StateId} from "../type/StateId.sol";
|
26
26
|
import {Timestamp} from "../type/Timestamp.sol";
|
27
27
|
|
28
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
29
|
+
|
30
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
28
31
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
29
32
|
import {IComponents} from "../instance/module/IComponents.sol";
|
30
33
|
import {Pool} from "../pool/Pool.sol";
|
@@ -38,7 +41,7 @@ abstract contract Product is
|
|
38
41
|
bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
|
39
42
|
|
40
43
|
struct ProductStorage {
|
41
|
-
|
44
|
+
IProductService _productService;
|
42
45
|
IApplicationService _applicationService;
|
43
46
|
IPolicyService _policyService;
|
44
47
|
IClaimService _claimService;
|
@@ -164,7 +167,7 @@ abstract contract Product is
|
|
164
167
|
ProductStorage storage $ = _getProductStorage();
|
165
168
|
// TODO add validation
|
166
169
|
// TODO refactor to go via registry ?
|
167
|
-
$.
|
170
|
+
$._productService = IProductService(_getServiceAddress(PRODUCT()));
|
168
171
|
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
169
172
|
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
170
173
|
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
@@ -194,7 +197,7 @@ abstract contract Product is
|
|
194
197
|
RiskId id,
|
195
198
|
bytes memory data
|
196
199
|
) internal {
|
197
|
-
|
200
|
+
_getProductService().createRisk(
|
198
201
|
id,
|
199
202
|
data
|
200
203
|
);
|
@@ -204,7 +207,7 @@ abstract contract Product is
|
|
204
207
|
RiskId id,
|
205
208
|
bytes memory data
|
206
209
|
) internal {
|
207
|
-
|
210
|
+
_getProductService().updateRisk(
|
208
211
|
id,
|
209
212
|
data
|
210
213
|
);
|
@@ -214,7 +217,7 @@ abstract contract Product is
|
|
214
217
|
RiskId id,
|
215
218
|
StateId state
|
216
219
|
) internal {
|
217
|
-
|
220
|
+
_getProductService().updateRiskState(
|
218
221
|
id,
|
219
222
|
state
|
220
223
|
);
|
@@ -404,7 +407,7 @@ abstract contract Product is
|
|
404
407
|
}
|
405
408
|
}
|
406
409
|
|
407
|
-
function
|
408
|
-
return _getProductStorage().
|
410
|
+
function _getProductService() internal view returns (IProductService) {
|
411
|
+
return _getProductStorage()._productService;
|
409
412
|
}
|
410
413
|
}
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IInstance} from "../instance/IInstance.sol";
|
5
5
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
6
6
|
import {IPoolService} from "../pool/PoolService.sol";
|
7
|
-
import {
|
7
|
+
import {IProductService} from "./IProductService.sol";
|
8
8
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
9
9
|
import {IRisk} from "../instance/module/IRisk.sol";
|
10
10
|
|
@@ -16,14 +16,16 @@ import {RiskId} from "../type/RiskId.sol";
|
|
16
16
|
import {StateId} from "../type/StateId.sol";
|
17
17
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
18
18
|
|
19
|
-
contract
|
19
|
+
contract ProductService is
|
20
20
|
ComponentVerifyingService,
|
21
|
-
|
21
|
+
IProductService
|
22
22
|
{
|
23
23
|
IInstanceService private _instanceService;
|
24
24
|
IPoolService internal _poolService;
|
25
25
|
IRegistryService private _registryService;
|
26
26
|
|
27
|
+
event LogProductServiceSender(address sender);
|
28
|
+
|
27
29
|
function _initialize(
|
28
30
|
address owner,
|
29
31
|
bytes memory data
|
@@ -44,7 +46,7 @@ contract RiskService is
|
|
44
46
|
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
45
47
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
46
48
|
|
47
|
-
registerInterface(type(
|
49
|
+
registerInterface(type(IProductService).interfaceId);
|
48
50
|
}
|
49
51
|
|
50
52
|
|
@@ -3,11 +3,11 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
5
|
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
|
-
import {
|
6
|
+
import {ProductService} from "./ProductService.sol";
|
7
7
|
|
8
|
-
contract
|
8
|
+
contract ProductServiceManager is ProxyManager {
|
9
9
|
|
10
|
-
|
10
|
+
ProductService private _productService;
|
11
11
|
|
12
12
|
/// @dev initializes proxy manager with product service implementation
|
13
13
|
constructor(
|
@@ -17,23 +17,23 @@ contract RiskServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
ProxyManager(registryAddress)
|
19
19
|
{
|
20
|
-
|
20
|
+
ProductService svc = new ProductService{salt: salt}();
|
21
21
|
bytes memory data = abi.encode(registryAddress, address(this), authority);
|
22
22
|
IVersionable versionable = deployDetermenistic(
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
26
26
|
|
27
|
-
|
27
|
+
_productService = ProductService(address(versionable));
|
28
28
|
}
|
29
29
|
|
30
30
|
//--- view functions ----------------------------------------------------//
|
31
|
-
function
|
31
|
+
function getProductService()
|
32
32
|
external
|
33
33
|
view
|
34
|
-
returns (
|
34
|
+
returns (ProductService productService)
|
35
35
|
{
|
36
|
-
return
|
36
|
+
return _productService;
|
37
37
|
}
|
38
38
|
|
39
39
|
}
|
@@ -7,14 +7,21 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
7
7
|
import {Amount} from "../type/Amount.sol";
|
8
8
|
import {IComponent} from "../shared/IComponent.sol";
|
9
9
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
10
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
10
11
|
import {IInstance} from "../instance/IInstance.sol";
|
12
|
+
import {IInstanceService} from "../instance/IInstanceService.sol";
|
13
|
+
import {IProductService} from "../product/IProductService.sol";
|
14
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
15
|
import {NftId} from "../type/NftId.sol";
|
16
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
17
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
12
18
|
|
13
19
|
/// @dev component base class
|
14
20
|
/// component examples are product, distribution, pool and oracle
|
15
21
|
interface IInstanceLinkedComponent is
|
16
22
|
IComponent
|
17
23
|
{
|
24
|
+
error ErrorComponentNotProductService(address caller);
|
18
25
|
error ErrorComponentNotInstance(NftId instanceNftId);
|
19
26
|
error ErrorComponentProductNftAlreadySet();
|
20
27
|
|
package/package.json
CHANGED