@etherisc/gif-next 0.0.2-9d3eab3-323 → 0.0.2-9dd1984-554
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/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → Component.sol/Component.json} +51 -6
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +51 -104
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{IBaseComponent.sol/IBaseComponent.json → IComponent.sol/IComponent.json} +51 -6
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +5 -5
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +51 -132
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +56 -120
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
- 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 +90 -13
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +75 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +56 -616
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +221 -114
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.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 +126 -229
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -126
- 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 +4 -0
- package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +98 -24
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -13
- 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/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +59 -16
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.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/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +219 -48
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +20 -24
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +131 -38
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +17 -21
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +51 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +107 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +308 -60
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +48 -20
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +131 -38
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +17 -21
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +131 -38
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +13 -9
- 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/IRegistry.sol/IRegistry.json +72 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +3 -3
- 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 +85 -59
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +33 -23
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +17 -17
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +13 -13
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +84 -101
- 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/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/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- 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/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/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +2 -2
- 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 +2 -2
- 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/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- 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/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- 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/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- 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 +177 -0
- package/contracts/components/Distribution.sol +5 -14
- package/contracts/components/{IBaseComponent.sol → IComponent.sol} +12 -6
- package/contracts/components/IProductComponent.sol +2 -2
- package/contracts/components/Pool.sol +7 -20
- package/contracts/components/Product.sol +21 -18
- package/contracts/instance/IInstance.sol +3 -3
- package/contracts/instance/IInstanceBase.sol +0 -1
- package/contracts/instance/IInstanceService.sol +10 -4
- package/contracts/instance/Instance.sol +6 -208
- package/contracts/instance/InstanceAccessManager.sol +92 -77
- package/contracts/instance/InstanceBase.sol +0 -2
- package/contracts/instance/InstanceService.sol +117 -71
- package/contracts/instance/InstanceServiceManager.sol +5 -9
- package/contracts/instance/base/ComponentService.sol +133 -0
- package/contracts/instance/base/IInstanceBase.sol +0 -2
- package/contracts/instance/module/IAccess.sol +27 -17
- package/contracts/instance/service/BundleService.sol +38 -5
- package/contracts/instance/service/BundleServiceManager.sol +5 -9
- package/contracts/instance/service/DistributionService.sol +33 -32
- package/contracts/instance/service/DistributionServiceManager.sol +6 -10
- package/contracts/instance/service/IBundleService.sol +5 -6
- package/contracts/instance/service/IPolicyService.sol +7 -0
- package/contracts/instance/service/PolicyService.sol +62 -27
- package/contracts/instance/service/PoolService.sol +46 -26
- package/contracts/instance/service/PoolServiceManager.sol +5 -9
- package/contracts/instance/service/ProductService.sol +104 -31
- package/contracts/registry/IRegistry.sol +17 -3
- package/contracts/registry/IRegistryService.sol +5 -5
- package/contracts/registry/Registry.sol +30 -19
- package/contracts/registry/RegistryAccessManager.sol +27 -27
- package/contracts/registry/RegistryService.sol +22 -32
- package/contracts/registry/RegistryServiceManager.sol +4 -2
- package/contracts/registry/ReleaseManager.sol +87 -123
- package/contracts/registry/TokenRegistry.sol +4 -4
- package/contracts/shared/IRegisterable.sol +0 -2
- package/contracts/shared/NftOwnable.sol +2 -0
- package/contracts/shared/Service.sol +4 -2
- package/contracts/types/RoleId.sol +6 -7
- package/package.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -814
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -466
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
- package/contracts/components/BaseComponent.sol +0 -132
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/base/ComponentServiceBase.sol +0 -72
- package/contracts/instance/service/ComponentOwnerService.sol +0 -315
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -4,7 +4,6 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
5
|
import {IProductComponent} from "../../components/IProductComponent.sol";
|
6
6
|
import {Product} from "../../components/Product.sol";
|
7
|
-
import {IBaseComponent} from "../../components/IBaseComponent.sol";
|
8
7
|
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
9
8
|
import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
|
10
9
|
import {IInstance} from "../IInstance.sol";
|
@@ -20,11 +19,11 @@ import {TokenHandler} from "../../shared/TokenHandler.sol";
|
|
20
19
|
import {IVersionable} from "../../shared/IVersionable.sol";
|
21
20
|
import {Versionable} from "../../shared/Versionable.sol";
|
22
21
|
|
23
|
-
import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
|
22
|
+
import {Timestamp, TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
23
|
import {UFixed, UFixedLib} from "../../types/UFixed.sol";
|
25
24
|
import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
|
26
25
|
import {ObjectType, INSTANCE, PRODUCT, POOL, POLICY, BUNDLE} from "../../types/ObjectType.sol";
|
27
|
-
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
|
26
|
+
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE, CLOSED} from "../../types/StateId.sol";
|
28
27
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
29
28
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
30
29
|
import {ReferralId} from "../../types/Referral.sol";
|
@@ -35,15 +34,16 @@ import {Version, VersionLib} from "../../types/Version.sol";
|
|
35
34
|
|
36
35
|
import {IService} from "../../shared/IService.sol";
|
37
36
|
import {Service} from "../../shared/Service.sol";
|
38
|
-
import {
|
37
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
39
38
|
import {IPolicyService} from "./IPolicyService.sol";
|
40
39
|
import {InstanceReader} from "../InstanceReader.sol";
|
41
40
|
import {IPoolService} from "./IPoolService.sol";
|
42
41
|
import {IBundleService} from "./IBundleService.sol";
|
43
42
|
|
44
43
|
|
45
|
-
contract PolicyService is
|
44
|
+
contract PolicyService is ComponentService, IPolicyService {
|
46
45
|
using NftIdLib for NftId;
|
46
|
+
using TimestampLib for Timestamp;
|
47
47
|
|
48
48
|
IPoolService internal _poolService;
|
49
49
|
IBundleService internal _bundleService;
|
@@ -81,7 +81,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
81
81
|
(productInfo,) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
82
82
|
product = Product(productInfo.objectAddress);
|
83
83
|
}
|
84
|
-
// TODO no access restrictions
|
84
|
+
// TODO: no access restrictions
|
85
85
|
function calculatePremium(
|
86
86
|
RiskId riskId,
|
87
87
|
uint256 sumInsuredAmount,
|
@@ -179,7 +179,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
179
179
|
ReferralId referralId
|
180
180
|
) external override returns (NftId policyNftId) {
|
181
181
|
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
182
|
-
// TODO add validations (see create bundle in pool service)
|
182
|
+
// TODO: add validations (see create bundle in pool service)
|
183
183
|
|
184
184
|
policyNftId = getRegistryService().registerPolicy(
|
185
185
|
IRegistry.ObjectInfo(
|
@@ -224,7 +224,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
224
224
|
instance.createPolicy(policyNftId, policyInfo);
|
225
225
|
instance.updatePolicyState(policyNftId, APPLIED());
|
226
226
|
|
227
|
-
// TODO add logging
|
227
|
+
// TODO: add logging
|
228
228
|
}
|
229
229
|
|
230
230
|
function _getAndVerifyUnderwritingSetup(
|
@@ -384,7 +384,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
384
384
|
}
|
385
385
|
}
|
386
386
|
|
387
|
-
// TODO add logging
|
387
|
+
// TODO: add logging
|
388
388
|
}
|
389
389
|
|
390
390
|
function calculateRequiredCollateral(UFixed collateralizationLevel, uint256 sumInsuredAmount) public pure override returns(uint256 collateralAmount) {
|
@@ -397,28 +397,30 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
397
397
|
// check caller is registered product
|
398
398
|
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
399
399
|
InstanceReader instanceReader = instance.getInstanceReader();
|
400
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
400
401
|
|
401
|
-
|
402
|
-
|
403
|
-
|
402
|
+
if (policyInfo.premiumPaidAmount == policyInfo.premiumAmount) {
|
403
|
+
revert ErrorIPolicyServicePremiumAlreadyPaid(policyNftId, policyInfo.premiumPaidAmount);
|
404
|
+
}
|
404
405
|
|
405
|
-
|
406
|
-
// IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
407
|
-
|
408
|
-
// uint256 premiumAmount = policyInfo.premiumAmount;
|
409
|
-
// _processPremiumByTreasury(instance, productInfo.nftId, policyNftId, premiumAmount);
|
406
|
+
uint256 unpaidPremiumAmount = policyInfo.premiumAmount - policyInfo.premiumPaidAmount;
|
410
407
|
|
411
|
-
|
412
|
-
|
408
|
+
uint256 netPremiumAmount = _processPremiumByTreasury(
|
409
|
+
instance,
|
410
|
+
productInfo.nftId,
|
411
|
+
policyNftId,
|
412
|
+
unpaidPremiumAmount);
|
413
413
|
|
414
|
-
|
414
|
+
policyInfo.premiumPaidAmount += unpaidPremiumAmount;
|
415
415
|
|
416
|
-
|
417
|
-
|
418
|
-
// activate(policyNftId, activateAt);
|
419
|
-
// }
|
416
|
+
_bundleService.increaseBalance(instance, policyInfo.bundleNftId, netPremiumAmount);
|
417
|
+
instance.updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
420
418
|
|
421
|
-
|
419
|
+
if(activateAt.gtz() && policyInfo.activatedAt.eqz()) {
|
420
|
+
activate(policyNftId, activateAt);
|
421
|
+
}
|
422
|
+
|
423
|
+
// TODO: add logging
|
422
424
|
}
|
423
425
|
|
424
426
|
function activate(NftId policyNftId, Timestamp activateAt) public override {
|
@@ -437,14 +439,47 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
437
439
|
|
438
440
|
instance.updatePolicy(policyNftId, policyInfo, ACTIVE());
|
439
441
|
|
440
|
-
// TODO add logging
|
442
|
+
// TODO: add logging
|
441
443
|
}
|
442
444
|
|
443
445
|
function close(
|
444
446
|
NftId policyNftId
|
445
447
|
) external override // solhint-disable-next-line no-empty-blocks
|
446
448
|
{
|
449
|
+
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
450
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
451
|
+
|
452
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
453
|
+
|
454
|
+
if (policyInfo.activatedAt.eqz()) {
|
455
|
+
revert ErrorIPolicyServicePolicyNotActivated(policyNftId);
|
456
|
+
}
|
457
|
+
|
458
|
+
StateId state = instanceReader.getPolicyState(policyNftId);
|
459
|
+
if (state != ACTIVE()) {
|
460
|
+
revert ErrorIPolicyServicePolicyNotActive(policyNftId, state);
|
461
|
+
}
|
462
|
+
|
463
|
+
if (policyInfo.closedAt.gtz()) {
|
464
|
+
revert ErrorIPolicyServicePolicyAlreadyClosed(policyNftId);
|
465
|
+
}
|
466
|
+
|
467
|
+
if (policyInfo.premiumAmount != policyInfo.premiumPaidAmount) {
|
468
|
+
revert ErrorIPolicyServicePremiumNotFullyPaid(policyNftId, policyInfo.premiumAmount, policyInfo.premiumPaidAmount);
|
469
|
+
}
|
470
|
+
|
471
|
+
if (policyInfo.openClaimsCount > 0) {
|
472
|
+
revert ErrorIPolicyServiceOpenClaims(policyNftId, policyInfo.openClaimsCount);
|
473
|
+
}
|
474
|
+
|
475
|
+
if (TimestampLib.blockTimestamp().lte(policyInfo.expiredAt) && (policyInfo.payoutAmount < policyInfo.sumInsuredAmount)) {
|
476
|
+
revert ErrorIPolicyServicePolicyHasNotExpired(policyNftId, policyInfo.expiredAt);
|
477
|
+
}
|
478
|
+
|
479
|
+
policyInfo.closedAt = TimestampLib.blockTimestamp();
|
447
480
|
|
481
|
+
_bundleService.closePolicy(instance, policyNftId, policyInfo.bundleNftId, policyInfo.sumInsuredAmount);
|
482
|
+
instance.updatePolicy(policyNftId, policyInfo, CLOSED());
|
448
483
|
}
|
449
484
|
|
450
485
|
function _getPoolNftId(
|
@@ -498,6 +533,6 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
498
533
|
}
|
499
534
|
}
|
500
535
|
|
501
|
-
// TODO add logging
|
536
|
+
// TODO: add logging
|
502
537
|
}
|
503
538
|
}
|
@@ -24,17 +24,17 @@ import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
|
24
24
|
import {IService} from "../../shared/IService.sol";
|
25
25
|
import {Service} from "../../shared/Service.sol";
|
26
26
|
import {BundleManager} from "../BundleManager.sol";
|
27
|
-
import {
|
27
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
28
28
|
import {IPoolService} from "./IPoolService.sol";
|
29
29
|
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
30
30
|
import {InstanceService} from "../InstanceService.sol";
|
31
31
|
import {InstanceReader} from "../InstanceReader.sol";
|
32
|
-
import {
|
32
|
+
import {IComponent} from "../../components/IComponent.sol";
|
33
33
|
|
34
34
|
string constant POOL_SERVICE_NAME = "PoolService";
|
35
35
|
|
36
36
|
contract PoolService is
|
37
|
-
|
37
|
+
ComponentService,
|
38
38
|
IPoolService
|
39
39
|
{
|
40
40
|
using NftIdLib for NftId;
|
@@ -67,37 +67,57 @@ contract PoolService is
|
|
67
67
|
external
|
68
68
|
returns(NftId poolNftId)
|
69
69
|
{
|
70
|
-
|
71
|
-
|
70
|
+
(
|
71
|
+
IComponent pool,
|
72
|
+
address owner,
|
73
|
+
IInstance instance,
|
74
|
+
NftId instanceNftId
|
75
|
+
) = _checkComponentForRegistration(
|
76
|
+
poolAddress,
|
77
|
+
POOL(),
|
78
|
+
POOL_OWNER_ROLE());
|
79
|
+
|
80
|
+
(
|
81
|
+
IRegistry.ObjectInfo memory poolInfo,
|
82
|
+
bytes memory data
|
83
|
+
) = getRegistryService().registerPool(pool, owner);
|
84
|
+
pool.linkToRegisteredNftId();
|
85
|
+
poolNftId = poolInfo.nftId;
|
86
|
+
|
87
|
+
(
|
88
|
+
string memory name,
|
89
|
+
ISetup.PoolSetupInfo memory initialSetup
|
90
|
+
) = _decodeAndVerifyPoolData(data);
|
91
|
+
instance.createPoolSetup(poolNftId, initialSetup);
|
72
92
|
|
73
|
-
|
74
|
-
|
75
|
-
(info, data) = getRegistryService().registerPool(pool, poolOwner);
|
93
|
+
getInstanceService().createTarget(instanceNftId, poolAddress, name);
|
94
|
+
}
|
76
95
|
|
77
|
-
|
96
|
+
function _decodeAndVerifyPoolData(bytes memory data)
|
97
|
+
internal
|
98
|
+
returns(string memory name, ISetup.PoolSetupInfo memory setup)
|
99
|
+
{
|
100
|
+
(name, setup) = abi.decode(
|
101
|
+
data,
|
102
|
+
(string, ISetup.PoolSetupInfo)
|
103
|
+
);
|
78
104
|
|
79
|
-
|
80
|
-
|
81
|
-
POOL_OWNER_ROLE(),
|
82
|
-
address(instance));
|
105
|
+
// TODO add checks
|
106
|
+
/*IRegistry _registry = getRegistry();
|
83
107
|
|
84
|
-
if(
|
85
|
-
revert
|
108
|
+
if(wallet == address(0)) {
|
109
|
+
revert WalletIsZero();
|
86
110
|
}
|
87
111
|
|
88
|
-
|
89
|
-
ISetup.PoolSetupInfo memory initialSetup = _decodeAndVerifyPoolSetup(data);
|
90
|
-
instance.createPoolSetup(poolNftId, initialSetup);
|
91
|
-
}
|
112
|
+
ObjectType tokenType = _registry.getObjectInfo(address(token)).objectType;
|
92
113
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
data,
|
97
|
-
(ISetup.PoolSetupInfo)
|
98
|
-
);
|
114
|
+
if(tokenType != TOKEN()) {
|
115
|
+
revert InvalidToken();
|
116
|
+
}
|
99
117
|
|
100
|
-
|
118
|
+
if(UFixedLib.eqz(info.collateralizationLevel)) {
|
119
|
+
revert CollateralizationLevelIsZero();
|
120
|
+
}*/
|
101
121
|
}
|
102
122
|
|
103
123
|
function setFees(
|
@@ -6,8 +6,7 @@ import {ProxyManager} from "../../shared/ProxyManager.sol";
|
|
6
6
|
import {PoolService} from "./PoolService.sol";
|
7
7
|
import {Registry} from "../../registry/Registry.sol";
|
8
8
|
import {RegistryService} from "../../registry/RegistryService.sol";
|
9
|
-
import {
|
10
|
-
import {SERVICE} from "../../types/ObjectType.sol";
|
9
|
+
import {REGISTRY} from "../../types/ObjectType.sol";
|
11
10
|
|
12
11
|
contract PoolServiceManager is ProxyManager {
|
13
12
|
|
@@ -27,10 +26,10 @@ contract PoolServiceManager is ProxyManager {
|
|
27
26
|
|
28
27
|
_poolService = PoolService(address(versionable));
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
//
|
29
|
+
// TODO `this` must have a role or own nft to register service
|
30
|
+
//Registry registry = Registry(registryAddress);
|
31
|
+
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _poolService.getMajorVersion());
|
32
|
+
//RegistryService registryService = RegistryService(registryServiceAddress);
|
34
33
|
//registryService.registerService(_poolService);
|
35
34
|
|
36
35
|
// TODO no nft to link yet
|
@@ -38,9 +37,6 @@ contract PoolServiceManager is ProxyManager {
|
|
38
37
|
//_linkToNftOwnable(
|
39
38
|
// address(registryAddress),
|
40
39
|
// address(_poolService));
|
41
|
-
|
42
|
-
// implies that after this constructor call only upgrade functionality is available
|
43
|
-
_isDeployed = true;
|
44
40
|
}
|
45
41
|
|
46
42
|
//--- view functions ----------------------------------------------------//
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
5
|
import {IProductComponent} from "../../components/IProductComponent.sol";
|
6
6
|
import {Product} from "../../components/Product.sol";
|
7
|
-
import {
|
7
|
+
import {IComponent} from "../../components/IComponent.sol";
|
8
8
|
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
9
9
|
import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
|
10
10
|
import {IInstance} from "../IInstance.sol";
|
@@ -35,13 +35,13 @@ import {RoleId, PRODUCT_OWNER_ROLE} from "../../types/RoleId.sol";
|
|
35
35
|
|
36
36
|
import {IService} from "../../shared/IService.sol";
|
37
37
|
import {Service} from "../../shared/Service.sol";
|
38
|
-
import {
|
38
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
39
39
|
import {IProductService} from "./IProductService.sol";
|
40
40
|
import {InstanceReader} from "../InstanceReader.sol";
|
41
41
|
import {IPoolService} from "./PoolService.sol";
|
42
42
|
|
43
43
|
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
44
|
-
contract ProductService is
|
44
|
+
contract ProductService is ComponentService, IProductService {
|
45
45
|
using NftIdLib for NftId;
|
46
46
|
|
47
47
|
IPoolService internal _poolService;
|
@@ -68,44 +68,117 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
68
68
|
}
|
69
69
|
|
70
70
|
|
71
|
-
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
72
|
-
return PRODUCT();
|
73
|
-
}
|
74
|
-
|
75
71
|
function register(address productAddress)
|
76
72
|
external
|
77
73
|
returns(NftId productNftId)
|
78
74
|
{
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
75
|
+
(
|
76
|
+
IComponent product,
|
77
|
+
address owner,
|
78
|
+
IInstance instance,
|
79
|
+
NftId instanceNftId
|
80
|
+
) = _checkComponentForRegistration(
|
81
|
+
productAddress,
|
82
|
+
PRODUCT(),
|
83
|
+
PRODUCT_OWNER_ROLE());
|
84
|
+
|
85
|
+
(
|
86
|
+
IRegistry.ObjectInfo memory productInfo,
|
87
|
+
bytes memory data
|
88
|
+
) = getRegistryService().registerProduct(product, owner);
|
89
|
+
|
90
|
+
productNftId = productInfo.nftId;
|
91
|
+
_createProductSetup(
|
92
|
+
instance,
|
93
|
+
product,
|
94
|
+
productNftId,
|
95
|
+
data);
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
function _createProductSetup(
|
100
|
+
IInstance instance,
|
101
|
+
IComponent product,
|
102
|
+
NftId productNftId,
|
103
|
+
bytes memory data
|
104
|
+
)
|
105
|
+
internal
|
106
|
+
returns (string memory name)
|
107
|
+
{
|
108
|
+
(
|
109
|
+
string memory name,
|
110
|
+
ISetup.ProductSetupInfo memory setup
|
111
|
+
) = _decodeAndVerifyProductData(data);
|
112
|
+
|
113
|
+
// wire distribution and pool components to product component
|
114
|
+
IComponent distribution = IComponent(_registry.getObjectInfo(setup.distributionNftId).objectAddress);
|
115
|
+
IComponent pool = IComponent(_registry.getObjectInfo(setup.poolNftId).objectAddress);
|
116
|
+
|
117
|
+
distribution.setProductNftId(productNftId);
|
118
|
+
pool.setProductNftId(productNftId);
|
119
|
+
product.setProductNftId(productNftId);
|
120
|
+
product.linkToRegisteredNftId();
|
121
|
+
|
122
|
+
// create product setup in instance
|
123
|
+
instance.createProductSetup(productNftId, setup);
|
124
|
+
|
125
|
+
// create target for instane access manager
|
126
|
+
getInstanceService().createTarget(
|
127
|
+
_registry.getNftId(address(instance)),
|
128
|
+
address(product),
|
129
|
+
name);
|
99
130
|
}
|
100
131
|
|
101
|
-
function
|
132
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
133
|
+
return PRODUCT();
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
function _decodeAndVerifyProductData(bytes memory data)
|
138
|
+
internal
|
139
|
+
returns(string memory name, ISetup.ProductSetupInfo memory setup)
|
102
140
|
{
|
103
|
-
setup = abi.decode(
|
141
|
+
(name, setup) = abi.decode(
|
104
142
|
data,
|
105
|
-
(ISetup.ProductSetupInfo)
|
143
|
+
(string, ISetup.ProductSetupInfo)
|
106
144
|
);
|
107
145
|
|
108
|
-
// TODO add checks
|
146
|
+
// TODO add checks
|
147
|
+
// if(wallet == address(0)) {
|
148
|
+
// revert WalletIsZero();
|
149
|
+
// }
|
150
|
+
|
151
|
+
// IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
|
152
|
+
|
153
|
+
// if(tokenInfo.objectType != TOKEN()) {
|
154
|
+
// revert InvalidToken();
|
155
|
+
// }
|
156
|
+
|
157
|
+
// IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
|
158
|
+
|
159
|
+
// if(poolInfo.objectType != POOL()) {
|
160
|
+
// revert InvalidPool();
|
161
|
+
// }
|
162
|
+
|
163
|
+
// if(poolInfo.parentNftId != instanceNftId) {
|
164
|
+
// revert InvalidPoolsInstance();
|
165
|
+
// }
|
166
|
+
// // TODO pool have the same token
|
167
|
+
// //ITreasury.PoolSetup memory poolSetup = instance.getPoolSetup(info.poolNftId);
|
168
|
+
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
169
|
+
// // TODO pool is not linked
|
170
|
+
|
171
|
+
// IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
|
172
|
+
|
173
|
+
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
174
|
+
// revert InvalidDistribution();
|
175
|
+
// }
|
176
|
+
|
177
|
+
// if(distributionInfo.parentNftId != instanceNftId) {
|
178
|
+
// revert InvalidDistributionsInstance();
|
179
|
+
// }
|
180
|
+
// // TODO distribution have the same token
|
181
|
+
// // TODO distribution is not linked
|
109
182
|
}
|
110
183
|
|
111
184
|
function setFees(
|
@@ -7,11 +7,12 @@ import {ChainNft} from "./ChainNft.sol";
|
|
7
7
|
import {NftId} from "../types/NftId.sol";
|
8
8
|
import {ObjectType} from "../types/ObjectType.sol";
|
9
9
|
import {VersionPart} from "../types/Version.sol";
|
10
|
+
import {Timestamp} from "../types/Timestamp.sol";
|
10
11
|
|
11
12
|
interface IRegistry is IERC165 {
|
12
13
|
|
13
14
|
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
14
|
-
|
15
|
+
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
15
16
|
|
16
17
|
// register()
|
17
18
|
error CallerNotRegistryService();
|
@@ -19,6 +20,7 @@ interface IRegistry is IERC165 {
|
|
19
20
|
|
20
21
|
// registerService()
|
21
22
|
error CallerNotReleaseManager();
|
23
|
+
error ServiceAlreadyRegistered(address service);
|
22
24
|
|
23
25
|
// _register()
|
24
26
|
error ZeroParentAddress();
|
@@ -36,7 +38,17 @@ interface IRegistry is IERC165 {
|
|
36
38
|
}// TODO delete nftId and initialOwner(if not used) from struct
|
37
39
|
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
38
40
|
|
39
|
-
|
41
|
+
struct ReleaseInfo {
|
42
|
+
ObjectType[] domains;
|
43
|
+
Timestamp createdAt;
|
44
|
+
//Timestamp updatedAt;
|
45
|
+
}
|
46
|
+
|
47
|
+
function registerService(
|
48
|
+
ObjectInfo memory serviceInfo,
|
49
|
+
VersionPart serviceVersion,
|
50
|
+
ObjectType serviceDomain
|
51
|
+
) external returns(NftId nftId);
|
40
52
|
|
41
53
|
function register(ObjectInfo memory info) external returns (NftId nftId);
|
42
54
|
|
@@ -46,6 +58,8 @@ interface IRegistry is IERC165 {
|
|
46
58
|
|
47
59
|
function getMajorVersion() external view returns (VersionPart);
|
48
60
|
|
61
|
+
function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
|
62
|
+
|
49
63
|
function getObjectCount() external view returns (uint256);
|
50
64
|
|
51
65
|
function getNftId() external view returns (NftId nftId);
|
@@ -67,7 +81,7 @@ interface IRegistry is IERC165 {
|
|
67
81
|
function isRegisteredService(address contractAddress) external view returns (bool);
|
68
82
|
|
69
83
|
function getServiceAddress(
|
70
|
-
ObjectType
|
84
|
+
ObjectType serviceDomain,
|
71
85
|
VersionPart releaseVersion
|
72
86
|
) external view returns (address serviceAddress);
|
73
87
|
|
@@ -10,7 +10,7 @@ import {IService} from "../shared/IService.sol";
|
|
10
10
|
import {IRegistry} from "./IRegistry.sol";
|
11
11
|
|
12
12
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
13
|
-
import {
|
13
|
+
import {IComponent} from "../components/IComponent.sol";
|
14
14
|
|
15
15
|
interface IRegistryService is
|
16
16
|
IService,
|
@@ -35,20 +35,20 @@ interface IRegistryService is
|
|
35
35
|
struct FunctionConfig
|
36
36
|
{
|
37
37
|
ObjectType serviceDomain;
|
38
|
-
bytes4
|
38
|
+
bytes4 selector;
|
39
39
|
}
|
40
40
|
|
41
41
|
// TODO used by service -> add owner arg
|
42
42
|
function registerInstance(IRegisterable instance)
|
43
43
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
44
44
|
|
45
|
-
function registerProduct(
|
45
|
+
function registerProduct(IComponent product, address owner)
|
46
46
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
47
47
|
|
48
|
-
function registerPool(
|
48
|
+
function registerPool(IComponent pool, address owner)
|
49
49
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
50
50
|
|
51
|
-
function registerDistribution(
|
51
|
+
function registerDistribution(IComponent distribution, address owner)
|
52
52
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
53
53
|
|
54
54
|
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|