@etherisc/gif-next 0.0.2-bf51045-496 → 0.0.2-bf9f7e6-880
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +44 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +69 -62
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +29 -31
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +33 -9
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +454 -253
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -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 +227 -26
- 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 +353 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +105 -18
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +74 -157
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +212 -38
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +39 -95
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +271 -185
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +66 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +26 -82
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +159 -72
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +92 -88
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +193 -51
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +248 -237
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +212 -38
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +132 -173
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +212 -38
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +75 -68
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +123 -116
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +193 -51
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +338 -242
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +212 -38
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +158 -29
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +108 -9
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +187 -54
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +677 -325
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +193 -51
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +496 -324
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +121 -85
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -38
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +619 -559
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +96 -53
- 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 +2 -2
- 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/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +60 -51
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +194 -40
- 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 +30 -21
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +44 -35
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +75 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +65 -56
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +193 -51
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -207
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +42 -64
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +44 -86
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +40 -31
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +138 -193
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +53 -44
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +254 -299
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +70 -56
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +123 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +37 -27
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +176 -152
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +212 -38
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +244 -187
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -74
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +69 -3
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +105 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +48 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +157 -133
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +58 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +193 -173
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +54 -56
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +96 -108
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +35 -57
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +170 -146
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +131 -81
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -28
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +36 -12
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- 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/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +74 -50
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +553 -434
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +22 -24
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +333 -63
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +43 -34
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +147 -165
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +48 -50
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +113 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- 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 +30 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +71 -72
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +30 -21
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -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 +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +43 -34
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -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 +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +113 -39
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +131 -7
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +169 -97
- 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 +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +44 -32
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +168 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -29
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
- 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 +10 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- 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 +93 -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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- 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 +2 -2
- 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 +30 -6
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- 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/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 +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
- 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 +4 -4
- 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 +3 -4
- package/contracts/accounting/AccountingServiceManager.sol +1 -1
- package/contracts/accounting/IAccountingService.sol +2 -2
- package/contracts/authorization/AccessAdmin.sol +293 -204
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +307 -231
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +69 -36
- package/contracts/authorization/IAuthorization.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +13 -11
- package/contracts/distribution/BasicDistributionAuthorization.sol +21 -8
- package/contracts/distribution/Distribution.sol +13 -56
- package/contracts/distribution/DistributionService.sol +83 -55
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +18 -15
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -1
- package/contracts/examples/fire/FireProduct.sol +4 -7
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -5
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +29 -8
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +1 -1
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +51 -16
- package/contracts/instance/IInstanceService.sol +20 -2
- package/contracts/instance/Instance.sol +90 -25
- package/contracts/instance/InstanceAdmin.sol +261 -99
- package/contracts/instance/InstanceAuthorizationV3.sol +49 -36
- package/contracts/instance/InstanceReader.sol +103 -34
- package/contracts/instance/InstanceService.sol +154 -87
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +11 -12
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +19 -7
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +4 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +1 -3
- package/contracts/oracle/OracleService.sol +16 -15
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +21 -13
- package/contracts/pool/BundleService.sol +28 -58
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +13 -19
- package/contracts/pool/IPoolService.sol +50 -38
- package/contracts/pool/Pool.sol +9 -11
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +294 -154
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +24 -9
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -2
- package/contracts/product/BasicProductAuthorization.sol +23 -8
- package/contracts/product/ClaimService.sol +157 -139
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +11 -6
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +86 -158
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +30 -21
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +55 -15
- package/contracts/product/RiskService.sol +76 -29
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +12 -15
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryAdmin.sol +143 -342
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +146 -115
- package/contracts/registry/ServiceAuthorizationV3.sol +126 -2
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +17 -26
- package/contracts/shared/ComponentService.sol +141 -129
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/ContractLib.sol +60 -3
- package/contracts/shared/IComponent.sol +0 -4
- package/contracts/shared/IComponentService.sol +9 -13
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +2 -4
- package/contracts/shared/NftOwnable.sol +5 -5
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +45 -92
- package/contracts/staking/IStaking.sol +12 -10
- package/contracts/staking/IStakingService.sol +16 -1
- package/contracts/staking/Staking.sol +59 -28
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +6 -16
- package/contracts/staking/StakingService.sol +68 -44
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/ObjectType.sol +47 -39
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +27 -10
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +2 -2
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- 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/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -1,33 +1,38 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
6
|
-
import {DistributorType} from "../type/DistributorType.sol";
|
7
|
-
import {Key32} from "../type/Key32.sol";
|
8
|
-
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {COMPONENT, DISTRIBUTOR, DISTRIBUTION, PREMIUM, PRODUCT, POLICY, POOL, BUNDLE} from "../type/ObjectType.sol";
|
10
|
-
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
11
|
-
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
12
|
-
import {RequestId} from "../type/RequestId.sol";
|
13
|
-
import {RiskId} from "../type/RiskId.sol";
|
14
|
-
import {RoleId} from "../type/RoleId.sol";
|
15
|
-
import {StateId} from "../type/StateId.sol";
|
16
|
-
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
17
5
|
|
18
6
|
import {IBundle} from "../instance/module/IBundle.sol";
|
19
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
20
8
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
9
|
+
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
21
10
|
import {IInstance} from "./IInstance.sol";
|
22
11
|
import {IKeyValueStore} from "../shared/IKeyValueStore.sol";
|
23
12
|
import {IOracle} from "../oracle/IOracle.sol";
|
24
13
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
14
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
25
15
|
import {IRisk} from "../instance/module/IRisk.sol";
|
26
16
|
import {TimestampLib} from "../type/Timestamp.sol";
|
27
17
|
|
28
|
-
import {
|
18
|
+
import {Amount} from "../type/Amount.sol";
|
29
19
|
import {BundleSet} from "./BundleSet.sol";
|
20
|
+
import {BUNDLE, COMPONENT, DISTRIBUTOR, DISTRIBUTION, FEE, PREMIUM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
|
21
|
+
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
22
|
+
import {DistributorType} from "../type/DistributorType.sol";
|
23
|
+
import {InstanceStore} from "./InstanceStore.sol";
|
24
|
+
import {Key32} from "../type/Key32.sol";
|
25
|
+
import {NftId} from "../type/NftId.sol";
|
26
|
+
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
27
|
+
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
28
|
+
import {RequestId} from "../type/RequestId.sol";
|
29
|
+
import {RiskId} from "../type/RiskId.sol";
|
30
30
|
import {RiskSet} from "./RiskSet.sol";
|
31
|
+
import {RoleId} from "../type/RoleId.sol";
|
32
|
+
import {StateId} from "../type/StateId.sol";
|
33
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
34
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
35
|
+
|
31
36
|
|
32
37
|
|
33
38
|
contract InstanceReader {
|
@@ -37,10 +42,13 @@ contract InstanceReader {
|
|
37
42
|
|
38
43
|
bool private _initialized = false;
|
39
44
|
|
45
|
+
IRegistry internal _registry;
|
40
46
|
IInstance internal _instance;
|
47
|
+
|
41
48
|
InstanceStore internal _store;
|
42
49
|
BundleSet internal _bundleSet;
|
43
50
|
RiskSet internal _riskSet;
|
51
|
+
IDistributionService internal _distributionService;
|
44
52
|
|
45
53
|
/// @dev This initializer needs to be called from the instance itself.
|
46
54
|
function initialize() public {
|
@@ -51,7 +59,6 @@ contract InstanceReader {
|
|
51
59
|
initializeWithInstance(msg.sender);
|
52
60
|
}
|
53
61
|
|
54
|
-
/// @dev This initializer needs to be called from the instance itself.
|
55
62
|
function initializeWithInstance(address instanceAddress)
|
56
63
|
public
|
57
64
|
{
|
@@ -61,12 +68,41 @@ contract InstanceReader {
|
|
61
68
|
|
62
69
|
_initialized = true;
|
63
70
|
_instance = IInstance(instanceAddress);
|
71
|
+
_registry = _instance.getRegistry();
|
72
|
+
|
64
73
|
_store = _instance.getInstanceStore();
|
65
74
|
_bundleSet = _instance.getBundleSet();
|
66
75
|
_riskSet = _instance.getRiskSet();
|
76
|
+
_distributionService = IDistributionService(_registry.getServiceAddress(DISTRIBUTION(), _instance.getRelease()));
|
67
77
|
}
|
68
78
|
|
69
79
|
|
80
|
+
// instance level functions
|
81
|
+
|
82
|
+
function getRegistry() public view returns (IRegistry registry) {
|
83
|
+
return _registry;
|
84
|
+
}
|
85
|
+
|
86
|
+
function getInstanceNftId() public view returns (NftId instanceNftid) {
|
87
|
+
return _registry.getNftIdForAddress(address(_instance));
|
88
|
+
}
|
89
|
+
|
90
|
+
function getInstance() public view returns (IInstance instance) {
|
91
|
+
return _instance;
|
92
|
+
}
|
93
|
+
|
94
|
+
function components() public view returns (uint256 componentCount) {
|
95
|
+
return _instance.getInstanceAdmin().components();
|
96
|
+
}
|
97
|
+
|
98
|
+
function products() public view returns (uint256 productCount) {
|
99
|
+
return _instance.products();
|
100
|
+
}
|
101
|
+
|
102
|
+
function getProductNftId(uint256 idx) public view returns (NftId productNftId) {
|
103
|
+
return _instance.getProductNftId(idx);
|
104
|
+
}
|
105
|
+
|
70
106
|
// module specific functions
|
71
107
|
|
72
108
|
function getPolicyInfo(NftId policyNftId)
|
@@ -110,7 +146,7 @@ contract InstanceReader {
|
|
110
146
|
function bundles(NftId poolNftId)
|
111
147
|
public
|
112
148
|
view
|
113
|
-
returns (uint256
|
149
|
+
returns (uint256 bundleCount)
|
114
150
|
{
|
115
151
|
return _bundleSet.bundles(poolNftId);
|
116
152
|
}
|
@@ -118,7 +154,7 @@ contract InstanceReader {
|
|
118
154
|
function activeBundles(NftId poolNftId)
|
119
155
|
public
|
120
156
|
view
|
121
|
-
returns (uint256
|
157
|
+
returns (uint256 bundleCount)
|
122
158
|
{
|
123
159
|
return _bundleSet.activeBundles(poolNftId);
|
124
160
|
}
|
@@ -166,7 +202,7 @@ contract InstanceReader {
|
|
166
202
|
function claims(NftId policyNftId)
|
167
203
|
public
|
168
204
|
view
|
169
|
-
returns (uint16
|
205
|
+
returns (uint16 claimCount)
|
170
206
|
{
|
171
207
|
return getPolicyInfo(policyNftId).claimsCount;
|
172
208
|
}
|
@@ -204,7 +240,7 @@ contract InstanceReader {
|
|
204
240
|
function payouts(NftId policyNftId, ClaimId claimId)
|
205
241
|
public
|
206
242
|
view
|
207
|
-
returns (uint24
|
243
|
+
returns (uint24 payoutCount)
|
208
244
|
{
|
209
245
|
return getClaimInfo(policyNftId, claimId).payoutsCount;
|
210
246
|
}
|
@@ -250,7 +286,7 @@ contract InstanceReader {
|
|
250
286
|
function risks(NftId productNftId)
|
251
287
|
public
|
252
288
|
view
|
253
|
-
returns (uint256
|
289
|
+
returns (uint256 riskCount)
|
254
290
|
{
|
255
291
|
return _riskSet.risks(productNftId);
|
256
292
|
}
|
@@ -266,7 +302,7 @@ contract InstanceReader {
|
|
266
302
|
function activeRisks(NftId productNftId)
|
267
303
|
public
|
268
304
|
view
|
269
|
-
returns (uint256
|
305
|
+
returns (uint256 activeRiskCount)
|
270
306
|
{
|
271
307
|
return _riskSet.activeRisks(productNftId);
|
272
308
|
}
|
@@ -315,32 +351,43 @@ contract InstanceReader {
|
|
315
351
|
return _riskSet.getLinkedPolicyNftId(riskId, idx);
|
316
352
|
}
|
317
353
|
|
318
|
-
|
354
|
+
|
355
|
+
function getToken(NftId componentNftId)
|
319
356
|
public
|
320
357
|
view
|
321
|
-
returns (
|
358
|
+
returns (IERC20Metadata token)
|
322
359
|
{
|
323
|
-
|
360
|
+
TokenHandler tokenHandler = getTokenHandler(componentNftId);
|
361
|
+
if (address(tokenHandler) != address(0)) {
|
362
|
+
return tokenHandler.TOKEN();
|
363
|
+
}
|
364
|
+
}
|
324
365
|
|
325
|
-
|
326
|
-
|
327
|
-
|
366
|
+
|
367
|
+
function getWallet(NftId componentNftId)
|
368
|
+
public
|
369
|
+
view
|
370
|
+
returns (address wallet)
|
371
|
+
{
|
372
|
+
TokenHandler tokenHandler = getTokenHandler(componentNftId);
|
373
|
+
if (address(tokenHandler) != address(0)) {
|
374
|
+
return tokenHandler.getWallet();
|
328
375
|
}
|
329
376
|
}
|
330
377
|
|
378
|
+
|
331
379
|
function getTokenHandler(NftId componentNftId)
|
332
380
|
public
|
333
381
|
view
|
334
|
-
returns (
|
382
|
+
returns (TokenHandler tokenHandler)
|
335
383
|
{
|
336
384
|
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
337
|
-
|
338
385
|
if (data.length > 0) {
|
339
|
-
|
340
|
-
return address(info.tokenHandler);
|
386
|
+
return abi.decode(data, (IComponents.ComponentInfo)).tokenHandler;
|
341
387
|
}
|
342
388
|
}
|
343
389
|
|
390
|
+
|
344
391
|
function getBundleInfo(NftId bundleNftId)
|
345
392
|
public
|
346
393
|
view
|
@@ -408,6 +455,17 @@ contract InstanceReader {
|
|
408
455
|
}
|
409
456
|
}
|
410
457
|
|
458
|
+
function getFeeInfo(NftId productNftId)
|
459
|
+
public
|
460
|
+
view
|
461
|
+
returns (IComponents.FeeInfo memory feeInfo)
|
462
|
+
{
|
463
|
+
bytes memory data = _store.getData(toFeeKey(productNftId));
|
464
|
+
if (data.length > 0) {
|
465
|
+
return abi.decode(data, (IComponents.FeeInfo));
|
466
|
+
}
|
467
|
+
}
|
468
|
+
|
411
469
|
function getPoolInfo(NftId poolNftId)
|
412
470
|
public
|
413
471
|
view
|
@@ -430,6 +488,16 @@ contract InstanceReader {
|
|
430
488
|
}
|
431
489
|
}
|
432
490
|
|
491
|
+
function isReferralValid(NftId distributionNftId, ReferralId referralId)
|
492
|
+
external
|
493
|
+
view
|
494
|
+
returns (bool isValid)
|
495
|
+
{
|
496
|
+
return _distributionService.referralIsValid(
|
497
|
+
distributionNftId,
|
498
|
+
referralId);
|
499
|
+
}
|
500
|
+
|
433
501
|
function getRequestInfo(RequestId requestId)
|
434
502
|
public
|
435
503
|
view
|
@@ -554,11 +622,12 @@ contract InstanceReader {
|
|
554
622
|
return productNftId.toKey32(PRODUCT());
|
555
623
|
}
|
556
624
|
|
557
|
-
|
558
|
-
|
559
|
-
return _instance;
|
625
|
+
function toFeeKey(NftId productNftId) public pure returns (Key32) {
|
626
|
+
return productNftId.toKey32(FEE());
|
560
627
|
}
|
561
628
|
|
629
|
+
// low level function
|
630
|
+
|
562
631
|
function getInstanceStore() external view returns (IKeyValueStore store) {
|
563
632
|
return _store;
|
564
633
|
}
|
@@ -3,31 +3,29 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
5
5
|
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {ChainNft} from "../registry/ChainNft.sol";
|
11
|
-
import {NftId} from "../type/NftId.sol";
|
12
|
-
import {RoleId} from "../type/RoleId.sol";
|
13
|
-
import {UFixed} from "../type/UFixed.sol";
|
14
|
-
import {ObjectType, INSTANCE, COMPONENT, INSTANCE, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
15
|
-
|
16
|
-
import {Service} from "../shared/Service.sol";
|
17
|
-
|
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";
|
18
10
|
import {IRegistry} from "../registry/IRegistry.sol";
|
19
11
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
20
12
|
import {IStakingService} from "../staking/IStakingService.sol";
|
21
|
-
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
22
13
|
|
23
|
-
import {
|
14
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
15
|
+
import {Amount} from "../type/Amount.sol";
|
16
|
+
import {BundleSet} from "./BundleSet.sol";
|
24
17
|
import {Instance} from "./Instance.sol";
|
25
|
-
import {IInstance} from "./IInstance.sol";
|
26
18
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
27
|
-
import {IInstanceService} from "./IInstanceService.sol";
|
28
19
|
import {InstanceReader} from "./InstanceReader.sol";
|
29
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";
|
30
25
|
import {Seconds} from "../type/Seconds.sol";
|
26
|
+
import {Service} from "../shared/Service.sol";
|
27
|
+
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
28
|
+
import {UFixed} from "../type/UFixed.sol";
|
31
29
|
import {VersionPart} from "../type/Version.sol";
|
32
30
|
|
33
31
|
|
@@ -52,23 +50,8 @@ contract InstanceService is
|
|
52
50
|
address internal _masterInstanceStore;
|
53
51
|
|
54
52
|
|
55
|
-
modifier onlyInstance() {
|
56
|
-
|
57
|
-
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
58
|
-
if (instanceNftId.eqz()) {
|
59
|
-
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
60
|
-
}
|
61
|
-
|
62
|
-
ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
|
63
|
-
if (objectType != INSTANCE()) {
|
64
|
-
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
65
|
-
}
|
66
|
-
|
67
|
-
VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
|
68
|
-
if (instanceVersion != getVersion().toMajorPart()) {
|
69
|
-
revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
|
70
|
-
}
|
71
|
-
|
53
|
+
modifier onlyInstance() {
|
54
|
+
_checkInstance(msg.sender, getRelease());
|
72
55
|
_;
|
73
56
|
}
|
74
57
|
|
@@ -80,6 +63,7 @@ contract InstanceService is
|
|
80
63
|
_;
|
81
64
|
}
|
82
65
|
|
66
|
+
|
83
67
|
// TODO check component - service - instance version match
|
84
68
|
modifier onlyComponent() {
|
85
69
|
if (! getRegistry().isRegisteredComponent(msg.sender)) {
|
@@ -88,8 +72,34 @@ contract InstanceService is
|
|
88
72
|
_;
|
89
73
|
}
|
90
74
|
|
91
|
-
|
75
|
+
/// @inheritdoc IInstanceService
|
76
|
+
function setInstanceLocked(bool locked)
|
77
|
+
external
|
78
|
+
virtual
|
79
|
+
restricted()
|
80
|
+
onlyInstance()
|
81
|
+
{
|
82
|
+
address instanceAddress = msg.sender;
|
83
|
+
IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
/// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
|
88
|
+
function setTargetLocked(address target, bool locked)
|
89
|
+
external
|
90
|
+
virtual
|
91
|
+
restricted()
|
92
|
+
onlyInstance()
|
93
|
+
{
|
94
|
+
address instanceAddress = msg.sender;
|
95
|
+
IInstance(instanceAddress).getInstanceAdmin().setTargetLocked(target, locked);
|
96
|
+
}
|
97
|
+
|
98
|
+
/// @inheritdoc IInstanceService
|
99
|
+
function createInstance(bool allowAnyToken)
|
92
100
|
external
|
101
|
+
virtual
|
102
|
+
restricted()
|
93
103
|
returns (
|
94
104
|
IInstance instance,
|
95
105
|
NftId instanceNftId
|
@@ -99,22 +109,31 @@ contract InstanceService is
|
|
99
109
|
address instanceOwner = msg.sender;
|
100
110
|
|
101
111
|
// create instance admin and instance
|
102
|
-
InstanceAdmin instanceAdmin =
|
103
|
-
instance = _createInstance(instanceAdmin, instanceOwner);
|
112
|
+
InstanceAdmin instanceAdmin = _cloneNewInstanceAdmin();
|
113
|
+
instance = _createInstance(instanceAdmin, instanceOwner, allowAnyToken);
|
104
114
|
|
105
115
|
// register cloned instance with registry
|
106
116
|
instanceNftId = _registryService.registerInstance(
|
107
117
|
instance, instanceOwner).nftId;
|
108
118
|
|
119
|
+
// MUST be set after instance is set up and registered
|
120
|
+
IAuthorization instanceAuthorization = InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization();
|
121
|
+
instanceAdmin.completeSetup(
|
122
|
+
address(getRegistry()),
|
123
|
+
address(instance),
|
124
|
+
address(instanceAuthorization),
|
125
|
+
getRelease());
|
126
|
+
|
127
|
+
// hard checks for newly cloned instance
|
128
|
+
assert(address(instance.getRegistry()) == address(getRegistry()));
|
129
|
+
assert(instance.getRelease() == getRelease());
|
130
|
+
|
109
131
|
// register cloned instance as staking target
|
110
132
|
_stakingService.createInstanceTarget(
|
111
133
|
instanceNftId,
|
112
134
|
TargetManagerLib.getDefaultLockingPeriod(),
|
113
135
|
TargetManagerLib.getDefaultRewardRate());
|
114
136
|
|
115
|
-
// MUST be set after instance is set up and registered
|
116
|
-
instanceAdmin.initializeInstanceAuthorization(address(instance));
|
117
|
-
|
118
137
|
emit LogInstanceCloned(
|
119
138
|
instanceNftId,
|
120
139
|
address(instance));
|
@@ -124,6 +143,7 @@ contract InstanceService is
|
|
124
143
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
125
144
|
external
|
126
145
|
virtual
|
146
|
+
restricted()
|
127
147
|
onlyInstance()
|
128
148
|
{
|
129
149
|
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
@@ -136,6 +156,7 @@ contract InstanceService is
|
|
136
156
|
function setStakingRewardRate(UFixed rewardRate)
|
137
157
|
external
|
138
158
|
virtual
|
159
|
+
restricted()
|
139
160
|
onlyInstance()
|
140
161
|
{
|
141
162
|
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
@@ -144,10 +165,23 @@ contract InstanceService is
|
|
144
165
|
rewardRate);
|
145
166
|
}
|
146
167
|
|
168
|
+
function setStakingMaxAmount(Amount maxStakedAmount)
|
169
|
+
external
|
170
|
+
virtual
|
171
|
+
restricted()
|
172
|
+
onlyInstance()
|
173
|
+
{
|
174
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
175
|
+
_stakingService.setInstanceMaxStakedAmount(
|
176
|
+
instanceNftId,
|
177
|
+
maxStakedAmount);
|
178
|
+
}
|
179
|
+
|
147
180
|
|
148
181
|
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
|
149
182
|
external
|
150
183
|
virtual
|
184
|
+
restricted()
|
151
185
|
onlyInstance()
|
152
186
|
{
|
153
187
|
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
@@ -161,6 +195,7 @@ contract InstanceService is
|
|
161
195
|
function withdrawStakingRewardReserves(Amount dipAmount)
|
162
196
|
external
|
163
197
|
virtual
|
198
|
+
restricted()
|
164
199
|
onlyInstance()
|
165
200
|
returns (Amount newBalance)
|
166
201
|
{
|
@@ -170,14 +205,27 @@ contract InstanceService is
|
|
170
205
|
dipAmount);
|
171
206
|
}
|
172
207
|
|
173
|
-
|
174
|
-
|
208
|
+
|
209
|
+
function upgradeInstanceReader()
|
210
|
+
external
|
211
|
+
restricted()
|
212
|
+
onlyInstance()
|
213
|
+
{
|
214
|
+
address instanceAddress = msg.sender;
|
215
|
+
IInstance instance = IInstance(msg.sender);
|
216
|
+
|
217
|
+
InstanceReader upgradedInstanceReaderClone = InstanceReader(
|
218
|
+
Clones.clone(address(_masterInstanceReader)));
|
219
|
+
|
220
|
+
upgradedInstanceReaderClone.initializeWithInstance(instanceAddress);
|
221
|
+
instance.setInstanceReader(upgradedInstanceReaderClone);
|
175
222
|
}
|
176
223
|
|
224
|
+
|
177
225
|
function setAndRegisterMasterInstance(address instanceAddress)
|
178
|
-
|
179
|
-
|
180
|
-
|
226
|
+
external
|
227
|
+
onlyOwner()
|
228
|
+
returns(NftId masterInstanceNftId)
|
181
229
|
{
|
182
230
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
183
231
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
@@ -209,8 +257,8 @@ contract InstanceService is
|
|
209
257
|
if(bundleSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
210
258
|
if(riskSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceRiskSetAuthorityMismatch(); }
|
211
259
|
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
212
|
-
if(bundleSet.
|
213
|
-
if(riskSet.
|
260
|
+
if(bundleSet.getInstanceAddress() != address(instance)) { revert ErrorInstanceServiceBundleSetInstanceMismatch(); }
|
261
|
+
if(riskSet.getInstanceAddress() != address(instance)) { revert ErrorInstanceServiceRiskSetInstanceMismatch(); }
|
214
262
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
215
263
|
|
216
264
|
_masterAccessManager = accessManagerAddress;
|
@@ -226,7 +274,10 @@ contract InstanceService is
|
|
226
274
|
masterInstanceNftId = info.nftId;
|
227
275
|
}
|
228
276
|
|
229
|
-
function upgradeMasterInstanceReader(address instanceReaderAddress)
|
277
|
+
function upgradeMasterInstanceReader(address instanceReaderAddress)
|
278
|
+
external
|
279
|
+
onlyOwner
|
280
|
+
{
|
230
281
|
if(_masterInstanceReader == address(0)) { revert ErrorInstanceServiceMasterInstanceReaderNotSet(); }
|
231
282
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderAddressZero(); }
|
232
283
|
if(instanceReaderAddress == _masterInstanceReader) { revert ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader(); }
|
@@ -237,42 +288,29 @@ contract InstanceService is
|
|
237
288
|
_masterInstanceReader = instanceReaderAddress;
|
238
289
|
}
|
239
290
|
|
240
|
-
function
|
241
|
-
|
242
|
-
nonReentrant()
|
243
|
-
onlyInstanceOwner(instanceNftId)
|
244
|
-
onlyNftOfType(instanceNftId, INSTANCE())
|
245
|
-
{
|
246
|
-
IRegistry registry = getRegistry();
|
247
|
-
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
248
|
-
Instance instance = Instance(instanceInfo.objectAddress);
|
249
|
-
|
250
|
-
InstanceReader upgradedInstanceReaderClone = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
251
|
-
upgradedInstanceReaderClone.initializeWithInstance(address(instance));
|
252
|
-
instance.setInstanceReader(upgradedInstanceReaderClone);
|
291
|
+
function getMasterInstanceReader() external view returns (address) {
|
292
|
+
return _masterInstanceReader;
|
253
293
|
}
|
254
294
|
|
255
295
|
/// @dev create new cloned instance admin
|
256
296
|
/// function used to setup a new instance
|
257
|
-
function
|
297
|
+
function _cloneNewInstanceAdmin()
|
258
298
|
internal
|
259
299
|
virtual
|
260
|
-
returns (InstanceAdmin
|
300
|
+
returns (InstanceAdmin clonedAdmin)
|
261
301
|
{
|
262
|
-
//
|
302
|
+
// clone instance specific access manager
|
263
303
|
AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
|
264
|
-
Clones.clone(
|
304
|
+
Clones.clone(
|
305
|
+
InstanceAdmin(_masterInstanceAdmin).authority()));
|
265
306
|
|
266
307
|
// set up the instance admin
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
InstanceAdmin
|
273
|
-
clonedInstanceAdmin.initialize(
|
274
|
-
clonedAccessManager,
|
275
|
-
authorization);
|
308
|
+
clonedAdmin = InstanceAdmin(
|
309
|
+
Clones.clone(_masterInstanceAdmin));
|
310
|
+
|
311
|
+
clonedAdmin.initialize(
|
312
|
+
address(clonedAccessManager),
|
313
|
+
"InstanceAdmin");
|
276
314
|
}
|
277
315
|
|
278
316
|
|
@@ -280,27 +318,26 @@ contract InstanceService is
|
|
280
318
|
/// function used to setup a new instance
|
281
319
|
function _createInstance(
|
282
320
|
InstanceAdmin instanceAdmin,
|
283
|
-
address instanceOwner
|
321
|
+
address instanceOwner,
|
322
|
+
bool allowAnyToken
|
284
323
|
)
|
285
324
|
internal
|
286
325
|
virtual
|
287
326
|
returns (IInstance)
|
288
327
|
{
|
289
|
-
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
290
|
-
BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
|
291
|
-
RiskSet clonedRiskSet = RiskSet(Clones.clone(_masterInstanceRiskSet));
|
292
|
-
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
293
|
-
|
294
328
|
// clone instance
|
295
329
|
Instance clonedInstance = Instance(Clones.clone(_masterInstance));
|
296
330
|
clonedInstance.initialize(
|
297
331
|
instanceAdmin,
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
332
|
+
InstanceStore(Clones.clone(address(_masterInstanceStore))),
|
333
|
+
BundleSet(Clones.clone(_masterInstanceBundleSet)),
|
334
|
+
RiskSet(Clones.clone(_masterInstanceRiskSet)),
|
335
|
+
InstanceReader(Clones.clone(address(_masterInstanceReader))),
|
302
336
|
getRegistry(),
|
303
|
-
|
337
|
+
getRelease(),
|
338
|
+
instanceOwner,
|
339
|
+
allowAnyToken);
|
340
|
+
|
304
341
|
return clonedInstance;
|
305
342
|
}
|
306
343
|
|
@@ -344,11 +381,11 @@ contract InstanceService is
|
|
344
381
|
initializer()
|
345
382
|
{
|
346
383
|
(
|
347
|
-
address
|
348
|
-
address
|
384
|
+
address authority,
|
385
|
+
address registry
|
349
386
|
) = abi.decode(data, (address, address));
|
350
387
|
|
351
|
-
|
388
|
+
__Service_init(authority, registry, owner);
|
352
389
|
|
353
390
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
354
391
|
_stakingService = IStakingService(_getServiceAddress(STAKING()));
|
@@ -385,6 +422,36 @@ contract InstanceService is
|
|
385
422
|
|
386
423
|
}
|
387
424
|
|
425
|
+
|
426
|
+
function _checkInstance(
|
427
|
+
address instanceAddress,
|
428
|
+
VersionPart expectedRelease
|
429
|
+
)
|
430
|
+
internal
|
431
|
+
virtual
|
432
|
+
view
|
433
|
+
{
|
434
|
+
IRegistry registry = getRegistry();
|
435
|
+
|
436
|
+
NftId instanceNftId = registry.getNftIdForAddress(instanceAddress);
|
437
|
+
if (instanceNftId.eqz()) {
|
438
|
+
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
439
|
+
}
|
440
|
+
|
441
|
+
ObjectType objectType = registry.getObjectInfo(instanceNftId).objectType;
|
442
|
+
if (objectType != INSTANCE()) {
|
443
|
+
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
444
|
+
}
|
445
|
+
|
446
|
+
if (expectedRelease.gtz()) {
|
447
|
+
VersionPart instanceRelease = IInstance(instanceAddress).getRelease();
|
448
|
+
if (instanceRelease != expectedRelease) {
|
449
|
+
revert ErrorInstanceServiceInstanceVersionMismatch(instanceNftId, expectedRelease, instanceRelease);
|
450
|
+
}
|
451
|
+
}
|
452
|
+
}
|
453
|
+
|
454
|
+
|
388
455
|
// From IService
|
389
456
|
function _getDomain() internal pure override returns(ObjectType) {
|
390
457
|
return INSTANCE();
|
@@ -17,7 +17,7 @@ contract InstanceServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
InstanceService svc = new InstanceService{salt: salt}();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|