@etherisc/gif-next 0.0.2-e769e2e-077 → 0.0.2-e79d227-681
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +77 -10
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +414 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1324 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +154 -546
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +380 -229
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +198 -96
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +186 -238
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +223 -47
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1429 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1979 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1430 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1177 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1606 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2281 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +808 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +153 -86
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +181 -119
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +174 -215
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1666 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +574 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +876 -160
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +260 -268
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +163 -81
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +506 -338
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.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/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +961 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +776 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +877 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +990 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +766 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1254 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +502 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +456 -187
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +218 -80
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +264 -26
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +115 -354
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +464 -223
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +152 -682
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +590 -382
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +190 -76
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +147 -161
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +147 -77
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1148 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +343 -168
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +200 -90
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +88 -8
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +196 -7
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +364 -121
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +134 -86
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +176 -160
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +51 -3
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +475 -294
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +199 -81
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +229 -275
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +172 -102
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +201 -486
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +638 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +718 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +412 -35
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +225 -196
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +761 -87
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1899 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +278 -306
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +154 -78
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +185 -135
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +79 -274
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +626 -252
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +209 -99
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +55 -101
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +74 -79
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +561 -13
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +120 -108
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +45 -13
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +34 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +23 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -30
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +36 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +49 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +129 -360
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +55 -98
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -62
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +26 -55
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +20 -124
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +62 -87
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +55 -101
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +697 -25
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +462 -634
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +546 -48
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +613 -871
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +185 -81
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +633 -173
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +166 -68
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +121 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +40 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +17 -12
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +124 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +36 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +71 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +618 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +616 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +289 -0
- package/contracts/authorization/IAccess.sol +49 -0
- package/contracts/authorization/IAccessAdmin.sol +137 -0
- package/contracts/authorization/IAuthorization.sol +60 -0
- package/contracts/authorization/IServiceAuthorization.sol +40 -0
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +106 -0
- package/contracts/distribution/BasicDistribution.sol +139 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +145 -124
- package/contracts/distribution/DistributionService.sol +156 -99
- package/contracts/distribution/DistributionServiceManager.sol +13 -25
- package/contracts/distribution/IDistributionComponent.sol +27 -41
- package/contracts/distribution/IDistributionService.sol +29 -10
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +431 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +58 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +108 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +345 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IInstance.sol +39 -44
- package/contracts/instance/IInstanceService.sol +33 -42
- package/contracts/instance/Instance.sol +137 -124
- package/contracts/instance/InstanceAdmin.sol +278 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +217 -0
- package/contracts/instance/InstanceReader.sol +249 -36
- package/contracts/instance/InstanceService.sol +227 -151
- package/contracts/instance/InstanceServiceManager.sol +14 -29
- package/contracts/instance/InstanceStore.sol +85 -57
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/BalanceStore.sol +12 -7
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/ObjectSet.sol +78 -0
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +11 -13
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +26 -25
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +47 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +156 -0
- package/contracts/oracle/OracleService.sol +309 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +175 -0
- package/contracts/pool/BasicPoolAuthorization.sol +68 -0
- package/contracts/pool/BundleService.sol +232 -122
- package/contracts/pool/BundleServiceManager.sol +13 -25
- package/contracts/pool/IBundleService.sol +34 -18
- package/contracts/pool/IPoolComponent.sol +20 -70
- package/contracts/pool/IPoolService.sol +57 -51
- package/contracts/pool/Pool.sol +208 -162
- package/contracts/pool/PoolService.sol +372 -181
- package/contracts/pool/PoolServiceManager.sol +12 -24
- package/contracts/product/ApplicationService.sol +90 -84
- package/contracts/product/ApplicationServiceManager.sol +12 -9
- package/contracts/product/BasicProduct.sol +49 -0
- package/contracts/product/BasicProductAuthorization.sol +42 -0
- package/contracts/product/ClaimService.sol +331 -153
- package/contracts/product/ClaimServiceManager.sol +12 -9
- package/contracts/product/IApplicationService.sol +7 -3
- package/contracts/product/IClaimService.sol +35 -5
- package/contracts/product/IPolicyService.sol +47 -35
- package/contracts/product/IPricingService.sol +11 -11
- package/contracts/product/IProductComponent.sol +26 -9
- package/contracts/product/{IProductService.sol → IRiskService.sol} +2 -2
- package/contracts/product/PolicyService.sol +524 -262
- package/contracts/product/PolicyServiceManager.sol +12 -27
- package/contracts/product/PricingService.sol +64 -64
- package/contracts/product/PricingServiceManager.sol +12 -24
- package/contracts/product/Product.sol +189 -139
- package/contracts/product/{ProductService.sol → RiskService.sol} +35 -50
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +68 -37
- package/contracts/registry/IRegistry.sol +90 -28
- package/contracts/registry/IRegistryService.sol +26 -43
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +424 -228
- package/contracts/registry/RegistryAdmin.sol +451 -0
- package/contracts/registry/RegistryService.sol +63 -149
- package/contracts/registry/RegistryServiceManager.sol +23 -30
- package/contracts/registry/ReleaseLifecycle.sol +30 -0
- package/contracts/registry/ReleaseRegistry.sol +485 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +175 -0
- package/contracts/registry/TokenRegistry.sol +187 -59
- package/contracts/shared/Component.sol +56 -125
- package/contracts/shared/ComponentService.sol +411 -201
- package/contracts/shared/ComponentServiceManager.sol +10 -7
- package/contracts/shared/ComponentVerifyingService.sol +40 -23
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +11 -18
- package/contracts/shared/IComponentService.sol +52 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +11 -16
- package/contracts/shared/IKeyValueStore.sol +2 -1
- package/contracts/shared/ILifecycle.sol +3 -2
- package/contracts/shared/INftOwnable.sol +3 -1
- package/contracts/shared/IPolicyHolder.sol +12 -17
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/IService.sol +9 -2
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +4 -4
- package/contracts/shared/InstanceLinkedComponent.sol +103 -43
- package/contracts/shared/KeyValueStore.sol +30 -68
- package/contracts/shared/Lifecycle.sol +30 -63
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +31 -22
- package/contracts/shared/PolicyHolder.sol +18 -50
- package/contracts/shared/Registerable.sol +19 -11
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +44 -37
- package/contracts/shared/TokenHandler.sol +358 -27
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +133 -37
- package/contracts/staking/IStakingService.sol +93 -41
- package/contracts/staking/StakeManagerLib.sol +224 -0
- package/contracts/staking/Staking.sol +394 -101
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +24 -18
- package/contracts/staking/StakingReader.sol +190 -0
- package/contracts/staking/StakingService.sol +282 -42
- package/contracts/staking/StakingServiceManager.sol +10 -7
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +39 -3
- package/contracts/type/Blocknumber.sol +20 -2
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +1 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +16 -4
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +178 -65
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +2 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +31 -5
- package/contracts/type/RoleId.sol +98 -74
- package/contracts/type/Seconds.sol +48 -1
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +41 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +17 -3
- package/contracts/type/UFixed.sol +38 -9
- package/contracts/type/Version.sol +4 -2
- package/contracts/{shared → upgradeability}/ProxyManager.sol +90 -27
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
- package/package.json +11 -7
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -132
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -673
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -636
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -308
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -688
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -569
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/contracts/instance/BundleManager.sol +0 -126
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -336
- package/contracts/instance/base/ObjectManager.sol +0 -82
- package/contracts/product/ProductServiceManager.sol +0 -54
- package/contracts/registry/RegistryAccessManager.sol +0 -213
- package/contracts/registry/ReleaseManager.sol +0 -375
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -4,15 +4,21 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
5
5
|
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
6
|
|
7
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
8
|
+
import {Amount} from "../type/Amount.sol";
|
9
|
+
import {BundleSet} from "./BundleSet.sol";
|
10
|
+
import {RiskSet} from "./RiskSet.sol";
|
11
|
+
import {ChainNft} from "../registry/ChainNft.sol";
|
7
12
|
import {NftId} from "../type/NftId.sol";
|
8
13
|
import {RoleId} from "../type/RoleId.sol";
|
9
|
-
import {
|
10
|
-
import {
|
14
|
+
import {SecondsLib} from "../type/Seconds.sol";
|
15
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
16
|
+
import {ADMIN_ROLE} from "../type/RoleId.sol";
|
17
|
+
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
11
18
|
|
12
19
|
import {Service} from "../shared/Service.sol";
|
13
20
|
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
14
21
|
import {IService} from "../shared/IService.sol";
|
15
|
-
import {AccessManagerUpgradeableInitializeable} from "../shared/AccessManagerUpgradeableInitializeable.sol";
|
16
22
|
|
17
23
|
import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
|
18
24
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
@@ -20,16 +26,18 @@ import {IProductComponent} from "../product/IProductComponent.sol";
|
|
20
26
|
|
21
27
|
import {IRegistry} from "../registry/IRegistry.sol";
|
22
28
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
23
|
-
import {
|
29
|
+
import {IStakingService} from "../staking/IStakingService.sol";
|
30
|
+
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
24
31
|
|
25
32
|
import {Instance} from "./Instance.sol";
|
26
33
|
import {IInstance} from "./IInstance.sol";
|
27
|
-
import {
|
34
|
+
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
28
35
|
import {IInstanceService} from "./IInstanceService.sol";
|
29
36
|
import {InstanceReader} from "./InstanceReader.sol";
|
30
|
-
import {BundleManager} from "./BundleManager.sol";
|
31
37
|
import {InstanceStore} from "./InstanceStore.sol";
|
32
|
-
import {
|
38
|
+
import {Seconds} from "../type/Seconds.sol";
|
39
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
40
|
+
|
33
41
|
|
34
42
|
contract InstanceService is
|
35
43
|
Service,
|
@@ -40,13 +48,38 @@ contract InstanceService is
|
|
40
48
|
bytes32 public constant INSTANCE_CREATION_CODE_HASH = bytes32(0);
|
41
49
|
|
42
50
|
IRegistryService internal _registryService;
|
43
|
-
|
44
|
-
|
51
|
+
IStakingService internal _stakingService;
|
52
|
+
|
53
|
+
address internal _masterAccessManager;
|
54
|
+
address internal _masterInstanceAdmin;
|
45
55
|
address internal _masterInstance;
|
46
56
|
address internal _masterInstanceReader;
|
47
|
-
address internal
|
57
|
+
address internal _masterInstanceBundleSet;
|
58
|
+
address internal _masterInstanceRiskSet;
|
48
59
|
address internal _masterInstanceStore;
|
49
60
|
|
61
|
+
|
62
|
+
modifier onlyInstance() {
|
63
|
+
address instanceAddress = msg.sender;
|
64
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
65
|
+
if (instanceNftId.eqz()) {
|
66
|
+
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
67
|
+
}
|
68
|
+
|
69
|
+
ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
|
70
|
+
if (objectType != INSTANCE()) {
|
71
|
+
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
72
|
+
}
|
73
|
+
|
74
|
+
VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
|
75
|
+
if (instanceVersion != getVersion().toMajorPart()) {
|
76
|
+
revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
|
77
|
+
}
|
78
|
+
|
79
|
+
_;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
50
83
|
modifier onlyInstanceOwner(NftId instanceNftId) {
|
51
84
|
if(msg.sender != getRegistry().ownerOf(instanceNftId)) {
|
52
85
|
revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
|
@@ -54,78 +87,101 @@ contract InstanceService is
|
|
54
87
|
_;
|
55
88
|
}
|
56
89
|
|
90
|
+
// TODO check component - service - instance version match
|
91
|
+
modifier onlyComponent() {
|
92
|
+
if (! getRegistry().isRegisteredComponent(msg.sender)) {
|
93
|
+
revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
|
94
|
+
}
|
95
|
+
_;
|
96
|
+
}
|
57
97
|
|
58
|
-
function
|
98
|
+
function createInstance()
|
59
99
|
external
|
60
100
|
returns (
|
61
|
-
|
62
|
-
NftId
|
101
|
+
IInstance instance,
|
102
|
+
NftId instanceNftId
|
63
103
|
)
|
64
104
|
{
|
105
|
+
// tx sender will become instance owner
|
65
106
|
address instanceOwner = msg.sender;
|
66
|
-
AccessManagerUpgradeableInitializeable clonedOzAccessManager = AccessManagerUpgradeableInitializeable(
|
67
|
-
Clones.clone(_masterOzAccessManager));
|
68
107
|
|
69
|
-
//
|
70
|
-
|
71
|
-
|
72
|
-
// Instance service will renounce ADMIN_ROLE when bootstraping is finished
|
73
|
-
clonedOzAccessManager.initialize(address(this));
|
108
|
+
// create instance admin and instance
|
109
|
+
InstanceAdmin instanceAdmin = _createInstanceAdmin();
|
110
|
+
instance = _createInstance(instanceAdmin, instanceOwner);
|
74
111
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
address(getRegistry()),
|
79
|
-
instanceOwner);
|
80
|
-
// initialize and set before instance reader
|
81
|
-
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
82
|
-
clonedInstanceStore.initialize(address(clonedInstance));
|
83
|
-
clonedInstance.setInstanceStore(clonedInstanceStore);
|
84
|
-
|
85
|
-
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
86
|
-
clonedInstanceReader.initialize(address(clonedInstance));
|
87
|
-
clonedInstance.setInstanceReader(clonedInstanceReader);
|
88
|
-
|
89
|
-
BundleManager clonedBundleManager = BundleManager(Clones.clone(_masterInstanceBundleManager));
|
90
|
-
clonedBundleManager.initialize(address(clonedInstance));
|
91
|
-
clonedInstance.setBundleManager(clonedBundleManager);
|
92
|
-
|
93
|
-
InstanceAccessManager clonedInstanceAccessManager = InstanceAccessManager(Clones.clone(_masterInstanceAccessManager));
|
94
|
-
clonedOzAccessManager.grantRole(ADMIN_ROLE().toInt(), address(clonedInstanceAccessManager), 0);
|
95
|
-
clonedInstanceAccessManager.initialize(address(clonedInstance));
|
96
|
-
clonedInstance.setInstanceAccessManager(clonedInstanceAccessManager);
|
97
|
-
|
98
|
-
// TODO amend setters with instance specific , policy manager ...
|
99
|
-
|
100
|
-
// TODO library does external calls -> but it is registry and access manager -> find out is it best practice
|
101
|
-
InstanceAuthorizationsLib.grantInitialAuthorizations(
|
102
|
-
clonedInstanceAccessManager,
|
103
|
-
clonedInstance,
|
104
|
-
clonedBundleManager,
|
105
|
-
clonedInstanceStore,
|
106
|
-
instanceOwner,
|
107
|
-
getRegistry(),
|
108
|
-
getVersion().toMajorPart());
|
112
|
+
// register cloned instance with registry
|
113
|
+
instanceNftId = _registryService.registerInstance(
|
114
|
+
instance, instanceOwner).nftId;
|
109
115
|
|
110
|
-
|
116
|
+
// register cloned instance as staking target
|
117
|
+
_stakingService.createInstanceTarget(
|
118
|
+
instanceNftId,
|
119
|
+
TargetManagerLib.getDefaultLockingPeriod(),
|
120
|
+
TargetManagerLib.getDefaultRewardRate());
|
111
121
|
|
112
|
-
|
113
|
-
|
122
|
+
// MUST be set after instance is set up and registered
|
123
|
+
instanceAdmin.initializeInstanceAuthorization(address(instance));
|
114
124
|
|
115
125
|
emit LogInstanceCloned(
|
116
|
-
|
117
|
-
address(
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
126
|
+
instanceNftId,
|
127
|
+
address(instance));
|
128
|
+
}
|
129
|
+
|
130
|
+
|
131
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
132
|
+
external
|
133
|
+
virtual
|
134
|
+
onlyInstance()
|
135
|
+
{
|
136
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
137
|
+
_stakingService.setInstanceLockingPeriod(
|
138
|
+
instanceNftId,
|
139
|
+
stakeLockingPeriod);
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
function setStakingRewardRate(UFixed rewardRate)
|
144
|
+
external
|
145
|
+
virtual
|
146
|
+
onlyInstance()
|
147
|
+
{
|
148
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
149
|
+
_stakingService.setInstanceRewardRate(
|
150
|
+
instanceNftId,
|
151
|
+
rewardRate);
|
152
|
+
}
|
153
|
+
|
154
|
+
|
155
|
+
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
|
156
|
+
external
|
157
|
+
virtual
|
158
|
+
onlyInstance()
|
159
|
+
{
|
160
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
161
|
+
_stakingService.refillInstanceRewardReserves(
|
162
|
+
instanceNftId,
|
163
|
+
rewardProvider,
|
164
|
+
dipAmount);
|
165
|
+
}
|
166
|
+
|
167
|
+
|
168
|
+
function withdrawStakingRewardReserves(Amount dipAmount)
|
169
|
+
external
|
170
|
+
virtual
|
171
|
+
onlyInstance()
|
172
|
+
returns (Amount newBalance)
|
173
|
+
{
|
174
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
175
|
+
_stakingService.withdrawInstanceRewardReserves(
|
176
|
+
instanceNftId,
|
177
|
+
dipAmount);
|
123
178
|
}
|
124
179
|
|
125
180
|
|
126
181
|
function setComponentLocked(bool locked)
|
127
182
|
external
|
128
183
|
virtual
|
184
|
+
onlyComponent()
|
129
185
|
{
|
130
186
|
// checks
|
131
187
|
address componentAddress = msg.sender;
|
@@ -137,18 +193,14 @@ contract InstanceService is
|
|
137
193
|
IRegistry registry = getRegistry();
|
138
194
|
NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
|
139
195
|
|
140
|
-
if (instanceNftId.eqz()) {
|
141
|
-
revert ErrorInstanceServiceComponentNotRegistered(componentAddress);
|
142
|
-
}
|
143
|
-
|
144
196
|
IInstance instance = IInstance(
|
145
|
-
registry.
|
146
|
-
instanceNftId).objectAddress);
|
197
|
+
registry.getObjectAddress(instanceNftId));
|
147
198
|
|
148
|
-
//
|
149
|
-
|
150
|
-
|
151
|
-
|
199
|
+
// no revert in case already locked
|
200
|
+
// TODO refactor/implement
|
201
|
+
// instance.getInstanceAdmin().setTargetLockedByService(
|
202
|
+
// componentAddress,
|
203
|
+
// locked);
|
152
204
|
}
|
153
205
|
|
154
206
|
|
@@ -156,49 +208,51 @@ contract InstanceService is
|
|
156
208
|
return _masterInstanceReader;
|
157
209
|
}
|
158
210
|
|
159
|
-
// From IService
|
160
|
-
function getDomain() public pure override returns(ObjectType) {
|
161
|
-
return INSTANCE();
|
162
|
-
}
|
163
|
-
|
164
211
|
function setAndRegisterMasterInstance(address instanceAddress)
|
165
212
|
external
|
166
213
|
onlyOwner
|
167
214
|
returns(NftId masterInstanceNftId)
|
168
215
|
{
|
169
216
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
170
|
-
if(
|
171
|
-
if(
|
172
|
-
if(
|
173
|
-
|
217
|
+
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
218
|
+
if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
|
219
|
+
if(_masterInstanceRiskSet != address(0)) { revert ErrorInstanceServiceMasterRiskSetAlreadySet(); }
|
174
220
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
175
221
|
|
176
222
|
IInstance instance = IInstance(instanceAddress);
|
177
|
-
|
178
|
-
|
223
|
+
address accessManagerAddress = instance.authority();
|
224
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
225
|
+
address instanceAdminAddress = address(instanceAdmin);
|
179
226
|
InstanceReader instanceReader = instance.getInstanceReader();
|
180
227
|
address instanceReaderAddress = address(instanceReader);
|
181
|
-
|
182
|
-
address
|
228
|
+
BundleSet bundleSet = instance.getBundleSet();
|
229
|
+
address bundleSetAddress = address(bundleSet);
|
230
|
+
RiskSet riskSet = instance.getRiskSet();
|
231
|
+
address riskSetAddress = address(riskSet);
|
183
232
|
InstanceStore instanceStore = instance.getInstanceStore();
|
184
233
|
address instanceStoreAddress = address(instanceStore);
|
185
234
|
|
186
|
-
if(
|
235
|
+
if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
|
236
|
+
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
187
237
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
188
|
-
if(
|
238
|
+
if(bundleSetAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
|
239
|
+
if(riskSetAddress == address(0)) { revert ErrorInstanceServiceRiskSetZero(); }
|
189
240
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
190
241
|
|
191
|
-
if(instance.authority() !=
|
192
|
-
if(
|
193
|
-
if(
|
194
|
-
if(
|
242
|
+
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
243
|
+
if(bundleSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
244
|
+
if(riskSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceRiskSetAuthorityMismatch(); }
|
245
|
+
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
246
|
+
if(bundleSet.getInstance() != instance) { revert ErrorInstanceServiceBundleSetInstanceMismatch(); }
|
247
|
+
if(riskSet.getInstance() != instance) { revert ErrorInstanceServiceRiskSetInstanceMismatch(); }
|
195
248
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
196
249
|
|
197
|
-
|
198
|
-
|
250
|
+
_masterAccessManager = accessManagerAddress;
|
251
|
+
_masterInstanceAdmin = instanceAdminAddress;
|
199
252
|
_masterInstance = instanceAddress;
|
200
253
|
_masterInstanceReader = instanceReaderAddress;
|
201
|
-
|
254
|
+
_masterInstanceBundleSet = bundleSetAddress;
|
255
|
+
_masterInstanceRiskSet = riskSetAddress;
|
202
256
|
_masterInstanceStore = instanceStoreAddress;
|
203
257
|
|
204
258
|
IInstance masterInstance = IInstance(_masterInstance);
|
@@ -206,7 +260,7 @@ contract InstanceService is
|
|
206
260
|
masterInstanceNftId = info.nftId;
|
207
261
|
}
|
208
262
|
|
209
|
-
function
|
263
|
+
function upgradeMasterInstanceReader(address instanceReaderAddress) external onlyOwner {
|
210
264
|
if(_masterInstanceReader == address(0)) { revert ErrorInstanceServiceMasterInstanceReaderNotSet(); }
|
211
265
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderAddressZero(); }
|
212
266
|
if(instanceReaderAddress == _masterInstanceReader) { revert ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader(); }
|
@@ -220,57 +274,67 @@ contract InstanceService is
|
|
220
274
|
function upgradeInstanceReader(NftId instanceNftId)
|
221
275
|
external
|
222
276
|
onlyInstanceOwner(instanceNftId)
|
277
|
+
onlyNftOfType(instanceNftId, INSTANCE())
|
223
278
|
{
|
224
279
|
IRegistry registry = getRegistry();
|
225
280
|
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
226
281
|
Instance instance = Instance(instanceInfo.objectAddress);
|
227
282
|
|
228
283
|
InstanceReader upgradedInstanceReaderClone = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
229
|
-
upgradedInstanceReaderClone.
|
284
|
+
upgradedInstanceReaderClone.initializeWithInstance(address(instance));
|
230
285
|
instance.setInstanceReader(upgradedInstanceReaderClone);
|
231
286
|
}
|
232
287
|
|
233
|
-
|
234
|
-
function
|
235
|
-
|
236
|
-
|
237
|
-
string memory targetName,
|
238
|
-
bytes4[][] memory selectors,
|
239
|
-
RoleId[] memory roles
|
240
|
-
)
|
241
|
-
external
|
288
|
+
/// @dev create new cloned instance admin
|
289
|
+
/// function used to setup a new instance
|
290
|
+
function _createInstanceAdmin()
|
291
|
+
internal
|
242
292
|
virtual
|
243
|
-
|
293
|
+
returns (InstanceAdmin clonedInstanceAdmin)
|
244
294
|
{
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
295
|
+
// start with setting up a new OZ access manager
|
296
|
+
AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
|
297
|
+
Clones.clone(_masterAccessManager));
|
298
|
+
|
299
|
+
// set up the instance admin
|
300
|
+
clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
|
301
|
+
clonedAccessManager.initialize(
|
302
|
+
address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
|
303
|
+
|
304
|
+
address authorization = address(
|
305
|
+
InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
|
306
|
+
clonedInstanceAdmin.initialize(
|
307
|
+
clonedAccessManager,
|
308
|
+
authorization);
|
252
309
|
}
|
253
310
|
|
254
311
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
RoleId[] memory roles
|
312
|
+
/// @dev create new cloned instance
|
313
|
+
/// function used to setup a new instance
|
314
|
+
function _createInstance(
|
315
|
+
InstanceAdmin instanceAdmin,
|
316
|
+
address instanceOwner
|
261
317
|
)
|
262
|
-
|
318
|
+
internal
|
263
319
|
virtual
|
264
|
-
|
265
|
-
// restricted()
|
320
|
+
returns (IInstance)
|
266
321
|
{
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
);
|
322
|
+
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
323
|
+
BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
|
324
|
+
RiskSet clonedRiskSet = RiskSet(Clones.clone(_masterInstanceRiskSet));
|
325
|
+
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
326
|
+
|
327
|
+
// clone instance
|
328
|
+
Instance clonedInstance = Instance(Clones.clone(_masterInstance));
|
329
|
+
clonedInstance.initialize(
|
330
|
+
instanceAdmin,
|
331
|
+
clonedInstanceStore,
|
332
|
+
clonedBundleSet,
|
333
|
+
clonedRiskSet,
|
334
|
+
clonedInstanceReader,
|
335
|
+
getRegistry(),
|
336
|
+
instanceOwner);
|
337
|
+
return clonedInstance;
|
274
338
|
}
|
275
339
|
|
276
340
|
|
@@ -285,18 +349,21 @@ contract InstanceService is
|
|
285
349
|
internal
|
286
350
|
virtual
|
287
351
|
{
|
352
|
+
// TODO instanceAdmin will check target instance match anyway
|
288
353
|
(
|
289
354
|
IInstance instance, // or instanceInfo
|
290
355
|
// or targetInfo
|
291
356
|
) = _validateInstanceAndComponent(instanceNftId, targetAddress);
|
292
357
|
|
293
|
-
|
294
|
-
|
358
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
359
|
+
|
360
|
+
// TODO refactor/implement
|
361
|
+
// instanceAdmin.createGifTarget(targetAddress, targetName);
|
362
|
+
|
295
363
|
// set proposed target config
|
296
|
-
// TODO restriction: gif targets are set only once and only here?
|
297
|
-
// assume config is a mix of gif and custom roles and no further configuration by INSTANCE_OWNER_ROLE is ever needed?
|
298
364
|
for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++) {
|
299
|
-
|
365
|
+
// TODO refactor/implement
|
366
|
+
// instanceAdmin.setTargetFunctionRoleByService(targetName, selectors[roleIdx], roles[roleIdx]);
|
300
367
|
}
|
301
368
|
}
|
302
369
|
|
@@ -306,23 +373,20 @@ contract InstanceService is
|
|
306
373
|
bytes memory data
|
307
374
|
)
|
308
375
|
internal
|
309
|
-
initializer
|
310
376
|
virtual override
|
377
|
+
initializer()
|
311
378
|
{
|
312
379
|
(
|
313
380
|
address registryAddress,
|
314
|
-
address
|
381
|
+
address authority
|
315
382
|
) = abi.decode(data, (address, address));
|
316
383
|
|
317
|
-
|
318
|
-
IRegistry(registryAddress).getServiceAddress(
|
319
|
-
REGISTRY(),
|
320
|
-
getVersion().toMajorPart()));
|
384
|
+
_initializeService(registryAddress, authority, owner);
|
321
385
|
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
386
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
387
|
+
_stakingService = IStakingService(_getServiceAddress(STAKING()));
|
388
|
+
|
389
|
+
_registerInterface(type(IInstanceService).interfaceId);
|
326
390
|
}
|
327
391
|
|
328
392
|
|
@@ -334,15 +398,27 @@ contract InstanceService is
|
|
334
398
|
IRegistry registry = getRegistry();
|
335
399
|
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
336
400
|
if(instanceInfo.objectType != INSTANCE()) {
|
337
|
-
revert
|
401
|
+
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
338
402
|
}
|
339
403
|
|
340
|
-
|
341
|
-
|
342
|
-
|
404
|
+
if (registry.getNftIdForAddress(componentAddress).gtz()) {
|
405
|
+
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
406
|
+
|
407
|
+
if(componentInfo.parentNftId != instanceNftId) {
|
408
|
+
revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
|
409
|
+
}
|
410
|
+
|
411
|
+
componentNftId = componentInfo.nftId;
|
412
|
+
} else {
|
413
|
+
|
343
414
|
}
|
344
415
|
|
345
416
|
instance = Instance(instanceInfo.objectAddress);
|
346
|
-
|
417
|
+
|
418
|
+
}
|
419
|
+
|
420
|
+
// From IService
|
421
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
422
|
+
return INSTANCE();
|
347
423
|
}
|
348
424
|
}
|
@@ -1,45 +1,30 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {ProxyManager} from "../shared/ProxyManager.sol";
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
7
6
|
import {InstanceService} from "./InstanceService.sol";
|
8
|
-
import {Registry} from "../registry/Registry.sol";
|
9
|
-
import {RegistryService} from "../registry/RegistryService.sol";
|
10
|
-
import {REGISTRY} from "../type/ObjectType.sol";
|
11
7
|
|
12
8
|
contract InstanceServiceManager is ProxyManager {
|
13
9
|
|
14
10
|
InstanceService private _instanceService;
|
15
11
|
|
16
|
-
/// @dev initializes proxy manager with instance service implementation
|
12
|
+
/// @dev initializes proxy manager with instance service implementation
|
17
13
|
constructor(
|
18
|
-
address
|
19
|
-
|
20
|
-
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
21
18
|
{
|
22
|
-
InstanceService
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
address(
|
27
|
-
data
|
19
|
+
InstanceService svc = new InstanceService{salt: salt}();
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
|
+
address(svc),
|
24
|
+
data,
|
25
|
+
salt);
|
28
26
|
|
29
27
|
_instanceService = InstanceService(address(versionable));
|
30
|
-
|
31
|
-
// TODO `this` must have a role or own nft to register service
|
32
|
-
//Registry registry = Registry(registryAddress);
|
33
|
-
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _instanceService.getMajorVersion());
|
34
|
-
//RegistryService registryService = RegistryService(registryServiceAddress);
|
35
|
-
//registryService.registerService(_instanceService);
|
36
|
-
// RegistryService registryService = _instanceService.getRegistryService();
|
37
|
-
|
38
|
-
// TODO no nft to link yet
|
39
|
-
// link ownership of instance service manager ot nft owner of instance service
|
40
|
-
//_linkToNftOwnable(
|
41
|
-
// address(registryAddress),
|
42
|
-
// address(_instanceService));
|
43
28
|
}
|
44
29
|
|
45
30
|
//--- view functions ----------------------------------------------------//
|