@etherisc/gif-next 0.0.2-aa8d0c4-506 → 0.0.2-ab4c2da-820
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 +63 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +126 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +136 -62
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +88 -0
- 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/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +168 -102
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +144 -64
- 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 +788 -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/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +981 -10
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +448 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +30 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +169 -139
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +55 -32
- 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 +74 -40
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +269 -94
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +102 -34
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +285 -0
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +30 -19
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- 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/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 +923 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +440 -0
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +39 -52
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +43 -53
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +15 -23
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +669 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +13 -13
- 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 +664 -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 +971 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +464 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +42 -157
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +15 -35
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +755 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +420 -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 +82 -262
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +188 -65
- 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 +112 -331
- 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 +37 -79
- 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 +551 -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/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +1 -1
- 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/BaseComponent.sol +49 -8
- package/contracts/components/Distribution.sol +12 -15
- package/contracts/components/IBaseComponent.sol +6 -0
- package/contracts/components/IDistributionComponent.sol +0 -2
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/Pool.sol +49 -25
- package/contracts/components/Product.sol +41 -46
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +23 -0
- package/contracts/instance/BundleManager.sol +129 -0
- package/contracts/instance/Cloneable.sol +46 -0
- package/contracts/instance/IInstance.sol +25 -4
- package/contracts/instance/IInstanceBase.sol +26 -0
- package/contracts/instance/IInstanceService.sol +7 -3
- package/contracts/instance/Instance.sol +44 -23
- package/contracts/instance/InstanceAccessManager.sol +6 -6
- package/contracts/instance/InstanceBase.sol +41 -0
- package/contracts/instance/InstanceReader.sol +9 -0
- package/contracts/instance/InstanceService.sol +190 -73
- package/contracts/instance/InstanceServiceManager.sol +8 -6
- package/contracts/instance/ObjectManager.sol +101 -0
- package/contracts/instance/base/ComponentServiceBase.sol +36 -24
- package/contracts/instance/module/ISetup.sol +3 -1
- package/contracts/instance/service/BundleService.sol +260 -0
- package/contracts/instance/service/BundleServiceManager.sol +55 -0
- package/contracts/instance/service/ComponentOwnerService.sol +4 -6
- package/contracts/instance/service/DistributionService.sol +41 -26
- package/contracts/instance/service/DistributionServiceManager.sol +8 -6
- package/contracts/instance/service/IBundleService.sol +45 -0
- package/contracts/instance/service/IPolicyService.sol +87 -0
- package/contracts/instance/service/IPoolService.sol +6 -23
- package/contracts/instance/service/IProductService.sol +6 -73
- package/contracts/instance/service/PolicyService.sol +503 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +46 -129
- package/contracts/instance/service/PoolServiceManager.sol +8 -6
- package/contracts/instance/service/ProductService.sol +168 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +16 -33
- package/contracts/registry/IRegistryService.sol +37 -12
- package/contracts/registry/Registry.sol +138 -242
- package/contracts/registry/RegistryAccessManager.sol +207 -0
- package/contracts/registry/RegistryService.sol +83 -152
- package/contracts/registry/RegistryServiceManager.sol +18 -36
- package/contracts/registry/ReleaseManager.sol +382 -0
- package/contracts/registry/TokenRegistry.sol +5 -6
- package/contracts/shared/IService.sol +2 -1
- package/contracts/shared/NftOwnable.sol +2 -4
- package/contracts/shared/ProxyManager.sol +1 -1
- package/contracts/shared/Service.sol +11 -7
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +7 -5
- package/package.json +1 -1
- 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/contracts/instance/AccessManagedSimple.sol +0 -115
- package/contracts/instance/AccessManagerSimple.sol +0 -692
@@ -7,27 +7,29 @@ import {IInstance} from "../../instance/IInstance.sol";
|
|
7
7
|
import {IBundle} from "../../instance/module/IBundle.sol";
|
8
8
|
import {TokenHandler} from "../../instance/module/ITreasury.sol";
|
9
9
|
import {ISetup} from "../module/ISetup.sol";
|
10
|
+
import {IPolicy} from "../module/IPolicy.sol";
|
10
11
|
|
11
12
|
import {IVersionable} from "../../shared/IVersionable.sol";
|
12
13
|
import {Versionable} from "../../shared/Versionable.sol";
|
13
14
|
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
14
15
|
|
15
16
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
16
|
-
import {POOL, BUNDLE} from "../../types/ObjectType.sol";
|
17
|
+
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
17
18
|
import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
|
18
19
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
19
20
|
import {Version, VersionLib} from "../../types/Version.sol";
|
20
|
-
import {KEEP_STATE} from "../../types/StateId.sol";
|
21
|
-
import {zeroTimestamp} from "../../types/Timestamp.sol";
|
21
|
+
import {KEEP_STATE, StateId} from "../../types/StateId.sol";
|
22
|
+
import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
22
23
|
|
23
24
|
import {IService} from "../../shared/IService.sol";
|
24
25
|
import {Service} from "../../shared/Service.sol";
|
26
|
+
import {BundleManager} from "../BundleManager.sol";
|
25
27
|
import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
|
26
28
|
import {IPoolService} from "./IPoolService.sol";
|
27
29
|
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
28
30
|
import {InstanceService} from "../InstanceService.sol";
|
29
31
|
import {InstanceReader} from "../InstanceReader.sol";
|
30
|
-
|
32
|
+
import {IBaseComponent} from "../../components/IBaseComponent.sol";
|
31
33
|
|
32
34
|
string constant POOL_SERVICE_NAME = "PoolService";
|
33
35
|
|
@@ -37,8 +39,6 @@ contract PoolService is
|
|
37
39
|
{
|
38
40
|
using NftIdLib for NftId;
|
39
41
|
|
40
|
-
string public constant NAME = "PoolService";
|
41
|
-
|
42
42
|
address internal _registryAddress;
|
43
43
|
|
44
44
|
function _initialize(
|
@@ -49,39 +49,57 @@ contract PoolService is
|
|
49
49
|
initializer
|
50
50
|
virtual override
|
51
51
|
{
|
52
|
-
address
|
53
|
-
|
54
|
-
|
55
|
-
|
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);
|
56
58
|
|
57
|
-
_registerInterface(type(IService).interfaceId);
|
58
59
|
_registerInterface(type(IPoolService).interfaceId);
|
59
60
|
}
|
60
61
|
|
61
|
-
function
|
62
|
-
return
|
62
|
+
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
63
|
+
return POOL();
|
63
64
|
}
|
64
65
|
|
65
|
-
function register(address
|
66
|
-
external
|
67
|
-
|
68
|
-
returns (NftId poolNftId)
|
66
|
+
function register(address poolAddress)
|
67
|
+
external
|
68
|
+
returns(NftId poolNftId)
|
69
69
|
{
|
70
|
-
address
|
71
|
-
|
72
|
-
IInstance instance = pool.getInstance();
|
73
|
-
|
74
|
-
IRegistryService registryService = getRegistryService();
|
75
|
-
(IRegistry.ObjectInfo memory poolObjInfo, ) = registryService.registerPool(
|
76
|
-
pool,
|
77
|
-
componentOwner
|
78
|
-
);
|
79
|
-
poolNftId = poolObjInfo.nftId;
|
70
|
+
address poolOwner = msg.sender;
|
71
|
+
IBaseComponent pool = IBaseComponent(poolAddress);
|
80
72
|
|
81
|
-
|
73
|
+
IRegistry.ObjectInfo memory info;
|
74
|
+
bytes memory data;
|
75
|
+
(info, data) = getRegistryService().registerPool(pool, poolOwner);
|
76
|
+
|
77
|
+
IInstance instance = _getInstance(info);
|
78
|
+
|
79
|
+
bool hasRole = getInstanceService().hasRole(
|
80
|
+
poolOwner,
|
81
|
+
POOL_OWNER_ROLE(),
|
82
|
+
address(instance));
|
83
|
+
|
84
|
+
if(!hasRole) {
|
85
|
+
revert ExpectedRoleMissing(POOL_OWNER_ROLE(), poolOwner);
|
86
|
+
}
|
87
|
+
|
88
|
+
poolNftId = info.nftId;
|
89
|
+
ISetup.PoolSetupInfo memory initialSetup = _decodeAndVerifyPoolSetup(data);
|
82
90
|
instance.createPoolSetup(poolNftId, initialSetup);
|
83
91
|
}
|
84
92
|
|
93
|
+
function _decodeAndVerifyPoolSetup(bytes memory data) internal returns(ISetup.PoolSetupInfo memory setup)
|
94
|
+
{
|
95
|
+
setup = abi.decode(
|
96
|
+
data,
|
97
|
+
(ISetup.PoolSetupInfo)
|
98
|
+
);
|
99
|
+
|
100
|
+
// TODO add checks if applicable
|
101
|
+
}
|
102
|
+
|
85
103
|
function setFees(
|
86
104
|
Fee memory poolFee,
|
87
105
|
Fee memory stakingFee,
|
@@ -101,105 +119,4 @@ contract PoolService is
|
|
101
119
|
|
102
120
|
instance.updatePoolSetup(poolNftId, poolSetupInfo, KEEP_STATE());
|
103
121
|
}
|
104
|
-
|
105
|
-
function createBundle(
|
106
|
-
address owner,
|
107
|
-
Fee memory fee,
|
108
|
-
uint256 stakingAmount,
|
109
|
-
uint256 lifetime,
|
110
|
-
bytes calldata filter
|
111
|
-
)
|
112
|
-
external
|
113
|
-
override
|
114
|
-
returns(NftId bundleNftId)
|
115
|
-
{
|
116
|
-
(IRegistry.ObjectInfo memory info, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
117
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
118
|
-
NftId poolNftId = info.nftId;
|
119
|
-
|
120
|
-
IBundle.BundleInfo memory bundleInfo = IBundle.BundleInfo(
|
121
|
-
poolNftId,
|
122
|
-
FeeLib.zeroFee(),
|
123
|
-
filter,
|
124
|
-
stakingAmount,
|
125
|
-
0,
|
126
|
-
stakingAmount,
|
127
|
-
lifetime,
|
128
|
-
zeroTimestamp(),
|
129
|
-
zeroTimestamp()
|
130
|
-
);
|
131
|
-
|
132
|
-
// register bundle with registry
|
133
|
-
bundleNftId = getRegistryService().registerBundle(
|
134
|
-
IRegistry.ObjectInfo(
|
135
|
-
zeroNftId(),
|
136
|
-
poolNftId,
|
137
|
-
BUNDLE(),
|
138
|
-
false, // intercepting property for bundles is defined on pool
|
139
|
-
address(0),
|
140
|
-
owner,
|
141
|
-
abi.encode(bundleInfo)
|
142
|
-
)
|
143
|
-
);
|
144
|
-
|
145
|
-
// create bundle info in instance
|
146
|
-
instance.createBundle(bundleNftId, bundleInfo);
|
147
|
-
|
148
|
-
// TODO add bundle to pool in instance
|
149
|
-
|
150
|
-
// TODO collect capital
|
151
|
-
// _processStakingByTreasury(
|
152
|
-
// instanceReader,
|
153
|
-
// zeroNftId(),
|
154
|
-
// poolNftId,
|
155
|
-
// bundleNftId,
|
156
|
-
// stakingAmount);
|
157
|
-
|
158
|
-
// TODO add logging
|
159
|
-
}
|
160
|
-
|
161
|
-
function setBundleFee(
|
162
|
-
NftId bundleNftId,
|
163
|
-
Fee memory fee
|
164
|
-
)
|
165
|
-
external
|
166
|
-
override
|
167
|
-
{
|
168
|
-
(IRegistry.ObjectInfo memory info , IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
169
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
170
|
-
NftId poolNftId = info.nftId;
|
171
|
-
|
172
|
-
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
173
|
-
require(bundleInfo.poolNftId.gtz(), "ERROR:PLS-010:BUNDLE_UNKNOWN");
|
174
|
-
require(poolNftId == bundleInfo.poolNftId, "ERROR:PLS-011:BUNDLE_POOL_MISMATCH");
|
175
|
-
|
176
|
-
bundleInfo.fee = fee;
|
177
|
-
|
178
|
-
instance.updateBundle(bundleNftId, bundleInfo, KEEP_STATE());
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
function _processStakingByTreasury(
|
184
|
-
InstanceReader instanceReader,
|
185
|
-
NftId productNftId,
|
186
|
-
NftId poolNftId,
|
187
|
-
NftId bundleNftId,
|
188
|
-
uint256 stakingAmount
|
189
|
-
)
|
190
|
-
internal
|
191
|
-
{
|
192
|
-
// process token transfer(s)
|
193
|
-
if(stakingAmount > 0) {
|
194
|
-
TokenHandler tokenHandler = TokenHandler(instanceReader.getTokenHandler(productNftId));
|
195
|
-
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
196
|
-
ISetup.PoolSetupInfo memory poolInfo = instanceReader.getPoolSetupInfo(poolNftId);
|
197
|
-
|
198
|
-
tokenHandler.transfer(
|
199
|
-
bundleOwner,
|
200
|
-
poolInfo.wallet,
|
201
|
-
stakingAmount
|
202
|
-
);
|
203
|
-
}
|
204
|
-
}
|
205
122
|
}
|
@@ -7,6 +7,7 @@ import {PoolService} from "./PoolService.sol";
|
|
7
7
|
import {Registry} from "../../registry/Registry.sol";
|
8
8
|
import {RegistryService} from "../../registry/RegistryService.sol";
|
9
9
|
import {VersionLib} from "../../types/Version.sol";
|
10
|
+
import {SERVICE} from "../../types/ObjectType.sol";
|
10
11
|
|
11
12
|
contract PoolServiceManager is ProxyManager {
|
12
13
|
|
@@ -27,15 +28,16 @@ contract PoolServiceManager is ProxyManager {
|
|
27
28
|
_poolService = PoolService(address(versionable));
|
28
29
|
|
29
30
|
Registry registry = Registry(registryAddress);
|
30
|
-
address registryServiceAddress = registry.getServiceAddress(
|
31
|
+
address registryServiceAddress = registry.getServiceAddress(SERVICE(), VersionLib.toVersion(3, 0, 0).toMajorPart());
|
31
32
|
RegistryService registryService = RegistryService(registryServiceAddress);
|
33
|
+
// TODO this must have a role or own nft to register service
|
34
|
+
//registryService.registerService(_poolService);
|
32
35
|
|
33
|
-
|
34
|
-
|
36
|
+
// TODO no nft to link yet
|
35
37
|
// link ownership of instance service manager ot nft owner of instance service
|
36
|
-
_linkToNftOwnable(
|
37
|
-
|
38
|
-
|
38
|
+
//_linkToNftOwnable(
|
39
|
+
// address(registryAddress),
|
40
|
+
// address(_poolService));
|
39
41
|
|
40
42
|
// implies that after this constructor call only upgrade functionality is available
|
41
43
|
_isDeployed = true;
|
@@ -0,0 +1,168 @@
|
|
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 {IBaseComponent} from "../../components/IBaseComponent.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 {ComponentServiceBase} from "../base/ComponentServiceBase.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 ComponentServiceBase, 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 getDomain() public pure override(IService, Service) returns(ObjectType) {
|
72
|
+
return PRODUCT();
|
73
|
+
}
|
74
|
+
|
75
|
+
function register(address productAddress)
|
76
|
+
external
|
77
|
+
returns(NftId productNftId)
|
78
|
+
{
|
79
|
+
address productOwner = msg.sender;
|
80
|
+
IBaseComponent product = IBaseComponent(productAddress);
|
81
|
+
|
82
|
+
IRegistry.ObjectInfo memory info;
|
83
|
+
bytes memory data;
|
84
|
+
(info, data) = getRegistryService().registerProduct(product, productOwner);
|
85
|
+
|
86
|
+
IInstance instance = _getInstance(info);
|
87
|
+
bool hasRole = getInstanceService().hasRole(
|
88
|
+
productOwner,
|
89
|
+
PRODUCT_OWNER_ROLE(),
|
90
|
+
address(instance));
|
91
|
+
|
92
|
+
if(!hasRole) {
|
93
|
+
revert ExpectedRoleMissing(PRODUCT_OWNER_ROLE(), productOwner);
|
94
|
+
}
|
95
|
+
|
96
|
+
productNftId = info.nftId;
|
97
|
+
ISetup.ProductSetupInfo memory initialSetup = _decodeAndVerifyProductSetup(data);
|
98
|
+
instance.createProductSetup(productNftId, initialSetup);
|
99
|
+
}
|
100
|
+
|
101
|
+
function _decodeAndVerifyProductSetup(bytes memory data) internal returns(ISetup.ProductSetupInfo memory setup)
|
102
|
+
{
|
103
|
+
setup = abi.decode(
|
104
|
+
data,
|
105
|
+
(ISetup.ProductSetupInfo)
|
106
|
+
);
|
107
|
+
|
108
|
+
// TODO add checks if applicable
|
109
|
+
}
|
110
|
+
|
111
|
+
function setFees(
|
112
|
+
Fee memory productFee,
|
113
|
+
Fee memory processingFee
|
114
|
+
)
|
115
|
+
external
|
116
|
+
{
|
117
|
+
// TODO check args
|
118
|
+
|
119
|
+
(
|
120
|
+
IRegistry.ObjectInfo memory productInfo,
|
121
|
+
IInstance instance
|
122
|
+
) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
123
|
+
|
124
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
125
|
+
NftId productNftId = productInfo.nftId;
|
126
|
+
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
127
|
+
|
128
|
+
productSetupInfo.productFee = productFee;
|
129
|
+
productSetupInfo.processingFee = processingFee;
|
130
|
+
|
131
|
+
instance.updateProductSetup(productNftId, productSetupInfo, KEEP_STATE());
|
132
|
+
}
|
133
|
+
|
134
|
+
function createRisk(
|
135
|
+
RiskId riskId,
|
136
|
+
bytes memory data
|
137
|
+
) external override {
|
138
|
+
(
|
139
|
+
IRegistry.ObjectInfo memory productInfo,
|
140
|
+
IInstance instance
|
141
|
+
) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
142
|
+
NftId productNftId = productInfo.nftId;
|
143
|
+
IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo(productNftId, data);
|
144
|
+
instance.createRisk(
|
145
|
+
riskId,
|
146
|
+
riskInfo
|
147
|
+
);
|
148
|
+
}
|
149
|
+
|
150
|
+
function updateRisk(
|
151
|
+
RiskId riskId,
|
152
|
+
bytes memory data
|
153
|
+
) external {
|
154
|
+
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
155
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
156
|
+
IRisk.RiskInfo memory riskInfo = instanceReader.getRiskInfo(riskId);
|
157
|
+
riskInfo.data = data;
|
158
|
+
instance.updateRisk(riskId, riskInfo, KEEP_STATE());
|
159
|
+
}
|
160
|
+
|
161
|
+
function updateRiskState(
|
162
|
+
RiskId riskId,
|
163
|
+
StateId state
|
164
|
+
) external {
|
165
|
+
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
166
|
+
instance.updateRiskState(riskId, state);
|
167
|
+
}
|
168
|
+
}
|
@@ -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
|
+
}
|
@@ -10,33 +10,20 @@ import {VersionPart} from "../types/Version.sol";
|
|
10
10
|
|
11
11
|
interface IRegistry is IERC165 {
|
12
12
|
|
13
|
-
event
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
error NotToken(address token);
|
25
|
-
error TokenMajorVersionInvalid(VersionPart majorVersion);
|
26
|
-
|
27
|
-
// register
|
28
|
-
error NotRegistryService();
|
13
|
+
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
14
|
+
|
15
|
+
|
16
|
+
// register()
|
17
|
+
error CallerNotRegistryService();
|
18
|
+
error ServiceRegistration();
|
19
|
+
|
20
|
+
// registerService()
|
21
|
+
error CallerNotReleaseManager();
|
22
|
+
|
23
|
+
// _register()
|
29
24
|
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
25
|
error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
|
39
|
-
|
26
|
+
error ContractAlreadyRegistered(address objectAddress);
|
40
27
|
|
41
28
|
struct ObjectInfo {
|
42
29
|
NftId nftId;
|
@@ -49,12 +36,10 @@ interface IRegistry is IERC165 {
|
|
49
36
|
}// TODO delete nftId and initialOwner(if not used) from struct
|
50
37
|
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
51
38
|
|
52
|
-
function
|
39
|
+
function registerService(ObjectInfo memory serviceInfo) external returns(NftId nftId);
|
53
40
|
|
54
41
|
function register(ObjectInfo memory info) external returns (NftId nftId);
|
55
42
|
|
56
|
-
function setTokenActive(address token, VersionPart majorVersion, bool active) external;
|
57
|
-
|
58
43
|
function getMajorVersionMin() external view returns (VersionPart);
|
59
44
|
|
60
45
|
function getMajorVersionMax() external view returns (VersionPart);
|
@@ -79,13 +64,11 @@ interface IRegistry is IERC165 {
|
|
79
64
|
|
80
65
|
function isRegistered(address contractAddress) external view returns (bool);
|
81
66
|
|
82
|
-
function
|
83
|
-
|
84
|
-
function getServiceName(NftId nftId) external view returns (string memory name);
|
67
|
+
function isRegisteredService(address contractAddress) external view returns (bool);
|
85
68
|
|
86
69
|
function getServiceAddress(
|
87
|
-
|
88
|
-
VersionPart
|
70
|
+
ObjectType serviceType,
|
71
|
+
VersionPart releaseVersion
|
89
72
|
) external view returns (address serviceAddress);
|
90
73
|
|
91
74
|
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";
|
@@ -10,24 +12,47 @@ import {IRegistry} from "./IRegistry.sol";
|
|
10
12
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
13
|
import {IBaseComponent} from "../components/IBaseComponent.sol";
|
12
14
|
|
13
|
-
interface IRegistryService is
|
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();
|
27
|
+
|
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
|
+
// TODO used by service -> add owner arg
|
42
|
+
function registerInstance(IRegisterable instance)
|
43
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
19
44
|
|
20
|
-
|
21
|
-
|
45
|
+
function registerProduct(IBaseComponent product, address owner)
|
46
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
22
47
|
|
23
|
-
|
24
|
-
|
48
|
+
function registerPool(IBaseComponent pool, address owner)
|
49
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
25
50
|
|
26
|
-
|
27
|
-
|
51
|
+
function registerDistribution(IBaseComponent distribution, address owner)
|
52
|
+
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
28
53
|
|
29
|
-
|
54
|
+
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
30
55
|
|
31
|
-
|
56
|
+
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
32
57
|
}
|
33
58
|
|