@etherisc/gif-next 0.0.2-c96f882-016 → 0.0.2-ca84135-795
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +63 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/{instance/service/IComponentOwnerService.sol/IComponentOwnerService.json → components/Component.sol/Component.json} +210 -178
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +171 -90
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → components/IComponent.sol/IComponent.json} +133 -162
- 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/IPoolComponent.sol/IPoolComponent.json +28 -2
- 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 +203 -119
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +183 -146
- 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/Dummy.sol/LifeCycleModule.json +2 -2
- 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/SM.sol/SM.json +2 -2
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +764 -0
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/{AccessManagedSimple.sol/AccessManagedSimple.json → Cloneable.sol/Cloneable.json} +74 -3
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1649 -28
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +619 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +104 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +155 -662
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +243 -126
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +763 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +164 -66
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +275 -74
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +52 -24
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +261 -0
- 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} +125 -11
- 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/KeyValueStore.sol/KeyValueStore.json +2 -2
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +1094 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +436 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +764 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +424 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +720 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +13 -13
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +771 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +15 -77
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +25 -240
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +1219 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +492 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +798 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +424 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +848 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +424 -0
- 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 +146 -229
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +195 -86
- 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 +159 -316
- 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 +38 -112
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -95
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +530 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +397 -0
- 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/ERC165.sol/ERC165.json +2 -2
- 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/IService.sol/IService.json +13 -13
- 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 +4 -4
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +13 -13
- 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 +4 -4
- 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 +31 -31
- 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/NftIdSet.sol/LibNftIdSet.json +26 -3
- 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/StateId.sol/StateIdLib.json +2 -2
- 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 +17 -29
- package/contracts/components/IComponent.sol +37 -0
- package/contracts/components/IDistributionComponent.sol +1 -0
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/IProductComponent.sol +2 -2
- package/contracts/components/Pool.sol +46 -47
- package/contracts/components/Product.sol +57 -59
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +23 -0
- package/contracts/instance/BundleManager.sol +125 -0
- package/contracts/instance/Cloneable.sol +46 -0
- package/contracts/instance/IInstance.sol +43 -9
- package/contracts/instance/IInstanceBase.sol +27 -0
- package/contracts/instance/IInstanceService.sol +14 -4
- package/contracts/instance/Instance.sol +54 -237
- package/contracts/instance/InstanceAccessManager.sol +93 -78
- package/contracts/instance/InstanceBase.sol +38 -0
- package/contracts/instance/InstanceReader.sol +29 -26
- package/contracts/instance/InstanceService.sol +301 -77
- package/contracts/instance/InstanceServiceManager.sol +10 -12
- package/contracts/instance/ObjectManager.sol +84 -0
- 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/module/IBundle.sol +1 -0
- package/contracts/instance/module/ISetup.sol +3 -0
- package/contracts/instance/service/BundleService.sol +293 -0
- package/contracts/instance/service/BundleServiceManager.sol +51 -0
- package/contracts/instance/service/DistributionService.sol +115 -0
- package/contracts/instance/service/DistributionServiceManager.sol +51 -0
- package/contracts/instance/service/IBundleService.sol +44 -0
- package/contracts/instance/service/IPolicyService.sol +94 -0
- package/contracts/instance/service/IPoolService.sol +6 -23
- package/contracts/instance/service/IProductService.sol +6 -73
- package/contracts/instance/service/PolicyService.sol +538 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +142 -0
- package/contracts/instance/service/PoolServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +241 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +30 -29
- package/contracts/registry/IRegistryService.sol +36 -14
- package/contracts/registry/Registry.sol +163 -239
- package/contracts/registry/RegistryAccessManager.sol +210 -0
- package/contracts/registry/RegistryService.sol +86 -218
- package/contracts/registry/RegistryServiceManager.sol +20 -22
- package/contracts/registry/ReleaseManager.sol +342 -0
- package/contracts/registry/TokenRegistry.sol +110 -0
- package/contracts/shared/ERC165.sol +6 -2
- package/contracts/shared/IRegisterable.sol +0 -2
- package/contracts/shared/IService.sol +2 -1
- package/contracts/shared/NftOwnable.sol +4 -4
- package/contracts/shared/ProxyManager.sol +1 -1
- package/contracts/shared/Registerable.sol +1 -0
- package/contracts/shared/Service.sol +14 -8
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +14 -6
- package/contracts/types/StateId.sol +4 -0
- package/package.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -314
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -267
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +0 -1132
- 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 -827
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/contracts/components/BaseComponent.sol +0 -86
- package/contracts/components/IBaseComponent.sol +0 -24
- package/contracts/instance/AccessManagedSimple.sol +0 -122
- package/contracts/instance/AccessManagerSimple.sol +0 -692
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/base/ComponentServiceBase.sol +0 -49
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -4,17 +4,16 @@ 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 {
|
8
|
-
import {IProductService} from "../instance/service/IProductService.sol";
|
7
|
+
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
9
8
|
import {IProductComponent} from "./IProductComponent.sol";
|
10
|
-
import {NftId,
|
11
|
-
import {
|
9
|
+
import {NftId, NftIdLib} from "../types/NftId.sol";
|
10
|
+
import {PRODUCT} from "../types/ObjectType.sol";
|
12
11
|
import {ReferralId} from "../types/Referral.sol";
|
13
12
|
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
14
13
|
import {StateId} from "../types/StateId.sol";
|
15
14
|
import {Timestamp} from "../types/Timestamp.sol";
|
16
|
-
import {Fee
|
17
|
-
import {
|
15
|
+
import {Fee} from "../types/Fee.sol";
|
16
|
+
import {Component} from "./Component.sol";
|
18
17
|
|
19
18
|
import {IRegistry} from "../registry/IRegistry.sol";
|
20
19
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
@@ -24,17 +23,17 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
24
23
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
25
24
|
import {ISetup} from "../instance/module/ISetup.sol";
|
26
25
|
import {Pool} from "../components/Pool.sol";
|
26
|
+
import {Distribution} from "../components/Distribution.sol";
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
contract Product is BaseComponent, IProductComponent {
|
28
|
+
abstract contract Product is Component, IProductComponent {
|
31
29
|
using NftIdLib for NftId;
|
32
30
|
|
33
|
-
|
31
|
+
IPolicyService internal _policyService;
|
34
32
|
Pool internal _pool;
|
35
|
-
|
33
|
+
Distribution internal _distribution;
|
36
34
|
Fee internal _initialProductFee;
|
37
35
|
Fee internal _initialProcessingFee;
|
36
|
+
TokenHandler internal _tokenHandler;
|
38
37
|
|
39
38
|
NftId internal _poolNftId;
|
40
39
|
NftId internal _distributionNftId;
|
@@ -49,17 +48,18 @@ contract Product is BaseComponent, IProductComponent {
|
|
49
48
|
Fee memory productFee,
|
50
49
|
Fee memory processingFee,
|
51
50
|
address initialOwner
|
52
|
-
)
|
51
|
+
) Component(registry, instanceNftid, token, PRODUCT(), isInterceptor, initialOwner) {
|
53
52
|
// TODO add validation
|
54
|
-
|
55
|
-
// _productService = _instance.getProductService();
|
53
|
+
_policyService = _instance.getPolicyService();
|
56
54
|
_pool = Pool(pool);
|
57
|
-
_distribution = distribution;
|
55
|
+
_distribution = Distribution(distribution);
|
58
56
|
_initialProductFee = productFee;
|
59
57
|
_initialProcessingFee = processingFee;
|
60
58
|
|
59
|
+
_tokenHandler = new TokenHandler(token);
|
60
|
+
|
61
61
|
_poolNftId = getRegistry().getNftId(address(_pool));
|
62
|
-
_distributionNftId = getRegistry().getNftId(_distribution);
|
62
|
+
_distributionNftId = getRegistry().getNftId(address(_distribution));
|
63
63
|
|
64
64
|
_registerInterface(type(IProductComponent).interfaceId);
|
65
65
|
}
|
@@ -70,15 +70,15 @@ contract Product is BaseComponent, IProductComponent {
|
|
70
70
|
RiskId riskId,
|
71
71
|
uint256 lifetime,
|
72
72
|
bytes memory applicationData,
|
73
|
-
|
74
|
-
|
73
|
+
NftId bundleNftId,
|
74
|
+
ReferralId referralId
|
75
75
|
)
|
76
76
|
external
|
77
77
|
view
|
78
78
|
override
|
79
79
|
returns (uint256 premiumAmount)
|
80
80
|
{
|
81
|
-
(premiumAmount,,,,) =
|
81
|
+
(premiumAmount,,,,) = _policyService.calculatePremium(
|
82
82
|
riskId,
|
83
83
|
sumInsuredAmount,
|
84
84
|
lifetime,
|
@@ -118,13 +118,13 @@ contract Product is BaseComponent, IProductComponent {
|
|
118
118
|
);
|
119
119
|
}
|
120
120
|
|
121
|
-
function
|
121
|
+
function _updateRisk(
|
122
122
|
RiskId id,
|
123
|
-
|
123
|
+
bytes memory data
|
124
124
|
) internal {
|
125
|
-
_productService.
|
125
|
+
_productService.updateRisk(
|
126
126
|
id,
|
127
|
-
|
127
|
+
data
|
128
128
|
);
|
129
129
|
}
|
130
130
|
|
@@ -151,7 +151,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
151
151
|
NftId bundleNftId,
|
152
152
|
ReferralId referralId
|
153
153
|
) internal returns (NftId nftId) {
|
154
|
-
nftId =
|
154
|
+
nftId = _policyService.createApplication(
|
155
155
|
applicationOwner,
|
156
156
|
riskId,
|
157
157
|
sumInsuredAmount,
|
@@ -169,7 +169,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
169
169
|
)
|
170
170
|
internal
|
171
171
|
{
|
172
|
-
|
172
|
+
_policyService.underwrite(
|
173
173
|
policyNftId,
|
174
174
|
requirePremiumPayment,
|
175
175
|
activateAt);
|
@@ -181,7 +181,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
181
181
|
)
|
182
182
|
internal
|
183
183
|
{
|
184
|
-
|
184
|
+
_policyService.collectPremium(
|
185
185
|
policyNftId,
|
186
186
|
activateAt);
|
187
187
|
}
|
@@ -192,17 +192,25 @@ contract Product is BaseComponent, IProductComponent {
|
|
192
192
|
)
|
193
193
|
internal
|
194
194
|
{
|
195
|
-
|
195
|
+
_policyService.activate(
|
196
196
|
policyNftId,
|
197
197
|
activateAt);
|
198
198
|
}
|
199
199
|
|
200
|
+
function _close(
|
201
|
+
NftId policyNftId
|
202
|
+
)
|
203
|
+
internal
|
204
|
+
{
|
205
|
+
_policyService.close(policyNftId);
|
206
|
+
}
|
207
|
+
|
200
208
|
function getPoolNftId() external view override returns (NftId poolNftId) {
|
201
209
|
return getRegistry().getNftId(address(_pool));
|
202
210
|
}
|
203
211
|
|
204
212
|
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
205
|
-
return getRegistry().getNftId(_distribution);
|
213
|
+
return getRegistry().getNftId(address(_distribution));
|
206
214
|
}
|
207
215
|
|
208
216
|
// from product component
|
@@ -218,28 +226,12 @@ contract Product is BaseComponent, IProductComponent {
|
|
218
226
|
}
|
219
227
|
|
220
228
|
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
221
|
-
if (getNftId().eq(zeroNftId())) {
|
222
|
-
return ISetup.ProductSetupInfo(
|
223
|
-
_token,
|
224
|
-
TokenHandler(address(0)),
|
225
|
-
_distributionNftId,
|
226
|
-
_poolNftId,
|
227
|
-
FeeLib.zeroFee(), //_instance.getDistributionFee(_distributionNftId)
|
228
|
-
_initialProductFee,
|
229
|
-
_initialProcessingFee,
|
230
|
-
FeeLib.zeroFee(), //_instance.getPoolFee(_poolNftId)
|
231
|
-
FeeLib.zeroFee(), //_instance.getStakingFee(_poolNftId)
|
232
|
-
FeeLib.zeroFee() //_instance.getPerformanceFee(_poolNftId)
|
233
|
-
);
|
234
|
-
}
|
235
|
-
|
236
229
|
InstanceReader reader = _instance.getInstanceReader();
|
237
230
|
return reader.getProductSetupInfo(getNftId());
|
238
231
|
}
|
239
232
|
|
240
233
|
// from IRegisterable
|
241
234
|
|
242
|
-
// TODO used only once, occupies space
|
243
235
|
function getInitialInfo()
|
244
236
|
public
|
245
237
|
view
|
@@ -251,7 +243,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
251
243
|
IRegistry.ObjectInfo memory productInfo,
|
252
244
|
bytes memory data
|
253
245
|
) = super.getInitialInfo();
|
254
|
-
|
246
|
+
|
255
247
|
// TODO read pool & distribution fees
|
256
248
|
// 1) from pool -> the only option -> pool must be registered first?
|
257
249
|
// 2) from instance -> all fees are set into instance at product registration which is ongoing here
|
@@ -261,35 +253,41 @@ contract Product is BaseComponent, IProductComponent {
|
|
261
253
|
|
262
254
|
// from PoolComponent
|
263
255
|
(
|
264
|
-
|
256
|
+
,
|
265
257
|
bytes memory poolData
|
266
258
|
) = _pool.getInitialInfo();
|
259
|
+
|
260
|
+
(
|
261
|
+
, ISetup.PoolSetupInfo memory poolSetupInfo
|
262
|
+
) = abi.decode(poolData, (string, ISetup.PoolSetupInfo));
|
267
263
|
|
264
|
+
// from DistributionComponent
|
268
265
|
(
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
Fee memory initialPoolFee,
|
273
|
-
Fee memory initialStakingFee,
|
274
|
-
Fee memory initialPerformanceFee
|
275
|
-
) = abi.decode(poolData, (ISetup.PoolSetupInfo, address, IERC20Metadata, Fee, Fee, Fee));
|
266
|
+
,
|
267
|
+
bytes memory distributionData
|
268
|
+
) = _distribution.getInitialInfo();
|
276
269
|
|
277
|
-
|
270
|
+
(
|
271
|
+
, ISetup.DistributionSetupInfo memory distributionSetupInfo
|
272
|
+
) = abi.decode(distributionData, (string, ISetup.DistributionSetupInfo));
|
278
273
|
|
279
274
|
return (
|
280
275
|
productInfo,
|
281
276
|
abi.encode(
|
277
|
+
getName(),
|
282
278
|
ISetup.ProductSetupInfo(
|
283
279
|
_token,
|
284
|
-
|
280
|
+
_tokenHandler,
|
285
281
|
_distributionNftId,
|
286
282
|
_poolNftId,
|
287
|
-
|
283
|
+
distributionSetupInfo.distributionFee,
|
288
284
|
_initialProductFee,
|
289
285
|
_initialProcessingFee,
|
290
|
-
|
291
|
-
|
292
|
-
|
286
|
+
poolSetupInfo.poolFee,
|
287
|
+
poolSetupInfo.stakingFee,
|
288
|
+
poolSetupInfo.performanceFee,
|
289
|
+
false,
|
290
|
+
_wallet
|
293
291
|
)
|
294
292
|
)
|
295
293
|
);
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
5
|
+
|
6
|
+
|
7
|
+
contract AccessManagerUpgradeableInitializeable is AccessManagerUpgradeable {
|
8
|
+
|
9
|
+
bool private _initialized;
|
10
|
+
|
11
|
+
function __AccessManagerUpgradeableInitializeable_init(address initialAdmin) public {
|
12
|
+
require(!_initialized, "AccessManager: already initialized");
|
13
|
+
|
14
|
+
if (initialAdmin == address(0)) {
|
15
|
+
revert AccessManagerInvalidInitialAdmin(address(0));
|
16
|
+
}
|
17
|
+
|
18
|
+
// admin is active immediately and without any execution delay.
|
19
|
+
_grantRole(ADMIN_ROLE, initialAdmin, 0, 0);
|
20
|
+
_initialized = true;
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IInstance} from "./IInstance.sol";
|
5
|
+
import {INSTANCE} from "../types/ObjectType.sol";
|
6
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
7
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
+
import {LibNftIdSet} from "../types/NftIdSet.sol";
|
10
|
+
import {NftId} from "../types/NftId.sol";
|
11
|
+
import {TimestampLib} from "../types/Timestamp.sol";
|
12
|
+
|
13
|
+
import {ObjectManager} from "./ObjectManager.sol";
|
14
|
+
|
15
|
+
contract BundleManager is
|
16
|
+
ObjectManager
|
17
|
+
{
|
18
|
+
|
19
|
+
event LogBundleManagerPolicyLinked(NftId bundleNftId, NftId policyNftId);
|
20
|
+
event LogBundleManagerPolicyUnlinked(NftId bundleNftId, NftId policyNftId);
|
21
|
+
|
22
|
+
event LogBundleManagerBundleAdded(NftId poolNftId, NftId bundleNftId);
|
23
|
+
event LogBundleManagerBundleUnlocked(NftId poolNftId, NftId bundleNftId);
|
24
|
+
event LogBundleManagerBundleLocked(NftId poolNftId, NftId bundleNftId);
|
25
|
+
|
26
|
+
error ErrorBundleManagerErrorPolicyAlreadyActivated(NftId policyNftId);
|
27
|
+
error ErrorBundleManagerErrorBundleLocked(NftId bundleNftId, NftId policyNftId);
|
28
|
+
error ErrorBundleManagerPolicyWithOpenClaims(NftId policyNftId, uint256 openClaimsCount);
|
29
|
+
error ErrorBundleManagerPolicyNotCloseable(NftId policyNftId);
|
30
|
+
error ErrorBundleManagerBundleUnknown(NftId bundleNftId);
|
31
|
+
error ErrorBundleManagerBundleNotRegistered(NftId bundleNftId);
|
32
|
+
|
33
|
+
mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
|
34
|
+
|
35
|
+
/// @dev links a policy with its bundle
|
36
|
+
// to link a policy it MUST NOT yet have been activated
|
37
|
+
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
38
|
+
function linkPolicy(NftId policyNftId) external restricted() {
|
39
|
+
NftId bundleNftId = _instance.getInstanceReader().getPolicyInfo(policyNftId).bundleNftId;
|
40
|
+
// decision will likely depend on the decision what to check here and what in the service
|
41
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
42
|
+
|
43
|
+
// ensure bundle is unlocked (in active set) and registered with this instance
|
44
|
+
if (!_isActive(poolNftId, bundleNftId)) {
|
45
|
+
revert ErrorBundleManagerErrorBundleLocked(bundleNftId, policyNftId);
|
46
|
+
}
|
47
|
+
|
48
|
+
LibNftIdSet.add(_activePolicies[bundleNftId], policyNftId);
|
49
|
+
emit LogBundleManagerPolicyLinked(bundleNftId, policyNftId);
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
/// @dev unlinks a policy from its bundle
|
54
|
+
// to unlink a policy it must closable, ie. meet one of the following criterias
|
55
|
+
// - the policy MUST be past its expiry period and it MUST NOT have any open claims
|
56
|
+
// - the policy's payoutAmount MUST be equal to its sumInsuredAmount and MUST NOT have any open claims
|
57
|
+
function unlinkPolicy(NftId policyNftId) external restricted() {
|
58
|
+
IPolicy.PolicyInfo memory policyInfo = _instance.getInstanceReader().getPolicyInfo(policyNftId);
|
59
|
+
|
60
|
+
NftId bundleNftId = policyInfo.bundleNftId;
|
61
|
+
// decision will likely depend on the decision what to check here and what in the service
|
62
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
63
|
+
|
64
|
+
// ensure bundle is registered with this instance
|
65
|
+
if (!_contains(poolNftId, bundleNftId)) {
|
66
|
+
revert ErrorBundleManagerBundleUnknown(bundleNftId);
|
67
|
+
}
|
68
|
+
|
69
|
+
LibNftIdSet.remove(_activePolicies[bundleNftId], policyNftId);
|
70
|
+
emit LogBundleManagerPolicyUnlinked(policyInfo.bundleNftId, policyNftId);
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
/// @dev add a new bundle to a riskpool registerd with this instance
|
75
|
+
// the corresponding pool is fetched via instance reader
|
76
|
+
function add(NftId bundleNftId) external restricted() {
|
77
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
78
|
+
|
79
|
+
// ensure pool is registered with instance
|
80
|
+
if(poolNftId.eqz()) {
|
81
|
+
revert ErrorBundleManagerBundleNotRegistered(bundleNftId);
|
82
|
+
}
|
83
|
+
|
84
|
+
_add(poolNftId, bundleNftId);
|
85
|
+
emit LogBundleManagerBundleAdded(poolNftId, bundleNftId);
|
86
|
+
}
|
87
|
+
|
88
|
+
/// @dev unlocked (active) bundles are available to underwrite new policies
|
89
|
+
function unlock(NftId bundleNftId) external restricted() {
|
90
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
91
|
+
_activate(poolNftId, bundleNftId);
|
92
|
+
emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
|
93
|
+
}
|
94
|
+
|
95
|
+
/// @dev locked (deactivated) bundles may not underwrite any new policies
|
96
|
+
function lock(NftId bundleNftId) external restricted() {
|
97
|
+
NftId poolNftId = _instance.getInstanceReader().getBundleInfo(bundleNftId).poolNftId;
|
98
|
+
_deactivate(poolNftId, bundleNftId);
|
99
|
+
emit LogBundleManagerBundleLocked(poolNftId, bundleNftId);
|
100
|
+
}
|
101
|
+
|
102
|
+
function bundles(NftId poolNftId) external view returns(uint256) {
|
103
|
+
return _objects(poolNftId);
|
104
|
+
}
|
105
|
+
|
106
|
+
function getBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
|
107
|
+
return _getObject(poolNftId, idx);
|
108
|
+
}
|
109
|
+
|
110
|
+
function activeBundles(NftId poolNftId) external view returns(uint256) {
|
111
|
+
return _activeObjs(poolNftId);
|
112
|
+
}
|
113
|
+
|
114
|
+
function getActiveBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
|
115
|
+
return _getActiveObject(poolNftId, idx);
|
116
|
+
}
|
117
|
+
|
118
|
+
function activePolicies(NftId bundleNftId) external view returns(uint256) {
|
119
|
+
return LibNftIdSet.size(_activePolicies[bundleNftId]);
|
120
|
+
}
|
121
|
+
|
122
|
+
function getActivePolicy(NftId bundleNftId, uint256 idx) external view returns(NftId policyNftId) {
|
123
|
+
return LibNftIdSet.getElementAt(_activePolicies[bundleNftId], idx);
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
6
|
+
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
8
|
+
|
9
|
+
abstract contract Cloneable is
|
10
|
+
AccessManagedUpgradeable
|
11
|
+
{
|
12
|
+
event CloneableInitialized(address authority, address registry);
|
13
|
+
|
14
|
+
error CloneableRegistryInvalid(address registry);
|
15
|
+
|
16
|
+
IRegistry internal _registry;
|
17
|
+
|
18
|
+
constructor() {
|
19
|
+
_registry = IRegistry(address(0));
|
20
|
+
}
|
21
|
+
|
22
|
+
/// @dev call to initialize MUST be made in the same transaction as cloning of the contract
|
23
|
+
function initialize(
|
24
|
+
address authority,
|
25
|
+
address registry
|
26
|
+
)
|
27
|
+
public
|
28
|
+
initializer
|
29
|
+
{
|
30
|
+
// check/handle access managed
|
31
|
+
__AccessManaged_init(authority);
|
32
|
+
|
33
|
+
// check/handle registry
|
34
|
+
if (registry.code.length == 0) {
|
35
|
+
revert CloneableRegistryInvalid(registry);
|
36
|
+
}
|
37
|
+
|
38
|
+
_registry = IRegistry(registry);
|
39
|
+
|
40
|
+
emit CloneableInitialized(authority, registry);
|
41
|
+
}
|
42
|
+
|
43
|
+
function getRegistry() external view returns (IRegistry) {
|
44
|
+
return _registry;
|
45
|
+
}
|
46
|
+
}
|
@@ -2,27 +2,61 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
6
|
|
7
|
+
import {BundleManager} from "./BundleManager.sol";
|
6
8
|
import {InstanceReader} from "./InstanceReader.sol";
|
7
9
|
|
8
|
-
import {
|
10
|
+
import {IInstanceBase} from "./IInstanceBase.sol";
|
11
|
+
|
12
|
+
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
9
13
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
10
14
|
import {IPoolService} from "./service/IPoolService.sol";
|
11
15
|
import {IProductService} from "./service/IProductService.sol";
|
16
|
+
import {IPolicyService} from "./service/IPolicyService.sol";
|
17
|
+
import {IBundleService} from "./service/IBundleService.sol";
|
18
|
+
import {IBundle} from "./module/IBundle.sol";
|
12
19
|
import {ISetup} from "./module/ISetup.sol";
|
13
20
|
import {NftId} from "../types/NftId.sol";
|
21
|
+
import {StateId} from "../types/StateId.sol";
|
22
|
+
import {RiskId} from "../types/RiskId.sol";
|
23
|
+
import {IRisk} from "./module/IRisk.sol";
|
24
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
25
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
14
26
|
|
15
|
-
interface IInstance is IERC165 {
|
16
27
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
28
|
+
interface IInstance is IInstanceBase, IAccessManaged {
|
29
|
+
|
30
|
+
function getDistributionService() external view returns (IDistributionService);
|
31
|
+
function getProductService() external view returns (IProductService);
|
32
|
+
function getPoolService() external view returns (IPoolService);
|
33
|
+
function getPolicyService() external view returns (IPolicyService);
|
34
|
+
function getBundleService() external view returns (IBundleService);
|
22
35
|
|
23
|
-
function createProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup) external;
|
24
36
|
function createDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup) external;
|
25
|
-
function
|
37
|
+
function updateDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup, StateId newState) external;
|
38
|
+
function updateDistributionSetupState(NftId distributionNftId, StateId newState) external;
|
39
|
+
|
40
|
+
function createPoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup) external;
|
41
|
+
function updatePoolSetup(NftId poolNftId, ISetup.PoolSetupInfo memory setup, StateId newState) external;
|
42
|
+
function updatePoolSetupState(NftId poolNftId, StateId newState) external;
|
43
|
+
|
44
|
+
function createBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle) external;
|
45
|
+
function updateBundle(NftId bundleNftId, IBundle.BundleInfo memory bundle, StateId newState) external;
|
46
|
+
function updateBundleState(NftId bundleNftId, StateId newState) external;
|
47
|
+
|
48
|
+
function createProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup) external;
|
49
|
+
function updateProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup, StateId newState) external;
|
50
|
+
function updateProductSetupState(NftId productNftId, StateId newState) external;
|
51
|
+
|
52
|
+
function createRisk(RiskId riskId, IRisk.RiskInfo memory risk) external;
|
53
|
+
function updateRisk(RiskId riskId, IRisk.RiskInfo memory risk, StateId newState) external;
|
54
|
+
function updateRiskState(RiskId riskId, StateId newState) external;
|
55
|
+
|
56
|
+
function createPolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy) external;
|
57
|
+
function updatePolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
|
58
|
+
function updatePolicyState(NftId policyNftId, StateId newState) external;
|
26
59
|
|
27
60
|
function getInstanceReader() external view returns (InstanceReader);
|
61
|
+
function getBundleManager() external view returns (BundleManager);
|
28
62
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
+
|
6
|
+
import {BundleManager} from "./BundleManager.sol";
|
7
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
8
|
+
|
9
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
10
|
+
import {IPoolService} from "./service/IPoolService.sol";
|
11
|
+
import {IProductService} from "./service/IProductService.sol";
|
12
|
+
import {IBundle} from "./module/IBundle.sol";
|
13
|
+
import {ISetup} from "./module/ISetup.sol";
|
14
|
+
import {NftId} from "../types/NftId.sol";
|
15
|
+
import {StateId} from "../types/StateId.sol";
|
16
|
+
import {RiskId} from "../types/RiskId.sol";
|
17
|
+
import {IRisk} from "./module/IRisk.sol";
|
18
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
19
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
20
|
+
|
21
|
+
import {IRegisterable} from "../shared/IRegisterable.sol";
|
22
|
+
|
23
|
+
|
24
|
+
interface IInstanceBase is IRegisterable, IKeyValueStore {
|
25
|
+
|
26
|
+
|
27
|
+
}
|
@@ -8,23 +8,33 @@ 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
|
+
import {BundleManager} from "./BundleManager.sol";
|
16
17
|
|
17
18
|
interface IInstanceService is IService {
|
18
19
|
|
20
|
+
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
21
|
+
error ErrorInstanceServiceNotInstanceOwner(address caller, NftId instanceNftId);
|
22
|
+
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
23
|
+
|
19
24
|
event LogInstanceCloned(address clonedAccessManagerAddress, address clonedInstanceAddress, address clonedInstanceReaderAddress, NftId clonedInstanceNftId);
|
20
25
|
|
21
26
|
function createInstanceClone()
|
22
27
|
external
|
23
28
|
returns (
|
24
|
-
|
29
|
+
InstanceAccessManager clonedAccessManager,
|
25
30
|
Instance clonedInstance,
|
26
31
|
NftId instanceNftId,
|
27
|
-
InstanceReader clonedInstanceReader
|
32
|
+
InstanceReader clonedInstanceReader,
|
33
|
+
BundleManager clonedBundleManager
|
28
34
|
);
|
35
|
+
|
36
|
+
function hasRole(address account, RoleId role, address instanceAddress) external returns (bool);
|
37
|
+
function setTargetLocked(string memory targetName, bool locked) external;
|
38
|
+
|
29
39
|
}
|
30
40
|
|