@etherisc/gif-next 0.0.2-90f8ffc-398 → 0.0.2-9105e58-225
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 +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +242 -34
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +592 -41
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +85 -27
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +327 -32
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +187 -43
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +85 -27
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +443 -54
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +342 -34
- 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/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/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 +673 -169
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +96 -34
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +762 -422
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +58 -53
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +289 -104
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +163 -57
- 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/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +151 -52
- 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/IAccess.sol/IAccess.json +13 -13
- 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/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +1047 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +543 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +282 -118
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +149 -51
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +932 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +523 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +426 -74
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +174 -48
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +612 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +130 -73
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +548 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +220 -31
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +44 -88
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +23 -31
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +23 -31
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +212 -149
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +162 -64
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +173 -74
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +146 -48
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +173 -74
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +146 -48
- 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 +15 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +82 -34
- 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 +28 -15
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +218 -63
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +142 -50
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
- 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 +41 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -29
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +48 -0
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +23 -31
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +113 -33
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +143 -39
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +126 -45
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +143 -44
- 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/shared/Versionable.sol/Versionable.json +2 -2
- 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 +126 -45
- 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 +161 -62
- 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/TestVersionable.sol/TestVersionable.json +8 -8
- 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/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- 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/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- 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/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/components/Component.sol +46 -20
- package/contracts/components/Distribution.sol +188 -33
- package/contracts/components/IComponent.sol +15 -3
- package/contracts/components/IDistributionComponent.sol +54 -1
- package/contracts/components/IPoolComponent.sol +48 -17
- package/contracts/components/Pool.sol +134 -95
- package/contracts/components/Product.sol +76 -57
- package/contracts/instance/IInstance.sol +21 -1
- package/contracts/instance/IInstanceService.sol +18 -0
- package/contracts/instance/Instance.sol +58 -36
- package/contracts/instance/InstanceAccessManager.sol +12 -13
- package/contracts/instance/InstanceService.sol +76 -35
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +1 -1
- package/contracts/instance/module/IAccess.sol +3 -4
- package/contracts/instance/module/IPolicy.sol +4 -2
- package/contracts/instance/module/ISetup.sol +5 -4
- package/contracts/instance/service/ApplicationService.sol +268 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +11 -6
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +185 -14
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +11 -1
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +53 -0
- package/contracts/instance/service/IPolicyService.sol +41 -46
- package/contracts/instance/service/PolicyService.sol +94 -158
- package/contracts/instance/service/PolicyServiceManager.sol +1 -1
- package/contracts/instance/service/PoolService.sol +2 -3
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +9 -9
- package/contracts/instance/service/ProductServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +3 -2
- package/contracts/registry/IRegistryService.sol +10 -8
- package/contracts/registry/Registry.sol +20 -8
- package/contracts/registry/RegistryService.sol +70 -49
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +8 -9
- package/contracts/registry/TokenRegistry.sol +15 -6
- package/contracts/shared/ERC165.sol +14 -12
- package/contracts/shared/INftOwnable.sol +11 -10
- package/contracts/shared/IPolicyHolder.sol +26 -0
- package/contracts/shared/IRegisterable.sol +3 -3
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IVersionable.sol +2 -2
- package/contracts/shared/NftOwnable.sol +66 -85
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +13 -5
- package/contracts/shared/Registerable.sol +6 -14
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +5 -5
- package/contracts/shared/Versionable.sol +3 -2
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/ObjectType.sol +9 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/RoleId.sol +3 -3
- package/package.json +3 -3
@@ -41,7 +41,10 @@ import {IPoolService} from "./IPoolService.sol";
|
|
41
41
|
import {IBundleService} from "./IBundleService.sol";
|
42
42
|
|
43
43
|
|
44
|
-
contract PolicyService is
|
44
|
+
contract PolicyService is
|
45
|
+
ComponentService,
|
46
|
+
IPolicyService
|
47
|
+
{
|
45
48
|
using NftIdLib for NftId;
|
46
49
|
using TimestampLib for Timestamp;
|
47
50
|
|
@@ -55,19 +58,19 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
55
58
|
bytes memory data
|
56
59
|
)
|
57
60
|
internal
|
58
|
-
initializer
|
59
61
|
virtual override
|
62
|
+
initializer
|
60
63
|
{
|
61
64
|
address registryAddress;
|
62
65
|
address initialOwner;
|
63
66
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
64
67
|
|
65
|
-
|
68
|
+
initializeService(registryAddress, owner);
|
66
69
|
|
67
|
-
_poolService = IPoolService(
|
68
|
-
_bundleService = IBundleService(
|
70
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getMajorVersion()));
|
71
|
+
_bundleService = IBundleService(getRegistry().getServiceAddress(BUNDLE(), getMajorVersion()));
|
69
72
|
|
70
|
-
|
73
|
+
registerInterface(type(IPolicyService).interfaceId);
|
71
74
|
}
|
72
75
|
|
73
76
|
|
@@ -81,6 +84,7 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
81
84
|
(productInfo,) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
82
85
|
product = Product(productInfo.objectAddress);
|
83
86
|
}
|
87
|
+
|
84
88
|
// TODO: no access restrictions
|
85
89
|
function calculatePremium(
|
86
90
|
RiskId riskId,
|
@@ -92,7 +96,7 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
92
96
|
)
|
93
97
|
public
|
94
98
|
view
|
95
|
-
override
|
99
|
+
virtual override
|
96
100
|
returns (
|
97
101
|
uint256 premiumAmount,
|
98
102
|
uint256 productFeeAmount,
|
@@ -168,65 +172,6 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
168
172
|
(bundleFeeAmount,) = FeeLib.calculateFee(bundleInfo.fee, netPremiumAmount);
|
169
173
|
}
|
170
174
|
|
171
|
-
|
172
|
-
function createApplication(
|
173
|
-
address applicationOwner,
|
174
|
-
RiskId riskId,
|
175
|
-
uint256 sumInsuredAmount,
|
176
|
-
uint256 lifetime,
|
177
|
-
bytes memory applicationData,
|
178
|
-
NftId bundleNftId,
|
179
|
-
ReferralId referralId
|
180
|
-
) external override returns (NftId policyNftId) {
|
181
|
-
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
182
|
-
// TODO: add validations (see create bundle in pool service)
|
183
|
-
|
184
|
-
policyNftId = getRegistryService().registerPolicy(
|
185
|
-
IRegistry.ObjectInfo(
|
186
|
-
zeroNftId(),
|
187
|
-
productInfo.nftId,
|
188
|
-
POLICY(),
|
189
|
-
false, // intercepting property for policies is defined on product
|
190
|
-
address(0),
|
191
|
-
applicationOwner,
|
192
|
-
""
|
193
|
-
)
|
194
|
-
);
|
195
|
-
|
196
|
-
(uint256 premiumAmount,,,,) = calculatePremium(
|
197
|
-
riskId,
|
198
|
-
sumInsuredAmount,
|
199
|
-
lifetime,
|
200
|
-
applicationData,
|
201
|
-
bundleNftId,
|
202
|
-
referralId
|
203
|
-
);
|
204
|
-
|
205
|
-
IPolicy.PolicyInfo memory policyInfo = IPolicy.PolicyInfo(
|
206
|
-
productInfo.nftId,
|
207
|
-
bundleNftId,
|
208
|
-
referralId,
|
209
|
-
riskId,
|
210
|
-
sumInsuredAmount,
|
211
|
-
premiumAmount,
|
212
|
-
0,
|
213
|
-
lifetime,
|
214
|
-
applicationData,
|
215
|
-
"",
|
216
|
-
0,
|
217
|
-
0,
|
218
|
-
0,
|
219
|
-
zeroTimestamp(),
|
220
|
-
zeroTimestamp(),
|
221
|
-
zeroTimestamp()
|
222
|
-
);
|
223
|
-
|
224
|
-
instance.createPolicy(policyNftId, policyInfo);
|
225
|
-
instance.updatePolicyState(policyNftId, APPLIED());
|
226
|
-
|
227
|
-
// TODO: add logging
|
228
|
-
}
|
229
|
-
|
230
175
|
function _getAndVerifyUnderwritingSetup(
|
231
176
|
IInstance instance,
|
232
177
|
InstanceReader instanceReader,
|
@@ -236,118 +181,78 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
236
181
|
internal
|
237
182
|
view
|
238
183
|
returns (
|
184
|
+
NftId poolNftId,
|
239
185
|
NftId bundleNftId,
|
240
186
|
IBundle.BundleInfo memory bundleInfo,
|
241
187
|
uint256 collateralAmount
|
242
188
|
)
|
243
189
|
{
|
244
190
|
// check match between policy and bundle (via pool)
|
191
|
+
poolNftId = productSetupInfo.poolNftId;
|
245
192
|
bundleNftId = policyInfo.bundleNftId;
|
246
193
|
bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
247
|
-
require(bundleInfo.poolNftId ==
|
194
|
+
require(bundleInfo.poolNftId == poolNftId, "POLICY_BUNDLE_MISMATCH");
|
248
195
|
|
249
196
|
// calculate required collateral
|
250
|
-
NftId poolNftId = productSetupInfo.poolNftId;
|
251
197
|
ISetup.PoolSetupInfo memory poolInfo = instanceReader.getPoolSetupInfo(poolNftId);
|
252
198
|
|
253
199
|
// obtain remaining return values
|
200
|
+
// TODO required collateral amount should be calculated by pool service, not policy service
|
254
201
|
collateralAmount = calculateRequiredCollateral(poolInfo.collateralizationLevel, policyInfo.sumInsuredAmount);
|
255
202
|
}
|
256
203
|
|
257
|
-
function _lockCollateralInBundle(
|
258
|
-
IInstance instance,
|
259
|
-
NftId bundleNftId,
|
260
|
-
IBundle.BundleInfo memory bundleInfo,
|
261
|
-
NftId policyNftId,
|
262
|
-
uint256 collateralAmount
|
263
|
-
)
|
264
|
-
internal
|
265
|
-
returns (IBundle.BundleInfo memory)
|
266
|
-
{
|
267
|
-
bundleInfo.lockedAmount += collateralAmount;
|
268
|
-
// TODO: track policy associated to bundle in bundlemanager (tbd) and how much is locked for it
|
269
|
-
return bundleInfo;
|
270
|
-
}
|
271
|
-
|
272
|
-
function _underwriteByPool(
|
273
|
-
NftId poolNftId,
|
274
|
-
NftId policyNftId,
|
275
|
-
IPolicy.PolicyInfo memory policyInfo,
|
276
|
-
bytes memory bundleFilter,
|
277
|
-
uint256 collateralAmount
|
278
|
-
)
|
279
|
-
internal
|
280
|
-
{
|
281
|
-
address poolAddress = getRegistry().getObjectInfo(poolNftId).objectAddress;
|
282
|
-
IPoolComponent pool = IPoolComponent(poolAddress);
|
283
|
-
pool.underwrite(
|
284
|
-
policyNftId,
|
285
|
-
policyInfo.applicationData,
|
286
|
-
bundleFilter,
|
287
|
-
collateralAmount);
|
288
|
-
}
|
289
|
-
|
290
204
|
|
291
|
-
function
|
205
|
+
function decline(
|
292
206
|
NftId policyNftId
|
293
207
|
)
|
294
208
|
external
|
295
209
|
override
|
296
210
|
{
|
297
|
-
require(false, "ERROR:PRS-
|
211
|
+
require(false, "ERROR:PRS-235:NOT_YET_IMPLEMENTED");
|
298
212
|
}
|
299
213
|
|
300
214
|
|
215
|
+
/// @dev underwites application which includes the locking of the required collateral from the pool.
|
301
216
|
function underwrite(
|
302
|
-
NftId policyNftId
|
217
|
+
NftId applicationNftId, // = policyNftId
|
303
218
|
bool requirePremiumPayment,
|
304
219
|
Timestamp activateAt
|
305
220
|
)
|
306
221
|
external
|
307
|
-
override
|
222
|
+
virtual override
|
308
223
|
{
|
309
224
|
// check caller is registered product
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
225
|
+
IInstance instance;
|
226
|
+
InstanceReader instanceReader;
|
227
|
+
NftId productNftId;
|
228
|
+
{
|
229
|
+
IRegistry.ObjectInfo memory productInfo;
|
230
|
+
(productInfo, instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
231
|
+
instanceReader = instance.getInstanceReader();
|
232
|
+
productNftId = productInfo.nftId;
|
233
|
+
}
|
315
234
|
|
316
|
-
// check
|
317
|
-
|
318
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
235
|
+
// check policy matches with calling product
|
236
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(applicationNftId);
|
319
237
|
require(policyInfo.productNftId == productNftId, "POLICY_PRODUCT_MISMATCH");
|
320
|
-
require(instanceReader.getPolicyState(policyNftId) == APPLIED(), "ERROR:PRS-021:STATE_NOT_APPLIED");
|
321
238
|
|
322
|
-
|
323
|
-
|
324
|
-
uint256 collateralAmount;
|
325
|
-
uint256 netPremiumAmount = 0; // > 0 if immediate premium payment
|
326
|
-
{
|
327
|
-
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
328
|
-
IBundle.BundleInfo memory bundleInfo;
|
329
|
-
|
330
|
-
(
|
331
|
-
bundleNftId,
|
332
|
-
bundleInfo,
|
333
|
-
collateralAmount
|
334
|
-
) = _getAndVerifyUnderwritingSetup(
|
335
|
-
instance,
|
336
|
-
instanceReader,
|
337
|
-
policyInfo,
|
338
|
-
productSetupInfo
|
339
|
-
);
|
340
|
-
}
|
239
|
+
// check policy is in state applied
|
240
|
+
require(instanceReader.getPolicyState(applicationNftId) == APPLIED(), "ERROR:PRS-021:STATE_NOT_APPLIED");
|
341
241
|
|
342
|
-
|
343
|
-
|
242
|
+
(
|
243
|
+
NftId poolNftId,
|
244
|
+
NftId bundleNftId,
|
245
|
+
IBundle.BundleInfo memory bundleInfo,
|
246
|
+
uint256 collateralAmount
|
247
|
+
) = _getAndVerifyUnderwritingSetup(
|
344
248
|
instance,
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
StateId newPolicyState = UNDERWRITTEN();
|
249
|
+
instanceReader,
|
250
|
+
policyInfo,
|
251
|
+
instanceReader.getProductSetupInfo(productNftId)
|
252
|
+
);
|
350
253
|
|
254
|
+
StateId newPolicyState = UNDERWRITTEN();
|
255
|
+
|
351
256
|
// optional activation of policy
|
352
257
|
if(activateAt > zeroTimestamp()) {
|
353
258
|
newPolicyState = ACTIVE();
|
@@ -355,38 +260,56 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
355
260
|
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
356
261
|
}
|
357
262
|
|
263
|
+
// lock bundle collateral
|
264
|
+
uint256 netPremiumAmount = 0; // > 0 if immediate premium payment
|
265
|
+
|
358
266
|
// optional collection of premium
|
359
267
|
if(requirePremiumPayment) {
|
360
268
|
netPremiumAmount = _processPremiumByTreasury(
|
361
269
|
instance,
|
362
|
-
|
363
|
-
|
270
|
+
productNftId,
|
271
|
+
applicationNftId,
|
364
272
|
policyInfo.premiumAmount);
|
365
273
|
|
366
274
|
policyInfo.premiumPaidAmount += policyInfo.premiumAmount;
|
367
275
|
}
|
368
276
|
|
369
|
-
|
370
|
-
|
277
|
+
// lock collateral and update bundle book keeping
|
278
|
+
// TODO introduct indirection via pool service?
|
279
|
+
// well pool would only need to be involved when a part of the collateral
|
280
|
+
// is provided by a "re insurance policy" of the pool
|
281
|
+
// but then again the policiy would likely best be attached to the bundle. really? why?
|
282
|
+
// retention level: fraction of sum insured that product will cover from pool funds directly
|
283
|
+
// eg retention level 30%, payouts up to 30% of the sum insured will be made from the product's pool directly
|
284
|
+
// for the remaining 70% the pool owns a policy that will cover claims that exceed the 30% of the sum insured
|
285
|
+
// open points:
|
286
|
+
// - do we need a link of a bundle to this policy or is it enough to know that the pool has an active policy?
|
287
|
+
// - when to buy such policies and for which amount? manual trigger or link to bundle creation and/or funding?
|
288
|
+
bundleInfo = _bundleService.lockCollateral(
|
289
|
+
instance,
|
290
|
+
applicationNftId,
|
291
|
+
bundleNftId,
|
292
|
+
collateralAmount,
|
293
|
+
netPremiumAmount);
|
371
294
|
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
);
|
384
|
-
}
|
295
|
+
instance.updatePolicy(applicationNftId, policyInfo, newPolicyState);
|
296
|
+
|
297
|
+
// also verify/confirm application by pool if necessary
|
298
|
+
if(instanceReader.getPoolSetupInfo(poolNftId).isVerifyingApplications) {
|
299
|
+
IPoolComponent pool = IPoolComponent(
|
300
|
+
getRegistry().getObjectInfo(poolNftId).objectAddress);
|
301
|
+
|
302
|
+
pool.verifyApplication(
|
303
|
+
applicationNftId,
|
304
|
+
policyInfo.applicationData,
|
305
|
+
bundleInfo.filter,
|
306
|
+
collateralAmount);
|
385
307
|
}
|
386
308
|
|
387
309
|
// TODO: add logging
|
388
310
|
}
|
389
311
|
|
312
|
+
|
390
313
|
function calculateRequiredCollateral(UFixed collateralizationLevel, uint256 sumInsuredAmount) public pure override returns(uint256 collateralAmount) {
|
391
314
|
UFixed sumInsuredUFixed = UFixedLib.toUFixed(sumInsuredAmount);
|
392
315
|
UFixed collateralUFixed = collateralizationLevel * sumInsuredUFixed;
|
@@ -442,9 +365,22 @@ contract PolicyService is ComponentService, IPolicyService {
|
|
442
365
|
// TODO: add logging
|
443
366
|
}
|
444
367
|
|
368
|
+
|
369
|
+
function expire(
|
370
|
+
NftId policyNftId
|
371
|
+
)
|
372
|
+
external
|
373
|
+
override
|
374
|
+
// solhint-disable-next-line no-empty-blocks
|
375
|
+
{
|
376
|
+
|
377
|
+
}
|
378
|
+
|
445
379
|
function close(
|
446
380
|
NftId policyNftId
|
447
|
-
)
|
381
|
+
)
|
382
|
+
external
|
383
|
+
override
|
448
384
|
{
|
449
385
|
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
450
386
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -16,7 +16,7 @@ contract PolicyServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
PolicyService svc = new PolicyService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -55,9 +55,8 @@ contract PoolService is
|
|
55
55
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
56
56
|
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
57
57
|
// owner is PoolServiceManager deployer
|
58
|
-
|
59
|
-
|
60
|
-
_registerInterface(type(IPoolService).interfaceId);
|
58
|
+
initializeService(registryAddress, owner);
|
59
|
+
registerInterface(type(IPoolService).interfaceId);
|
61
60
|
}
|
62
61
|
|
63
62
|
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
@@ -16,7 +16,7 @@ contract PoolServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
PoolService poolSrv = new PoolService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -60,11 +60,11 @@ contract ProductService is ComponentService, IProductService {
|
|
60
60
|
address initialOwner;
|
61
61
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
62
62
|
|
63
|
-
|
63
|
+
initializeService(registryAddress, owner);
|
64
64
|
|
65
|
-
_poolService = IPoolService(
|
65
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getMajorVersion()));
|
66
66
|
|
67
|
-
|
67
|
+
registerInterface(type(IProductService).interfaceId);
|
68
68
|
}
|
69
69
|
|
70
70
|
|
@@ -102,8 +102,8 @@ contract ProductService is ComponentService, IProductService {
|
|
102
102
|
{
|
103
103
|
// wire distribution and pool components to product component
|
104
104
|
ISetup.ProductSetupInfo memory setup = product.getSetupInfo();
|
105
|
-
IComponent distribution = IComponent(
|
106
|
-
IComponent pool = IComponent(
|
105
|
+
IComponent distribution = IComponent(getRegistry().getObjectInfo(setup.distributionNftId).objectAddress);
|
106
|
+
IComponent pool = IComponent(getRegistry().getObjectInfo(setup.poolNftId).objectAddress);
|
107
107
|
|
108
108
|
distribution.setProductNftId(productNftId);
|
109
109
|
pool.setProductNftId(productNftId);
|
@@ -115,7 +115,7 @@ contract ProductService is ComponentService, IProductService {
|
|
115
115
|
|
116
116
|
// create target for instane access manager
|
117
117
|
getInstanceService().createGifTarget(
|
118
|
-
|
118
|
+
getRegistry().getNftId(address(instance)),
|
119
119
|
address(product),
|
120
120
|
product.getName());
|
121
121
|
getInstanceService().grantProductDefaultPermissions(instance.getNftId(), address(product), product.getName());
|
@@ -140,13 +140,13 @@ contract ProductService is ComponentService, IProductService {
|
|
140
140
|
// revert WalletIsZero();
|
141
141
|
// }
|
142
142
|
|
143
|
-
// IRegistry.ObjectInfo memory tokenInfo =
|
143
|
+
// IRegistry.ObjectInfo memory tokenInfo = getRegistry().getObjectInfo(address(info.token));
|
144
144
|
|
145
145
|
// if(tokenInfo.objectType != TOKEN()) {
|
146
146
|
// revert InvalidToken();
|
147
147
|
// }
|
148
148
|
|
149
|
-
// IRegistry.ObjectInfo memory poolInfo =
|
149
|
+
// IRegistry.ObjectInfo memory poolInfo = getRegistry().getObjectInfo(info.poolNftId);
|
150
150
|
|
151
151
|
// if(poolInfo.objectType != POOL()) {
|
152
152
|
// revert InvalidPool();
|
@@ -160,7 +160,7 @@ contract ProductService is ComponentService, IProductService {
|
|
160
160
|
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
161
161
|
// // TODO pool is not linked
|
162
162
|
|
163
|
-
// IRegistry.ObjectInfo memory distributionInfo =
|
163
|
+
// IRegistry.ObjectInfo memory distributionInfo = getRegistry().getObjectInfo(info.distributionNftId);
|
164
164
|
|
165
165
|
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
166
166
|
// revert InvalidDistribution();
|
@@ -16,7 +16,7 @@ contract ProductServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
ProductService svc = new ProductService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
import {ChainNft} from "./ChainNft.sol";
|
7
6
|
import {NftId} from "../types/NftId.sol";
|
8
7
|
import {ObjectType} from "../types/ObjectType.sol";
|
9
8
|
import {VersionPart} from "../types/Version.sol";
|
@@ -92,7 +91,9 @@ interface IRegistry is IERC165 {
|
|
92
91
|
VersionPart releaseVersion
|
93
92
|
) external view returns (address serviceAddress);
|
94
93
|
|
95
|
-
function
|
94
|
+
function getReleaseManagerAddress() external view returns (address);
|
95
|
+
|
96
|
+
function getChainNftAddress() external view returns (address);
|
96
97
|
|
97
98
|
function getOwner() external view returns (address);
|
98
99
|
}
|
@@ -35,18 +35,18 @@ interface IRegistryService is
|
|
35
35
|
struct FunctionConfig
|
36
36
|
{
|
37
37
|
ObjectType serviceDomain;
|
38
|
-
bytes4
|
38
|
+
bytes4[] selectors;
|
39
39
|
}
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
function getFunctionConfigs()
|
42
|
+
external
|
43
|
+
pure
|
44
|
+
returns(
|
45
|
+
FunctionConfig[] memory config
|
46
|
+
);
|
47
47
|
|
48
48
|
// TODO used by service -> add owner arg
|
49
|
-
|
49
|
+
function registerInstance(IRegisterable instance, address owner)
|
50
50
|
external returns(IRegistry.ObjectInfo memory info);
|
51
51
|
|
52
52
|
function registerProduct(IComponent product, address owner)
|
@@ -58,6 +58,8 @@ interface IRegistryService is
|
|
58
58
|
function registerDistribution(IComponent distribution, address owner)
|
59
59
|
external returns(IRegistry.ObjectInfo memory info);
|
60
60
|
|
61
|
+
function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
62
|
+
|
61
63
|
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
62
64
|
|
63
65
|
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
@@ -1,12 +1,11 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
4
5
|
|
5
6
|
import {NftId, toNftId, zeroNftId} from "../types/NftId.sol";
|
6
7
|
import {VersionPart} from "../types/Version.sol";
|
7
|
-
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
8
|
-
|
9
|
-
import {ERC165} from "../shared/ERC165.sol";
|
8
|
+
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
10
9
|
|
11
10
|
import {ChainNft} from "./ChainNft.sol";
|
12
11
|
import {IRegistry} from "./IRegistry.sol";
|
@@ -23,7 +22,6 @@ import {ReleaseManager} from "./ReleaseManager.sol";
|
|
23
22
|
// 4) state object by regular service (POLICY, BUNDLE, STAKE)
|
24
23
|
|
25
24
|
contract Registry is
|
26
|
-
ERC165,
|
27
25
|
IRegistry
|
28
26
|
{
|
29
27
|
address public constant NFT_LOCK_ADDRESS = address(0x1);
|
@@ -75,8 +73,6 @@ contract Registry is
|
|
75
73
|
|
76
74
|
// set object types and object parent relations
|
77
75
|
_setupValidCoreTypesAndCombinations();
|
78
|
-
|
79
|
-
_registerInterface(type(IRegistry).interfaceId);
|
80
76
|
}
|
81
77
|
|
82
78
|
function registerService(
|
@@ -194,6 +190,10 @@ contract Registry is
|
|
194
190
|
return _chainNft.totalSupply();
|
195
191
|
}
|
196
192
|
|
193
|
+
function getReleaseManagerAddress() external view returns (address) {
|
194
|
+
return address(_releaseManager);
|
195
|
+
}
|
196
|
+
|
197
197
|
function getNftId() external view returns (NftId nftId) {
|
198
198
|
return _registryNftId;
|
199
199
|
}
|
@@ -246,14 +246,24 @@ contract Registry is
|
|
246
246
|
//}
|
247
247
|
}
|
248
248
|
|
249
|
-
function
|
250
|
-
return _chainNft;
|
249
|
+
function getChainNftAddress() external view override returns (address) {
|
250
|
+
return address(_chainNft);
|
251
251
|
}
|
252
252
|
|
253
253
|
function getOwner() public view returns (address owner) {
|
254
254
|
return ownerOf(address(this));
|
255
255
|
}
|
256
256
|
|
257
|
+
// IERC165
|
258
|
+
|
259
|
+
function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
|
260
|
+
if(interfaceId == type(IERC165).interfaceId || interfaceId == type(IRegistry).interfaceId) {
|
261
|
+
return true;
|
262
|
+
}
|
263
|
+
|
264
|
+
return false;
|
265
|
+
}
|
266
|
+
|
257
267
|
// Internals
|
258
268
|
|
259
269
|
/// @dev registry protects only against tampering existing records, registering with invalid types pairs and 0 parent address
|
@@ -442,6 +452,8 @@ contract Registry is
|
|
442
452
|
_coreContractCombinations[ORACLE()][INSTANCE()] = true;
|
443
453
|
_coreContractCombinations[POOL()][INSTANCE()] = true;
|
444
454
|
|
455
|
+
_coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
|
456
|
+
|
445
457
|
// product as parent, ONLY approved
|
446
458
|
_coreObjectCombinations[POLICY()][PRODUCT()] = true;
|
447
459
|
|