@etherisc/gif-next 0.0.2-7c3106f-930 → 0.0.2-7c515fb-081
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 +4 -0
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +13 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +75 -15
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +13 -0
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +52 -0
- 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/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +112 -13
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +39 -18
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +2 -2
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +2 -2
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +15 -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 +403 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +59 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +164 -84
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +34 -34
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +168 -37
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +229 -41
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +77 -9
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +29 -0
- 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/KeyValueStore.sol/KeyValueStore.json +2 -2
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/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/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +18 -18
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +681 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +436 -0
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +820 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +448 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +309 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -19
- 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 +258 -24
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +20 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +49 -28
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +410 -0
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IService.sol/IService.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +4 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +4 -0
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +442 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/{instance/base/ServiceBase.sol/ServiceBase.json → shared/Service.sol/Service.json} +2 -2
- 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/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- 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 +11 -11
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +2 -2
- 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/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +22 -3
- package/contracts/components/BaseComponent.sol +8 -3
- package/contracts/components/Distribution.sol +13 -13
- package/contracts/components/IBaseComponent.sol +1 -0
- package/contracts/components/IDistributionComponent.sol +3 -0
- package/contracts/components/Pool.sol +15 -27
- package/contracts/components/Product.sol +1 -1
- package/contracts/instance/AccessManagedSimple.sol +5 -4
- package/contracts/instance/AccessManagerSimple.sol +10 -0
- package/contracts/instance/IInstance.sol +15 -4
- package/contracts/instance/IInstanceService.sol +21 -8
- package/contracts/instance/Instance.sol +28 -21
- package/contracts/instance/InstanceAccessManager.sol +1 -1
- package/contracts/instance/InstanceReader.sol +27 -1
- package/contracts/instance/InstanceService.sol +107 -27
- package/contracts/instance/base/ComponentServiceBase.sol +21 -10
- package/contracts/instance/module/IBundle.sol +1 -0
- package/contracts/instance/module/ISetup.sol +1 -0
- package/contracts/instance/service/ComponentOwnerService.sol +5 -5
- package/contracts/instance/service/DistributionService.sol +99 -0
- package/contracts/instance/service/DistributionServiceManager.sol +53 -0
- package/contracts/instance/service/IComponentOwnerService.sol +1 -1
- package/contracts/instance/service/IDistributionService.sol +1 -1
- package/contracts/instance/service/IPoolService.sol +1 -1
- package/contracts/instance/service/IProductService.sol +1 -1
- package/contracts/instance/service/PoolService.sol +205 -0
- package/contracts/instance/service/PoolServiceManager.sol +53 -0
- package/contracts/registry/IRegistry.sol +39 -2
- package/contracts/registry/IRegistryService.sol +7 -9
- package/contracts/registry/Registry.sol +95 -29
- package/contracts/registry/RegistryService.sol +14 -54
- package/contracts/registry/RegistryServiceManager.sol +21 -5
- package/contracts/registry/TokenRegistry.sol +111 -0
- package/contracts/shared/ERC165.sol +6 -2
- package/contracts/{instance/base → shared}/IService.sol +3 -3
- package/contracts/shared/Registerable.sol +1 -0
- package/contracts/shared/RegisterableUpgradable.sol +16 -0
- package/contracts/shared/Service.sol +54 -0
- package/contracts/test/TestService.sol +3 -5
- package/contracts/types/RoleId.sol +7 -0
- package/contracts/types/StateId.sol +4 -0
- package/contracts/types/Version.sol +4 -1
- package/package.json +1 -1
- package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +0 -4
- package/contracts/instance/base/ServiceBase.sol +0 -44
@@ -7,7 +7,7 @@ import {DistributorType} from "../types/DistributorType.sol";
|
|
7
7
|
import {Fee, FeeLib} from "../types/Fee.sol";
|
8
8
|
import {Key32} from "../types/Key32.sol";
|
9
9
|
import {NftId} from "../types/NftId.sol";
|
10
|
-
import {ObjectType, DISTRIBUTOR, DISTRIBUTION, INSTANCE, PRODUCT, POLICY, POOL, TREASURY} from "../types/ObjectType.sol";
|
10
|
+
import {ObjectType, DISTRIBUTOR, DISTRIBUTION, INSTANCE, PRODUCT, POLICY, POOL, TREASURY, BUNDLE} from "../types/ObjectType.sol";
|
11
11
|
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../types/Referral.sol";
|
12
12
|
import {Registerable} from "../shared/Registerable.sol";
|
13
13
|
import {RiskId} from "../types/RiskId.sol";
|
@@ -15,6 +15,7 @@ import {UFixed, MathLib, UFixedLib} from "../types/UFixed.sol";
|
|
15
15
|
import {Version} from "../types/Version.sol";
|
16
16
|
|
17
17
|
import {IRegistry} from "../registry/IRegistry.sol";
|
18
|
+
import {IBundle} from "../instance/module/IBundle.sol";
|
18
19
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
19
20
|
import {IInstance} from "./IInstance.sol";
|
20
21
|
import {IKeyValueStore} from "../instance/base/IKeyValueStore.sol";
|
@@ -26,6 +27,7 @@ import {TimestampLib} from "../types/Timestamp.sol";
|
|
26
27
|
|
27
28
|
|
28
29
|
contract InstanceReader {
|
30
|
+
bool private _initialized;
|
29
31
|
|
30
32
|
IRegistry internal _registry;
|
31
33
|
NftId internal _instanceNftId;
|
@@ -37,6 +39,12 @@ contract InstanceReader {
|
|
37
39
|
NftId instanceNftId
|
38
40
|
)
|
39
41
|
{
|
42
|
+
initialize(registry, instanceNftId);
|
43
|
+
}
|
44
|
+
|
45
|
+
function initialize(address registry, NftId instanceNftId) public {
|
46
|
+
require(!_initialized, "ERROR:CRD-000:ALREADY_INITIALIZED");
|
47
|
+
|
40
48
|
require(
|
41
49
|
address(registry) != address(0),
|
42
50
|
"ERROR:CRD-001:REGISTRY_ZERO");
|
@@ -55,8 +63,11 @@ contract InstanceReader {
|
|
55
63
|
|
56
64
|
_instance = IInstance(instanceInfo.objectAddress);
|
57
65
|
_store = IKeyValueStore(instanceInfo.objectAddress);
|
66
|
+
|
67
|
+
_initialized = true;
|
58
68
|
}
|
59
69
|
|
70
|
+
|
60
71
|
// module specific functions
|
61
72
|
|
62
73
|
function getPolicyInfo(NftId policyNftId)
|
@@ -104,6 +115,17 @@ contract InstanceReader {
|
|
104
115
|
return abi.decode(data, (ITreasury.TreasuryInfo));
|
105
116
|
}
|
106
117
|
}
|
118
|
+
|
119
|
+
function getBundleInfo(NftId bundleNftId)
|
120
|
+
public
|
121
|
+
view
|
122
|
+
returns (IBundle.BundleInfo memory info)
|
123
|
+
{
|
124
|
+
bytes memory data = _store.getData(toBundleKey(bundleNftId));
|
125
|
+
if (data.length > 0) {
|
126
|
+
return abi.decode(data, (IBundle.BundleInfo));
|
127
|
+
}
|
128
|
+
}
|
107
129
|
|
108
130
|
function getDistributorTypeInfo(DistributorType distributorType)
|
109
131
|
public
|
@@ -249,6 +271,10 @@ contract InstanceReader {
|
|
249
271
|
return distributionNftId.toKey32(DISTRIBUTION());
|
250
272
|
}
|
251
273
|
|
274
|
+
function toBundleKey(NftId poolNftId) public pure returns (Key32) {
|
275
|
+
return poolNftId.toKey32(BUNDLE());
|
276
|
+
}
|
277
|
+
|
252
278
|
function toPoolKey(NftId poolNftId) public pure returns (Key32) {
|
253
279
|
return poolNftId.toKey32(POOL());
|
254
280
|
}
|
@@ -7,18 +7,24 @@ import {AccessManagerSimple} from "./AccessManagerSimple.sol";
|
|
7
7
|
import {InstanceAccessManager} from "./InstanceAccessManager.sol";
|
8
8
|
import {Instance} from "./Instance.sol";
|
9
9
|
import {IInstanceService} from "./IInstanceService.sol";
|
10
|
-
import {
|
10
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
11
11
|
import {IRegistry} from "../registry/IRegistry.sol";
|
12
|
-
import {
|
12
|
+
import {Registry} from "../registry/Registry.sol";
|
13
|
+
import {RegistryService} from "../registry/RegistryService.sol";
|
14
|
+
import {Service} from "../../contracts/shared/Service.sol";
|
15
|
+
import {IService} from "../shared/IService.sol";
|
13
16
|
import {ContractDeployerLib} from "../shared/ContractDeployerLib.sol";
|
14
17
|
import {NftId, NftIdLib, zeroNftId} from "../../contracts/types/NftId.sol";
|
18
|
+
import {RoleId} from "../types/RoleId.sol";
|
19
|
+
import {VersionLib} from "../types/Version.sol";
|
20
|
+
import {ADMIN_ROLE, INSTANCE_SERVICE_ROLE, DISTRIBUTION_SERVICE_ROLE, POOL_SERVICE_ROLE} from "../types/RoleId.sol";
|
15
21
|
|
16
|
-
contract InstanceService is
|
22
|
+
contract InstanceService is Service, IInstanceService {
|
17
23
|
|
18
24
|
address internal _registryAddress;
|
19
25
|
address internal _accessManagerMaster;
|
20
|
-
address internal _instanceAccessManagerMaster;
|
21
26
|
address internal _instanceMaster;
|
27
|
+
address internal _instanceReaderMaster;
|
22
28
|
|
23
29
|
// TODO update to real hash when instance is stable
|
24
30
|
bytes32 public constant INSTANCE_CREATION_CODE_HASH = bytes32(0);
|
@@ -27,34 +33,104 @@ contract InstanceService is ServiceBase, IInstanceService {
|
|
27
33
|
function createInstanceClone()
|
28
34
|
external
|
29
35
|
returns (
|
30
|
-
AccessManagerSimple
|
31
|
-
|
32
|
-
|
36
|
+
AccessManagerSimple clonedAccessManager,
|
37
|
+
Instance clonedInstance,
|
38
|
+
NftId instanceNftId,
|
39
|
+
InstanceReader clonedInstanceReader
|
33
40
|
)
|
34
41
|
{
|
35
|
-
|
36
|
-
|
37
|
-
|
42
|
+
address instanceOwner = msg.sender;
|
43
|
+
Registry registry = Registry(_registryAddress);
|
44
|
+
NftId registryNftId = registry.getNftId(_registryAddress);
|
45
|
+
address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
|
46
|
+
RegistryService registryService = RegistryService(registryServiceAddress);
|
47
|
+
|
48
|
+
// initially set the authority of the access managar to this (being the instance service).
|
49
|
+
// This will allow the instance service to bootstrap the authorizations of the instance
|
50
|
+
// and then transfer the ownership of the access manager to the instance owner once everything is setup
|
51
|
+
clonedAccessManager = AccessManagerSimple(Clones.clone(_accessManagerMaster));
|
52
|
+
clonedAccessManager.initialize(address(this));
|
53
|
+
|
54
|
+
clonedInstance = Instance(Clones.clone(_instanceMaster));
|
55
|
+
clonedInstance.initialize(address(clonedAccessManager), _registryAddress, registryNftId, msg.sender);
|
56
|
+
( IRegistry.ObjectInfo memory info, ) = registryService.registerInstance(clonedInstance);
|
57
|
+
instanceNftId = info.nftId;
|
58
|
+
|
59
|
+
clonedInstanceReader = InstanceReader(Clones.clone(address(_instanceReaderMaster)));
|
60
|
+
clonedInstanceReader.initialize(_registryAddress, instanceNftId);
|
61
|
+
|
62
|
+
_grantInitialAuthorizations(clonedAccessManager, clonedInstance);
|
63
|
+
|
64
|
+
clonedInstance.setInstanceReader(clonedInstanceReader);
|
65
|
+
|
66
|
+
// to complete setup switch instance ownership to the instance owner
|
67
|
+
// TODO: use a role less powerful than admin, maybe INSTANCE_ADMIN (does not exist yet)
|
68
|
+
clonedAccessManager.grantRole(ADMIN_ROLE().toInt(), instanceOwner, 0);
|
69
|
+
clonedAccessManager.revokeRole(ADMIN_ROLE().toInt(), address(this));
|
70
|
+
|
71
|
+
emit LogInstanceCloned(address(clonedAccessManager), address(clonedInstance), address(clonedInstanceReader), instanceNftId);
|
72
|
+
}
|
73
|
+
|
74
|
+
function _grantInitialAuthorizations(AccessManagerSimple clonedAccessManager, Instance clonedInstance) internal {
|
75
|
+
address distributionServiceAddress = _registry.getServiceAddress("DistributionService", VersionLib.toVersion(3, 0, 0).toMajorPart());
|
76
|
+
clonedAccessManager.grantRole(DISTRIBUTION_SERVICE_ROLE().toInt(), distributionServiceAddress, 0);
|
77
|
+
bytes4[] memory instanceDistributionServiceSelectors = new bytes4[](2);
|
78
|
+
instanceDistributionServiceSelectors[0] = clonedInstance.createDistributionSetup.selector;
|
79
|
+
instanceDistributionServiceSelectors[1] = clonedInstance.updateDistributionSetup.selector;
|
80
|
+
clonedAccessManager.setTargetFunctionRole(
|
81
|
+
address(clonedInstance),
|
82
|
+
instanceDistributionServiceSelectors,
|
83
|
+
DISTRIBUTION_SERVICE_ROLE().toInt());
|
84
|
+
|
85
|
+
address poolServiceAddress = _registry.getServiceAddress("PoolService", VersionLib.toVersion(3, 0, 0).toMajorPart());
|
86
|
+
clonedAccessManager.grantRole(POOL_SERVICE_ROLE().toInt(), address(poolServiceAddress), 0);
|
87
|
+
bytes4[] memory instancePoolServiceSelectors = new bytes4[](4);
|
88
|
+
instancePoolServiceSelectors[0] = clonedInstance.createPoolSetup.selector;
|
89
|
+
instancePoolServiceSelectors[1] = clonedInstance.updatePoolSetup.selector;
|
90
|
+
instancePoolServiceSelectors[2] = clonedInstance.createBundle.selector;
|
91
|
+
instancePoolServiceSelectors[3] = clonedInstance.updateBundle.selector;
|
92
|
+
clonedAccessManager.setTargetFunctionRole(
|
93
|
+
address(clonedInstance),
|
94
|
+
instancePoolServiceSelectors,
|
95
|
+
POOL_SERVICE_ROLE().toInt());
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
function setAccessManagerMaster(address accessManagerMaster) external {
|
100
|
+
require(
|
101
|
+
_accessManagerMaster == address(0),
|
102
|
+
"ERROR:CRD-001:ACCESS_MANAGER_MASTER_ALREADY_SET");
|
103
|
+
_accessManagerMaster = accessManagerMaster;
|
104
|
+
}
|
105
|
+
|
106
|
+
function setInstanceMaster(address instanceMaster) external {
|
107
|
+
require(
|
108
|
+
_instanceMaster == address(0),
|
109
|
+
"ERROR:CRD-002:INSTANCE_MASTER_ALREADY_SET");
|
110
|
+
_instanceMaster = instanceMaster;
|
38
111
|
}
|
39
112
|
|
40
|
-
function
|
41
|
-
|
113
|
+
function setInstanceReaderMaster(address instanceReaderMaster) external {
|
114
|
+
require(
|
115
|
+
_instanceReaderMaster == address(0),
|
116
|
+
"ERROR:CRD-003:INSTANCE_READER_MASTER_ALREADY_SET");
|
117
|
+
_instanceReaderMaster = instanceReaderMaster;
|
42
118
|
}
|
43
119
|
|
44
|
-
function
|
45
|
-
|
120
|
+
function getInstanceReaderMaster() external view returns (address) {
|
121
|
+
return _instanceReaderMaster;
|
46
122
|
}
|
47
123
|
|
48
|
-
function
|
49
|
-
_instanceMaster
|
124
|
+
function getInstanceMaster() external view returns (address) {
|
125
|
+
return _instanceMaster;
|
50
126
|
}
|
51
127
|
|
52
|
-
function getAccessManagerMaster() external view returns (address) {
|
53
|
-
|
54
|
-
|
128
|
+
function getAccessManagerMaster() external view returns (address) {
|
129
|
+
return _accessManagerMaster;
|
130
|
+
}
|
55
131
|
|
56
132
|
// From IService
|
57
|
-
function getName() public pure override(IService,
|
133
|
+
function getName() public pure override(IService, Service) returns(string memory) {
|
58
134
|
return NAME;
|
59
135
|
}
|
60
136
|
|
@@ -85,18 +161,22 @@ contract InstanceService is ServiceBase, IInstanceService {
|
|
85
161
|
address initialOwner = address(0);
|
86
162
|
(_registryAddress, initialOwner) = abi.decode(data, (address, address));
|
87
163
|
|
88
|
-
|
89
|
-
IRegistry registry = IRegistry(_registryAddress);
|
90
|
-
NftId registryNftId = registry.getNftId(_registryAddress);
|
91
|
-
|
92
|
-
_initializeServiceBase(_registryAddress, registryNftId, initialOwner);
|
164
|
+
_initializeService(_registryAddress, initialOwner);
|
93
165
|
|
94
166
|
_registerInterface(type(IService).interfaceId);
|
95
167
|
_registerInterface(type(IInstanceService).interfaceId);
|
96
168
|
}
|
97
169
|
|
98
|
-
function
|
99
|
-
|
170
|
+
function hasRole(address account, RoleId role, NftId instanceNftId) external view returns (bool) {
|
171
|
+
IRegistry.ObjectInfo memory instanceObjectInfo = getRegistry().getObjectInfo(instanceNftId);
|
172
|
+
address instanceAddress = instanceObjectInfo.objectAddress;
|
173
|
+
Instance instance = Instance(instanceAddress);
|
174
|
+
AccessManagerSimple accessManager = AccessManagerSimple(instance.authority());
|
175
|
+
(bool isMember, uint32 executionDelay) = accessManager.hasRole(role.toInt(), account);
|
176
|
+
if (executionDelay > 0) {
|
177
|
+
return false;
|
178
|
+
}
|
179
|
+
return isMember;
|
100
180
|
}
|
101
181
|
}
|
102
182
|
|
@@ -6,21 +6,32 @@ import {IRegistryService} from "../../registry/IRegistryService.sol";
|
|
6
6
|
import {IInstance} from "../../instance/IInstance.sol";
|
7
7
|
import {ObjectType, INSTANCE, PRODUCT, POOL} from "../../types/ObjectType.sol";
|
8
8
|
import {NftId, NftIdLib} from "../../types/NftId.sol";
|
9
|
+
import {RoleId} from "../../types/RoleId.sol";
|
10
|
+
import {BaseComponent} from "../../components/BaseComponent.sol";
|
9
11
|
|
10
|
-
import {
|
12
|
+
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
13
|
+
import {Service} from "../../shared/Service.sol";
|
14
|
+
import {InstanceService} from "../InstanceService.sol";
|
11
15
|
import {Version, VersionPart, VersionLib} from "../../types/Version.sol";
|
12
16
|
|
13
|
-
abstract contract ComponentServiceBase is
|
17
|
+
abstract contract ComponentServiceBase is Service {
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
error InvalidRole(RoleId expected, address caller);
|
20
|
+
|
21
|
+
/// @dev modifier to check if caller has a role on the instance the component is registered in
|
22
|
+
modifier onlyInstanceRole(RoleId role, address componentAddress) {
|
23
|
+
address componentOwner = msg.sender;
|
24
|
+
BaseComponent component = BaseComponent(componentAddress);
|
25
|
+
INftOwnable nftOwnable = INftOwnable(address(component.getInstance()));
|
26
|
+
if(! getInstanceService().hasRole(componentOwner, role, nftOwnable.getNftId())) {
|
27
|
+
revert InvalidRole(role, componentOwner);
|
28
|
+
}
|
29
|
+
_;
|
22
30
|
}
|
23
31
|
|
32
|
+
function getInstanceService() public view returns (InstanceService) {
|
33
|
+
return InstanceService(getRegistry().getServiceAddress("InstanceService", getMajorVersion()));
|
34
|
+
}
|
24
35
|
|
25
36
|
function _getAndVerifyComponentInfoAndInstance(
|
26
37
|
ObjectType objectType
|
@@ -32,7 +43,7 @@ abstract contract ComponentServiceBase is ServiceBase {
|
|
32
43
|
IInstance instance
|
33
44
|
)
|
34
45
|
{
|
35
|
-
NftId componentNftId =
|
46
|
+
NftId componentNftId = _registry.getNftId(msg.sender);
|
36
47
|
require(componentNftId.gtz(), "ERROR_COMPONENT_UNKNOWN");
|
37
48
|
|
38
49
|
info = getRegistry().getObjectInfo(componentNftId);
|
@@ -13,6 +13,7 @@ interface IBundle {
|
|
13
13
|
uint256 capitalAmount; // net investment capital + net premiums - payouts
|
14
14
|
uint256 lockedAmount; // capital amount linked to collateralizaion of non-closed policies (<= balance)
|
15
15
|
uint256 balanceAmount; // total amount of funds: capitalAmount + fees (balance >= captial)
|
16
|
+
uint256 lifetime;
|
16
17
|
Timestamp expiredAt; // no new policies
|
17
18
|
Timestamp closedAt; // no open policies, locked amount = 0
|
18
19
|
}
|
@@ -5,6 +5,7 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
5
5
|
|
6
6
|
import {Fee} from "../../types/Fee.sol";
|
7
7
|
import {NftId} from "../../types/NftId.sol";
|
8
|
+
import {LibNftIdSet} from "../../types/NftIdSet.sol";
|
8
9
|
import {UFixed} from "../../types/UFixed.sol";
|
9
10
|
import {TokenHandler} from "../../shared/TokenHandler.sol";
|
10
11
|
|
@@ -27,15 +27,15 @@ import {UFixed, UFixedLib} from "../../types/UFixed.sol";
|
|
27
27
|
import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
|
28
28
|
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
29
29
|
import {IProductComponent} from "../../components/IProductComponent.sol";
|
30
|
-
import {IService} from "
|
30
|
+
import {IService} from "../../shared/IService.sol";
|
31
31
|
import {IComponentOwnerService} from "./IComponentOwnerService.sol";
|
32
|
-
import {
|
32
|
+
import {Service} from "../../shared/Service.sol";
|
33
33
|
// import {IPool, IPoolModule} from "../module/IPoolModule.sol";
|
34
34
|
|
35
35
|
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
36
36
|
|
37
37
|
contract ComponentOwnerService is
|
38
|
-
|
38
|
+
Service,
|
39
39
|
IComponentOwnerService
|
40
40
|
{
|
41
41
|
using NftIdLib for NftId;
|
@@ -64,11 +64,11 @@ contract ComponentOwnerService is
|
|
64
64
|
address initialOwner
|
65
65
|
)
|
66
66
|
{
|
67
|
-
|
67
|
+
_initializeService(registry, initialOwner);
|
68
68
|
_registerInterface(type(IComponentOwnerService).interfaceId);
|
69
69
|
}
|
70
70
|
|
71
|
-
function getName() public pure override(IService,
|
71
|
+
function getName() public pure override(IService, Service) returns(string memory name) {
|
72
72
|
return NAME;
|
73
73
|
}
|
74
74
|
|
@@ -0,0 +1,99 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.19;
|
3
|
+
|
4
|
+
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
|
+
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
6
|
+
import {IInstance} from "../../instance/IInstance.sol";
|
7
|
+
import {InstanceReader} from "../../instance/InstanceReader.sol";
|
8
|
+
import {ISetup} from "../../instance/module/ISetup.sol";
|
9
|
+
import {ITreasury} from "../../instance/module/ITreasury.sol";
|
10
|
+
|
11
|
+
import {NftId, NftIdLib} from "../../types/NftId.sol";
|
12
|
+
import {Fee} from "../../types/Fee.sol";
|
13
|
+
import {DISTRIBUTION_OWNER_ROLE} from "../../types/RoleId.sol";
|
14
|
+
import {KEEP_STATE} from "../../types/StateId.sol";
|
15
|
+
import {DISTRIBUTION} from "../../types/ObjectType.sol";
|
16
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
17
|
+
|
18
|
+
import {IVersionable} from "../../shared/IVersionable.sol";
|
19
|
+
import {Versionable} from "../../shared/Versionable.sol";
|
20
|
+
|
21
|
+
import {IService} from "../../shared/IService.sol";
|
22
|
+
import {Service} from "../../shared/Service.sol";
|
23
|
+
import {ComponentServiceBase} from "../base/ComponentServiceBase.sol";
|
24
|
+
import {IDistributionService} from "./IDistributionService.sol";
|
25
|
+
import {Distribution} from "../../components/Distribution.sol";
|
26
|
+
import {InstanceService} from "../InstanceService.sol";
|
27
|
+
import {Instance} from "../Instance.sol";
|
28
|
+
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
29
|
+
|
30
|
+
string constant DISTRIBUTION_SERVICE_NAME = "DistributionService";
|
31
|
+
|
32
|
+
contract DistributionService is
|
33
|
+
ComponentServiceBase,
|
34
|
+
IDistributionService
|
35
|
+
{
|
36
|
+
using NftIdLib for NftId;
|
37
|
+
|
38
|
+
string public constant NAME = "DistributionService";
|
39
|
+
|
40
|
+
address internal _registryAddress;
|
41
|
+
|
42
|
+
function _initialize(
|
43
|
+
address owner,
|
44
|
+
bytes memory data
|
45
|
+
)
|
46
|
+
internal
|
47
|
+
initializer
|
48
|
+
virtual override
|
49
|
+
{
|
50
|
+
address initialOwner = address(0);
|
51
|
+
(_registryAddress, initialOwner) = abi.decode(data, (address, address));
|
52
|
+
|
53
|
+
_initializeService(_registryAddress, initialOwner);
|
54
|
+
|
55
|
+
_registerInterface(type(IService).interfaceId);
|
56
|
+
_registerInterface(type(IDistributionService).interfaceId);
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
function getName() public pure override(IService, Service) returns(string memory name) {
|
61
|
+
return NAME;
|
62
|
+
}
|
63
|
+
|
64
|
+
function register(address distributionComponentAddress)
|
65
|
+
external
|
66
|
+
onlyInstanceRole(DISTRIBUTION_OWNER_ROLE(), distributionComponentAddress)
|
67
|
+
returns (NftId distributionNftId)
|
68
|
+
{
|
69
|
+
address componentOwner = msg.sender;
|
70
|
+
Distribution distribution = Distribution(distributionComponentAddress);
|
71
|
+
IInstance instance = distribution.getInstance();
|
72
|
+
|
73
|
+
IRegistryService registryService = getRegistryService();
|
74
|
+
(IRegistry.ObjectInfo memory distributionObjInfo, ) = registryService.registerDistribution(
|
75
|
+
distribution,
|
76
|
+
componentOwner
|
77
|
+
);
|
78
|
+
distributionNftId = distributionObjInfo.nftId;
|
79
|
+
|
80
|
+
ISetup.DistributionSetupInfo memory initialSetup = distribution.getInitialSetupInfo();
|
81
|
+
instance.createDistributionSetup(distributionNftId, initialSetup);
|
82
|
+
}
|
83
|
+
|
84
|
+
function setFees(
|
85
|
+
Fee memory distributionFee
|
86
|
+
)
|
87
|
+
external
|
88
|
+
override
|
89
|
+
{
|
90
|
+
(IRegistry.ObjectInfo memory info , IInstance instance) = _getAndVerifyComponentInfoAndInstance(DISTRIBUTION());
|
91
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
92
|
+
NftId distributionNftId = info.nftId;
|
93
|
+
|
94
|
+
ISetup.DistributionSetupInfo memory distSetupInfo = instanceReader.getDistributionSetupInfo(distributionNftId);
|
95
|
+
distSetupInfo.distributionFee = distributionFee;
|
96
|
+
|
97
|
+
instance.updateDistributionSetup(distributionNftId, distSetupInfo, KEEP_STATE());
|
98
|
+
}
|
99
|
+
}
|
@@ -0,0 +1,53 @@
|
|
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 {DistributionService} from "./DistributionService.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 DistributionServiceManager is ProxyManager {
|
12
|
+
|
13
|
+
DistributionService private _distributionService;
|
14
|
+
|
15
|
+
/// @dev initializes proxy manager with distribution service implementation and deploys instance
|
16
|
+
constructor(
|
17
|
+
address registryAddress
|
18
|
+
)
|
19
|
+
ProxyManager()
|
20
|
+
{
|
21
|
+
DistributionService distSrv = new DistributionService();
|
22
|
+
bytes memory data = abi.encode(registryAddress, address(this));
|
23
|
+
IVersionable versionable = deploy(
|
24
|
+
address(distSrv),
|
25
|
+
data);
|
26
|
+
|
27
|
+
_distributionService = DistributionService(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
|
+
|
33
|
+
registryService.registerService(_distributionService);
|
34
|
+
|
35
|
+
// link ownership of instance service manager ot nft owner of instance service
|
36
|
+
_linkToNftOwnable(
|
37
|
+
address(registryAddress),
|
38
|
+
address(_distributionService));
|
39
|
+
|
40
|
+
// implies that after this constructor call only upgrade functionality is available
|
41
|
+
_isDeployed = true;
|
42
|
+
}
|
43
|
+
|
44
|
+
//--- view functions ----------------------------------------------------//
|
45
|
+
function getDistributionService()
|
46
|
+
external
|
47
|
+
view
|
48
|
+
returns (DistributionService distributionService)
|
49
|
+
{
|
50
|
+
return _distributionService;
|
51
|
+
}
|
52
|
+
|
53
|
+
}
|
@@ -5,7 +5,7 @@ import {NftId} from "../../types/NftId.sol";
|
|
5
5
|
import {ObjectType} from "../../types/ObjectType.sol";
|
6
6
|
import {RoleId} from "../../types/RoleId.sol";
|
7
7
|
import {IBaseComponent} from "../../components/IBaseComponent.sol";
|
8
|
-
import {IService} from "
|
8
|
+
import {IService} from "../../shared/IService.sol";
|
9
9
|
|
10
10
|
// TODO rename to registry service
|
11
11
|
interface IComponentOwnerService is IService {
|
@@ -3,7 +3,7 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {NftId} from "../../types/NftId.sol";
|
5
5
|
import {Fee} from "../../types/Fee.sol";
|
6
|
-
import {IService} from "
|
6
|
+
import {IService} from "../../shared/IService.sol";
|
7
7
|
|
8
8
|
interface IDistributionService is IService {
|
9
9
|
function setFees(
|
@@ -3,7 +3,7 @@ pragma solidity ^0.8.19;
|
|
3
3
|
|
4
4
|
import {NftId} from "../../types/NftId.sol";
|
5
5
|
import {Fee} from "../../types/Fee.sol";
|
6
|
-
import {IService} from "
|
6
|
+
import {IService} from "../../shared/IService.sol";
|
7
7
|
|
8
8
|
interface IPoolService is IService {
|
9
9
|
function setFees(
|
@@ -2,7 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.19;
|
3
3
|
|
4
4
|
import {IRisk} from "../module/IRisk.sol";
|
5
|
-
import {IService} from "
|
5
|
+
import {IService} from "../../shared/IService.sol";
|
6
6
|
|
7
7
|
import {NftId} from "../../types/NftId.sol";
|
8
8
|
import {ReferralId} from "../../types/Referral.sol";
|