@etherisc/gif-next 0.0.2-8ce6c0b-352 → 0.0.2-8d681eb-812
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 +99 -8
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +659 -260
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +1279 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +456 -24
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +507 -206
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +215 -18
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +265 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +473 -17
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +152 -491
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +431 -36
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +83 -387
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +448 -386
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +168 -130
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +84 -198
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +278 -134
- 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 +1445 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2002 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +805 -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 +1388 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1152 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1612 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2389 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +805 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +471 -48
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +222 -64
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +475 -144
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1102 -390
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +369 -68
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1502 -539
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +239 -238
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +106 -106
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +863 -726
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -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/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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 +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +108 -355
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +429 -37
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +91 -140
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +69 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +84 -323
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +153 -190
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +132 -98
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +156 -421
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +430 -35
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +336 -209
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +153 -107
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +212 -35
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +120 -212
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +460 -308
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +110 -392
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +673 -552
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +173 -107
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +194 -178
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +110 -100
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +261 -439
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +430 -35
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +415 -234
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +150 -124
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +136 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +308 -16
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +365 -104
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +157 -83
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +245 -233
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +88 -8
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +459 -309
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +349 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +151 -109
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +232 -333
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +119 -141
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +253 -431
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +688 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +736 -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 +342 -42
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +144 -41
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- 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 +548 -103
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +763 -382
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1053 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +109 -292
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +104 -90
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2140 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +487 -253
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +489 -20
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +15 -15
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +67 -277
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +513 -597
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +142 -138
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +57 -111
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +616 -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/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +80 -100
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +476 -257
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +91 -140
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +148 -0
- 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 +55 -2
- 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 +83 -322
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +22 -57
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +122 -97
- 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 +57 -111
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +585 -12
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -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 +196 -143
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +152 -20
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +280 -397
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +136 -105
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +41 -73
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +205 -168
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +113 -95
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +209 -149
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +95 -49
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +63 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -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 +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +98 -37
- 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 +23 -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 +33 -31
- 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 +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +125 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +42 -157
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +50 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +109 -35
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +81 -80
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +462 -264
- package/contracts/authorization/AccessAdminLib.sol +387 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +159 -203
- package/contracts/authorization/IAccess.sol +25 -6
- package/contracts/authorization/IAccessAdmin.sol +80 -79
- package/contracts/authorization/IAuthorization.sol +9 -36
- package/contracts/authorization/IServiceAuthorization.sol +57 -17
- package/contracts/authorization/ServiceAuthorization.sol +254 -24
- package/contracts/distribution/BasicDistribution.sol +20 -28
- package/contracts/distribution/BasicDistributionAuthorization.sol +30 -10
- package/contracts/distribution/Distribution.sol +39 -95
- package/contracts/distribution/DistributionService.sol +237 -151
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionComponent.sol +5 -12
- package/contracts/distribution/IDistributionService.sol +44 -33
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +433 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +81 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +133 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +102 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +373 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +96 -43
- package/contracts/instance/IInstanceService.sol +43 -30
- package/contracts/instance/Instance.sol +183 -96
- package/contracts/instance/InstanceAdmin.sol +251 -162
- package/contracts/instance/InstanceAuthorizationV3.sol +114 -56
- package/contracts/instance/InstanceReader.sol +372 -72
- package/contracts/instance/InstanceService.sol +270 -199
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +24 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +11 -4
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +30 -19
- package/contracts/instance/module/IDistribution.sol +21 -9
- package/contracts/instance/module/IPolicy.sol +50 -29
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/mock/Dip.sol +1 -1
- package/contracts/oracle/BasicOracle.sol +1 -4
- package/contracts/oracle/BasicOracleAuthorization.sol +15 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +9 -25
- package/contracts/oracle/OracleService.sol +113 -81
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +37 -28
- package/contracts/pool/BasicPoolAuthorization.sol +40 -10
- package/contracts/pool/BundleService.sol +194 -83
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +31 -22
- package/contracts/pool/IPoolComponent.sol +21 -10
- package/contracts/pool/IPoolService.sol +90 -75
- package/contracts/pool/Pool.sol +145 -113
- package/contracts/pool/PoolLib.sol +260 -0
- package/contracts/pool/PoolService.sol +517 -220
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +87 -43
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +12 -45
- package/contracts/product/BasicProductAuthorization.sol +30 -12
- package/contracts/product/ClaimService.sol +366 -152
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +9 -2
- package/contracts/product/IClaimService.sol +44 -8
- package/contracts/product/IPolicyService.sol +53 -36
- package/contracts/product/IPricingService.sol +11 -10
- package/contracts/product/IProductComponent.sol +27 -5
- package/contracts/product/{IProductService.sol → IRiskService.sol} +8 -8
- package/contracts/product/PolicyService.sol +458 -269
- package/contracts/product/PolicyServiceLib.sol +86 -0
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +69 -60
- package/contracts/product/PricingServiceManager.sol +4 -4
- package/contracts/product/Product.sol +168 -93
- package/contracts/product/RiskService.sol +154 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +72 -40
- package/contracts/registry/IRegistry.sol +64 -28
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +357 -203
- package/contracts/registry/RegistryAdmin.sol +110 -287
- package/contracts/registry/RegistryAuthorization.sol +277 -0
- package/contracts/registry/RegistryService.sol +37 -48
- package/contracts/registry/RegistryServiceManager.sol +3 -3
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +8 -3
- package/contracts/registry/ReleaseRegistry.sol +275 -242
- package/contracts/registry/ServiceAuthorizationV3.sol +198 -57
- package/contracts/registry/TokenRegistry.sol +12 -13
- package/contracts/shared/Component.sol +65 -135
- package/contracts/shared/ComponentService.sol +435 -349
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +28 -17
- package/contracts/shared/ContractLib.sol +292 -0
- package/contracts/shared/IComponent.sol +5 -17
- package/contracts/shared/IComponentService.sol +42 -42
- package/contracts/shared/IInstanceLinkedComponent.sol +6 -32
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/IRegisterable.sol +23 -1
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +11 -3
- package/contracts/shared/InstanceLinkedComponent.sol +73 -50
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +31 -11
- package/contracts/shared/PolicyHolder.sol +17 -57
- package/contracts/shared/Registerable.sol +52 -21
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +20 -35
- package/contracts/shared/TokenHandler.sol +310 -26
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +25 -13
- package/contracts/staking/IStakingService.sol +16 -4
- package/contracts/staking/Staking.sol +103 -71
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +95 -45
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +18 -21
- package/contracts/staking/StakingService.sol +90 -37
- package/contracts/staking/StakingServiceManager.sol +6 -5
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/staking/TargetManagerLib.sol +8 -4
- package/contracts/type/Amount.sol +27 -5
- package/contracts/type/Blocknumber.sol +7 -1
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +7 -0
- package/contracts/type/ObjectType.sol +72 -36
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +1 -0
- package/contracts/type/RiskId.sol +38 -6
- package/contracts/type/RoleId.sol +61 -55
- package/contracts/type/Seconds.sol +21 -1
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +15 -1
- package/contracts/type/Timestamp.sol +10 -5
- package/contracts/type/UFixed.sol +56 -126
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +79 -43
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +5 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- 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 -708
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
- 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/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -460
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -10
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/product/ProductService.sol +0 -99
- package/contracts/product/ProductServiceManager.sol +0 -39
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -2,41 +2,31 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
5
|
-
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
|
-
|
7
|
-
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
8
|
-
import {Amount} from "../type/Amount.sol";
|
9
|
-
import {BundleSet} from "./BundleSet.sol";
|
10
|
-
import {ChainNft} from "../registry/ChainNft.sol";
|
11
|
-
import {NftId} from "../type/NftId.sol";
|
12
|
-
import {RoleId} from "../type/RoleId.sol";
|
13
|
-
import {SecondsLib} from "../type/Seconds.sol";
|
14
|
-
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
15
|
-
import {ADMIN_ROLE, DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE} from "../type/RoleId.sol";
|
16
|
-
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
17
|
-
|
18
|
-
import {Service} from "../shared/Service.sol";
|
19
|
-
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
20
|
-
import {IService} from "../shared/IService.sol";
|
21
|
-
|
22
|
-
import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
|
23
|
-
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
24
|
-
import {IProductComponent} from "../product/IProductComponent.sol";
|
25
5
|
|
6
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
7
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
8
|
+
import {IInstance} from "./IInstance.sol";
|
9
|
+
import {IInstanceService} from "./IInstanceService.sol";
|
26
10
|
import {IRegistry} from "../registry/IRegistry.sol";
|
27
11
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
28
12
|
import {IStakingService} from "../staking/IStakingService.sol";
|
29
|
-
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
30
13
|
|
14
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
15
|
+
import {Amount} from "../type/Amount.sol";
|
16
|
+
import {BundleSet} from "./BundleSet.sol";
|
31
17
|
import {Instance} from "./Instance.sol";
|
32
|
-
import {IModuleAuthorization} from "../authorization/IModuleAuthorization.sol";
|
33
|
-
import {IInstance} from "./IInstance.sol";
|
34
18
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
35
|
-
import {IInstanceService} from "./IInstanceService.sol";
|
36
19
|
import {InstanceReader} from "./InstanceReader.sol";
|
37
20
|
import {InstanceStore} from "./InstanceStore.sol";
|
21
|
+
import {NftId} from "../type/NftId.sol";
|
22
|
+
import {ObjectType, INSTANCE, COMPONENT, INSTANCE, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
23
|
+
import {RiskSet} from "./RiskSet.sol";
|
24
|
+
import {RoleId} from "../type/RoleId.sol";
|
38
25
|
import {Seconds} from "../type/Seconds.sol";
|
39
|
-
import {
|
26
|
+
import {Service} from "../shared/Service.sol";
|
27
|
+
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
28
|
+
import {UFixed} from "../type/UFixed.sol";
|
29
|
+
import {VersionPart} from "../type/Version.sol";
|
40
30
|
|
41
31
|
|
42
32
|
contract InstanceService is
|
@@ -49,113 +39,163 @@ contract InstanceService is
|
|
49
39
|
|
50
40
|
IRegistryService internal _registryService;
|
51
41
|
IStakingService internal _stakingService;
|
42
|
+
IComponentService internal _componentService;
|
52
43
|
|
53
44
|
address internal _masterAccessManager;
|
54
45
|
address internal _masterInstanceAdmin;
|
55
46
|
address internal _masterInstance;
|
56
47
|
address internal _masterInstanceReader;
|
57
48
|
address internal _masterInstanceBundleSet;
|
49
|
+
address internal _masterInstanceRiskSet;
|
58
50
|
address internal _masterInstanceStore;
|
59
51
|
|
60
52
|
|
61
|
-
modifier onlyInstance() {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
66
|
-
}
|
53
|
+
modifier onlyInstance() {
|
54
|
+
_checkInstance(msg.sender, getRelease());
|
55
|
+
_;
|
56
|
+
}
|
67
57
|
|
68
|
-
ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
|
69
|
-
if (objectType != INSTANCE()) {
|
70
|
-
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
71
|
-
}
|
72
58
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
59
|
+
/// @inheritdoc IInstanceService
|
60
|
+
function createRole(
|
61
|
+
string memory roleName,
|
62
|
+
RoleId adminRoleId,
|
63
|
+
uint32 maxMemberCount
|
64
|
+
)
|
65
|
+
external
|
66
|
+
restricted()
|
67
|
+
onlyInstance()
|
68
|
+
returns (RoleId roleId)
|
69
|
+
{
|
70
|
+
IInstance instance = IInstance(msg.sender);
|
71
|
+
roleId = instance.getInstanceAdmin().createRole(
|
72
|
+
roleName,
|
73
|
+
adminRoleId,
|
74
|
+
maxMemberCount);
|
75
|
+
}
|
77
76
|
|
78
|
-
|
77
|
+
|
78
|
+
/// @inheritdoc IInstanceService
|
79
|
+
function setRoleActive(RoleId roleId, bool active)
|
80
|
+
external
|
81
|
+
restricted()
|
82
|
+
onlyInstance()
|
83
|
+
{
|
84
|
+
IInstance instance = IInstance(msg.sender);
|
85
|
+
instance.getInstanceAdmin().setRoleActive(roleId, active);
|
79
86
|
}
|
80
87
|
|
81
88
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
/// @inheritdoc IInstanceService
|
90
|
+
function grantRole(RoleId roleId, address account)
|
91
|
+
external
|
92
|
+
restricted()
|
93
|
+
onlyInstance()
|
94
|
+
{
|
95
|
+
IInstance instance = IInstance(msg.sender);
|
96
|
+
instance.getInstanceAdmin().grantRole(roleId, account);
|
87
97
|
}
|
88
98
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
99
|
+
|
100
|
+
/// @inheritdoc IInstanceService
|
101
|
+
function revokeRole(RoleId roleId, address account)
|
102
|
+
external
|
103
|
+
restricted()
|
104
|
+
onlyInstance()
|
105
|
+
{
|
106
|
+
IInstance instance = IInstance(msg.sender);
|
107
|
+
instance.getInstanceAdmin().revokeRole(roleId, account);
|
95
108
|
}
|
96
109
|
|
97
|
-
|
110
|
+
|
111
|
+
/// @inheritdoc IInstanceService
|
112
|
+
function createTarget(address target, string memory name)
|
113
|
+
external
|
114
|
+
restricted()
|
115
|
+
onlyInstance()
|
116
|
+
returns (RoleId contractRoleId)
|
117
|
+
{
|
118
|
+
IInstance instance = IInstance(msg.sender);
|
119
|
+
return instance.getInstanceAdmin().createTarget(target, name);
|
120
|
+
}
|
121
|
+
|
122
|
+
|
123
|
+
/// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
|
124
|
+
function setTargetLocked(address target, bool locked)
|
125
|
+
external
|
126
|
+
virtual
|
127
|
+
restricted()
|
128
|
+
onlyInstance()
|
129
|
+
{
|
130
|
+
address instanceAddress = msg.sender;
|
131
|
+
IInstance(instanceAddress).getInstanceAdmin().setTargetLocked(target, locked);
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
/// @inheritdoc IInstanceService
|
136
|
+
function setInstanceLocked(bool locked)
|
137
|
+
external
|
138
|
+
virtual
|
139
|
+
restricted()
|
140
|
+
onlyInstance()
|
141
|
+
{
|
142
|
+
address instanceAddress = msg.sender;
|
143
|
+
IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
/// @inheritdoc IInstanceService
|
148
|
+
function createInstance(bool allowAnyToken)
|
98
149
|
external
|
150
|
+
virtual
|
151
|
+
restricted()
|
99
152
|
returns (
|
100
|
-
|
101
|
-
NftId
|
153
|
+
IInstance instance,
|
154
|
+
NftId instanceNftId
|
102
155
|
)
|
103
156
|
{
|
104
157
|
// tx sender will become instance owner
|
105
158
|
address instanceOwner = msg.sender;
|
106
159
|
|
107
|
-
//
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
// set up the instance admin
|
112
|
-
InstanceAdmin clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
|
113
|
-
clonedAccessManager.initialize(
|
114
|
-
address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
|
115
|
-
|
116
|
-
clonedInstanceAdmin.initialize(
|
117
|
-
clonedAccessManager,
|
118
|
-
InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
|
160
|
+
// create instance admin and instance
|
161
|
+
InstanceAdmin instanceAdmin = _cloneNewInstanceAdmin();
|
162
|
+
instance = _createInstance(instanceAdmin, instanceOwner, allowAnyToken);
|
119
163
|
|
120
|
-
|
121
|
-
|
122
|
-
|
164
|
+
// register cloned instance with registry
|
165
|
+
instanceNftId = _registryService.registerInstance(
|
166
|
+
instance, instanceOwner).nftId;
|
123
167
|
|
124
|
-
//
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
getRegistry(),
|
132
|
-
instanceOwner);
|
168
|
+
// MUST be set after instance is set up and registered
|
169
|
+
IAuthorization instanceAuthorization = InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization();
|
170
|
+
instanceAdmin.completeSetup(
|
171
|
+
address(getRegistry()),
|
172
|
+
address(instanceAuthorization),
|
173
|
+
getRelease(),
|
174
|
+
address(instance));
|
133
175
|
|
134
|
-
//
|
135
|
-
|
136
|
-
|
176
|
+
// hard checks for newly cloned instance
|
177
|
+
assert(address(instance.getRegistry()) == address(getRegistry()));
|
178
|
+
assert(instance.getRelease() == getRelease());
|
137
179
|
|
138
180
|
// register cloned instance as staking target
|
139
181
|
_stakingService.createInstanceTarget(
|
140
|
-
|
182
|
+
instanceNftId,
|
141
183
|
TargetManagerLib.getDefaultLockingPeriod(),
|
142
184
|
TargetManagerLib.getDefaultRewardRate());
|
143
185
|
|
144
|
-
// MUST be set after instance is set up and registered
|
145
|
-
clonedInstanceAdmin.initializeInstanceAuthorization(address(clonedInstance));
|
146
|
-
|
147
186
|
emit LogInstanceCloned(
|
148
|
-
|
149
|
-
address(
|
187
|
+
instanceNftId,
|
188
|
+
address(instance));
|
150
189
|
}
|
151
190
|
|
152
191
|
|
153
192
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
154
193
|
external
|
155
194
|
virtual
|
195
|
+
restricted()
|
156
196
|
onlyInstance()
|
157
197
|
{
|
158
|
-
NftId instanceNftId = getRegistry().
|
198
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
159
199
|
_stakingService.setInstanceLockingPeriod(
|
160
200
|
instanceNftId,
|
161
201
|
stakeLockingPeriod);
|
@@ -165,21 +205,35 @@ contract InstanceService is
|
|
165
205
|
function setStakingRewardRate(UFixed rewardRate)
|
166
206
|
external
|
167
207
|
virtual
|
208
|
+
restricted()
|
168
209
|
onlyInstance()
|
169
210
|
{
|
170
|
-
NftId instanceNftId = getRegistry().
|
211
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
171
212
|
_stakingService.setInstanceRewardRate(
|
172
213
|
instanceNftId,
|
173
214
|
rewardRate);
|
174
215
|
}
|
175
216
|
|
217
|
+
function setStakingMaxAmount(Amount maxStakedAmount)
|
218
|
+
external
|
219
|
+
virtual
|
220
|
+
restricted()
|
221
|
+
onlyInstance()
|
222
|
+
{
|
223
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
224
|
+
_stakingService.setInstanceMaxStakedAmount(
|
225
|
+
instanceNftId,
|
226
|
+
maxStakedAmount);
|
227
|
+
}
|
228
|
+
|
176
229
|
|
177
230
|
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
|
178
231
|
external
|
179
232
|
virtual
|
233
|
+
restricted()
|
180
234
|
onlyInstance()
|
181
235
|
{
|
182
|
-
NftId instanceNftId = getRegistry().
|
236
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
183
237
|
_stakingService.refillInstanceRewardReserves(
|
184
238
|
instanceNftId,
|
185
239
|
rewardProvider,
|
@@ -190,56 +244,42 @@ contract InstanceService is
|
|
190
244
|
function withdrawStakingRewardReserves(Amount dipAmount)
|
191
245
|
external
|
192
246
|
virtual
|
247
|
+
restricted()
|
193
248
|
onlyInstance()
|
194
249
|
returns (Amount newBalance)
|
195
250
|
{
|
196
|
-
NftId instanceNftId = getRegistry().
|
251
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
197
252
|
_stakingService.withdrawInstanceRewardReserves(
|
198
253
|
instanceNftId,
|
199
254
|
dipAmount);
|
200
255
|
}
|
201
256
|
|
202
257
|
|
203
|
-
function
|
204
|
-
external
|
205
|
-
|
206
|
-
|
258
|
+
function upgradeInstanceReader()
|
259
|
+
external
|
260
|
+
restricted()
|
261
|
+
onlyInstance()
|
207
262
|
{
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
}
|
214
|
-
|
215
|
-
IRegistry registry = getRegistry();
|
216
|
-
NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
|
217
|
-
|
218
|
-
IInstance instance = IInstance(
|
219
|
-
registry.getObjectInfo(
|
220
|
-
instanceNftId).objectAddress);
|
263
|
+
address instanceAddress = msg.sender;
|
264
|
+
IInstance instance = IInstance(msg.sender);
|
265
|
+
|
266
|
+
InstanceReader upgradedInstanceReaderClone = InstanceReader(
|
267
|
+
Clones.clone(address(_masterInstanceReader)));
|
221
268
|
|
222
|
-
|
223
|
-
|
224
|
-
// instance.getInstanceAdmin().setTargetLockedByService(
|
225
|
-
// componentAddress,
|
226
|
-
// locked);
|
269
|
+
upgradedInstanceReaderClone.initializeWithInstance(instanceAddress);
|
270
|
+
instance.setInstanceReader(upgradedInstanceReaderClone);
|
227
271
|
}
|
228
272
|
|
229
273
|
|
230
|
-
function getMasterInstanceReader() external view returns (address) {
|
231
|
-
return _masterInstanceReader;
|
232
|
-
}
|
233
|
-
|
234
274
|
function setAndRegisterMasterInstance(address instanceAddress)
|
235
|
-
|
236
|
-
|
237
|
-
|
275
|
+
external
|
276
|
+
onlyOwner()
|
277
|
+
returns(NftId masterInstanceNftId)
|
238
278
|
{
|
239
279
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
240
280
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
241
281
|
if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
|
242
|
-
|
282
|
+
if(_masterInstanceRiskSet != address(0)) { revert ErrorInstanceServiceMasterRiskSetAlreadySet(); }
|
243
283
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
244
284
|
|
245
285
|
IInstance instance = IInstance(instanceAddress);
|
@@ -248,28 +288,34 @@ contract InstanceService is
|
|
248
288
|
address instanceAdminAddress = address(instanceAdmin);
|
249
289
|
InstanceReader instanceReader = instance.getInstanceReader();
|
250
290
|
address instanceReaderAddress = address(instanceReader);
|
251
|
-
BundleSet
|
252
|
-
address
|
291
|
+
BundleSet bundleSet = instance.getBundleSet();
|
292
|
+
address bundleSetAddress = address(bundleSet);
|
293
|
+
RiskSet riskSet = instance.getRiskSet();
|
294
|
+
address riskSetAddress = address(riskSet);
|
253
295
|
InstanceStore instanceStore = instance.getInstanceStore();
|
254
296
|
address instanceStoreAddress = address(instanceStore);
|
255
297
|
|
256
298
|
if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
|
257
299
|
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
258
300
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
259
|
-
if(
|
301
|
+
if(bundleSetAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
|
302
|
+
if(riskSetAddress == address(0)) { revert ErrorInstanceServiceRiskSetZero(); }
|
260
303
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
261
304
|
|
262
305
|
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
263
|
-
if(
|
306
|
+
if(bundleSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
307
|
+
if(riskSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceRiskSetAuthorityMismatch(); }
|
264
308
|
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
265
|
-
if(
|
309
|
+
if(bundleSet.getInstanceAddress() != address(instance)) { revert ErrorInstanceServiceBundleSetInstanceMismatch(); }
|
310
|
+
if(riskSet.getInstanceAddress() != address(instance)) { revert ErrorInstanceServiceRiskSetInstanceMismatch(); }
|
266
311
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
267
312
|
|
268
313
|
_masterAccessManager = accessManagerAddress;
|
269
314
|
_masterInstanceAdmin = instanceAdminAddress;
|
270
315
|
_masterInstance = instanceAddress;
|
271
316
|
_masterInstanceReader = instanceReaderAddress;
|
272
|
-
_masterInstanceBundleSet =
|
317
|
+
_masterInstanceBundleSet = bundleSetAddress;
|
318
|
+
_masterInstanceRiskSet = riskSetAddress;
|
273
319
|
_masterInstanceStore = instanceStoreAddress;
|
274
320
|
|
275
321
|
IInstance masterInstance = IInstance(_masterInstance);
|
@@ -277,7 +323,11 @@ contract InstanceService is
|
|
277
323
|
masterInstanceNftId = info.nftId;
|
278
324
|
}
|
279
325
|
|
280
|
-
|
326
|
+
|
327
|
+
function upgradeMasterInstanceReader(address instanceReaderAddress)
|
328
|
+
external
|
329
|
+
onlyOwner
|
330
|
+
{
|
281
331
|
if(_masterInstanceReader == address(0)) { revert ErrorInstanceServiceMasterInstanceReaderNotSet(); }
|
282
332
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderAddressZero(); }
|
283
333
|
if(instanceReaderAddress == _masterInstanceReader) { revert ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader(); }
|
@@ -288,78 +338,61 @@ contract InstanceService is
|
|
288
338
|
_masterInstanceReader = instanceReaderAddress;
|
289
339
|
}
|
290
340
|
|
291
|
-
|
292
|
-
external
|
293
|
-
onlyInstanceOwner(instanceNftId)
|
294
|
-
{
|
295
|
-
IRegistry registry = getRegistry();
|
296
|
-
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
297
|
-
Instance instance = Instance(instanceInfo.objectAddress);
|
298
|
-
|
299
|
-
InstanceReader upgradedInstanceReaderClone = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
300
|
-
upgradedInstanceReaderClone.initializeWithInstance(address(instance));
|
301
|
-
instance.setInstanceReader(upgradedInstanceReaderClone);
|
302
|
-
}
|
303
|
-
|
341
|
+
//--- view functions ------------------------------------------------------------//
|
304
342
|
|
305
|
-
function
|
306
|
-
|
307
|
-
address targetAddress,
|
308
|
-
string memory targetName,
|
309
|
-
bytes4[][] memory selectors,
|
310
|
-
RoleId[] memory roles
|
311
|
-
)
|
312
|
-
external
|
313
|
-
virtual
|
314
|
-
restricted()
|
315
|
-
{
|
316
|
-
_createGifTarget(
|
317
|
-
instanceNftId,
|
318
|
-
targetAddress,
|
319
|
-
targetName,
|
320
|
-
roles,
|
321
|
-
selectors
|
322
|
-
);
|
343
|
+
function getMasterInstanceReader() external view returns (address) {
|
344
|
+
return _masterInstanceReader;
|
323
345
|
}
|
324
346
|
|
347
|
+
//--- internal functions --------------------------------------------------------//
|
325
348
|
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
external
|
349
|
+
/// @dev create new cloned instance admin
|
350
|
+
/// function used to setup a new instance
|
351
|
+
function _cloneNewInstanceAdmin()
|
352
|
+
internal
|
331
353
|
virtual
|
332
|
-
|
354
|
+
returns (InstanceAdmin clonedAdmin)
|
333
355
|
{
|
334
|
-
|
335
|
-
|
336
|
-
|
356
|
+
// clone instance specific access manager
|
357
|
+
AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
|
358
|
+
Clones.clone(
|
359
|
+
InstanceAdmin(_masterInstanceAdmin).authority()));
|
360
|
+
|
361
|
+
// set up the instance admin
|
362
|
+
clonedAdmin = InstanceAdmin(
|
363
|
+
Clones.clone(_masterInstanceAdmin));
|
337
364
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
component.getAuthorization());
|
365
|
+
clonedAdmin.initialize(
|
366
|
+
address(clonedAccessManager),
|
367
|
+
"InstanceAdmin");
|
342
368
|
}
|
343
369
|
|
344
370
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
371
|
+
/// @dev create new cloned instance
|
372
|
+
/// function used to setup a new instance
|
373
|
+
function _createInstance(
|
374
|
+
InstanceAdmin instanceAdmin,
|
375
|
+
address instanceOwner,
|
376
|
+
bool allowAnyToken
|
351
377
|
)
|
352
|
-
|
378
|
+
internal
|
353
379
|
virtual
|
354
|
-
|
380
|
+
returns (IInstance)
|
355
381
|
{
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
382
|
+
// clone instance
|
383
|
+
Instance clonedInstance = Instance(Clones.clone(_masterInstance));
|
384
|
+
clonedInstance.initialize(
|
385
|
+
instanceAdmin,
|
386
|
+
InstanceStore(Clones.clone(address(_masterInstanceStore))),
|
387
|
+
BundleSet(Clones.clone(_masterInstanceBundleSet)),
|
388
|
+
RiskSet(Clones.clone(_masterInstanceRiskSet)),
|
389
|
+
InstanceReader(Clones.clone(address(_masterInstanceReader))),
|
390
|
+
getRegistry(),
|
391
|
+
getRelease(),
|
392
|
+
instanceOwner,
|
393
|
+
allowAnyToken);
|
394
|
+
|
395
|
+
return clonedInstance;
|
363
396
|
}
|
364
397
|
|
365
398
|
|
@@ -391,28 +424,29 @@ contract InstanceService is
|
|
391
424
|
// instanceAdmin.setTargetFunctionRoleByService(targetName, selectors[roleIdx], roles[roleIdx]);
|
392
425
|
}
|
393
426
|
}
|
394
|
-
|
427
|
+
|
428
|
+
|
395
429
|
/// @dev top level initializer
|
396
430
|
function _initialize(
|
397
431
|
address owner,
|
398
432
|
bytes memory data
|
399
433
|
)
|
400
434
|
internal
|
401
|
-
initializer
|
402
435
|
virtual override
|
436
|
+
initializer()
|
403
437
|
{
|
404
438
|
(
|
405
|
-
address
|
406
|
-
|
407
|
-
|
408
|
-
) = abi.decode(data, (address, address, address));
|
439
|
+
address authority,
|
440
|
+
address registry
|
441
|
+
) = abi.decode(data, (address, address));
|
409
442
|
|
410
|
-
|
443
|
+
__Service_init(authority, registry, owner);
|
411
444
|
|
412
445
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
413
446
|
_stakingService = IStakingService(_getServiceAddress(STAKING()));
|
447
|
+
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
414
448
|
|
415
|
-
|
449
|
+
_registerInterface(type(IInstanceService).interfaceId);
|
416
450
|
}
|
417
451
|
|
418
452
|
|
@@ -427,15 +461,52 @@ contract InstanceService is
|
|
427
461
|
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
428
462
|
}
|
429
463
|
|
430
|
-
|
431
|
-
|
432
|
-
|
464
|
+
if (registry.getNftIdForAddress(componentAddress).gtz()) {
|
465
|
+
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
466
|
+
|
467
|
+
if(componentInfo.parentNftId != instanceNftId) {
|
468
|
+
revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
|
469
|
+
}
|
470
|
+
|
471
|
+
componentNftId = componentInfo.nftId;
|
472
|
+
} else {
|
473
|
+
|
433
474
|
}
|
434
475
|
|
435
476
|
instance = Instance(instanceInfo.objectAddress);
|
436
|
-
|
477
|
+
|
478
|
+
}
|
479
|
+
|
480
|
+
|
481
|
+
function _checkInstance(
|
482
|
+
address instanceAddress,
|
483
|
+
VersionPart expectedRelease
|
484
|
+
)
|
485
|
+
internal
|
486
|
+
virtual
|
487
|
+
view
|
488
|
+
{
|
489
|
+
IRegistry registry = getRegistry();
|
490
|
+
|
491
|
+
NftId instanceNftId = registry.getNftIdForAddress(instanceAddress);
|
492
|
+
if (instanceNftId.eqz()) {
|
493
|
+
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
494
|
+
}
|
495
|
+
|
496
|
+
ObjectType objectType = registry.getObjectInfo(instanceNftId).objectType;
|
497
|
+
if (objectType != INSTANCE()) {
|
498
|
+
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
499
|
+
}
|
500
|
+
|
501
|
+
if (expectedRelease.gtz()) {
|
502
|
+
VersionPart instanceRelease = IInstance(instanceAddress).getRelease();
|
503
|
+
if (instanceRelease != expectedRelease) {
|
504
|
+
revert ErrorInstanceServiceInstanceVersionMismatch(instanceNftId, expectedRelease, instanceRelease);
|
505
|
+
}
|
506
|
+
}
|
437
507
|
}
|
438
508
|
|
509
|
+
|
439
510
|
// From IService
|
440
511
|
function _getDomain() internal pure override returns(ObjectType) {
|
441
512
|
return INSTANCE();
|