@etherisc/gif-next 0.0.2-c8cedfe-604 → 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/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → components/Component.sol/Component.json} +184 -128
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +154 -133
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +116 -30
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +0 -52
- 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 +190 -122
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +170 -154
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +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} +86 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1621 -93
- 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 +136 -643
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +244 -114
- 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 +231 -102
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +33 -41
- 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/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 +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 +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +163 -35
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +19 -23
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IBundleService.sol/IBundleService.json} +295 -41
- 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 +123 -232
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +196 -68
- 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 +137 -330
- 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 +44 -94
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -112
- 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 +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +14 -27
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/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 +2 -2
- 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/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 +15 -27
- package/contracts/components/IComponent.sol +37 -0
- package/contracts/components/IDistributionComponent.sol +0 -2
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/IProductComponent.sol +2 -2
- package/contracts/components/Pool.sol +46 -46
- 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 +38 -9
- package/contracts/instance/IInstanceBase.sol +27 -0
- package/contracts/instance/IInstanceService.sol +14 -4
- package/contracts/instance/Instance.sol +52 -236
- 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 +284 -83
- 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 +51 -32
- package/contracts/instance/service/DistributionServiceManager.sol +10 -12
- 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 +27 -30
- package/contracts/registry/IRegistryService.sol +37 -13
- package/contracts/registry/Registry.sol +150 -243
- package/contracts/registry/RegistryAccessManager.sol +210 -0
- package/contracts/registry/RegistryService.sol +86 -173
- package/contracts/registry/RegistryServiceManager.sol +18 -36
- package/contracts/registry/ReleaseManager.sol +342 -0
- package/contracts/registry/TokenRegistry.sol +5 -6
- 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/Service.sol +14 -8
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +10 -8
- package/package.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -280
- 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 -91
- package/contracts/components/IBaseComponent.sol +0 -25
- package/contracts/instance/AccessManagedSimple.sol +0 -115
- package/contracts/instance/AccessManagerSimple.sol +0 -692
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/base/ComponentServiceBase.sol +0 -39
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -0,0 +1,142 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {Pool} from "../../components/Pool.sol";
|
5
|
+
import {IRegistry} from "../../registry/IRegistry.sol";
|
6
|
+
import {IInstance} from "../../instance/IInstance.sol";
|
7
|
+
import {IBundle} from "../../instance/module/IBundle.sol";
|
8
|
+
import {TokenHandler} from "../../instance/module/ITreasury.sol";
|
9
|
+
import {ISetup} from "../module/ISetup.sol";
|
10
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
11
|
+
|
12
|
+
import {IVersionable} from "../../shared/IVersionable.sol";
|
13
|
+
import {Versionable} from "../../shared/Versionable.sol";
|
14
|
+
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
15
|
+
|
16
|
+
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
17
|
+
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
18
|
+
import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
|
19
|
+
import {Fee, FeeLib} from "../../types/Fee.sol";
|
20
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
21
|
+
import {KEEP_STATE, StateId} from "../../types/StateId.sol";
|
22
|
+
import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
23
|
+
|
24
|
+
import {IService} from "../../shared/IService.sol";
|
25
|
+
import {Service} from "../../shared/Service.sol";
|
26
|
+
import {BundleManager} from "../BundleManager.sol";
|
27
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
28
|
+
import {IPoolService} from "./IPoolService.sol";
|
29
|
+
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
30
|
+
import {InstanceService} from "../InstanceService.sol";
|
31
|
+
import {InstanceReader} from "../InstanceReader.sol";
|
32
|
+
import {IComponent} from "../../components/IComponent.sol";
|
33
|
+
|
34
|
+
string constant POOL_SERVICE_NAME = "PoolService";
|
35
|
+
|
36
|
+
contract PoolService is
|
37
|
+
ComponentService,
|
38
|
+
IPoolService
|
39
|
+
{
|
40
|
+
using NftIdLib for NftId;
|
41
|
+
|
42
|
+
address internal _registryAddress;
|
43
|
+
|
44
|
+
function _initialize(
|
45
|
+
address owner,
|
46
|
+
bytes memory data
|
47
|
+
)
|
48
|
+
internal
|
49
|
+
initializer
|
50
|
+
virtual override
|
51
|
+
{
|
52
|
+
address registryAddress;
|
53
|
+
address initialOwner;
|
54
|
+
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
55
|
+
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
56
|
+
// owner is PoolServiceManager deployer
|
57
|
+
_initializeService(registryAddress, owner);
|
58
|
+
|
59
|
+
_registerInterface(type(IPoolService).interfaceId);
|
60
|
+
}
|
61
|
+
|
62
|
+
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
63
|
+
return POOL();
|
64
|
+
}
|
65
|
+
|
66
|
+
function register(address poolAddress)
|
67
|
+
external
|
68
|
+
returns(NftId poolNftId)
|
69
|
+
{
|
70
|
+
(
|
71
|
+
IComponent pool,
|
72
|
+
address owner,
|
73
|
+
IInstance instance,
|
74
|
+
NftId instanceNftId
|
75
|
+
) = _checkComponentForRegistration(
|
76
|
+
poolAddress,
|
77
|
+
POOL(),
|
78
|
+
POOL_OWNER_ROLE());
|
79
|
+
|
80
|
+
(
|
81
|
+
IRegistry.ObjectInfo memory poolInfo,
|
82
|
+
bytes memory data
|
83
|
+
) = getRegistryService().registerPool(pool, owner);
|
84
|
+
pool.linkToRegisteredNftId();
|
85
|
+
poolNftId = poolInfo.nftId;
|
86
|
+
|
87
|
+
(
|
88
|
+
string memory name,
|
89
|
+
ISetup.PoolSetupInfo memory initialSetup
|
90
|
+
) = _decodeAndVerifyPoolData(data);
|
91
|
+
instance.createPoolSetup(poolNftId, initialSetup);
|
92
|
+
|
93
|
+
getInstanceService().createTarget(instanceNftId, poolAddress, name);
|
94
|
+
}
|
95
|
+
|
96
|
+
function _decodeAndVerifyPoolData(bytes memory data)
|
97
|
+
internal
|
98
|
+
returns(string memory name, ISetup.PoolSetupInfo memory setup)
|
99
|
+
{
|
100
|
+
(name, setup) = abi.decode(
|
101
|
+
data,
|
102
|
+
(string, ISetup.PoolSetupInfo)
|
103
|
+
);
|
104
|
+
|
105
|
+
// TODO add checks
|
106
|
+
/*IRegistry _registry = getRegistry();
|
107
|
+
|
108
|
+
if(wallet == address(0)) {
|
109
|
+
revert WalletIsZero();
|
110
|
+
}
|
111
|
+
|
112
|
+
ObjectType tokenType = _registry.getObjectInfo(address(token)).objectType;
|
113
|
+
|
114
|
+
if(tokenType != TOKEN()) {
|
115
|
+
revert InvalidToken();
|
116
|
+
}
|
117
|
+
|
118
|
+
if(UFixedLib.eqz(info.collateralizationLevel)) {
|
119
|
+
revert CollateralizationLevelIsZero();
|
120
|
+
}*/
|
121
|
+
}
|
122
|
+
|
123
|
+
function setFees(
|
124
|
+
Fee memory poolFee,
|
125
|
+
Fee memory stakingFee,
|
126
|
+
Fee memory performanceFee
|
127
|
+
)
|
128
|
+
external
|
129
|
+
override
|
130
|
+
{
|
131
|
+
(IRegistry.ObjectInfo memory poolInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
132
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
133
|
+
NftId poolNftId = poolInfo.nftId;
|
134
|
+
|
135
|
+
ISetup.PoolSetupInfo memory poolSetupInfo = instanceReader.getPoolSetupInfo(poolNftId);
|
136
|
+
poolSetupInfo.poolFee = poolFee;
|
137
|
+
poolSetupInfo.stakingFee = stakingFee;
|
138
|
+
poolSetupInfo.performanceFee = performanceFee;
|
139
|
+
|
140
|
+
instance.updatePoolSetup(poolNftId, poolSetupInfo, KEEP_STATE());
|
141
|
+
}
|
142
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../../shared/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../../shared/ProxyManager.sol";
|
6
|
+
import {PoolService} from "./PoolService.sol";
|
7
|
+
import {Registry} from "../../registry/Registry.sol";
|
8
|
+
import {RegistryService} from "../../registry/RegistryService.sol";
|
9
|
+
import {REGISTRY} from "../../types/ObjectType.sol";
|
10
|
+
|
11
|
+
contract PoolServiceManager is ProxyManager {
|
12
|
+
|
13
|
+
PoolService private _poolService;
|
14
|
+
|
15
|
+
/// @dev initializes proxy manager with pool service implementation
|
16
|
+
constructor(
|
17
|
+
address registryAddress
|
18
|
+
)
|
19
|
+
ProxyManager()
|
20
|
+
{
|
21
|
+
PoolService poolSrv = new PoolService();
|
22
|
+
bytes memory data = abi.encode(registryAddress, address(this));
|
23
|
+
IVersionable versionable = deploy(
|
24
|
+
address(poolSrv),
|
25
|
+
data);
|
26
|
+
|
27
|
+
_poolService = PoolService(address(versionable));
|
28
|
+
|
29
|
+
// TODO `this` must have a role or own nft to register service
|
30
|
+
//Registry registry = Registry(registryAddress);
|
31
|
+
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _poolService.getMajorVersion());
|
32
|
+
//RegistryService registryService = RegistryService(registryServiceAddress);
|
33
|
+
//registryService.registerService(_poolService);
|
34
|
+
|
35
|
+
// TODO no nft to link yet
|
36
|
+
// link ownership of instance service manager ot nft owner of instance service
|
37
|
+
//_linkToNftOwnable(
|
38
|
+
// address(registryAddress),
|
39
|
+
// address(_poolService));
|
40
|
+
}
|
41
|
+
|
42
|
+
//--- view functions ----------------------------------------------------//
|
43
|
+
function getPoolService()
|
44
|
+
external
|
45
|
+
view
|
46
|
+
returns (PoolService poolService)
|
47
|
+
{
|
48
|
+
return _poolService;
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
|
+
import {IProductComponent} from "../../components/IProductComponent.sol";
|
6
|
+
import {Product} from "../../components/Product.sol";
|
7
|
+
import {IComponent} from "../../components/IComponent.sol";
|
8
|
+
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
9
|
+
import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
|
10
|
+
import {IInstance} from "../IInstance.sol";
|
11
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
12
|
+
import {IRisk} from "../module/IRisk.sol";
|
13
|
+
import {IBundle} from "../module/IBundle.sol";
|
14
|
+
import {IProductService} from "./IProductService.sol";
|
15
|
+
import {ITreasury} from "../module/ITreasury.sol";
|
16
|
+
import {ISetup} from "../module/ISetup.sol";
|
17
|
+
|
18
|
+
import {TokenHandler} from "../../shared/TokenHandler.sol";
|
19
|
+
|
20
|
+
import {IVersionable} from "../../shared/IVersionable.sol";
|
21
|
+
import {Versionable} from "../../shared/Versionable.sol";
|
22
|
+
|
23
|
+
import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
|
+
import {UFixed, UFixedLib} from "../../types/UFixed.sol";
|
25
|
+
import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
|
26
|
+
import {ObjectType, PRODUCT, POOL, POLICY} from "../../types/ObjectType.sol";
|
27
|
+
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
|
28
|
+
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
29
|
+
import {Fee, FeeLib} from "../../types/Fee.sol";
|
30
|
+
import {ReferralId} from "../../types/Referral.sol";
|
31
|
+
import {RiskId} from "../../types/RiskId.sol";
|
32
|
+
import {StateId} from "../../types/StateId.sol";
|
33
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
34
|
+
import {RoleId, PRODUCT_OWNER_ROLE} from "../../types/RoleId.sol";
|
35
|
+
|
36
|
+
import {IService} from "../../shared/IService.sol";
|
37
|
+
import {Service} from "../../shared/Service.sol";
|
38
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
39
|
+
import {IProductService} from "./IProductService.sol";
|
40
|
+
import {InstanceReader} from "../InstanceReader.sol";
|
41
|
+
import {IPoolService} from "./PoolService.sol";
|
42
|
+
|
43
|
+
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
44
|
+
contract ProductService is ComponentService, IProductService {
|
45
|
+
using NftIdLib for NftId;
|
46
|
+
|
47
|
+
IPoolService internal _poolService;
|
48
|
+
|
49
|
+
event LogProductServiceSender(address sender);
|
50
|
+
|
51
|
+
function _initialize(
|
52
|
+
address owner,
|
53
|
+
bytes memory data
|
54
|
+
)
|
55
|
+
internal
|
56
|
+
initializer
|
57
|
+
virtual override
|
58
|
+
{
|
59
|
+
address registryAddress;
|
60
|
+
address initialOwner;
|
61
|
+
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
62
|
+
|
63
|
+
_initializeService(registryAddress, owner);
|
64
|
+
|
65
|
+
_poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
|
66
|
+
|
67
|
+
_registerInterface(type(IProductService).interfaceId);
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
function register(address productAddress)
|
72
|
+
external
|
73
|
+
returns(NftId productNftId)
|
74
|
+
{
|
75
|
+
(
|
76
|
+
IComponent product,
|
77
|
+
address owner,
|
78
|
+
IInstance instance,
|
79
|
+
NftId instanceNftId
|
80
|
+
) = _checkComponentForRegistration(
|
81
|
+
productAddress,
|
82
|
+
PRODUCT(),
|
83
|
+
PRODUCT_OWNER_ROLE());
|
84
|
+
|
85
|
+
(
|
86
|
+
IRegistry.ObjectInfo memory productInfo,
|
87
|
+
bytes memory data
|
88
|
+
) = getRegistryService().registerProduct(product, owner);
|
89
|
+
|
90
|
+
productNftId = productInfo.nftId;
|
91
|
+
_createProductSetup(
|
92
|
+
instance,
|
93
|
+
product,
|
94
|
+
productNftId,
|
95
|
+
data);
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
function _createProductSetup(
|
100
|
+
IInstance instance,
|
101
|
+
IComponent product,
|
102
|
+
NftId productNftId,
|
103
|
+
bytes memory data
|
104
|
+
)
|
105
|
+
internal
|
106
|
+
returns (string memory name)
|
107
|
+
{
|
108
|
+
(
|
109
|
+
string memory name,
|
110
|
+
ISetup.ProductSetupInfo memory setup
|
111
|
+
) = _decodeAndVerifyProductData(data);
|
112
|
+
|
113
|
+
// wire distribution and pool components to product component
|
114
|
+
IComponent distribution = IComponent(_registry.getObjectInfo(setup.distributionNftId).objectAddress);
|
115
|
+
IComponent pool = IComponent(_registry.getObjectInfo(setup.poolNftId).objectAddress);
|
116
|
+
|
117
|
+
distribution.setProductNftId(productNftId);
|
118
|
+
pool.setProductNftId(productNftId);
|
119
|
+
product.setProductNftId(productNftId);
|
120
|
+
product.linkToRegisteredNftId();
|
121
|
+
|
122
|
+
// create product setup in instance
|
123
|
+
instance.createProductSetup(productNftId, setup);
|
124
|
+
|
125
|
+
// create target for instane access manager
|
126
|
+
getInstanceService().createTarget(
|
127
|
+
_registry.getNftId(address(instance)),
|
128
|
+
address(product),
|
129
|
+
name);
|
130
|
+
}
|
131
|
+
|
132
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
133
|
+
return PRODUCT();
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
function _decodeAndVerifyProductData(bytes memory data)
|
138
|
+
internal
|
139
|
+
returns(string memory name, ISetup.ProductSetupInfo memory setup)
|
140
|
+
{
|
141
|
+
(name, setup) = abi.decode(
|
142
|
+
data,
|
143
|
+
(string, ISetup.ProductSetupInfo)
|
144
|
+
);
|
145
|
+
|
146
|
+
// TODO add checks
|
147
|
+
// if(wallet == address(0)) {
|
148
|
+
// revert WalletIsZero();
|
149
|
+
// }
|
150
|
+
|
151
|
+
// IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
|
152
|
+
|
153
|
+
// if(tokenInfo.objectType != TOKEN()) {
|
154
|
+
// revert InvalidToken();
|
155
|
+
// }
|
156
|
+
|
157
|
+
// IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
|
158
|
+
|
159
|
+
// if(poolInfo.objectType != POOL()) {
|
160
|
+
// revert InvalidPool();
|
161
|
+
// }
|
162
|
+
|
163
|
+
// if(poolInfo.parentNftId != instanceNftId) {
|
164
|
+
// revert InvalidPoolsInstance();
|
165
|
+
// }
|
166
|
+
// // TODO pool have the same token
|
167
|
+
// //ITreasury.PoolSetup memory poolSetup = instance.getPoolSetup(info.poolNftId);
|
168
|
+
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
169
|
+
// // TODO pool is not linked
|
170
|
+
|
171
|
+
// IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
|
172
|
+
|
173
|
+
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
174
|
+
// revert InvalidDistribution();
|
175
|
+
// }
|
176
|
+
|
177
|
+
// if(distributionInfo.parentNftId != instanceNftId) {
|
178
|
+
// revert InvalidDistributionsInstance();
|
179
|
+
// }
|
180
|
+
// // TODO distribution have the same token
|
181
|
+
// // TODO distribution is not linked
|
182
|
+
}
|
183
|
+
|
184
|
+
function setFees(
|
185
|
+
Fee memory productFee,
|
186
|
+
Fee memory processingFee
|
187
|
+
)
|
188
|
+
external
|
189
|
+
{
|
190
|
+
// TODO check args
|
191
|
+
|
192
|
+
(
|
193
|
+
IRegistry.ObjectInfo memory productInfo,
|
194
|
+
IInstance instance
|
195
|
+
) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
196
|
+
|
197
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
198
|
+
NftId productNftId = productInfo.nftId;
|
199
|
+
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
200
|
+
|
201
|
+
productSetupInfo.productFee = productFee;
|
202
|
+
productSetupInfo.processingFee = processingFee;
|
203
|
+
|
204
|
+
instance.updateProductSetup(productNftId, productSetupInfo, KEEP_STATE());
|
205
|
+
}
|
206
|
+
|
207
|
+
function createRisk(
|
208
|
+
RiskId riskId,
|
209
|
+
bytes memory data
|
210
|
+
) external override {
|
211
|
+
(
|
212
|
+
IRegistry.ObjectInfo memory productInfo,
|
213
|
+
IInstance instance
|
214
|
+
) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
215
|
+
NftId productNftId = productInfo.nftId;
|
216
|
+
IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo(productNftId, data);
|
217
|
+
instance.createRisk(
|
218
|
+
riskId,
|
219
|
+
riskInfo
|
220
|
+
);
|
221
|
+
}
|
222
|
+
|
223
|
+
function updateRisk(
|
224
|
+
RiskId riskId,
|
225
|
+
bytes memory data
|
226
|
+
) external {
|
227
|
+
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
228
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
229
|
+
IRisk.RiskInfo memory riskInfo = instanceReader.getRiskInfo(riskId);
|
230
|
+
riskInfo.data = data;
|
231
|
+
instance.updateRisk(riskId, riskInfo, KEEP_STATE());
|
232
|
+
}
|
233
|
+
|
234
|
+
function updateRiskState(
|
235
|
+
RiskId riskId,
|
236
|
+
StateId state
|
237
|
+
) external {
|
238
|
+
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
239
|
+
instance.updateRiskState(riskId, state);
|
240
|
+
}
|
241
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../../shared/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../../shared/ProxyManager.sol";
|
6
|
+
import {ProductService} from "./ProductService.sol";
|
7
|
+
import {Registry} from "../../registry/Registry.sol";
|
8
|
+
import {RegistryService} from "../../registry/RegistryService.sol";
|
9
|
+
import {VersionLib} from "../../types/Version.sol";
|
10
|
+
|
11
|
+
contract ProductServiceManager is ProxyManager {
|
12
|
+
|
13
|
+
ProductService private _productService;
|
14
|
+
|
15
|
+
/// @dev initializes proxy manager with product service implementation
|
16
|
+
constructor(
|
17
|
+
address registryAddress
|
18
|
+
)
|
19
|
+
ProxyManager()
|
20
|
+
{
|
21
|
+
ProductService svc = new ProductService();
|
22
|
+
bytes memory data = abi.encode(registryAddress, address(this));
|
23
|
+
IVersionable versionable = deploy(
|
24
|
+
address(svc),
|
25
|
+
data);
|
26
|
+
|
27
|
+
_productService = ProductService(address(versionable));
|
28
|
+
|
29
|
+
// Registry registry = Registry(registryAddress);
|
30
|
+
// address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
|
31
|
+
// RegistryService registryService = RegistryService(registryServiceAddress);
|
32
|
+
// TODO this must have a role or own nft to register service
|
33
|
+
//registryService.registerService(_productService);
|
34
|
+
|
35
|
+
// TODO no nft to link yet
|
36
|
+
// link ownership of instance service manager ot nft owner of instance service
|
37
|
+
//_linkToNftOwnable(
|
38
|
+
// address(registryAddress),
|
39
|
+
// address(_productService));
|
40
|
+
|
41
|
+
// implies that after this constructor call only upgrade functionality is available
|
42
|
+
_isDeployed = true;
|
43
|
+
}
|
44
|
+
|
45
|
+
//--- view functions ----------------------------------------------------//
|
46
|
+
function getProductService()
|
47
|
+
external
|
48
|
+
view
|
49
|
+
returns (ProductService productService)
|
50
|
+
{
|
51
|
+
return _productService;
|
52
|
+
}
|
53
|
+
|
54
|
+
}
|
@@ -7,36 +7,25 @@ import {ChainNft} from "./ChainNft.sol";
|
|
7
7
|
import {NftId} from "../types/NftId.sol";
|
8
8
|
import {ObjectType} from "../types/ObjectType.sol";
|
9
9
|
import {VersionPart} from "../types/Version.sol";
|
10
|
+
import {Timestamp} from "../types/Timestamp.sol";
|
10
11
|
|
11
12
|
interface IRegistry is IERC165 {
|
12
13
|
|
13
|
-
event
|
14
|
-
event
|
15
|
-
event LogRegistration(ObjectInfo info);
|
16
|
-
event LogTokenStateSet(address token, VersionPart majorVersion, bool active);
|
17
|
-
event LogServiceNameRegistration(string serviceName, VersionPart majorVersion);
|
14
|
+
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
15
|
+
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
18
16
|
|
19
|
-
//
|
20
|
-
error
|
17
|
+
// register()
|
18
|
+
error CallerNotRegistryService();
|
19
|
+
error ServiceRegistration();
|
21
20
|
|
22
|
-
//
|
23
|
-
error
|
24
|
-
error
|
25
|
-
error TokenMajorVersionInvalid(VersionPart majorVersion);
|
21
|
+
// registerService()
|
22
|
+
error CallerNotReleaseManager();
|
23
|
+
error ServiceAlreadyRegistered(address service);
|
26
24
|
|
27
|
-
//
|
28
|
-
error NotRegistryService();
|
25
|
+
// _register()
|
29
26
|
error ZeroParentAddress();
|
30
|
-
error ContractAlreadyRegistered(address objectAddress);
|
31
|
-
error InvalidServiceVersion(VersionPart majorVersion);
|
32
|
-
error ServiceNameAlreadyRegistered(string name, VersionPart majorVersion);
|
33
|
-
|
34
|
-
// approve
|
35
|
-
error NotOwner(address account);
|
36
|
-
error NotRegisteredContract(NftId registrarNftId);
|
37
|
-
error NotService(NftId registrarNftId);
|
38
27
|
error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
|
39
|
-
|
28
|
+
error ContractAlreadyRegistered(address objectAddress);
|
40
29
|
|
41
30
|
struct ObjectInfo {
|
42
31
|
NftId nftId;
|
@@ -49,11 +38,19 @@ interface IRegistry is IERC165 {
|
|
49
38
|
}// TODO delete nftId and initialOwner(if not used) from struct
|
50
39
|
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
51
40
|
|
52
|
-
|
41
|
+
struct ReleaseInfo {
|
42
|
+
ObjectType[] domains;
|
43
|
+
Timestamp createdAt;
|
44
|
+
//Timestamp updatedAt;
|
45
|
+
}
|
53
46
|
|
54
|
-
function
|
47
|
+
function registerService(
|
48
|
+
ObjectInfo memory serviceInfo,
|
49
|
+
VersionPart serviceVersion,
|
50
|
+
ObjectType serviceDomain
|
51
|
+
) external returns(NftId nftId);
|
55
52
|
|
56
|
-
function
|
53
|
+
function register(ObjectInfo memory info) external returns (NftId nftId);
|
57
54
|
|
58
55
|
function getMajorVersionMin() external view returns (VersionPart);
|
59
56
|
|
@@ -61,6 +58,8 @@ interface IRegistry is IERC165 {
|
|
61
58
|
|
62
59
|
function getMajorVersion() external view returns (VersionPart);
|
63
60
|
|
61
|
+
function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
|
62
|
+
|
64
63
|
function getObjectCount() external view returns (uint256);
|
65
64
|
|
66
65
|
function getNftId() external view returns (NftId nftId);
|
@@ -79,13 +78,11 @@ interface IRegistry is IERC165 {
|
|
79
78
|
|
80
79
|
function isRegistered(address contractAddress) external view returns (bool);
|
81
80
|
|
82
|
-
function
|
83
|
-
|
84
|
-
function getServiceName(NftId nftId) external view returns (string memory name);
|
81
|
+
function isRegisteredService(address contractAddress) external view returns (bool);
|
85
82
|
|
86
83
|
function getServiceAddress(
|
87
|
-
|
88
|
-
VersionPart
|
84
|
+
ObjectType serviceDomain,
|
85
|
+
VersionPart releaseVersion
|
89
86
|
) external view returns (address serviceAddress);
|
90
87
|
|
91
88
|
function getChainNft() external view returns (ChainNft);
|
@@ -1,6 +1,8 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
|
+
|
4
6
|
import {NftId} from "../types/NftId.sol";
|
5
7
|
import {ObjectType} from "../types/ObjectType.sol";
|
6
8
|
import {RoleId} from "../types/RoleId.sol";
|
@@ -8,26 +10,48 @@ import {IService} from "../shared/IService.sol";
|
|
8
10
|
import {IRegistry} from "./IRegistry.sol";
|
9
11
|
|
10
12
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
|
-
import {
|
13
|
+
import {IComponent} from "../components/IComponent.sol";
|
14
|
+
|
15
|
+
interface IRegistryService is
|
16
|
+
IService,
|
17
|
+
IAccessManaged
|
18
|
+
{
|
19
|
+
error SelfRegistration();
|
20
|
+
error NotRegistryOwner();
|
21
|
+
|
22
|
+
error NotService();
|
23
|
+
error NotInstance();
|
24
|
+
error NotProduct();
|
25
|
+
error NotPool();
|
26
|
+
error NotDistribution();
|
12
27
|
|
13
|
-
|
28
|
+
error UnexpectedRegisterableType(ObjectType expected, ObjectType found);
|
29
|
+
error NotRegisterableOwner(address expectedOwner);
|
30
|
+
error RegisterableOwnerIsZero();
|
31
|
+
error RegisterableOwnerIsRegistered();
|
32
|
+
error InvalidInitialOwner(address initialOwner);
|
33
|
+
error InvalidAddress(address registerableAddress);
|
14
34
|
|
15
|
-
|
35
|
+
struct FunctionConfig
|
36
|
+
{
|
37
|
+
ObjectType serviceDomain;
|
38
|
+
bytes4 selector;
|
39
|
+
}
|
16
40
|
|
17
|
-
|
18
|
-
|
41
|
+
function registerInstance(IRegisterable instance, address owner)
|
42
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
19
43
|
|
20
|
-
|
21
|
-
|
44
|
+
function registerProduct(IComponent product, address owner)
|
45
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
22
46
|
|
23
|
-
|
24
|
-
|
47
|
+
function registerPool(IComponent pool, address owner)
|
48
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
25
49
|
|
26
|
-
|
27
|
-
|
50
|
+
function registerDistribution(IComponent distribution, address owner)
|
51
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
28
52
|
|
29
|
-
|
53
|
+
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
30
54
|
|
31
|
-
|
55
|
+
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
32
56
|
}
|
33
57
|
|