@etherisc/gif-next 0.0.2-dc7e4cb-141 → 0.0.2-de0a1d3-009
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/README.md +58 -11
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +405 -0
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +340 -0
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +131 -0
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +109 -18
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +194 -3
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +160 -21
- 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/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +709 -678
- package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +916 -717
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/{InstanceBase.sol/InstanceBase.json → base/ComponentServiceBase.sol/ComponentServiceBase.json} +102 -28
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +113 -0
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +560 -0
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/{module/lifecycle/ILifecycle.sol/ILifecycleModule.json → base/ILifecycle.sol/ILifecycle.json} +10 -77
- package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/instance/{service → base}/IService.sol/IService.json +58 -17
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.json +463 -0
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +710 -0
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +169 -0
- package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +4 -0
- package/artifacts/contracts/instance/{module/compensation/ICompensation.sol/ICompensation.json → base/ModuleBase.sol/ModuleBase.json} +2 -2
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/{service → base}/ServiceBase.sol/ServiceBase.json +88 -1
- package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +71 -50
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +71 -50
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +22 -93
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +22 -93
- package/artifacts/contracts/instance/module/distribution/DistributionModule.sol/DistributionModule.dbg.json +4 -0
- package/artifacts/contracts/instance/module/distribution/DistributionModule.sol/DistributionModule.json +10 -0
- package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{compensation/ICompensation.sol/ICompensationModule.json → distribution/IDistribution.sol/IDistribution.json} +2 -2
- package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistributionModule.dbg.json +4 -0
- package/artifacts/contracts/instance/module/distribution/IDistribution.sol/IDistributionModule.json +10 -0
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +61 -38
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +61 -38
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +1 -1
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -5
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -5
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +104 -1
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +126 -5
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +209 -231
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +1 -1
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +209 -231
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +145 -18
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +507 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +57 -16
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/{ComponentServiceBase.sol/ComponentServiceBase.json → IDistributionService.sol/IDistributionService.json} +91 -25
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +122 -17
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +210 -16
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +171 -12
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +303 -31
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryUpgradeable.sol/RegistryUpgradeable.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryUpgradeable.sol/RegistryUpgradeable.json +724 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +53 -12
- package/artifacts/contracts/shared/Proxy.sol/ProxyDeployer.dbg.json +4 -0
- package/artifacts/contracts/shared/Proxy.sol/ProxyDeployer.json +248 -0
- package/artifacts/contracts/shared/Proxy.sol/ProxyWithProxyAdminGetter.dbg.json +4 -0
- package/artifacts/contracts/shared/Proxy.sol/ProxyWithProxyAdminGetter.json +129 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +87 -0
- package/artifacts/contracts/shared/VersionableUpgradeable.sol/VersionableUpgradeable.dbg.json +4 -0
- package/artifacts/contracts/shared/VersionableUpgradeable.sol/VersionableUpgradeable.json +228 -0
- package/artifacts/contracts/test/TestDistribution.sol/TestDistribution.dbg.json +4 -0
- package/artifacts/contracts/test/TestDistribution.sol/TestDistribution.json +405 -0
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +1 -1
- package/artifacts/contracts/test/TestPool.sol/TestPool.json +194 -3
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +1 -1
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +209 -27
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +2 -2
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +38 -4
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +95 -8
- 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/TestVersion.sol/TestVersion.json +2 -2
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +95 -8
- 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/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +50 -11
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +111 -0
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +65 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/ReferralId.sol/ReferralIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ReferralId.sol/ReferralIdLib.json +99 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +30 -0
- 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/UFixedMathLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +40 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
- package/contracts/components/BaseComponent.sol +7 -2
- package/contracts/components/Distribution.sol +132 -0
- package/contracts/components/IDistributionComponent.sol +47 -0
- package/contracts/components/IPoolComponent.sol +14 -0
- package/contracts/components/IProductComponent.sol +24 -5
- package/contracts/components/Pool.sol +64 -3
- package/contracts/components/Product.sol +123 -13
- package/contracts/instance/IInstance.sol +14 -14
- package/contracts/instance/Instance.sol +20 -12
- package/contracts/instance/{service → base}/ComponentServiceBase.sol +1 -0
- package/contracts/instance/base/IInstanceBase.sol +22 -0
- package/contracts/instance/base/IKeyValueStore.sol +50 -0
- package/contracts/instance/base/ILifecycle.sol +30 -0
- package/contracts/instance/{InstanceBase.sol → base/InstanceBase.sol} +33 -13
- package/contracts/instance/base/KeyValueStore.sol +161 -0
- package/contracts/instance/{module/lifecycle/LifecycleModule.sol → base/Lifecycle.sol} +50 -39
- package/contracts/instance/base/ModuleBase.sol +57 -0
- package/contracts/instance/{service → base}/ServiceBase.sol +0 -2
- package/contracts/instance/module/access/Access.sol +6 -6
- package/contracts/instance/module/bundle/BundleModule.sol +24 -118
- package/contracts/instance/module/bundle/IBundle.sol +9 -9
- package/contracts/instance/module/component/ComponentModule.sol +27 -60
- package/contracts/instance/module/component/IComponent.sol +5 -30
- package/contracts/instance/module/distribution/DistributionModule.sol +17 -0
- package/contracts/instance/module/distribution/IDistribution.sol +10 -0
- package/contracts/instance/module/policy/IPolicy.sol +12 -9
- package/contracts/instance/module/policy/PolicyModule.sol +33 -26
- package/contracts/instance/module/pool/IPoolModule.sol +0 -1
- package/contracts/instance/module/pool/PoolModule.sol +12 -9
- package/contracts/instance/module/risk/IRisk.sol +18 -2
- package/contracts/instance/module/risk/RiskModule.sol +56 -2
- package/contracts/instance/module/treasury/ITreasury.sol +29 -50
- package/contracts/instance/module/treasury/TreasuryModule.sol +71 -85
- package/contracts/instance/service/ComponentOwnerService.sol +30 -44
- package/contracts/instance/service/DistributionService.sol +59 -0
- package/contracts/instance/service/IComponentOwnerService.sol +1 -1
- package/contracts/instance/service/IDistributionService.sol +12 -0
- package/contracts/instance/service/IPoolService.sol +8 -1
- package/contracts/instance/service/IProductService.sol +56 -7
- package/contracts/instance/service/PoolService.sol +31 -5
- package/contracts/instance/service/ProductService.sol +231 -77
- package/contracts/registry/Registry.sol +4 -4
- package/contracts/registry/RegistryUpgradeable.sol +473 -0
- package/contracts/shared/IVersionable.sol +17 -4
- package/contracts/shared/Proxy.sol +94 -0
- package/contracts/shared/Versionable.sol +13 -3
- package/contracts/shared/VersionableUpgradeable.sol +133 -0
- package/contracts/test/TestDistribution.sol +21 -0
- package/contracts/test/TestPool.sol +5 -2
- package/contracts/test/TestProduct.sol +35 -7
- package/contracts/test/TestRoleId.sol +2 -2
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Fee.sol +8 -3
- package/contracts/types/Key32.sol +45 -0
- package/contracts/types/NftId.sol +16 -1
- package/contracts/types/ObjectType.sol +24 -8
- package/contracts/types/ReferralId.sol +48 -0
- package/contracts/types/RiskId.sol +43 -0
- package/contracts/types/RoleId.sol +12 -10
- package/contracts/types/StateId.sol +7 -1
- package/contracts/types/Version.sol +8 -0
- package/package.json +1 -1
- package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.dbg.json +0 -4
- package/artifacts/contracts/instance/IServiceLinked.sol/IServiceLinked.json +0 -50
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +0 -10
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycle.json +0 -134
- package/artifacts/contracts/instance/module/lifecycle/ILifecycle.sol/ILifecycleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/lifecycle/LifecycleModule.sol/LifecycleModule.json +0 -221
- package/artifacts/contracts/instance/service/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IService.sol/IService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ServiceBase.sol/ServiceBase.dbg.json +0 -4
- package/contracts/instance/IServiceLinked.sol +0 -12
- package/contracts/instance/module/compensation/CompensationModule.sol +0 -8
- package/contracts/instance/module/compensation/ICompensation.sol +0 -10
- package/contracts/instance/module/lifecycle/ILifecycle.sol +0 -47
- /package/contracts/instance/{service → base}/IService.sol +0 -0
@@ -1,42 +1,138 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
+
import {IRisk} from "../instance/module/risk/IRisk.sol";
|
5
|
+
import {ITreasury} from "../instance/module/treasury/ITreasury.sol";
|
4
6
|
import {IProductService} from "../instance/service/IProductService.sol";
|
5
7
|
import {IProductComponent} from "./IProductComponent.sol";
|
6
8
|
import {NftId} from "../types/NftId.sol";
|
7
9
|
import {ObjectType, PRODUCT} from "../types/ObjectType.sol";
|
10
|
+
import {ReferralId} from "../types/ReferralId.sol";
|
11
|
+
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
12
|
+
import {StateId} from "../types/StateId.sol";
|
8
13
|
import {Timestamp} from "../types/Timestamp.sol";
|
9
14
|
import {Fee} from "../types/Fee.sol";
|
10
15
|
import {BaseComponent} from "./BaseComponent.sol";
|
11
16
|
|
12
17
|
contract Product is BaseComponent, IProductComponent {
|
13
|
-
IProductService
|
14
|
-
address
|
18
|
+
IProductService internal _productService;
|
19
|
+
address internal _pool;
|
20
|
+
address internal _distribution;
|
21
|
+
Fee internal _initialProductFee;
|
22
|
+
Fee internal _initialProcessingFee;
|
15
23
|
|
16
24
|
constructor(
|
17
25
|
address registry,
|
18
26
|
NftId instanceNftid,
|
19
27
|
address token,
|
20
|
-
address pool
|
28
|
+
address pool,
|
29
|
+
address distribution,
|
30
|
+
Fee memory productFee,
|
31
|
+
Fee memory processingFee
|
21
32
|
) BaseComponent(registry, instanceNftid, token) {
|
22
33
|
// TODO add validation
|
23
34
|
_productService = _instance.getProductService();
|
24
35
|
_pool = pool;
|
36
|
+
_distribution = distribution;
|
37
|
+
_initialProductFee = productFee;
|
38
|
+
_initialProcessingFee = processingFee;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
function calculatePremium(
|
43
|
+
uint256 sumInsuredAmount,
|
44
|
+
RiskId riskId,
|
45
|
+
uint256 lifetime,
|
46
|
+
bytes memory applicationData,
|
47
|
+
ReferralId referralId,
|
48
|
+
NftId bundleNftId
|
49
|
+
)
|
50
|
+
external
|
51
|
+
view
|
52
|
+
override
|
53
|
+
returns (uint256 premiumAmount)
|
54
|
+
{
|
55
|
+
(premiumAmount,,,,) = _productService.calculatePremium(
|
56
|
+
riskId,
|
57
|
+
sumInsuredAmount,
|
58
|
+
lifetime,
|
59
|
+
applicationData,
|
60
|
+
bundleNftId,
|
61
|
+
referralId
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
function calculateNetPremium(
|
67
|
+
uint256 sumInsuredAmount,
|
68
|
+
RiskId riskId,
|
69
|
+
uint256 lifetime,
|
70
|
+
bytes memory applicationData
|
71
|
+
)
|
72
|
+
external
|
73
|
+
view
|
74
|
+
virtual override
|
75
|
+
returns (uint256 netPremiumAmount)
|
76
|
+
{
|
77
|
+
// default 10% of sum insured
|
78
|
+
return sumInsuredAmount / 10;
|
79
|
+
}
|
80
|
+
|
81
|
+
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
82
|
+
return RiskIdLib.toRiskId(riskName);
|
83
|
+
}
|
84
|
+
|
85
|
+
function _createRisk(
|
86
|
+
RiskId id,
|
87
|
+
bytes memory data
|
88
|
+
) internal {
|
89
|
+
_productService.createRisk(
|
90
|
+
id,
|
91
|
+
data
|
92
|
+
);
|
93
|
+
}
|
94
|
+
|
95
|
+
function _setRiskInfo(
|
96
|
+
RiskId id,
|
97
|
+
IRisk.RiskInfo memory info
|
98
|
+
) internal {
|
99
|
+
_productService.setRiskInfo(
|
100
|
+
id,
|
101
|
+
info
|
102
|
+
);
|
103
|
+
}
|
104
|
+
|
105
|
+
function _updateRiskState(
|
106
|
+
RiskId id,
|
107
|
+
StateId state
|
108
|
+
) internal {
|
109
|
+
_productService.updateRiskState(
|
110
|
+
id,
|
111
|
+
state
|
112
|
+
);
|
113
|
+
}
|
114
|
+
|
115
|
+
function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
|
116
|
+
return _instance.getRiskInfo(id);
|
25
117
|
}
|
26
118
|
|
27
119
|
function _createApplication(
|
28
120
|
address applicationOwner,
|
121
|
+
RiskId riskId,
|
29
122
|
uint256 sumInsuredAmount,
|
30
|
-
uint256 premiumAmount,
|
31
123
|
uint256 lifetime,
|
32
|
-
|
124
|
+
bytes memory applicationData,
|
125
|
+
NftId bundleNftId,
|
126
|
+
ReferralId referralId
|
33
127
|
) internal returns (NftId nftId) {
|
34
128
|
nftId = _productService.createApplication(
|
35
129
|
applicationOwner,
|
130
|
+
riskId,
|
36
131
|
sumInsuredAmount,
|
37
|
-
premiumAmount,
|
38
132
|
lifetime,
|
39
|
-
|
133
|
+
applicationData,
|
134
|
+
bundleNftId,
|
135
|
+
referralId
|
40
136
|
);
|
41
137
|
}
|
42
138
|
|
@@ -79,26 +175,35 @@ contract Product is BaseComponent, IProductComponent {
|
|
79
175
|
return _registry.getNftId(_pool);
|
80
176
|
}
|
81
177
|
|
178
|
+
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
179
|
+
return _registry.getNftId(_distribution);
|
180
|
+
}
|
181
|
+
|
82
182
|
// from product component
|
83
183
|
function setFees(
|
84
|
-
Fee memory
|
184
|
+
Fee memory productFee,
|
85
185
|
Fee memory processingFee
|
86
186
|
)
|
87
187
|
external
|
88
188
|
onlyOwner
|
89
189
|
override
|
90
190
|
{
|
91
|
-
_productService.setFees(
|
191
|
+
_productService.setFees(productFee, processingFee);
|
92
192
|
}
|
93
193
|
|
94
194
|
|
95
|
-
function
|
195
|
+
function getProductFee()
|
96
196
|
external
|
97
197
|
view
|
98
198
|
override
|
99
|
-
returns (Fee memory
|
199
|
+
returns (Fee memory productFee)
|
100
200
|
{
|
101
|
-
|
201
|
+
NftId productNftId = getNftId();
|
202
|
+
if (_instance.hasTreasuryInfo(productNftId)) {
|
203
|
+
return _instance.getTreasuryInfo(productNftId).productFee;
|
204
|
+
} else {
|
205
|
+
return _initialProductFee;
|
206
|
+
}
|
102
207
|
}
|
103
208
|
|
104
209
|
function getProcessingFee()
|
@@ -107,7 +212,12 @@ contract Product is BaseComponent, IProductComponent {
|
|
107
212
|
override
|
108
213
|
returns (Fee memory processingFee)
|
109
214
|
{
|
110
|
-
|
215
|
+
NftId productNftId = getNftId();
|
216
|
+
if (_instance.hasTreasuryInfo(productNftId)) {
|
217
|
+
return _instance.getTreasuryInfo(productNftId).processingFee;
|
218
|
+
} else {
|
219
|
+
return _initialProcessingFee;
|
220
|
+
}
|
111
221
|
}
|
112
222
|
|
113
223
|
// from registerable
|
@@ -3,7 +3,6 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
|
7
6
|
import {IVersionable} from "../shared/IVersionable.sol";
|
8
7
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
9
8
|
import {IOwnable} from "../shared/IOwnable.sol";
|
@@ -11,21 +10,21 @@ import {RoleId} from "../types/RoleId.sol";
|
|
11
10
|
|
12
11
|
import {IAccessModule} from "./module/access/IAccess.sol";
|
13
12
|
import {IBundleModule} from "./module/bundle/IBundle.sol";
|
14
|
-
import {
|
15
|
-
import {ILifecycleModule} from "./module/lifecycle/ILifecycle.sol";
|
13
|
+
import {IDistributionModule} from "./module/distribution/IDistribution.sol";
|
16
14
|
import {IComponentModule} from "./module/component/IComponent.sol";
|
17
15
|
import {IPolicyModule} from "./module/policy/IPolicy.sol";
|
18
16
|
import {IPoolModule} from "./module/pool/IPoolModule.sol";
|
19
17
|
import {IRiskModule} from "./module/risk/IRisk.sol";
|
20
18
|
import {ITreasuryModule} from "./module/treasury/ITreasury.sol";
|
21
19
|
|
20
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
22
21
|
import {IRegistry, IRegistryLinked} from "../registry/IRegistryLinked.sol";
|
23
|
-
import {IServiceLinked} from "./IServiceLinked.sol";
|
24
22
|
|
25
23
|
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
24
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
26
25
|
import {IProductService} from "./service/IProductService.sol";
|
27
26
|
import {IPoolService} from "./service/IPoolService.sol";
|
28
|
-
|
27
|
+
import {IInstanceBase} from "./base/IInstanceBase.sol";
|
29
28
|
|
30
29
|
// solhint-disable-next-line no-empty-blocks
|
31
30
|
interface IInstance is
|
@@ -33,21 +32,22 @@ interface IInstance is
|
|
33
32
|
IVersionable,
|
34
33
|
IRegisterable,
|
35
34
|
IAccessModule,
|
36
|
-
ILifecycleModule,
|
37
35
|
IPolicyModule,
|
38
36
|
IPoolModule,
|
37
|
+
IRiskModule,
|
39
38
|
IBundleModule,
|
40
39
|
IComponentModule,
|
41
40
|
ITreasuryModule,
|
42
|
-
|
43
|
-
|
41
|
+
IDistributionModule,
|
42
|
+
IInstanceBase
|
44
43
|
{
|
45
|
-
function getRegistry() external view override (
|
46
|
-
function
|
44
|
+
function getRegistry() external view override (IPolicyModule, IRegisterable) returns (IRegistry registry);
|
45
|
+
function getOwner() external view override (IOwnable, IAccessModule) returns(address owner);
|
47
46
|
|
48
|
-
function
|
49
|
-
function
|
50
|
-
function
|
47
|
+
function getKeyValueStore() external view override (IInstanceBase) returns (IKeyValueStore keyValueStore);
|
48
|
+
function getComponentOwnerService() external view override (IInstanceBase, IComponentModule) returns(IComponentOwnerService);
|
49
|
+
function getDistributionService() external view override returns(IDistributionService);
|
50
|
+
function getProductService() external view override (IInstanceBase, IBundleModule, IPolicyModule) returns(IProductService);
|
51
|
+
function getPoolService() external view override (IInstanceBase, IBundleModule, IPoolModule) returns(IPoolService);
|
51
52
|
|
52
|
-
function getOwner() external view override (IOwnable, IAccessModule) returns(address owner);
|
53
53
|
}
|
@@ -4,11 +4,10 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {NftId} from "../types/NftId.sol";
|
5
5
|
import {RoleId} from "../types/RoleId.sol";
|
6
6
|
|
7
|
-
import {InstanceBase} from "./InstanceBase.sol";
|
7
|
+
import {InstanceBase} from "./base/InstanceBase.sol";
|
8
8
|
import {AccessModule} from "./module/access/Access.sol";
|
9
|
-
import {CompensationModule} from "./module/compensation/CompensationModule.sol";
|
10
|
-
import {LifecycleModule} from "./module/lifecycle/LifecycleModule.sol";
|
11
9
|
import {ComponentModule} from "./module/component/ComponentModule.sol";
|
10
|
+
import {DistributionModule} from "./module/distribution/DistributionModule.sol";
|
12
11
|
import {PolicyModule} from "./module/policy/PolicyModule.sol";
|
13
12
|
import {PoolModule} from "./module/pool/PoolModule.sol";
|
14
13
|
import {RiskModule} from "./module/risk/RiskModule.sol";
|
@@ -22,19 +21,21 @@ import {IBundleModule} from "./module/bundle/IBundle.sol";
|
|
22
21
|
import {IComponentModule} from "./module/component/IComponent.sol";
|
23
22
|
import {IPoolModule} from "./module/pool/IPoolModule.sol";
|
24
23
|
import {IPolicyModule} from "./module/policy/IPolicy.sol";
|
25
|
-
import {
|
24
|
+
import {IInstanceBase} from "./base/IInstanceBase.sol";
|
26
25
|
|
27
26
|
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
27
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
28
28
|
import {IProductService} from "./service/IProductService.sol";
|
29
29
|
import {IPoolService} from "./service/IPoolService.sol";
|
30
30
|
|
31
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
32
|
+
|
31
33
|
contract Instance is
|
32
34
|
InstanceBase,
|
33
35
|
AccessModule,
|
34
36
|
BundleModule,
|
35
37
|
ComponentModule,
|
36
|
-
|
37
|
-
LifecycleModule,
|
38
|
+
DistributionModule,
|
38
39
|
PolicyModule,
|
39
40
|
PoolModule,
|
40
41
|
RiskModule,
|
@@ -47,20 +48,27 @@ contract Instance is
|
|
47
48
|
InstanceBase(registry, registryNftId)
|
48
49
|
AccessModule()
|
49
50
|
BundleModule()
|
51
|
+
DistributionModule()
|
50
52
|
ComponentModule()
|
51
53
|
PolicyModule()
|
52
54
|
PoolModule()
|
53
55
|
TreasuryModule()
|
54
56
|
{
|
57
|
+
initializeBundleModule(_keyValueStore);
|
58
|
+
initializeComponentModule(_keyValueStore);
|
59
|
+
initializeDistributionModule(_keyValueStore);
|
60
|
+
initializePolicyModule(_keyValueStore);
|
61
|
+
initializePoolModule(_keyValueStore);
|
62
|
+
initializeRiskModule(_keyValueStore);
|
55
63
|
}
|
56
64
|
|
57
|
-
function getRegistry() public view override (Registerable,
|
58
|
-
|
59
|
-
function hasRole(RoleId role, address member) public view override (AccessModule, IComponentModule) returns (bool) { return super.hasRole(role, member); }
|
65
|
+
function getRegistry() public view override (Registerable, IPolicyModule) returns (IRegistry registry) { return super.getRegistry(); }
|
66
|
+
function getKeyValueStore() public view override (InstanceBase) returns (IKeyValueStore keyValueStore) { return super.getKeyValueStore(); }
|
60
67
|
|
61
|
-
function getComponentOwnerService() external view override (IComponentModule,
|
62
|
-
function
|
63
|
-
function
|
68
|
+
function getComponentOwnerService() external view override (IComponentModule, IInstanceBase) returns(IComponentOwnerService service) { return _componentOwnerService; }
|
69
|
+
function getDistributionService() external view override (IInstanceBase) returns(IDistributionService service) { return _distributionService; }
|
70
|
+
function getProductService() external view override (IBundleModule, IPolicyModule, IInstanceBase) returns(IProductService service) { return _productService; }
|
71
|
+
function getPoolService() external view override (IBundleModule, IPoolModule, IInstanceBase) returns(IPoolService service) { return _poolService; }
|
64
72
|
|
65
73
|
function getOwner() public view override (IAccessModule, Registerable) returns(address owner) { return super.getOwner(); }
|
66
74
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {Key32} from "../../types/Key32.sol";
|
5
|
+
import {StateId} from "../../types/StateId.sol";
|
6
|
+
|
7
|
+
import {IKeyValueStore} from "./IKeyValueStore.sol";
|
8
|
+
import {IComponentOwnerService} from "../service/IComponentOwnerService.sol";
|
9
|
+
import {IDistributionService} from "../service/IDistributionService.sol";
|
10
|
+
import {IProductService} from "../service/IProductService.sol";
|
11
|
+
import {IPoolService} from "../service/IPoolService.sol";
|
12
|
+
|
13
|
+
interface IInstanceBase {
|
14
|
+
function getKeyValueStore() external view returns (IKeyValueStore keyValueStore);
|
15
|
+
function updateState(Key32 key, StateId state) external;
|
16
|
+
function getState(Key32 key) external view returns (StateId state);
|
17
|
+
|
18
|
+
function getComponentOwnerService() external view returns(IComponentOwnerService service);
|
19
|
+
function getDistributionService() external view returns(IDistributionService);
|
20
|
+
function getProductService() external view returns(IProductService service);
|
21
|
+
function getPoolService() external view returns(IPoolService service);
|
22
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {Blocknumber, blockBlocknumber, zeroBlocknumber} from "../../types/Blocknumber.sol";
|
5
|
+
import {Key32, KeyId} from "../../types/Key32.sol";
|
6
|
+
import {NftId} from "../../types/NftId.sol";
|
7
|
+
import {ObjectType} from "../../types/ObjectType.sol";
|
8
|
+
import {StateId} from "../../types/StateId.sol";
|
9
|
+
|
10
|
+
import {ILifecycle} from "./ILifecycle.sol";
|
11
|
+
|
12
|
+
interface IKeyValueStore is ILifecycle {
|
13
|
+
|
14
|
+
struct Key {
|
15
|
+
ObjectType objectType;
|
16
|
+
KeyId id;
|
17
|
+
}
|
18
|
+
|
19
|
+
struct Value {
|
20
|
+
Metadata metadata;
|
21
|
+
bytes data;
|
22
|
+
}
|
23
|
+
|
24
|
+
struct Metadata {
|
25
|
+
ObjectType objectType;
|
26
|
+
StateId state;
|
27
|
+
address updatedBy;
|
28
|
+
Blocknumber updatedIn;
|
29
|
+
Blocknumber createdIn;
|
30
|
+
}
|
31
|
+
|
32
|
+
event LogInfoCreated(Key key, StateId state, address createdBy, address txOrigin);
|
33
|
+
event LogInfoUpdated(Key key, StateId state, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn);
|
34
|
+
event LogStateUpdated(Key key, StateId stateOld, StateId stateNew, address updatedBy, address txOrigin, Blocknumber lastUpdatedIn);
|
35
|
+
|
36
|
+
// generic state changing functions
|
37
|
+
function create(Key32 key, ObjectType objectType, bytes memory data) external;
|
38
|
+
function update(Key32 key, StateId state, bytes memory data) external;
|
39
|
+
function updateData(Key32 key, bytes memory data) external;
|
40
|
+
function updateState(Key32 key, StateId state) external;
|
41
|
+
|
42
|
+
function exists(Key32 key) external view returns (bool);
|
43
|
+
function get(Key32 key) external view returns (Value memory value);
|
44
|
+
function getData(Key32 key) external view returns (bytes memory data);
|
45
|
+
function getMetadata(Key32 key) external view returns (Metadata memory metadata);
|
46
|
+
function getState(Key32 key) external view returns (StateId state);
|
47
|
+
|
48
|
+
function toKey32(ObjectType objectType, KeyId id) external pure returns(Key32);
|
49
|
+
function toKey(Key32 key32) external pure returns(Key memory key);
|
50
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {ObjectType} from "../../types/ObjectType.sol";
|
5
|
+
import {StateId, toStateId, zeroStateId} from "../../types/StateId.sol";
|
6
|
+
import {NftId} from "../../types/NftId.sol";
|
7
|
+
|
8
|
+
interface ILifecycle {
|
9
|
+
|
10
|
+
error ErrorNoLifecycle(NftId nftId, ObjectType objectType);
|
11
|
+
error ErrorInvalidStateTransition(
|
12
|
+
ObjectType objectType,
|
13
|
+
StateId fromStateId,
|
14
|
+
StateId toStateId
|
15
|
+
);
|
16
|
+
|
17
|
+
function hasLifecycle(
|
18
|
+
ObjectType objectType
|
19
|
+
) external view returns (bool);
|
20
|
+
|
21
|
+
function getInitialState(
|
22
|
+
ObjectType objectType
|
23
|
+
) external view returns (StateId);
|
24
|
+
|
25
|
+
function isValidTransition(
|
26
|
+
ObjectType objectType,
|
27
|
+
StateId fromId,
|
28
|
+
StateId toId
|
29
|
+
) external view returns (bool);
|
30
|
+
}
|
@@ -1,28 +1,35 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
|
-
import {Versionable} from "
|
5
|
-
import {Registerable} from "
|
6
|
-
// import {IRegistry} from "../registry/IRegistry.sol";
|
4
|
+
import {Versionable} from "../../shared/Versionable.sol";
|
5
|
+
import {Registerable} from "../../shared/Registerable.sol";
|
7
6
|
|
8
|
-
|
9
|
-
import {
|
10
|
-
import {NftId} from "
|
11
|
-
import {
|
7
|
+
import {ObjectType, INSTANCE} from "../../types/ObjectType.sol";
|
8
|
+
import {Key32} from "../../types/Key32.sol";
|
9
|
+
import {NftId} from "../../types/NftId.sol";
|
10
|
+
import {StateId} from "../../types/StateId.sol";
|
11
|
+
import {Version, VersionPart, VersionLib} from "../../types/Version.sol";
|
12
12
|
|
13
|
-
import {IComponentOwnerService} from "
|
14
|
-
import {
|
15
|
-
import {
|
13
|
+
import {IComponentOwnerService} from "../service/IComponentOwnerService.sol";
|
14
|
+
import {IDistributionService} from "../service/IDistributionService.sol";
|
15
|
+
import {IProductService} from "../service/IProductService.sol";
|
16
|
+
import {IPoolService} from "../service/IPoolService.sol";
|
16
17
|
|
17
|
-
import {
|
18
|
-
import {IInstance} from "
|
18
|
+
import {IKeyValueStore} from "./IKeyValueStore.sol";
|
19
|
+
import {IInstance} from "../IInstance.sol";
|
20
|
+
import {IInstanceBase} from "./IInstanceBase.sol";
|
21
|
+
|
22
|
+
import {KeyValueStore} from "./KeyValueStore.sol";
|
19
23
|
|
20
24
|
abstract contract InstanceBase is
|
21
25
|
Versionable,
|
22
26
|
Registerable,
|
23
|
-
|
27
|
+
IInstanceBase
|
24
28
|
{
|
29
|
+
IKeyValueStore internal _keyValueStore;
|
30
|
+
|
25
31
|
IComponentOwnerService internal _componentOwnerService;
|
32
|
+
IDistributionService internal _distributionService;
|
26
33
|
IProductService internal _productService;
|
27
34
|
IPoolService internal _poolService;
|
28
35
|
|
@@ -33,10 +40,22 @@ abstract contract InstanceBase is
|
|
33
40
|
Registerable(registry, registryNftId)
|
34
41
|
Versionable()
|
35
42
|
{
|
43
|
+
_keyValueStore = new KeyValueStore();
|
44
|
+
|
36
45
|
_registerInterface(type(IInstance).interfaceId);
|
37
46
|
_linkToServicesInRegistry();
|
38
47
|
}
|
39
48
|
|
49
|
+
function getKeyValueStore() public view virtual override returns (IKeyValueStore keyValueStore) { return _keyValueStore; }
|
50
|
+
|
51
|
+
function updateState(Key32 key, StateId state) external override {
|
52
|
+
_keyValueStore.updateState(key, state);
|
53
|
+
}
|
54
|
+
|
55
|
+
function getState(Key32 key) external view override returns (StateId state) {
|
56
|
+
return _keyValueStore.getState(key);
|
57
|
+
}
|
58
|
+
|
40
59
|
// from versionable
|
41
60
|
function getVersion()
|
42
61
|
public
|
@@ -57,6 +76,7 @@ abstract contract InstanceBase is
|
|
57
76
|
function _linkToServicesInRegistry() internal {
|
58
77
|
VersionPart majorVersion = getVersion().toMajorPart();
|
59
78
|
_componentOwnerService = IComponentOwnerService(_getAndCheck("ComponentOwnerService", majorVersion));
|
79
|
+
_distributionService = IDistributionService(_getAndCheck("DistributionService", majorVersion));
|
60
80
|
_productService = IProductService(_getAndCheck("ProductService", majorVersion));
|
61
81
|
_poolService = IPoolService(_getAndCheck("PoolService", majorVersion));
|
62
82
|
}
|