@etherisc/gif-next 0.0.2-ca9d515-311 → 0.0.2-cc18d4d-714
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/{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
@@ -1,29 +1,22 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {IProductService} from "../instance/service/IProductService.sol";
|
4
|
+
import {POOL} from "../types/ObjectType.sol";
|
6
5
|
import {IPoolService} from "../instance/service/IPoolService.sol";
|
7
6
|
import {IBundleService} from "../instance/service/IBundleService.sol";
|
8
|
-
import {NftId,
|
7
|
+
import {NftId, NftIdLib} from "../types/NftId.sol";
|
9
8
|
import {Fee} from "../types/Fee.sol";
|
10
9
|
import {UFixed} from "../types/UFixed.sol";
|
11
10
|
import {IPoolComponent} from "./IPoolComponent.sol";
|
12
|
-
import {
|
11
|
+
import {Component} from "./Component.sol";
|
13
12
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
14
13
|
import {ISetup} from "../instance/module/ISetup.sol";
|
15
14
|
|
16
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
17
|
-
|
18
|
-
// import {IPool} from "../instance/module/pool/IPoolModule.sol";
|
19
|
-
import {ITreasury} from "../instance/module/ITreasury.sol";
|
20
15
|
import {ISetup} from "../instance/module/ISetup.sol";
|
21
16
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
22
17
|
|
23
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
24
|
-
import {Registerable} from "../shared/Registerable.sol";
|
25
18
|
|
26
|
-
contract Pool is
|
19
|
+
abstract contract Pool is Component, IPoolComponent {
|
27
20
|
using NftIdLib for NftId;
|
28
21
|
|
29
22
|
bool internal _isConfirmingApplication;
|
@@ -37,10 +30,6 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
37
30
|
|
38
31
|
// may be used to interact with instance by derived contracts
|
39
32
|
IPoolService internal _poolService;
|
40
|
-
|
41
|
-
// only relevant to protect callback functions for "active" pools
|
42
|
-
IProductService private _productService;
|
43
|
-
|
44
33
|
IBundleService private _bundleService;
|
45
34
|
|
46
35
|
modifier onlyPoolService() {
|
@@ -50,16 +39,10 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
50
39
|
_;
|
51
40
|
}
|
52
41
|
|
53
|
-
modifier onlyProductService() {
|
54
|
-
require(
|
55
|
-
msg.sender == address(_productService),
|
56
|
-
"ERROR:POL-002:NOT_PRODUCT_SERVICE");
|
57
|
-
_;
|
58
|
-
}
|
59
|
-
|
60
42
|
constructor(
|
61
43
|
address registry,
|
62
44
|
NftId instanceNftId,
|
45
|
+
string memory name,
|
63
46
|
// TODO refactor into tokenNftId
|
64
47
|
address token,
|
65
48
|
bool isInterceptor,
|
@@ -68,10 +51,18 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
68
51
|
Fee memory poolFee,
|
69
52
|
Fee memory stakingFee,
|
70
53
|
Fee memory performanceFee,
|
71
|
-
address initialOwner
|
72
|
-
|
73
|
-
|
74
|
-
|
54
|
+
address initialOwner,
|
55
|
+
bytes memory data
|
56
|
+
) Component(
|
57
|
+
registry,
|
58
|
+
instanceNftId,
|
59
|
+
name,
|
60
|
+
token,
|
61
|
+
POOL(),
|
62
|
+
isInterceptor,
|
63
|
+
initialOwner,
|
64
|
+
data
|
65
|
+
) {
|
75
66
|
_isConfirmingApplication = isConfirmingApplication;
|
76
67
|
// TODO add validation
|
77
68
|
_collateralizationLevel = collateralizationLevel;
|
@@ -81,35 +72,12 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
81
72
|
|
82
73
|
_tokenHandler = new TokenHandler(token);
|
83
74
|
|
84
|
-
_poolService =
|
85
|
-
|
86
|
-
_bundleService = _instance.getBundleService();
|
75
|
+
_poolService = getInstance().getPoolService();
|
76
|
+
_bundleService = getInstance().getBundleService();
|
87
77
|
|
88
78
|
_registerInterface(type(IPoolComponent).interfaceId);
|
89
79
|
}
|
90
80
|
|
91
|
-
function createBundle(
|
92
|
-
Fee memory fee,
|
93
|
-
uint256 initialAmount,
|
94
|
-
uint256 lifetime,
|
95
|
-
bytes memory filter
|
96
|
-
)
|
97
|
-
external
|
98
|
-
virtual override
|
99
|
-
returns(NftId bundleNftId)
|
100
|
-
{
|
101
|
-
address owner = msg.sender;
|
102
|
-
bundleNftId = _bundleService.createBundle(
|
103
|
-
owner,
|
104
|
-
fee,
|
105
|
-
initialAmount,
|
106
|
-
lifetime,
|
107
|
-
filter
|
108
|
-
);
|
109
|
-
|
110
|
-
// TODO add logging
|
111
|
-
}
|
112
|
-
|
113
81
|
/**
|
114
82
|
* @dev see {IPool.underwrite}.
|
115
83
|
* Default implementation that only writes a {LogUnderwrittenByPool} entry.
|
@@ -121,7 +89,7 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
121
89
|
uint256 collateralizationAmount
|
122
90
|
)
|
123
91
|
external
|
124
|
-
|
92
|
+
restricted()
|
125
93
|
virtual override
|
126
94
|
{
|
127
95
|
_underwrite(policyNftId, policyData, bundleFilter, collateralizationAmount);
|
@@ -159,76 +127,45 @@ contract Pool is BaseComponent, IPoolComponent {
|
|
159
127
|
)
|
160
128
|
external
|
161
129
|
onlyOwner
|
130
|
+
restricted()
|
162
131
|
override
|
163
132
|
{
|
164
133
|
_poolService.setFees(poolFee, stakingFee, performanceFee);
|
165
134
|
}
|
166
135
|
|
167
|
-
function
|
168
|
-
NftId bundleNftId,
|
169
|
-
Fee memory fee
|
170
|
-
)
|
171
|
-
external
|
172
|
-
override
|
173
|
-
// TODO add onlyBundleOwner
|
174
|
-
{
|
136
|
+
function _setBundleFee(NftId bundleNftId, Fee memory fee) internal {
|
175
137
|
_bundleService.setBundleFee(bundleNftId, fee);
|
176
138
|
}
|
177
139
|
|
178
|
-
function
|
179
|
-
NftId bundleNftId
|
180
|
-
)
|
181
|
-
external
|
182
|
-
override
|
183
|
-
// TODO add onlyBundleOwner
|
184
|
-
{
|
140
|
+
function _lockBundle(NftId bundleNftId) internal {
|
185
141
|
_bundleService.lockBundle(bundleNftId);
|
186
142
|
}
|
187
143
|
|
188
|
-
function
|
189
|
-
NftId bundleNftId
|
190
|
-
)
|
191
|
-
external
|
192
|
-
override
|
193
|
-
// TODO add onlyBundleOwner
|
194
|
-
{
|
144
|
+
function _unlockBundle(NftId bundleNftId) internal {
|
195
145
|
_bundleService.unlockBundle(bundleNftId);
|
196
146
|
}
|
197
147
|
|
198
148
|
function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
|
199
|
-
InstanceReader reader =
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
abi.encode(
|
220
|
-
ISetup.PoolSetupInfo(
|
221
|
-
_productNftId,
|
222
|
-
_tokenHandler,
|
223
|
-
_collateralizationLevel,
|
224
|
-
_initialPoolFee,
|
225
|
-
_initialStakingFee,
|
226
|
-
_initialPerformanceFee,
|
227
|
-
false,
|
228
|
-
_isConfirmingApplication,
|
229
|
-
_wallet
|
230
|
-
)
|
231
|
-
)
|
149
|
+
InstanceReader reader = getInstance().getInstanceReader();
|
150
|
+
setupInfo = reader.getPoolSetupInfo(getNftId());
|
151
|
+
|
152
|
+
// fallback to initial setup info (wallet is always != address(0))
|
153
|
+
if(setupInfo.wallet == address(0)) {
|
154
|
+
setupInfo = _getInitialSetupInfo();
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
function _getInitialSetupInfo() internal view returns (ISetup.PoolSetupInfo memory) {
|
159
|
+
return ISetup.PoolSetupInfo(
|
160
|
+
getProductNftId(),
|
161
|
+
_tokenHandler,
|
162
|
+
_collateralizationLevel,
|
163
|
+
_initialPoolFee,
|
164
|
+
_initialStakingFee,
|
165
|
+
_initialPerformanceFee,
|
166
|
+
false,
|
167
|
+
_isConfirmingApplication,
|
168
|
+
getWallet()
|
232
169
|
);
|
233
170
|
}
|
234
171
|
|
@@ -4,22 +4,17 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
6
|
import {IRisk} from "../instance/module/IRisk.sol";
|
7
|
-
import {ITreasury} from "../instance/module/ITreasury.sol";
|
8
|
-
import {IProductService} from "../instance/service/IProductService.sol";
|
9
7
|
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
10
8
|
import {IProductComponent} from "./IProductComponent.sol";
|
11
|
-
import {NftId,
|
12
|
-
import {
|
9
|
+
import {NftId, NftIdLib} from "../types/NftId.sol";
|
10
|
+
import {PRODUCT} from "../types/ObjectType.sol";
|
13
11
|
import {ReferralId} from "../types/Referral.sol";
|
14
12
|
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
15
13
|
import {StateId} from "../types/StateId.sol";
|
16
14
|
import {Timestamp} from "../types/Timestamp.sol";
|
17
|
-
import {Fee
|
18
|
-
import {
|
15
|
+
import {Fee} from "../types/Fee.sol";
|
16
|
+
import {Component} from "./Component.sol";
|
19
17
|
|
20
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
21
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
22
|
-
import {Registerable} from "../shared/Registerable.sol";
|
23
18
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
24
19
|
|
25
20
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
@@ -27,12 +22,9 @@ import {ISetup} from "../instance/module/ISetup.sol";
|
|
27
22
|
import {Pool} from "../components/Pool.sol";
|
28
23
|
import {Distribution} from "../components/Distribution.sol";
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
contract Product is BaseComponent, IProductComponent {
|
25
|
+
abstract contract Product is Component, IProductComponent {
|
33
26
|
using NftIdLib for NftId;
|
34
27
|
|
35
|
-
IProductService internal _productService;
|
36
28
|
IPolicyService internal _policyService;
|
37
29
|
Pool internal _pool;
|
38
30
|
Distribution internal _distribution;
|
@@ -46,17 +38,27 @@ contract Product is BaseComponent, IProductComponent {
|
|
46
38
|
constructor(
|
47
39
|
address registry,
|
48
40
|
NftId instanceNftid,
|
41
|
+
string memory name,
|
49
42
|
address token,
|
50
43
|
bool isInterceptor,
|
51
44
|
address pool,
|
52
45
|
address distribution,
|
53
46
|
Fee memory productFee,
|
54
47
|
Fee memory processingFee,
|
55
|
-
address initialOwner
|
56
|
-
|
48
|
+
address initialOwner,
|
49
|
+
bytes memory data
|
50
|
+
) Component (
|
51
|
+
registry,
|
52
|
+
instanceNftid,
|
53
|
+
name,
|
54
|
+
token,
|
55
|
+
PRODUCT(),
|
56
|
+
isInterceptor,
|
57
|
+
initialOwner,
|
58
|
+
data
|
59
|
+
) {
|
57
60
|
// TODO add validation
|
58
|
-
|
59
|
-
_policyService = _instance.getPolicyService();
|
61
|
+
_policyService = getInstance().getPolicyService();
|
60
62
|
_pool = Pool(pool);
|
61
63
|
_distribution = Distribution(distribution);
|
62
64
|
_initialProductFee = productFee;
|
@@ -76,8 +78,8 @@ contract Product is BaseComponent, IProductComponent {
|
|
76
78
|
RiskId riskId,
|
77
79
|
uint256 lifetime,
|
78
80
|
bytes memory applicationData,
|
79
|
-
|
80
|
-
|
81
|
+
NftId bundleNftId,
|
82
|
+
ReferralId referralId
|
81
83
|
)
|
82
84
|
external
|
83
85
|
view
|
@@ -118,7 +120,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
118
120
|
RiskId id,
|
119
121
|
bytes memory data
|
120
122
|
) internal {
|
121
|
-
|
123
|
+
getProductService().createRisk(
|
122
124
|
id,
|
123
125
|
data
|
124
126
|
);
|
@@ -128,7 +130,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
128
130
|
RiskId id,
|
129
131
|
bytes memory data
|
130
132
|
) internal {
|
131
|
-
|
133
|
+
getProductService().updateRisk(
|
132
134
|
id,
|
133
135
|
data
|
134
136
|
);
|
@@ -138,14 +140,14 @@ contract Product is BaseComponent, IProductComponent {
|
|
138
140
|
RiskId id,
|
139
141
|
StateId state
|
140
142
|
) internal {
|
141
|
-
|
143
|
+
getProductService().updateRiskState(
|
142
144
|
id,
|
143
145
|
state
|
144
146
|
);
|
145
147
|
}
|
146
148
|
|
147
149
|
function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
|
148
|
-
return
|
150
|
+
return getInstance().getInstanceReader().getRiskInfo(id);
|
149
151
|
}
|
150
152
|
|
151
153
|
function _createApplication(
|
@@ -203,6 +205,14 @@ contract Product is BaseComponent, IProductComponent {
|
|
203
205
|
activateAt);
|
204
206
|
}
|
205
207
|
|
208
|
+
function _close(
|
209
|
+
NftId policyNftId
|
210
|
+
)
|
211
|
+
internal
|
212
|
+
{
|
213
|
+
_policyService.close(policyNftId);
|
214
|
+
}
|
215
|
+
|
206
216
|
function getPoolNftId() external view override returns (NftId poolNftId) {
|
207
217
|
return getRegistry().getNftId(address(_pool));
|
208
218
|
}
|
@@ -218,75 +228,39 @@ contract Product is BaseComponent, IProductComponent {
|
|
218
228
|
)
|
219
229
|
external
|
220
230
|
onlyOwner
|
231
|
+
restricted()
|
221
232
|
override
|
222
233
|
{
|
223
|
-
|
234
|
+
getProductService().setFees(productFee, processingFee);
|
224
235
|
}
|
225
236
|
|
226
237
|
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
227
|
-
InstanceReader reader =
|
228
|
-
|
229
|
-
}
|
238
|
+
InstanceReader reader = getInstance().getInstanceReader();
|
239
|
+
setupInfo = reader.getProductSetupInfo(getNftId());
|
230
240
|
|
231
|
-
|
241
|
+
// fallback to initial setup info (wallet is always != address(0))
|
242
|
+
if(setupInfo.wallet == address(0)) {
|
243
|
+
setupInfo = _getInitialSetupInfo();
|
244
|
+
}
|
245
|
+
}
|
232
246
|
|
233
|
-
function
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
//require(getRegistry().getObjectInfo(_distributionNftId).objectType == DISTRIBUTION(), "DISTRIBUTION_NOT_REGISTERED");
|
251
|
-
|
252
|
-
// from PoolComponent
|
253
|
-
(
|
254
|
-
,
|
255
|
-
bytes memory poolData
|
256
|
-
) = _pool.getInitialInfo();
|
257
|
-
|
258
|
-
(
|
259
|
-
ISetup.PoolSetupInfo memory poolSetupInfo
|
260
|
-
) = abi.decode(poolData, (ISetup.PoolSetupInfo));
|
261
|
-
|
262
|
-
// from DistributionComponent
|
263
|
-
(
|
264
|
-
,
|
265
|
-
bytes memory distributionData
|
266
|
-
) = _distribution.getInitialInfo();
|
267
|
-
|
268
|
-
(
|
269
|
-
ISetup.DistributionSetupInfo memory distributionSetupInfo
|
270
|
-
) = abi.decode(distributionData, (ISetup.DistributionSetupInfo));
|
271
|
-
|
272
|
-
return (
|
273
|
-
productInfo,
|
274
|
-
abi.encode(
|
275
|
-
ISetup.ProductSetupInfo(
|
276
|
-
_token,
|
277
|
-
_tokenHandler,
|
278
|
-
_distributionNftId,
|
279
|
-
_poolNftId,
|
280
|
-
distributionSetupInfo.distributionFee,
|
281
|
-
_initialProductFee,
|
282
|
-
_initialProcessingFee,
|
283
|
-
poolSetupInfo.poolFee,
|
284
|
-
poolSetupInfo.stakingFee,
|
285
|
-
poolSetupInfo.performanceFee,
|
286
|
-
false,
|
287
|
-
_wallet
|
288
|
-
)
|
289
|
-
)
|
247
|
+
function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
248
|
+
ISetup.DistributionSetupInfo memory distributionSetupInfo = _distribution.getSetupInfo();
|
249
|
+
ISetup.PoolSetupInfo memory poolSetupInfo = _pool.getSetupInfo();
|
250
|
+
|
251
|
+
return ISetup.ProductSetupInfo(
|
252
|
+
getToken(),
|
253
|
+
_tokenHandler,
|
254
|
+
_distributionNftId,
|
255
|
+
_poolNftId,
|
256
|
+
distributionSetupInfo.distributionFee,
|
257
|
+
_initialProductFee,
|
258
|
+
_initialProcessingFee,
|
259
|
+
poolSetupInfo.poolFee,
|
260
|
+
poolSetupInfo.stakingFee,
|
261
|
+
poolSetupInfo.performanceFee,
|
262
|
+
false,
|
263
|
+
getWallet()
|
290
264
|
);
|
291
265
|
}
|
292
266
|
}
|
@@ -32,17 +32,13 @@ contract BundleManager is
|
|
32
32
|
|
33
33
|
mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
|
34
34
|
|
35
|
-
constructor() ObjectManager() {
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
35
|
/// @dev links a policy with its bundle
|
40
36
|
// to link a policy it MUST NOT yet have been activated
|
41
37
|
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
42
38
|
function linkPolicy(NftId policyNftId) external restricted() {
|
43
|
-
NftId bundleNftId =
|
39
|
+
NftId bundleNftId = _instance.getInstanceReader().getPolicyInfo(policyNftId).bundleNftId;
|
44
40
|
// decision will likely depend on the decision what to check here and what in the service
|
45
|
-
NftId poolNftId =
|
41
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
46
42
|
|
47
43
|
// ensure bundle is unlocked (in active set) and registered with this instance
|
48
44
|
if (!_isActive(poolNftId, bundleNftId)) {
|
@@ -59,11 +55,11 @@ contract BundleManager is
|
|
59
55
|
// - the policy MUST be past its expiry period and it MUST NOT have any open claims
|
60
56
|
// - the policy's payoutAmount MUST be equal to its sumInsuredAmount and MUST NOT have any open claims
|
61
57
|
function unlinkPolicy(NftId policyNftId) external restricted() {
|
62
|
-
IPolicy.PolicyInfo memory policyInfo =
|
58
|
+
IPolicy.PolicyInfo memory policyInfo = _instance.getInstanceReader().getPolicyInfo(policyNftId);
|
63
59
|
|
64
60
|
NftId bundleNftId = policyInfo.bundleNftId;
|
65
61
|
// decision will likely depend on the decision what to check here and what in the service
|
66
|
-
NftId poolNftId =
|
62
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
67
63
|
|
68
64
|
// ensure bundle is registered with this instance
|
69
65
|
if (!_contains(poolNftId, bundleNftId)) {
|
@@ -78,7 +74,7 @@ contract BundleManager is
|
|
78
74
|
/// @dev add a new bundle to a riskpool registerd with this instance
|
79
75
|
// the corresponding pool is fetched via instance reader
|
80
76
|
function add(NftId bundleNftId) external restricted() {
|
81
|
-
NftId poolNftId =
|
77
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
82
78
|
|
83
79
|
// ensure pool is registered with instance
|
84
80
|
if(poolNftId.eqz()) {
|
@@ -91,14 +87,14 @@ contract BundleManager is
|
|
91
87
|
|
92
88
|
/// @dev unlocked (active) bundles are available to underwrite new policies
|
93
89
|
function unlock(NftId bundleNftId) external restricted() {
|
94
|
-
NftId poolNftId =
|
90
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
95
91
|
_activate(poolNftId, bundleNftId);
|
96
92
|
emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
|
97
93
|
}
|
98
94
|
|
99
95
|
/// @dev locked (deactivated) bundles may not underwrite any new policies
|
100
96
|
function lock(NftId bundleNftId) external restricted() {
|
101
|
-
NftId poolNftId =
|
97
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
102
98
|
_deactivate(poolNftId, bundleNftId);
|
103
99
|
emit LogBundleManagerBundleLocked(poolNftId, bundleNftId);
|
104
100
|
}
|
@@ -1,30 +1,41 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
|
+
import {NftId} from "../types/NftId.sol";
|
7
|
+
import {StateId} from "../types/StateId.sol";
|
8
|
+
import {RiskId} from "../types/RiskId.sol";
|
9
|
+
|
10
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
+
|
12
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
6
13
|
import {BundleManager} from "./BundleManager.sol";
|
7
14
|
import {InstanceReader} from "./InstanceReader.sol";
|
8
15
|
|
9
|
-
import {
|
16
|
+
import {IBundle} from "./module/IBundle.sol";
|
17
|
+
import {IBundleService} from "./service/IBundleService.sol";
|
10
18
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
19
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
20
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
21
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
22
|
+
import {IPolicyService} from "./service/IPolicyService.sol";
|
11
23
|
import {IPoolService} from "./service/IPoolService.sol";
|
12
24
|
import {IProductService} from "./service/IProductService.sol";
|
13
25
|
import {IPolicyService} from "./service/IPolicyService.sol";
|
14
26
|
import {IBundleService} from "./service/IBundleService.sol";
|
15
|
-
import {
|
27
|
+
import {IRisk} from "./module/IRisk.sol";
|
16
28
|
import {ISetup} from "./module/ISetup.sol";
|
17
29
|
import {NftId} from "../types/NftId.sol";
|
18
|
-
import {StateId} from "../types/StateId.sol";
|
19
30
|
import {RiskId} from "../types/RiskId.sol";
|
20
|
-
import {
|
21
|
-
import {
|
22
|
-
|
31
|
+
import {StateId} from "../types/StateId.sol";
|
32
|
+
import {VersionPart} from "../types/Version.sol";
|
33
|
+
|
34
|
+
|
23
35
|
|
24
36
|
|
25
|
-
interface IInstance is
|
37
|
+
interface IInstance is IRegisterable, IKeyValueStore, IAccessManaged {
|
26
38
|
|
27
|
-
function getComponentOwnerService() external view returns (IComponentOwnerService);
|
28
39
|
function getDistributionService() external view returns (IDistributionService);
|
29
40
|
function getProductService() external view returns (IProductService);
|
30
41
|
function getPoolService() external view returns (IPoolService);
|
@@ -55,6 +66,7 @@ interface IInstance is IERC165, IKeyValueStore {
|
|
55
66
|
function updatePolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
56
67
|
function updatePolicyState(NftId policyNftId, StateId newState) external;
|
57
68
|
|
69
|
+
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
58
70
|
function getInstanceReader() external view returns (InstanceReader);
|
59
71
|
function getBundleManager() external view returns (BundleManager);
|
60
72
|
}
|
@@ -8,25 +8,34 @@ import {IService} from "../shared/IService.sol";
|
|
8
8
|
import {IRegistry} from "../registry/IRegistry.sol";
|
9
9
|
|
10
10
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
-
import {
|
11
|
+
import {IComponent} from "../components/IComponent.sol";
|
12
12
|
|
13
|
-
import {
|
13
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
14
14
|
import {Instance} from "./Instance.sol";
|
15
15
|
import {InstanceReader} from "./InstanceReader.sol";
|
16
16
|
import {BundleManager} from "./BundleManager.sol";
|
17
17
|
|
18
18
|
interface IInstanceService is IService {
|
19
19
|
|
20
|
+
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
21
|
+
error ErrorInstanceServiceNotInstanceOwner(address caller, NftId instanceNftId);
|
22
|
+
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
23
|
+
error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType);
|
24
|
+
|
20
25
|
event LogInstanceCloned(address clonedAccessManagerAddress, address clonedInstanceAddress, address clonedInstanceReaderAddress, NftId clonedInstanceNftId);
|
21
26
|
|
22
27
|
function createInstanceClone()
|
23
28
|
external
|
24
29
|
returns (
|
25
|
-
|
30
|
+
InstanceAccessManager clonedAccessManager,
|
26
31
|
Instance clonedInstance,
|
27
32
|
NftId instanceNftId,
|
28
33
|
InstanceReader clonedInstanceReader,
|
29
34
|
BundleManager clonedBundleManager
|
30
35
|
);
|
36
|
+
|
37
|
+
function hasRole(address account, RoleId role, address instanceAddress) external returns (bool);
|
38
|
+
function setTargetLocked(string memory targetName, bool locked) external;
|
39
|
+
|
31
40
|
}
|
32
41
|
|