@etherisc/gif-next 0.0.2-ca9d515-311 → 0.0.2-cc18d4d-714
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/{IBaseComponent.sol/IBaseComponent.json → Component.sol/Component.json} +300 -12
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +199 -94
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +86 -84
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +496 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +512 -74
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +596 -5
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +180 -205
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +204 -110
- 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/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +38 -62
- 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 +269 -13
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +120 -19
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +105 -615
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +188 -144
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +41 -82
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +265 -265
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +41 -120
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -32
- 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} +124 -42
- 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 +245 -66
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +35 -26
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +153 -65
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +32 -23
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +64 -18
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -18
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +120 -18
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +13 -18
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +13 -18
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +334 -91
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +66 -25
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +153 -65
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +32 -23
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +159 -71
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +32 -15
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +212 -133
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +127 -93
- 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 +224 -234
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +68 -161
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +51 -104
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +13 -29
- 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/IRegisterable.sol/IRegisterable.json +0 -5
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +13 -18
- 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 +19 -6
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +19 -6
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +19 -11
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +26 -18
- 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 +19 -11
- 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 +44 -36
- 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 +216 -0
- package/contracts/components/Distribution.sol +41 -51
- package/contracts/components/IComponent.sol +43 -0
- package/contracts/components/IDistributionComponent.sol +5 -2
- package/contracts/components/IPoolComponent.sol +6 -21
- package/contracts/components/IProductComponent.sol +7 -3
- package/contracts/components/Pool.sol +44 -107
- package/contracts/components/Product.sol +59 -85
- package/contracts/instance/BundleManager.sol +7 -11
- package/contracts/instance/IInstance.sol +21 -9
- package/contracts/instance/IInstanceService.sol +12 -3
- package/contracts/instance/Instance.sol +37 -233
- package/contracts/instance/InstanceAccessManager.sol +87 -78
- package/contracts/instance/InstanceReader.sol +3 -25
- package/contracts/instance/InstanceService.sol +294 -120
- package/contracts/instance/InstanceServiceManager.sol +5 -8
- package/contracts/instance/ObjectManager.sol +7 -24
- package/contracts/instance/base/ComponentService.sol +134 -0
- package/contracts/instance/module/IAccess.sol +27 -18
- package/contracts/instance/service/BundleService.sol +41 -8
- package/contracts/instance/service/BundleServiceManager.sol +5 -8
- package/contracts/instance/service/DistributionService.sol +31 -43
- package/contracts/instance/service/DistributionServiceManager.sol +6 -9
- package/contracts/instance/service/IBundleService.sol +5 -6
- package/contracts/instance/service/IPolicyService.sol +7 -0
- package/contracts/instance/service/PolicyService.sol +67 -37
- package/contracts/instance/service/PoolService.sol +25 -39
- package/contracts/instance/service/PoolServiceManager.sol +5 -8
- package/contracts/instance/service/ProductService.sol +98 -38
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +34 -17
- package/contracts/registry/IRegistryService.sol +28 -13
- package/contracts/registry/Registry.sol +214 -210
- package/contracts/registry/RegistryAccessManager.sol +216 -0
- package/contracts/registry/RegistryService.sol +61 -157
- package/contracts/registry/RegistryServiceManager.sol +18 -36
- package/contracts/registry/ReleaseManager.sol +332 -0
- package/contracts/registry/TokenRegistry.sol +8 -7
- package/contracts/shared/IRegisterable.sol +1 -3
- package/contracts/shared/IService.sol +2 -1
- package/contracts/shared/NftOwnable.sol +5 -0
- package/contracts/shared/ProxyManager.sol +1 -1
- package/contracts/shared/Registerable.sol +10 -14
- package/contracts/shared/Service.sol +13 -8
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/RoleId.sol +10 -12
- package/package.json +3 -3
- 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/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- 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/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
- 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/components/IBaseComponent.sol +0 -31
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/IInstanceBase.sol +0 -26
- package/contracts/instance/InstanceBase.sol +0 -41
- package/contracts/instance/base/ComponentServiceBase.sol +0 -72
- package/contracts/instance/base/IInstanceBase.sol +0 -23
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- 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
|
-
import {ObjectType, INSTANCE, PRODUCT, POLICY} from "../../types/ObjectType.sol";
|
27
|
-
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
|
25
|
+
import {ObjectType, INSTANCE, PRODUCT, POOL, POLICY, BUNDLE} from "../../types/ObjectType.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,20 +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
|
-
import {POOL_SERVICE_NAME} from "./PoolService.sol";
|
44
|
-
import {BUNDLE_SERVICE_NAME} from "./BundleService.sol";
|
45
42
|
|
46
|
-
string constant POLICY_SERVICE_NAME = "PolicyService";
|
47
43
|
|
48
|
-
contract PolicyService is
|
44
|
+
contract PolicyService is ComponentService, IPolicyService {
|
49
45
|
using NftIdLib for NftId;
|
50
|
-
|
51
|
-
string public constant NAME = "PolicyService";
|
46
|
+
using TimestampLib for Timestamp;
|
52
47
|
|
53
48
|
IPoolService internal _poolService;
|
54
49
|
IBundleService internal _bundleService;
|
@@ -69,15 +64,15 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
69
64
|
|
70
65
|
_initializeService(registryAddress, owner);
|
71
66
|
|
72
|
-
_poolService = IPoolService(_registry.getServiceAddress(
|
73
|
-
_bundleService = IBundleService(_registry.getServiceAddress(
|
67
|
+
_poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
|
68
|
+
_bundleService = IBundleService(_registry.getServiceAddress(BUNDLE(), getMajorVersion()));
|
74
69
|
|
75
70
|
_registerInterface(type(IPolicyService).interfaceId);
|
76
71
|
}
|
77
72
|
|
78
73
|
|
79
|
-
function
|
80
|
-
return
|
74
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
75
|
+
return POLICY();
|
81
76
|
}
|
82
77
|
|
83
78
|
|
@@ -86,7 +81,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
86
81
|
(productInfo,) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
87
82
|
product = Product(productInfo.objectAddress);
|
88
83
|
}
|
89
|
-
// TODO no access restrictions
|
84
|
+
// TODO: no access restrictions
|
90
85
|
function calculatePremium(
|
91
86
|
RiskId riskId,
|
92
87
|
uint256 sumInsuredAmount,
|
@@ -184,7 +179,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
184
179
|
ReferralId referralId
|
185
180
|
) external override returns (NftId policyNftId) {
|
186
181
|
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
187
|
-
// TODO add validations (see create bundle in pool service)
|
182
|
+
// TODO: add validations (see create bundle in pool service)
|
188
183
|
|
189
184
|
policyNftId = getRegistryService().registerPolicy(
|
190
185
|
IRegistry.ObjectInfo(
|
@@ -229,7 +224,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
229
224
|
instance.createPolicy(policyNftId, policyInfo);
|
230
225
|
instance.updatePolicyState(policyNftId, APPLIED());
|
231
226
|
|
232
|
-
// TODO add logging
|
227
|
+
// TODO: add logging
|
233
228
|
}
|
234
229
|
|
235
230
|
function _getAndVerifyUnderwritingSetup(
|
@@ -389,7 +384,7 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
389
384
|
}
|
390
385
|
}
|
391
386
|
|
392
|
-
// TODO add logging
|
387
|
+
// TODO: add logging
|
393
388
|
}
|
394
389
|
|
395
390
|
function calculateRequiredCollateral(UFixed collateralizationLevel, uint256 sumInsuredAmount) public pure override returns(uint256 collateralAmount) {
|
@@ -402,28 +397,30 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
402
397
|
// check caller is registered product
|
403
398
|
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
404
399
|
InstanceReader instanceReader = instance.getInstanceReader();
|
400
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
405
401
|
|
406
|
-
|
407
|
-
|
408
|
-
|
402
|
+
if (policyInfo.premiumPaidAmount == policyInfo.premiumAmount) {
|
403
|
+
revert ErrorIPolicyServicePremiumAlreadyPaid(policyNftId, policyInfo.premiumPaidAmount);
|
404
|
+
}
|
409
405
|
|
410
|
-
|
411
|
-
// IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
412
|
-
|
413
|
-
// uint256 premiumAmount = policyInfo.premiumAmount;
|
414
|
-
// _processPremiumByTreasury(instance, productInfo.nftId, policyNftId, premiumAmount);
|
406
|
+
uint256 unpaidPremiumAmount = policyInfo.premiumAmount - policyInfo.premiumPaidAmount;
|
415
407
|
|
416
|
-
|
417
|
-
|
408
|
+
uint256 netPremiumAmount = _processPremiumByTreasury(
|
409
|
+
instance,
|
410
|
+
productInfo.nftId,
|
411
|
+
policyNftId,
|
412
|
+
unpaidPremiumAmount);
|
418
413
|
|
419
|
-
|
414
|
+
policyInfo.premiumPaidAmount += unpaidPremiumAmount;
|
420
415
|
|
421
|
-
|
422
|
-
|
423
|
-
// activate(policyNftId, activateAt);
|
424
|
-
// }
|
416
|
+
_bundleService.increaseBalance(instance, policyInfo.bundleNftId, netPremiumAmount);
|
417
|
+
instance.updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
425
418
|
|
426
|
-
|
419
|
+
if(activateAt.gtz() && policyInfo.activatedAt.eqz()) {
|
420
|
+
activate(policyNftId, activateAt);
|
421
|
+
}
|
422
|
+
|
423
|
+
// TODO: add logging
|
427
424
|
}
|
428
425
|
|
429
426
|
function activate(NftId policyNftId, Timestamp activateAt) public override {
|
@@ -442,14 +439,47 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
442
439
|
|
443
440
|
instance.updatePolicy(policyNftId, policyInfo, ACTIVE());
|
444
441
|
|
445
|
-
// TODO add logging
|
442
|
+
// TODO: add logging
|
446
443
|
}
|
447
444
|
|
448
445
|
function close(
|
449
446
|
NftId policyNftId
|
450
447
|
) external override // solhint-disable-next-line no-empty-blocks
|
451
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();
|
452
480
|
|
481
|
+
_bundleService.closePolicy(instance, policyNftId, policyInfo.bundleNftId, policyInfo.sumInsuredAmount);
|
482
|
+
instance.updatePolicy(policyNftId, policyInfo, CLOSED());
|
453
483
|
}
|
454
484
|
|
455
485
|
function _getPoolNftId(
|
@@ -503,6 +533,6 @@ contract PolicyService is ComponentServiceBase, IPolicyService {
|
|
503
533
|
}
|
504
534
|
}
|
505
535
|
|
506
|
-
// TODO add logging
|
536
|
+
// TODO: add logging
|
507
537
|
}
|
508
538
|
}
|
@@ -14,7 +14,7 @@ import {Versionable} from "../../shared/Versionable.sol";
|
|
14
14
|
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
15
15
|
|
16
16
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
17
|
-
import {POOL, BUNDLE} from "../../types/ObjectType.sol";
|
17
|
+
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
18
18
|
import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
|
19
19
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
20
20
|
import {Version, VersionLib} from "../../types/Version.sol";
|
@@ -24,23 +24,22 @@ 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
|
+
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
33
34
|
|
34
35
|
string constant POOL_SERVICE_NAME = "PoolService";
|
35
36
|
|
36
37
|
contract PoolService is
|
37
|
-
|
38
|
+
ComponentService,
|
38
39
|
IPoolService
|
39
40
|
{
|
40
41
|
using NftIdLib for NftId;
|
41
42
|
|
42
|
-
string public constant NAME = "PoolService";
|
43
|
-
|
44
43
|
address internal _registryAddress;
|
45
44
|
|
46
45
|
function _initialize(
|
@@ -61,45 +60,32 @@ contract PoolService is
|
|
61
60
|
_registerInterface(type(IPoolService).interfaceId);
|
62
61
|
}
|
63
62
|
|
64
|
-
function
|
65
|
-
return
|
63
|
+
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
64
|
+
return POOL();
|
66
65
|
}
|
67
66
|
|
68
67
|
function register(address poolAddress)
|
69
68
|
external
|
70
69
|
returns(NftId poolNftId)
|
71
70
|
{
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
poolNftId = info.nftId;
|
91
|
-
ISetup.PoolSetupInfo memory initialSetup = _decodeAndVerifyPoolSetup(data);
|
92
|
-
instance.createPoolSetup(poolNftId, initialSetup);
|
93
|
-
}
|
94
|
-
|
95
|
-
function _decodeAndVerifyPoolSetup(bytes memory data) internal returns(ISetup.PoolSetupInfo memory setup)
|
96
|
-
{
|
97
|
-
setup = abi.decode(
|
98
|
-
data,
|
99
|
-
(ISetup.PoolSetupInfo)
|
100
|
-
);
|
101
|
-
|
102
|
-
// TODO add checks if applicable
|
71
|
+
(
|
72
|
+
IComponent component,
|
73
|
+
address owner,
|
74
|
+
IInstance instance,
|
75
|
+
NftId instanceNftId
|
76
|
+
) = _checkComponentForRegistration(
|
77
|
+
poolAddress,
|
78
|
+
POOL(),
|
79
|
+
POOL_OWNER_ROLE());
|
80
|
+
|
81
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
82
|
+
IRegistry.ObjectInfo memory poolInfo = getRegistryService().registerPool(pool, owner);
|
83
|
+
pool.linkToRegisteredNftId();
|
84
|
+
poolNftId = poolInfo.nftId;
|
85
|
+
|
86
|
+
instance.createPoolSetup(poolNftId, pool.getSetupInfo());
|
87
|
+
getInstanceService().createGifTarget(instanceNftId, poolAddress, pool.getName());
|
88
|
+
getInstanceService().grantPoolDefaultPermissions(instanceNftId, poolAddress, pool.getName());
|
103
89
|
}
|
104
90
|
|
105
91
|
function setFees(
|
@@ -6,7 +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 {
|
9
|
+
import {REGISTRY} from "../../types/ObjectType.sol";
|
10
10
|
|
11
11
|
contract PoolServiceManager is ProxyManager {
|
12
12
|
|
@@ -26,10 +26,10 @@ contract PoolServiceManager is ProxyManager {
|
|
26
26
|
|
27
27
|
_poolService = PoolService(address(versionable));
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
//
|
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);
|
33
33
|
//registryService.registerService(_poolService);
|
34
34
|
|
35
35
|
// TODO no nft to link yet
|
@@ -37,9 +37,6 @@ contract PoolServiceManager is ProxyManager {
|
|
37
37
|
//_linkToNftOwnable(
|
38
38
|
// address(registryAddress),
|
39
39
|
// address(_poolService));
|
40
|
-
|
41
|
-
// implies that after this constructor call only upgrade functionality is available
|
42
|
-
_isDeployed = true;
|
43
40
|
}
|
44
41
|
|
45
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";
|
@@ -23,7 +23,7 @@ import {Versionable} from "../../shared/Versionable.sol";
|
|
23
23
|
import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
24
|
import {UFixed, UFixedLib} from "../../types/UFixed.sol";
|
25
25
|
import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
|
26
|
-
import {ObjectType,
|
26
|
+
import {ObjectType, PRODUCT, POOL, POLICY} from "../../types/ObjectType.sol";
|
27
27
|
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
|
28
28
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
29
29
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
@@ -35,20 +35,15 @@ 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
|
-
import {POOL_SERVICE_NAME} from "./PoolService.sol";
|
43
|
-
|
44
|
-
string constant PRODUCT_SERVICE_NAME = "ProductService";
|
45
42
|
|
46
43
|
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
47
|
-
contract ProductService is
|
44
|
+
contract ProductService is ComponentService, IProductService {
|
48
45
|
using NftIdLib for NftId;
|
49
46
|
|
50
|
-
string public constant NAME = "ProductService";
|
51
|
-
|
52
47
|
IPoolService internal _poolService;
|
53
48
|
|
54
49
|
event LogProductServiceSender(address sender);
|
@@ -67,50 +62,115 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
67
62
|
|
68
63
|
_initializeService(registryAddress, owner);
|
69
64
|
|
70
|
-
_poolService = IPoolService(_registry.getServiceAddress(
|
65
|
+
_poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
|
71
66
|
|
72
67
|
_registerInterface(type(IProductService).interfaceId);
|
73
68
|
}
|
74
69
|
|
75
70
|
|
76
|
-
function getName() public pure override(IService, Service) returns(string memory name) {
|
77
|
-
return NAME;
|
78
|
-
}
|
79
|
-
|
80
71
|
function register(address productAddress)
|
81
72
|
external
|
82
73
|
returns(NftId productNftId)
|
83
74
|
{
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
75
|
+
(
|
76
|
+
IComponent component,
|
77
|
+
address owner,
|
78
|
+
IInstance instance,
|
79
|
+
NftId instanceNftId
|
80
|
+
) = _checkComponentForRegistration(
|
81
|
+
productAddress,
|
82
|
+
PRODUCT(),
|
83
|
+
PRODUCT_OWNER_ROLE());
|
84
|
+
|
85
|
+
IProductComponent product = IProductComponent(productAddress);
|
86
|
+
IRegistry.ObjectInfo memory productInfo = getRegistryService().registerProduct(product, owner);
|
87
|
+
productNftId = productInfo.nftId;
|
88
|
+
_createProductSetup(
|
89
|
+
instance,
|
90
|
+
product,
|
91
|
+
productNftId);
|
92
|
+
}
|
93
|
+
|
94
|
+
|
95
|
+
function _createProductSetup(
|
96
|
+
IInstance instance,
|
97
|
+
IProductComponent product,
|
98
|
+
NftId productNftId
|
99
|
+
)
|
100
|
+
internal
|
101
|
+
returns (string memory name)
|
102
|
+
{
|
103
|
+
// wire distribution and pool components to product component
|
104
|
+
ISetup.ProductSetupInfo memory setup = product.getSetupInfo();
|
105
|
+
IComponent distribution = IComponent(_registry.getObjectInfo(setup.distributionNftId).objectAddress);
|
106
|
+
IComponent pool = IComponent(_registry.getObjectInfo(setup.poolNftId).objectAddress);
|
107
|
+
|
108
|
+
distribution.setProductNftId(productNftId);
|
109
|
+
pool.setProductNftId(productNftId);
|
110
|
+
product.setProductNftId(productNftId);
|
111
|
+
product.linkToRegisteredNftId();
|
112
|
+
|
113
|
+
// create product setup in instance
|
114
|
+
instance.createProductSetup(productNftId, product.getSetupInfo());
|
115
|
+
|
116
|
+
// create target for instane access manager
|
117
|
+
getInstanceService().createGifTarget(
|
118
|
+
_registry.getNftId(address(instance)),
|
119
|
+
address(product),
|
120
|
+
product.getName());
|
121
|
+
getInstanceService().grantProductDefaultPermissions(instance.getNftId(), address(product), product.getName());
|
104
122
|
}
|
105
123
|
|
106
|
-
function
|
124
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
125
|
+
return PRODUCT();
|
126
|
+
}
|
127
|
+
|
128
|
+
|
129
|
+
function _decodeAndVerifyProductData(bytes memory data)
|
130
|
+
internal
|
131
|
+
returns(string memory name, ISetup.ProductSetupInfo memory setup)
|
107
132
|
{
|
108
|
-
setup = abi.decode(
|
133
|
+
(name, setup) = abi.decode(
|
109
134
|
data,
|
110
|
-
(ISetup.ProductSetupInfo)
|
135
|
+
(string, ISetup.ProductSetupInfo)
|
111
136
|
);
|
112
137
|
|
113
|
-
// TODO add checks
|
138
|
+
// TODO add checks
|
139
|
+
// if(wallet == address(0)) {
|
140
|
+
// revert WalletIsZero();
|
141
|
+
// }
|
142
|
+
|
143
|
+
// IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
|
144
|
+
|
145
|
+
// if(tokenInfo.objectType != TOKEN()) {
|
146
|
+
// revert InvalidToken();
|
147
|
+
// }
|
148
|
+
|
149
|
+
// IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
|
150
|
+
|
151
|
+
// if(poolInfo.objectType != POOL()) {
|
152
|
+
// revert InvalidPool();
|
153
|
+
// }
|
154
|
+
|
155
|
+
// if(poolInfo.parentNftId != instanceNftId) {
|
156
|
+
// revert InvalidPoolsInstance();
|
157
|
+
// }
|
158
|
+
// // TODO pool have the same token
|
159
|
+
// //ITreasury.PoolSetup memory poolSetup = instance.getPoolSetup(info.poolNftId);
|
160
|
+
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
161
|
+
// // TODO pool is not linked
|
162
|
+
|
163
|
+
// IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
|
164
|
+
|
165
|
+
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
166
|
+
// revert InvalidDistribution();
|
167
|
+
// }
|
168
|
+
|
169
|
+
// if(distributionInfo.parentNftId != instanceNftId) {
|
170
|
+
// revert InvalidDistributionsInstance();
|
171
|
+
// }
|
172
|
+
// // TODO distribution have the same token
|
173
|
+
// // TODO distribution is not linked
|
114
174
|
}
|
115
175
|
|
116
176
|
function setFees(
|
@@ -7,25 +7,28 @@ 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
|
-
event
|
14
|
-
event
|
15
|
-
event LogRegistration(ObjectInfo info);
|
16
|
-
event LogServiceNameRegistration(string serviceName, VersionPart majorVersion);
|
14
|
+
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
15
|
+
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
17
16
|
|
18
|
-
//
|
19
|
-
error
|
20
|
-
error
|
17
|
+
// registerService()
|
18
|
+
error CallerNotReleaseManager();
|
19
|
+
error ServiceAlreadyRegistered(address service);
|
21
20
|
|
22
21
|
// register()
|
23
|
-
error
|
22
|
+
error CallerNotRegistryService();
|
23
|
+
error ServiceRegistration();
|
24
|
+
|
25
|
+
// registerWithCustomTypes()
|
26
|
+
error CoreTypeRegistration();
|
27
|
+
|
28
|
+
// _register()
|
24
29
|
error ZeroParentAddress();
|
25
30
|
error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
|
26
31
|
error ContractAlreadyRegistered(address objectAddress);
|
27
|
-
error InvalidServiceVersion(VersionPart majorVersion);
|
28
|
-
error ServiceNameAlreadyRegistered(string name, VersionPart majorVersion);
|
29
32
|
|
30
33
|
struct ObjectInfo {
|
31
34
|
NftId nftId;
|
@@ -38,15 +41,29 @@ interface IRegistry is IERC165 {
|
|
38
41
|
}// TODO delete nftId and initialOwner(if not used) from struct
|
39
42
|
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
40
43
|
|
41
|
-
|
44
|
+
struct ReleaseInfo {
|
45
|
+
ObjectType[] domains;
|
46
|
+
Timestamp createdAt;
|
47
|
+
//Timestamp updatedAt;
|
48
|
+
}
|
49
|
+
|
50
|
+
function registerService(
|
51
|
+
ObjectInfo memory serviceInfo,
|
52
|
+
VersionPart serviceVersion,
|
53
|
+
ObjectType serviceDomain
|
54
|
+
) external returns(NftId nftId);
|
42
55
|
|
43
56
|
function register(ObjectInfo memory info) external returns (NftId nftId);
|
44
57
|
|
45
|
-
function
|
58
|
+
function registerWithCustomType(ObjectInfo memory info) external returns (NftId nftId);
|
59
|
+
|
60
|
+
function getInitialVersion() external view returns (VersionPart);
|
61
|
+
|
62
|
+
function getNextVersion() external view returns (VersionPart);
|
46
63
|
|
47
|
-
function
|
64
|
+
function getLatestVersion() external view returns (VersionPart);
|
48
65
|
|
49
|
-
function
|
66
|
+
function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
|
50
67
|
|
51
68
|
function getObjectCount() external view returns (uint256);
|
52
69
|
|
@@ -68,11 +85,11 @@ interface IRegistry is IERC165 {
|
|
68
85
|
|
69
86
|
function isRegisteredService(address contractAddress) external view returns (bool);
|
70
87
|
|
71
|
-
function
|
88
|
+
function isValidRelease(VersionPart version) external view returns (bool);
|
72
89
|
|
73
90
|
function getServiceAddress(
|
74
|
-
|
75
|
-
VersionPart
|
91
|
+
ObjectType serviceDomain,
|
92
|
+
VersionPart releaseVersion
|
76
93
|
) external view returns (address serviceAddress);
|
77
94
|
|
78
95
|
function getChainNft() external view returns (ChainNft);
|