@etherisc/gif-next 0.0.2-e2d8c7d-942 → 0.0.2-e38b7e6-931
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +40 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +42 -100
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +40 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/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 +42 -128
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +47 -116
- 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 +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +90 -13
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +88 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +56 -616
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +221 -114
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +126 -242
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -126
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +114 -13
- 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 +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +235 -37
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +20 -24
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +145 -38
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +17 -21
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +64 -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 +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +120 -13
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +13 -13
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +13 -13
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +326 -64
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +51 -23
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +145 -38
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +17 -21
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +151 -44
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +17 -13
- 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 +132 -133
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +94 -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 +145 -227
- 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 +30 -128
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +38 -104
- 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/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 +2 -2
- 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/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 +48 -12
- package/contracts/components/Distribution.sol +2 -11
- package/contracts/components/IBaseComponent.sol +5 -1
- package/contracts/components/IProductComponent.sol +2 -2
- package/contracts/components/Pool.sol +5 -18
- package/contracts/components/Product.sol +19 -16
- package/contracts/instance/IInstance.sol +3 -3
- package/contracts/instance/IInstanceBase.sol +0 -1
- package/contracts/instance/IInstanceService.sol +9 -3
- package/contracts/instance/Instance.sol +12 -214
- package/contracts/instance/InstanceAccessManager.sol +92 -77
- package/contracts/instance/InstanceBase.sol +0 -2
- package/contracts/instance/InstanceService.sol +118 -72
- package/contracts/instance/InstanceServiceManager.sol +5 -8
- package/contracts/instance/base/ComponentServiceBase.sol +78 -12
- package/contracts/instance/base/IInstanceBase.sol +0 -2
- package/contracts/instance/module/IAccess.sol +27 -17
- package/contracts/instance/service/BundleService.sol +39 -5
- package/contracts/instance/service/BundleServiceManager.sol +5 -8
- package/contracts/instance/service/DistributionService.sol +33 -36
- package/contracts/instance/service/DistributionServiceManager.sol +6 -9
- package/contracts/instance/service/IBundleService.sol +5 -6
- package/contracts/instance/service/IPolicyService.sol +7 -0
- package/contracts/instance/service/PolicyService.sol +65 -34
- package/contracts/instance/service/PoolService.sol +46 -28
- package/contracts/instance/service/PoolServiceManager.sol +5 -8
- package/contracts/instance/service/ProductService.sol +66 -30
- package/contracts/registry/ChainNft.sol +1 -1
- package/contracts/registry/IRegistry.sol +26 -16
- package/contracts/registry/IRegistryService.sol +13 -5
- package/contracts/registry/Registry.sol +149 -201
- package/contracts/registry/RegistryAccessManager.sol +210 -0
- package/contracts/registry/RegistryService.sol +50 -88
- 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/ProxyManager.sol +1 -1
- package/contracts/shared/Service.sol +10 -7
- package/contracts/test/TestService.sol +3 -2
- package/contracts/types/RoleId.sol +10 -12
- package/package.json +1 -1
- 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/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -466
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
@@ -23,7 +23,7 @@ import {Versionable} from "../../shared/Versionable.sol";
|
|
23
23
|
import {Timestamp, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
24
|
import {UFixed, UFixedLib} from "../../types/UFixed.sol";
|
25
25
|
import {Blocknumber, blockNumber} from "../../types/Blocknumber.sol";
|
26
|
-
import {ObjectType,
|
26
|
+
import {ObjectType, PRODUCT, POOL, POLICY} from "../../types/ObjectType.sol";
|
27
27
|
import {APPLIED, UNDERWRITTEN, ACTIVE, KEEP_STATE} from "../../types/StateId.sol";
|
28
28
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
29
29
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
@@ -39,16 +39,11 @@ import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
|
|
39
39
|
import {IProductService} from "./IProductService.sol";
|
40
40
|
import {InstanceReader} from "../InstanceReader.sol";
|
41
41
|
import {IPoolService} from "./PoolService.sol";
|
42
|
-
import {POOL_SERVICE_NAME} from "./PoolService.sol";
|
43
|
-
|
44
|
-
string constant PRODUCT_SERVICE_NAME = "ProductService";
|
45
42
|
|
46
43
|
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
47
44
|
contract ProductService is ComponentServiceBase, IProductService {
|
48
45
|
using NftIdLib for NftId;
|
49
46
|
|
50
|
-
string public constant NAME = "ProductService";
|
51
|
-
|
52
47
|
IPoolService internal _poolService;
|
53
48
|
|
54
49
|
event LogProductServiceSender(address sender);
|
@@ -67,50 +62,91 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
67
62
|
|
68
63
|
_initializeService(registryAddress, owner);
|
69
64
|
|
70
|
-
_poolService = IPoolService(_registry.getServiceAddress(
|
65
|
+
_poolService = IPoolService(_registry.getServiceAddress(POOL(), getMajorVersion()));
|
71
66
|
|
72
67
|
_registerInterface(type(IProductService).interfaceId);
|
73
68
|
}
|
74
69
|
|
75
70
|
|
76
|
-
function
|
77
|
-
return
|
71
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
72
|
+
return PRODUCT();
|
78
73
|
}
|
79
74
|
|
80
75
|
function register(address productAddress)
|
81
76
|
external
|
82
77
|
returns(NftId productNftId)
|
83
78
|
{
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
productOwner,
|
94
|
-
PRODUCT_OWNER_ROLE(),
|
95
|
-
address(instance));
|
79
|
+
(
|
80
|
+
IBaseComponent product,
|
81
|
+
address productOwner,
|
82
|
+
IInstance instance,
|
83
|
+
NftId instanceNftId
|
84
|
+
) = _checkComponentForRegistration(
|
85
|
+
productAddress,
|
86
|
+
PRODUCT(),
|
87
|
+
PRODUCT_OWNER_ROLE());
|
96
88
|
|
97
|
-
|
98
|
-
|
99
|
-
|
89
|
+
(
|
90
|
+
IRegistry.ObjectInfo memory productInfo,
|
91
|
+
bytes memory data
|
92
|
+
) = getRegistryService().registerProduct(product, productOwner);
|
93
|
+
product.linkToRegisteredNftId();
|
94
|
+
productNftId = productInfo.nftId;
|
100
95
|
|
101
|
-
|
102
|
-
|
96
|
+
(
|
97
|
+
string memory name,
|
98
|
+
ISetup.ProductSetupInfo memory initialSetup
|
99
|
+
) = _decodeAndVerifyProductData(data);
|
103
100
|
instance.createProductSetup(productNftId, initialSetup);
|
101
|
+
|
102
|
+
getInstanceService().createTarget(instanceNftId, productAddress, name);
|
104
103
|
}
|
105
104
|
|
106
|
-
function
|
105
|
+
function _decodeAndVerifyProductData(bytes memory data)
|
106
|
+
internal
|
107
|
+
returns(string memory name, ISetup.ProductSetupInfo memory setup)
|
107
108
|
{
|
108
|
-
setup = abi.decode(
|
109
|
+
(name, setup) = abi.decode(
|
109
110
|
data,
|
110
|
-
(ISetup.ProductSetupInfo)
|
111
|
+
(string, ISetup.ProductSetupInfo)
|
111
112
|
);
|
112
113
|
|
113
|
-
// TODO add checks
|
114
|
+
// TODO add checks
|
115
|
+
// if(wallet == address(0)) {
|
116
|
+
// revert WalletIsZero();
|
117
|
+
// }
|
118
|
+
|
119
|
+
// IRegistry.ObjectInfo memory tokenInfo = _registry.getObjectInfo(address(info.token));
|
120
|
+
|
121
|
+
// if(tokenInfo.objectType != TOKEN()) {
|
122
|
+
// revert InvalidToken();
|
123
|
+
// }
|
124
|
+
|
125
|
+
// IRegistry.ObjectInfo memory poolInfo = _registry.getObjectInfo(info.poolNftId);
|
126
|
+
|
127
|
+
// if(poolInfo.objectType != POOL()) {
|
128
|
+
// revert InvalidPool();
|
129
|
+
// }
|
130
|
+
|
131
|
+
// if(poolInfo.parentNftId != instanceNftId) {
|
132
|
+
// revert InvalidPoolsInstance();
|
133
|
+
// }
|
134
|
+
// // TODO pool have the same token
|
135
|
+
// //ITreasury.PoolSetup memory poolSetup = instance.getPoolSetup(info.poolNftId);
|
136
|
+
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
137
|
+
// // TODO pool is not linked
|
138
|
+
|
139
|
+
// IRegistry.ObjectInfo memory distributionInfo = _registry.getObjectInfo(info.distributionNftId);
|
140
|
+
|
141
|
+
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
142
|
+
// revert InvalidDistribution();
|
143
|
+
// }
|
144
|
+
|
145
|
+
// if(distributionInfo.parentNftId != instanceNftId) {
|
146
|
+
// revert InvalidDistributionsInstance();
|
147
|
+
// }
|
148
|
+
// // TODO distribution have the same token
|
149
|
+
// // TODO distribution is not linked
|
114
150
|
}
|
115
151
|
|
116
152
|
function setFees(
|
@@ -7,25 +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 LogServiceNameRegistration(string serviceName, VersionPart majorVersion);
|
17
|
-
|
18
|
-
// setMajorVersion()
|
19
|
-
error NotOwner(address account);
|
20
|
-
error MajorVersionMaxIncreaseInvalid(VersionPart newMajorVersionMax, VersionPart existingMaxMajorVersion);
|
14
|
+
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
15
|
+
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
21
16
|
|
22
17
|
// register()
|
23
|
-
error
|
18
|
+
error CallerNotRegistryService();
|
19
|
+
error ServiceRegistration();
|
20
|
+
|
21
|
+
// registerService()
|
22
|
+
error CallerNotReleaseManager();
|
23
|
+
error ServiceAlreadyRegistered(address service);
|
24
|
+
|
25
|
+
// _register()
|
24
26
|
error ZeroParentAddress();
|
25
27
|
error InvalidTypesCombination(ObjectType objectType, ObjectType parentType);
|
26
28
|
error ContractAlreadyRegistered(address objectAddress);
|
27
|
-
error InvalidServiceVersion(VersionPart majorVersion);
|
28
|
-
error ServiceNameAlreadyRegistered(string name, VersionPart majorVersion);
|
29
29
|
|
30
30
|
struct ObjectInfo {
|
31
31
|
NftId nftId;
|
@@ -38,7 +38,17 @@ interface IRegistry is IERC165 {
|
|
38
38
|
}// TODO delete nftId and initialOwner(if not used) from struct
|
39
39
|
// TODO strong disagree, keep nftId there (lets keep get object info return object consistent)
|
40
40
|
|
41
|
-
|
41
|
+
struct ReleaseInfo {
|
42
|
+
ObjectType[] domains;
|
43
|
+
Timestamp createdAt;
|
44
|
+
//Timestamp updatedAt;
|
45
|
+
}
|
46
|
+
|
47
|
+
function registerService(
|
48
|
+
ObjectInfo memory serviceInfo,
|
49
|
+
VersionPart serviceVersion,
|
50
|
+
ObjectType serviceDomain
|
51
|
+
) external returns(NftId nftId);
|
42
52
|
|
43
53
|
function register(ObjectInfo memory info) external returns (NftId nftId);
|
44
54
|
|
@@ -48,6 +58,8 @@ interface IRegistry is IERC165 {
|
|
48
58
|
|
49
59
|
function getMajorVersion() external view returns (VersionPart);
|
50
60
|
|
61
|
+
function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
|
62
|
+
|
51
63
|
function getObjectCount() external view returns (uint256);
|
52
64
|
|
53
65
|
function getNftId() external view returns (NftId nftId);
|
@@ -68,11 +80,9 @@ interface IRegistry is IERC165 {
|
|
68
80
|
|
69
81
|
function isRegisteredService(address contractAddress) external view returns (bool);
|
70
82
|
|
71
|
-
function getServiceName(NftId nftId) external view returns (string memory name);
|
72
|
-
|
73
83
|
function getServiceAddress(
|
74
|
-
|
75
|
-
VersionPart
|
84
|
+
ObjectType serviceDomain,
|
85
|
+
VersionPart releaseVersion
|
76
86
|
) external view returns (address serviceAddress);
|
77
87
|
|
78
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";
|
@@ -10,8 +12,10 @@ 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
|
14
|
-
|
15
|
+
interface IRegistryService is
|
16
|
+
IService,
|
17
|
+
IAccessManaged
|
18
|
+
{
|
15
19
|
error SelfRegistration();
|
16
20
|
error NotRegistryOwner();
|
17
21
|
|
@@ -28,9 +32,13 @@ interface IRegistryService is IService {
|
|
28
32
|
error InvalidInitialOwner(address initialOwner);
|
29
33
|
error InvalidAddress(address registerableAddress);
|
30
34
|
|
35
|
+
struct FunctionConfig
|
36
|
+
{
|
37
|
+
ObjectType serviceDomain;
|
38
|
+
bytes4 selector;
|
39
|
+
}
|
31
40
|
|
32
|
-
|
33
|
-
|
41
|
+
// TODO used by service -> add owner arg
|
34
42
|
function registerInstance(IRegisterable instance)
|
35
43
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
36
44
|
|
@@ -43,7 +51,7 @@ interface IRegistryService is IService {
|
|
43
51
|
function registerDistribution(IBaseComponent distribution, address owner)
|
44
52
|
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
45
53
|
|
46
|
-
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
54
|
+
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
47
55
|
|
48
56
|
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
49
57
|
}
|