@etherisc/gif-next 0.0.2-e1f23dc-329 → 0.0.2-e2d8c7d-942
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 -10
- 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/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 -11
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +144 -8
- 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 +69 -0
- 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 +17 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +156 -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 +55 -40
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +243 -95
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +82 -30
- 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 +0 -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 +2 -2
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +16 -48
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +8 -24
- 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/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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 +9 -158
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +9 -212
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +984 -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 +20 -228
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +10 -30
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +20 -346
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +10 -62
- 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/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- 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/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- 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/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- 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/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/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/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 +5 -1
- package/contracts/components/IBaseComponent.sol +6 -0
- package/contracts/components/IPoolComponent.sol +5 -1
- package/contracts/components/Pool.sol +39 -10
- package/contracts/components/Product.sol +15 -7
- 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 +6 -0
- package/contracts/instance/IInstanceBase.sol +26 -0
- package/contracts/instance/IInstanceService.sol +7 -3
- package/contracts/instance/Instance.sol +36 -15
- package/contracts/instance/InstanceAccessManager.sol +6 -6
- package/contracts/instance/InstanceBase.sol +41 -0
- package/contracts/instance/InstanceService.sol +171 -70
- package/contracts/instance/ObjectManager.sol +101 -0
- package/contracts/instance/base/ComponentServiceBase.sol +15 -77
- package/contracts/instance/module/ISetup.sol +3 -1
- package/contracts/instance/service/BundleService.sol +260 -0
- package/contracts/instance/service/BundleServiceManager.sol +54 -0
- package/contracts/instance/service/DistributionService.sol +38 -8
- package/contracts/instance/service/IBundleService.sol +45 -0
- package/contracts/instance/service/IPolicyService.sol +87 -0
- package/contracts/instance/service/IPoolService.sol +4 -25
- package/contracts/instance/service/IProductService.sol +3 -70
- package/contracts/instance/service/PolicyService.sol +508 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +41 -118
- package/contracts/instance/service/ProductService.sol +50 -441
- package/contracts/types/NftIdSet.sol +26 -24
- package/contracts/types/RoleId.sol +2 -0
- 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
@@ -6,6 +6,7 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
6
6
|
import {IRisk} from "../instance/module/IRisk.sol";
|
7
7
|
import {ITreasury} from "../instance/module/ITreasury.sol";
|
8
8
|
import {IProductService} from "../instance/service/IProductService.sol";
|
9
|
+
import {IPolicyService} from "../instance/service/IPolicyService.sol";
|
9
10
|
import {IProductComponent} from "./IProductComponent.sol";
|
10
11
|
import {NftId, zeroNftId, NftIdLib} from "../types/NftId.sol";
|
11
12
|
import {ObjectType, PRODUCT} from "../types/ObjectType.sol";
|
@@ -32,10 +33,12 @@ contract Product is BaseComponent, IProductComponent {
|
|
32
33
|
using NftIdLib for NftId;
|
33
34
|
|
34
35
|
IProductService internal _productService;
|
36
|
+
IPolicyService internal _policyService;
|
35
37
|
Pool internal _pool;
|
36
38
|
Distribution internal _distribution;
|
37
39
|
Fee internal _initialProductFee;
|
38
40
|
Fee internal _initialProcessingFee;
|
41
|
+
TokenHandler internal _tokenHandler;
|
39
42
|
|
40
43
|
NftId internal _poolNftId;
|
41
44
|
NftId internal _distributionNftId;
|
@@ -53,11 +56,14 @@ contract Product is BaseComponent, IProductComponent {
|
|
53
56
|
) BaseComponent(registry, instanceNftid, token, PRODUCT(), isInterceptor, initialOwner) {
|
54
57
|
// TODO add validation
|
55
58
|
_productService = _instance.getProductService();
|
59
|
+
_policyService = _instance.getPolicyService();
|
56
60
|
_pool = Pool(pool);
|
57
61
|
_distribution = Distribution(distribution);
|
58
62
|
_initialProductFee = productFee;
|
59
63
|
_initialProcessingFee = processingFee;
|
60
64
|
|
65
|
+
_tokenHandler = new TokenHandler(token);
|
66
|
+
|
61
67
|
_poolNftId = getRegistry().getNftId(address(_pool));
|
62
68
|
_distributionNftId = getRegistry().getNftId(address(_distribution));
|
63
69
|
|
@@ -78,7 +84,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
78
84
|
override
|
79
85
|
returns (uint256 premiumAmount)
|
80
86
|
{
|
81
|
-
(premiumAmount,,,,) =
|
87
|
+
(premiumAmount,,,,) = _policyService.calculatePremium(
|
82
88
|
riskId,
|
83
89
|
sumInsuredAmount,
|
84
90
|
lifetime,
|
@@ -151,7 +157,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
151
157
|
NftId bundleNftId,
|
152
158
|
ReferralId referralId
|
153
159
|
) internal returns (NftId nftId) {
|
154
|
-
nftId =
|
160
|
+
nftId = _policyService.createApplication(
|
155
161
|
applicationOwner,
|
156
162
|
riskId,
|
157
163
|
sumInsuredAmount,
|
@@ -169,7 +175,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
169
175
|
)
|
170
176
|
internal
|
171
177
|
{
|
172
|
-
|
178
|
+
_policyService.underwrite(
|
173
179
|
policyNftId,
|
174
180
|
requirePremiumPayment,
|
175
181
|
activateAt);
|
@@ -181,7 +187,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
181
187
|
)
|
182
188
|
internal
|
183
189
|
{
|
184
|
-
|
190
|
+
_policyService.collectPremium(
|
185
191
|
policyNftId,
|
186
192
|
activateAt);
|
187
193
|
}
|
@@ -192,7 +198,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
192
198
|
)
|
193
199
|
internal
|
194
200
|
{
|
195
|
-
|
201
|
+
_policyService.activate(
|
196
202
|
policyNftId,
|
197
203
|
activateAt);
|
198
204
|
}
|
@@ -268,7 +274,7 @@ contract Product is BaseComponent, IProductComponent {
|
|
268
274
|
abi.encode(
|
269
275
|
ISetup.ProductSetupInfo(
|
270
276
|
_token,
|
271
|
-
|
277
|
+
_tokenHandler,
|
272
278
|
_distributionNftId,
|
273
279
|
_poolNftId,
|
274
280
|
distributionSetupInfo.distributionFee,
|
@@ -276,7 +282,9 @@ contract Product is BaseComponent, IProductComponent {
|
|
276
282
|
_initialProcessingFee,
|
277
283
|
poolSetupInfo.poolFee,
|
278
284
|
poolSetupInfo.stakingFee,
|
279
|
-
poolSetupInfo.performanceFee
|
285
|
+
poolSetupInfo.performanceFee,
|
286
|
+
false,
|
287
|
+
_wallet
|
280
288
|
)
|
281
289
|
)
|
282
290
|
);
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
5
|
+
|
6
|
+
|
7
|
+
contract AccessManagerUpgradeableInitializeable is AccessManagerUpgradeable {
|
8
|
+
|
9
|
+
bool private _initialized;
|
10
|
+
|
11
|
+
function __AccessManagerUpgradeableInitializeable_init(address initialAdmin) public {
|
12
|
+
require(!_initialized, "AccessManager: already initialized");
|
13
|
+
|
14
|
+
if (initialAdmin == address(0)) {
|
15
|
+
revert AccessManagerInvalidInitialAdmin(address(0));
|
16
|
+
}
|
17
|
+
|
18
|
+
// admin is active immediately and without any execution delay.
|
19
|
+
_grantRole(ADMIN_ROLE, initialAdmin, 0, 0);
|
20
|
+
_initialized = true;
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IInstance} from "./IInstance.sol";
|
5
|
+
import {INSTANCE} from "../types/ObjectType.sol";
|
6
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
7
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
+
import {LibNftIdSet} from "../types/NftIdSet.sol";
|
10
|
+
import {NftId} from "../types/NftId.sol";
|
11
|
+
import {TimestampLib} from "../types/Timestamp.sol";
|
12
|
+
|
13
|
+
import {ObjectManager} from "./ObjectManager.sol";
|
14
|
+
|
15
|
+
contract BundleManager is
|
16
|
+
ObjectManager
|
17
|
+
{
|
18
|
+
|
19
|
+
event LogBundleManagerPolicyLinked(NftId bundleNftId, NftId policyNftId);
|
20
|
+
event LogBundleManagerPolicyUnlinked(NftId bundleNftId, NftId policyNftId);
|
21
|
+
|
22
|
+
event LogBundleManagerBundleAdded(NftId poolNftId, NftId bundleNftId);
|
23
|
+
event LogBundleManagerBundleUnlocked(NftId poolNftId, NftId bundleNftId);
|
24
|
+
event LogBundleManagerBundleLocked(NftId poolNftId, NftId bundleNftId);
|
25
|
+
|
26
|
+
error ErrorBundleManagerErrorPolicyAlreadyActivated(NftId policyNftId);
|
27
|
+
error ErrorBundleManagerErrorBundleLocked(NftId bundleNftId, NftId policyNftId);
|
28
|
+
error ErrorBundleManagerPolicyWithOpenClaims(NftId policyNftId, uint256 openClaimsCount);
|
29
|
+
error ErrorBundleManagerPolicyNotCloseable(NftId policyNftId);
|
30
|
+
error ErrorBundleManagerBundleUnknown(NftId bundleNftId);
|
31
|
+
error ErrorBundleManagerBundleNotRegistered(NftId bundleNftId);
|
32
|
+
|
33
|
+
mapping(NftId bundleNftId => LibNftIdSet.Set policies) internal _activePolicies;
|
34
|
+
|
35
|
+
constructor() ObjectManager() {
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
/// @dev links a policy with its bundle
|
40
|
+
// to link a policy it MUST NOT yet have been activated
|
41
|
+
// the bundle MUST be unlocked (active) for linking (underwriting) and registered with this instance
|
42
|
+
function linkPolicy(NftId policyNftId) external restricted() {
|
43
|
+
NftId bundleNftId = _instanceReader.getPolicyInfo(policyNftId).bundleNftId;
|
44
|
+
// decision will likely depend on the decision what to check here and what in the service
|
45
|
+
NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
46
|
+
|
47
|
+
// ensure bundle is unlocked (in active set) and registered with this instance
|
48
|
+
if (!_isActive(poolNftId, bundleNftId)) {
|
49
|
+
revert ErrorBundleManagerErrorBundleLocked(bundleNftId, policyNftId);
|
50
|
+
}
|
51
|
+
|
52
|
+
LibNftIdSet.add(_activePolicies[bundleNftId], policyNftId);
|
53
|
+
emit LogBundleManagerPolicyLinked(bundleNftId, policyNftId);
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
/// @dev unlinks a policy from its bundle
|
58
|
+
// to unlink a policy it must closable, ie. meet one of the following criterias
|
59
|
+
// - the policy MUST be past its expiry period and it MUST NOT have any open claims
|
60
|
+
// - the policy's payoutAmount MUST be equal to its sumInsuredAmount and MUST NOT have any open claims
|
61
|
+
function unlinkPolicy(NftId policyNftId) external restricted() {
|
62
|
+
IPolicy.PolicyInfo memory policyInfo = _instanceReader.getPolicyInfo(policyNftId);
|
63
|
+
|
64
|
+
NftId bundleNftId = policyInfo.bundleNftId;
|
65
|
+
// decision will likely depend on the decision what to check here and what in the service
|
66
|
+
NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
67
|
+
|
68
|
+
// ensure bundle is registered with this instance
|
69
|
+
if (!_contains(poolNftId, bundleNftId)) {
|
70
|
+
revert ErrorBundleManagerBundleUnknown(bundleNftId);
|
71
|
+
}
|
72
|
+
|
73
|
+
LibNftIdSet.remove(_activePolicies[bundleNftId], policyNftId);
|
74
|
+
emit LogBundleManagerPolicyUnlinked(policyInfo.bundleNftId, policyNftId);
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
/// @dev add a new bundle to a riskpool registerd with this instance
|
79
|
+
// the corresponding pool is fetched via instance reader
|
80
|
+
function add(NftId bundleNftId) external restricted() {
|
81
|
+
NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
82
|
+
|
83
|
+
// ensure pool is registered with instance
|
84
|
+
if(poolNftId.eqz()) {
|
85
|
+
revert ErrorBundleManagerBundleNotRegistered(bundleNftId);
|
86
|
+
}
|
87
|
+
|
88
|
+
_add(poolNftId, bundleNftId);
|
89
|
+
emit LogBundleManagerBundleAdded(poolNftId, bundleNftId);
|
90
|
+
}
|
91
|
+
|
92
|
+
/// @dev unlocked (active) bundles are available to underwrite new policies
|
93
|
+
function unlock(NftId bundleNftId) external restricted() {
|
94
|
+
NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
95
|
+
_activate(poolNftId, bundleNftId);
|
96
|
+
emit LogBundleManagerBundleUnlocked(poolNftId, bundleNftId);
|
97
|
+
}
|
98
|
+
|
99
|
+
/// @dev locked (deactivated) bundles may not underwrite any new policies
|
100
|
+
function lock(NftId bundleNftId) external restricted() {
|
101
|
+
NftId poolNftId = _instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
102
|
+
_deactivate(poolNftId, bundleNftId);
|
103
|
+
emit LogBundleManagerBundleLocked(poolNftId, bundleNftId);
|
104
|
+
}
|
105
|
+
|
106
|
+
function bundles(NftId poolNftId) external view returns(uint256) {
|
107
|
+
return _objects(poolNftId);
|
108
|
+
}
|
109
|
+
|
110
|
+
function getBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
|
111
|
+
return _getObject(poolNftId, idx);
|
112
|
+
}
|
113
|
+
|
114
|
+
function activeBundles(NftId poolNftId) external view returns(uint256) {
|
115
|
+
return _activeObjs(poolNftId);
|
116
|
+
}
|
117
|
+
|
118
|
+
function getActiveBundleNftId(NftId poolNftId, uint256 idx) external view returns(NftId bundleNftId) {
|
119
|
+
return _getActiveObject(poolNftId, idx);
|
120
|
+
}
|
121
|
+
|
122
|
+
function activePolicies(NftId bundleNftId) external view returns(uint256) {
|
123
|
+
return LibNftIdSet.size(_activePolicies[bundleNftId]);
|
124
|
+
}
|
125
|
+
|
126
|
+
function getActivePolicy(NftId bundleNftId, uint256 idx) external view returns(NftId policyNftId) {
|
127
|
+
return LibNftIdSet.getElementAt(_activePolicies[bundleNftId], idx);
|
128
|
+
}
|
129
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
6
|
+
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
8
|
+
|
9
|
+
abstract contract Cloneable is
|
10
|
+
AccessManagedUpgradeable
|
11
|
+
{
|
12
|
+
event CloneableInitialized(address authority, address registry);
|
13
|
+
|
14
|
+
error CloneableRegistryInvalid(address registry);
|
15
|
+
|
16
|
+
IRegistry internal _registry;
|
17
|
+
|
18
|
+
constructor() {
|
19
|
+
_registry = IRegistry(address(0));
|
20
|
+
}
|
21
|
+
|
22
|
+
/// @dev call to initialize MUST be made in the same transaction as cloning of the contract
|
23
|
+
function initialize(
|
24
|
+
address authority,
|
25
|
+
address registry
|
26
|
+
)
|
27
|
+
public
|
28
|
+
initializer
|
29
|
+
{
|
30
|
+
// check/handle access managed
|
31
|
+
__AccessManaged_init(authority);
|
32
|
+
|
33
|
+
// check/handle registry
|
34
|
+
if (registry.code.length == 0) {
|
35
|
+
revert CloneableRegistryInvalid(registry);
|
36
|
+
}
|
37
|
+
|
38
|
+
_registry = IRegistry(registry);
|
39
|
+
|
40
|
+
emit CloneableInitialized(authority, registry);
|
41
|
+
}
|
42
|
+
|
43
|
+
function getRegistry() external view returns (IRegistry) {
|
44
|
+
return _registry;
|
45
|
+
}
|
46
|
+
}
|
@@ -3,12 +3,15 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
+
import {BundleManager} from "./BundleManager.sol";
|
6
7
|
import {InstanceReader} from "./InstanceReader.sol";
|
7
8
|
|
8
9
|
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
9
10
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
10
11
|
import {IPoolService} from "./service/IPoolService.sol";
|
11
12
|
import {IProductService} from "./service/IProductService.sol";
|
13
|
+
import {IPolicyService} from "./service/IPolicyService.sol";
|
14
|
+
import {IBundleService} from "./service/IBundleService.sol";
|
12
15
|
import {IBundle} from "./module/IBundle.sol";
|
13
16
|
import {ISetup} from "./module/ISetup.sol";
|
14
17
|
import {NftId} from "../types/NftId.sol";
|
@@ -25,6 +28,8 @@ interface IInstance is IERC165, IKeyValueStore {
|
|
25
28
|
function getDistributionService() external view returns (IDistributionService);
|
26
29
|
function getProductService() external view returns (IProductService);
|
27
30
|
function getPoolService() external view returns (IPoolService);
|
31
|
+
function getPolicyService() external view returns (IPolicyService);
|
32
|
+
function getBundleService() external view returns (IBundleService);
|
28
33
|
|
29
34
|
function createDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup) external;
|
30
35
|
function updateDistributionSetup(NftId distributionNftId, ISetup.DistributionSetupInfo memory setup, StateId newState) external;
|
@@ -51,4 +56,5 @@ interface IInstance is IERC165, IKeyValueStore {
|
|
51
56
|
function updatePolicyState(NftId policyNftId, StateId newState) external;
|
52
57
|
|
53
58
|
function getInstanceReader() external view returns (InstanceReader);
|
59
|
+
function getBundleManager() external view returns (BundleManager);
|
54
60
|
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
+
|
6
|
+
import {BundleManager} from "./BundleManager.sol";
|
7
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
8
|
+
|
9
|
+
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
10
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
11
|
+
import {IPoolService} from "./service/IPoolService.sol";
|
12
|
+
import {IProductService} from "./service/IProductService.sol";
|
13
|
+
import {IBundle} from "./module/IBundle.sol";
|
14
|
+
import {ISetup} from "./module/ISetup.sol";
|
15
|
+
import {NftId} from "../types/NftId.sol";
|
16
|
+
import {StateId} from "../types/StateId.sol";
|
17
|
+
import {RiskId} from "../types/RiskId.sol";
|
18
|
+
import {IRisk} from "./module/IRisk.sol";
|
19
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
20
|
+
import {IKeyValueStore} from "./base/IKeyValueStore.sol";
|
21
|
+
|
22
|
+
|
23
|
+
interface IInstanceBase is IERC165, IKeyValueStore {
|
24
|
+
|
25
|
+
|
26
|
+
}
|
@@ -10,21 +10,25 @@ import {IRegistry} from "../registry/IRegistry.sol";
|
|
10
10
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
11
11
|
import {IBaseComponent} from "../components/IBaseComponent.sol";
|
12
12
|
|
13
|
-
import {
|
13
|
+
import {AccessManagerUpgradeableInitializeable} from "./AccessManagerUpgradeableInitializeable.sol";
|
14
14
|
import {Instance} from "./Instance.sol";
|
15
15
|
import {InstanceReader} from "./InstanceReader.sol";
|
16
|
+
import {BundleManager} from "./BundleManager.sol";
|
16
17
|
|
17
18
|
interface IInstanceService is IService {
|
18
19
|
|
20
|
+
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
21
|
+
|
19
22
|
event LogInstanceCloned(address clonedAccessManagerAddress, address clonedInstanceAddress, address clonedInstanceReaderAddress, NftId clonedInstanceNftId);
|
20
23
|
|
21
24
|
function createInstanceClone()
|
22
25
|
external
|
23
26
|
returns (
|
24
|
-
|
27
|
+
AccessManagerUpgradeableInitializeable clonedAccessManager,
|
25
28
|
Instance clonedInstance,
|
26
29
|
NftId instanceNftId,
|
27
|
-
InstanceReader clonedInstanceReader
|
30
|
+
InstanceReader clonedInstanceReader,
|
31
|
+
BundleManager clonedBundleManager
|
28
32
|
);
|
29
33
|
}
|
30
34
|
|
@@ -3,9 +3,10 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
5
5
|
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
|
+
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
7
|
+
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
8
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
6
9
|
|
7
|
-
import {AccessManagedSimple} from "./AccessManagedSimple.sol";
|
8
|
-
import {AccessManagerSimple} from "./AccessManagerSimple.sol";
|
9
10
|
import {IAccess} from "./module/IAccess.sol";
|
10
11
|
import {IBundle} from "./module/IBundle.sol";
|
11
12
|
import {IPolicy} from "./module/IPolicy.sol";
|
@@ -15,6 +16,7 @@ import {Key32, KeyId, Key32Lib} from "../types/Key32.sol";
|
|
15
16
|
import {KeyValueStore} from "./base/KeyValueStore.sol";
|
16
17
|
import {IInstance} from "./IInstance.sol";
|
17
18
|
import {InstanceReader} from "./InstanceReader.sol";
|
19
|
+
import {BundleManager} from "./BundleManager.sol";
|
18
20
|
import {NftId} from "../types/NftId.sol";
|
19
21
|
import {NumberId} from "../types/NumberId.sol";
|
20
22
|
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET} from "../types/ObjectType.sol";
|
@@ -28,14 +30,16 @@ import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
|
28
30
|
import {IDistributionService} from "./service/IDistributionService.sol";
|
29
31
|
import {IPoolService} from "./service/IPoolService.sol";
|
30
32
|
import {IProductService} from "./service/IProductService.sol";
|
33
|
+
import {IPolicyService} from "./service/IPolicyService.sol";
|
34
|
+
import {IBundleService} from "./service/IBundleService.sol";
|
31
35
|
import {VersionPart} from "../types/Version.sol";
|
36
|
+
import {InstanceBase} from "./InstanceBase.sol";
|
32
37
|
|
33
38
|
contract Instance is
|
34
|
-
|
35
|
-
KeyValueStore,
|
39
|
+
AccessManagedUpgradeable,
|
36
40
|
IInstance,
|
37
|
-
|
38
|
-
|
41
|
+
// Initializable,
|
42
|
+
InstanceBase
|
39
43
|
{
|
40
44
|
|
41
45
|
uint64 public constant ADMIN_ROLE = type(uint64).min;
|
@@ -52,20 +56,19 @@ contract Instance is
|
|
52
56
|
|
53
57
|
mapping(ShortString name => address target) internal _target;
|
54
58
|
|
55
|
-
|
59
|
+
AccessManagerUpgradeable internal _accessManager;
|
56
60
|
InstanceReader internal _instanceReader;
|
61
|
+
BundleManager internal _bundleManager;
|
57
62
|
|
58
|
-
|
63
|
+
function initialize(address accessManagerAddress, address registryAddress, NftId registryNftId, address initialOwner)
|
64
|
+
public
|
65
|
+
initializer
|
59
66
|
{
|
60
|
-
initialize(accessManagerAddress, registryAddress, registryNftId, msg.sender);
|
61
|
-
}
|
62
|
-
|
63
|
-
function initialize(address accessManagerAddress, address registryAddress, NftId registryNftId, address initialOwner) public {
|
64
67
|
require(!_initialized, "Contract instance has already been initialized");
|
65
68
|
|
66
|
-
|
69
|
+
__AccessManaged_init(accessManagerAddress);
|
67
70
|
|
68
|
-
_accessManager =
|
71
|
+
_accessManager = AccessManagerUpgradeable(accessManagerAddress);
|
69
72
|
_createRole(RoleIdLib.toRoleId(ADMIN_ROLE), "AdminRole", false, false);
|
70
73
|
_createRole(RoleIdLib.toRoleId(PUBLIC_ROLE), "PublicRole", false, false);
|
71
74
|
|
@@ -432,12 +435,30 @@ contract Instance is
|
|
432
435
|
return IPoolService(_registry.getServiceAddress("PoolService", VersionPart.wrap(3)));
|
433
436
|
}
|
434
437
|
|
438
|
+
function getPolicyService() external view returns (IPolicyService) {
|
439
|
+
return IPolicyService(_registry.getServiceAddress("PolicyService", VersionPart.wrap(3)));
|
440
|
+
}
|
441
|
+
|
442
|
+
function getBundleService() external view returns (IBundleService) {
|
443
|
+
return IBundleService(_registry.getServiceAddress("BundleService", VersionPart.wrap(3)));
|
444
|
+
}
|
445
|
+
|
435
446
|
function setInstanceReader(InstanceReader instanceReader) external restricted() {
|
436
|
-
require(
|
447
|
+
require(instanceReader.getInstanceNftId() == getNftId(), "NFT ID of InstanceReader does not match");
|
437
448
|
_instanceReader = instanceReader;
|
438
449
|
}
|
439
450
|
|
440
451
|
function getInstanceReader() external view returns (InstanceReader) {
|
441
452
|
return _instanceReader;
|
442
453
|
}
|
454
|
+
|
455
|
+
function setBundleManager(BundleManager bundleManager) external restricted() {
|
456
|
+
require(address(_bundleManager) == address(0), "BundleManager is set");
|
457
|
+
require(bundleManager.getInstanceNftId() == getNftId(), "NFT ID of BundleManager does not match");
|
458
|
+
_bundleManager = bundleManager;
|
459
|
+
}
|
460
|
+
|
461
|
+
function getBundleManager() external view returns (BundleManager) {
|
462
|
+
return _bundleManager;
|
463
|
+
}
|
443
464
|
}
|
@@ -3,9 +3,9 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
5
5
|
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
|
+
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
7
|
+
import {AccessManagerUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagerUpgradeable.sol";
|
6
8
|
|
7
|
-
import {AccessManagedSimple} from "./AccessManagedSimple.sol";
|
8
|
-
import {AccessManagerSimple} from "./AccessManagerSimple.sol";
|
9
9
|
import {IBundle} from "./module/IBundle.sol";
|
10
10
|
import {IPolicy} from "./module/IPolicy.sol";
|
11
11
|
import {IRisk} from "./module/IRisk.sol";
|
@@ -21,7 +21,7 @@ import {StateId, ACTIVE} from "../types/StateId.sol";
|
|
21
21
|
import {Timestamp, TimestampLib} from "../types/Timestamp.sol";
|
22
22
|
|
23
23
|
contract InstanceAccessManager is
|
24
|
-
|
24
|
+
AccessManagedUpgradeable
|
25
25
|
{
|
26
26
|
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
27
27
|
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
@@ -76,12 +76,12 @@ contract InstanceAccessManager is
|
|
76
76
|
mapping(ShortString name => address target) internal _targetForName;
|
77
77
|
address [] internal _targets;
|
78
78
|
|
79
|
-
|
79
|
+
AccessManagerUpgradeable internal _accessManager;
|
80
80
|
|
81
81
|
constructor(address accessManager)
|
82
82
|
{
|
83
|
-
_accessManager =
|
84
|
-
|
83
|
+
_accessManager = AccessManagerUpgradeable(accessManager);
|
84
|
+
__AccessManaged_init(accessManager);
|
85
85
|
|
86
86
|
_createRole(RoleIdLib.toRoleId(_accessManager.ADMIN_ROLE()), ADMIN_ROLE_NAME, false, false);
|
87
87
|
_createRole(RoleIdLib.toRoleId(_accessManager.PUBLIC_ROLE()), PUBLIC_ROLE_NAME, false, false);
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
5
|
+
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
|
+
|
7
|
+
import {IAccess} from "./module/IAccess.sol";
|
8
|
+
import {IBundle} from "./module/IBundle.sol";
|
9
|
+
import {IPolicy} from "./module/IPolicy.sol";
|
10
|
+
import {IRisk} from "./module/IRisk.sol";
|
11
|
+
import {ISetup} from "./module/ISetup.sol";
|
12
|
+
import {Key32, KeyId, Key32Lib} from "../types/Key32.sol";
|
13
|
+
import {KeyValueStore} from "./base/KeyValueStore.sol";
|
14
|
+
import {IInstance} from "./IInstance.sol";
|
15
|
+
import {InstanceReader} from "./InstanceReader.sol";
|
16
|
+
import {BundleManager} from "./BundleManager.sol";
|
17
|
+
import {NftId} from "../types/NftId.sol";
|
18
|
+
import {NumberId} from "../types/NumberId.sol";
|
19
|
+
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET} from "../types/ObjectType.sol";
|
20
|
+
import {RiskId, RiskIdLib} from "../types/RiskId.sol";
|
21
|
+
import {RoleId, RoleIdLib} from "../types/RoleId.sol";
|
22
|
+
import {StateId, ACTIVE} from "../types/StateId.sol";
|
23
|
+
import {ERC165} from "../shared/ERC165.sol";
|
24
|
+
import {Registerable} from "../shared/Registerable.sol";
|
25
|
+
import {ComponentOwnerService} from "./service/ComponentOwnerService.sol";
|
26
|
+
import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
|
27
|
+
import {IDistributionService} from "./service/IDistributionService.sol";
|
28
|
+
import {IPoolService} from "./service/IPoolService.sol";
|
29
|
+
import {IProductService} from "./service/IProductService.sol";
|
30
|
+
import {VersionPart} from "../types/Version.sol";
|
31
|
+
import {IInstanceBase} from "./IInstanceBase.sol";
|
32
|
+
|
33
|
+
contract InstanceBase is
|
34
|
+
IInstanceBase,
|
35
|
+
KeyValueStore,
|
36
|
+
ERC165,
|
37
|
+
Registerable
|
38
|
+
{
|
39
|
+
|
40
|
+
|
41
|
+
}
|