@etherisc/gif-next 0.0.2-de7c770-422 → 0.0.2-de9ede4-391
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +28 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1000 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +746 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +767 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +103 -63
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
- 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 +60 -32
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +159 -209
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +99 -125
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +180 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +139 -64
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +87 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +52 -0
- 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 +1441 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1991 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +187 -169
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +131 -157
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +282 -194
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +564 -249
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +116 -48
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -101
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +149 -60
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +196 -138
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +58 -85
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +687 -84
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +118 -148
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +107 -44
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +475 -116
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/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 +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/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 +119 -169
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
- 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 +82 -103
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +95 -121
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +147 -79
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +127 -40
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +115 -141
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +148 -150
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +121 -70
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +48 -33
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +102 -134
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +272 -185
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +115 -152
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +413 -263
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +144 -45
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +119 -45
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +103 -40
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +158 -138
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +200 -86
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +144 -61
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +63 -7
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +64 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +178 -19
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +141 -116
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +328 -119
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +150 -55
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +170 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +119 -48
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +154 -134
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +81 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +101 -34
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +91 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- 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 +135 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +220 -182
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +94 -172
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +99 -32
- 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 +123 -225
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +72 -80
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +483 -477
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +141 -76
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +47 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +61 -64
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +425 -261
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +82 -103
- 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 +16 -6
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -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 +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +94 -120
- 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 +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +18 -8
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- 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 +47 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +79 -100
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +3 -3
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +158 -170
- 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 +120 -54
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +103 -36
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +145 -104
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
- 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 +33 -9
- 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 +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 +3 -3
- 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 +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +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 +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- 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/SelectorSetLib.dbg.json +1 -1
- 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/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +16 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- 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 +79 -27
- 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 +263 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +82 -56
- package/contracts/authorization/Authorization.sol +111 -39
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +4 -3
- package/contracts/authorization/IAuthorization.sol +13 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +8 -7
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +32 -40
- package/contracts/distribution/DistributionService.sol +86 -65
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +5 -6
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +90 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +436 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +11 -4
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +37 -6
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +24 -23
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +38 -34
- package/contracts/instance/IInstance.sol +11 -3
- package/contracts/instance/IInstanceService.sol +7 -29
- package/contracts/instance/Instance.sol +36 -26
- package/contracts/instance/InstanceAdmin.sol +57 -54
- package/contracts/instance/InstanceAuthorizationV3.sol +50 -32
- package/contracts/instance/InstanceReader.sol +187 -21
- package/contracts/instance/InstanceService.sol +54 -129
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +12 -2
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +2 -1
- package/contracts/instance/base/ObjectSet.sol +24 -25
- package/contracts/instance/module/IComponents.sol +20 -7
- package/contracts/instance/module/IPolicy.sol +4 -3
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +4 -15
- package/contracts/oracle/OracleService.sol +110 -80
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +33 -24
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +74 -87
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +2 -15
- package/contracts/pool/IPoolComponent.sol +19 -15
- package/contracts/pool/IPoolService.sol +30 -37
- package/contracts/pool/Pool.sol +141 -122
- package/contracts/pool/PoolService.sol +263 -157
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +31 -20
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +1 -3
- package/contracts/product/ClaimService.sol +233 -106
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +5 -2
- package/contracts/product/IClaimService.sol +3 -2
- package/contracts/product/IPolicyService.sol +25 -8
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +23 -3
- package/contracts/product/PolicyService.sol +361 -198
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +10 -11
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +76 -74
- package/contracts/product/RiskService.sol +16 -6
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +8 -3
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +29 -6
- package/contracts/registry/RegistryAdmin.sol +29 -36
- package/contracts/registry/RegistryService.sol +33 -44
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +205 -210
- package/contracts/registry/ServiceAuthorizationV3.sol +58 -50
- package/contracts/shared/Component.sol +56 -105
- package/contracts/shared/ComponentService.sol +384 -329
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +27 -16
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +6 -14
- package/contracts/shared/IComponentService.sol +45 -37
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -13
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +68 -43
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +23 -3
- package/contracts/shared/PolicyHolder.sol +11 -5
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/RegistryLinked.sol +6 -12
- package/contracts/shared/Service.sol +16 -14
- package/contracts/shared/TokenHandler.sol +316 -66
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +9 -4
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +42 -25
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +56 -23
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- 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 +14 -0
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +30 -4
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/UFixed.sol +13 -119
- package/contracts/upgradeability/ProxyManager.sol +68 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +4 -3
- 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/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -2,12 +2,12 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {ClaimId} from "../type/ClaimId.sol";
|
5
|
+
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
6
6
|
import {DistributorType} from "../type/DistributorType.sol";
|
7
7
|
import {Key32} from "../type/Key32.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {COMPONENT, DISTRIBUTOR, DISTRIBUTION, PREMIUM, PRODUCT, POLICY, POOL, BUNDLE} from "../type/ObjectType.sol";
|
10
|
-
import {PayoutId} from "../type/PayoutId.sol";
|
9
|
+
import {COMPONENT, DISTRIBUTOR, DISTRIBUTION, FEE, PREMIUM, PRODUCT, POLICY, POOL, BUNDLE} from "../type/ObjectType.sol";
|
10
|
+
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
11
11
|
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
12
12
|
import {RequestId} from "../type/RequestId.sol";
|
13
13
|
import {RiskId} from "../type/RiskId.sol";
|
@@ -26,6 +26,8 @@ import {IRisk} from "../instance/module/IRisk.sol";
|
|
26
26
|
import {TimestampLib} from "../type/Timestamp.sol";
|
27
27
|
|
28
28
|
import {InstanceStore} from "./InstanceStore.sol";
|
29
|
+
import {BundleSet} from "./BundleSet.sol";
|
30
|
+
import {RiskSet} from "./RiskSet.sol";
|
29
31
|
|
30
32
|
|
31
33
|
contract InstanceReader {
|
@@ -37,6 +39,8 @@ contract InstanceReader {
|
|
37
39
|
|
38
40
|
IInstance internal _instance;
|
39
41
|
InstanceStore internal _store;
|
42
|
+
BundleSet internal _bundleSet;
|
43
|
+
RiskSet internal _riskSet;
|
40
44
|
|
41
45
|
/// @dev This initializer needs to be called from the instance itself.
|
42
46
|
function initialize() public {
|
@@ -48,7 +52,9 @@ contract InstanceReader {
|
|
48
52
|
}
|
49
53
|
|
50
54
|
/// @dev This initializer needs to be called from the instance itself.
|
51
|
-
function initializeWithInstance(address instanceAddress)
|
55
|
+
function initializeWithInstance(address instanceAddress)
|
56
|
+
public
|
57
|
+
{
|
52
58
|
if(_initialized) {
|
53
59
|
revert ErrorInstanceReaderAlreadyInitialized();
|
54
60
|
}
|
@@ -56,6 +62,8 @@ contract InstanceReader {
|
|
56
62
|
_initialized = true;
|
57
63
|
_instance = IInstance(instanceAddress);
|
58
64
|
_store = _instance.getInstanceStore();
|
65
|
+
_bundleSet = _instance.getBundleSet();
|
66
|
+
_riskSet = _instance.getRiskSet();
|
59
67
|
}
|
60
68
|
|
61
69
|
|
@@ -99,6 +107,38 @@ contract InstanceReader {
|
|
99
107
|
return _store.getState(toPremiumKey(policyNftId));
|
100
108
|
}
|
101
109
|
|
110
|
+
function bundles(NftId poolNftId)
|
111
|
+
public
|
112
|
+
view
|
113
|
+
returns (uint256 bundles)
|
114
|
+
{
|
115
|
+
return _bundleSet.bundles(poolNftId);
|
116
|
+
}
|
117
|
+
|
118
|
+
function activeBundles(NftId poolNftId)
|
119
|
+
public
|
120
|
+
view
|
121
|
+
returns (uint256 bundles)
|
122
|
+
{
|
123
|
+
return _bundleSet.activeBundles(poolNftId);
|
124
|
+
}
|
125
|
+
|
126
|
+
function getActiveBundleNftId(NftId poolNftId, uint256 idx)
|
127
|
+
public
|
128
|
+
view
|
129
|
+
returns (NftId bundleNftId)
|
130
|
+
{
|
131
|
+
return _bundleSet.getActiveBundleNftId(poolNftId, idx);
|
132
|
+
}
|
133
|
+
|
134
|
+
function getBundleNftId(NftId poolNftId, uint256 idx)
|
135
|
+
public
|
136
|
+
view
|
137
|
+
returns (NftId bundleNftId)
|
138
|
+
{
|
139
|
+
return _bundleSet.getBundleNftId(poolNftId, idx);
|
140
|
+
}
|
141
|
+
|
102
142
|
function getBundleState(NftId bundleNftId)
|
103
143
|
public
|
104
144
|
view
|
@@ -107,14 +147,8 @@ contract InstanceReader {
|
|
107
147
|
return _store.getState(toBundleKey(bundleNftId));
|
108
148
|
}
|
109
149
|
|
110
|
-
/// @dev
|
111
|
-
|
112
|
-
/// - policy exists
|
113
|
-
/// - has been activated
|
114
|
-
/// - is not yet closed
|
115
|
-
/// - has no open claims
|
116
|
-
/// - claim amount matches sum insured amount or is expired
|
117
|
-
function policyIsCloseable(NftId policyNftId)
|
150
|
+
/// @dev Returns true iff policy is active.
|
151
|
+
function policyIsActive(NftId policyNftId)
|
118
152
|
public
|
119
153
|
view
|
120
154
|
returns (bool isCloseable)
|
@@ -123,17 +157,27 @@ contract InstanceReader {
|
|
123
157
|
|
124
158
|
if (info.productNftId.eqz()) { return false; } // not closeable: policy does not exist (or does not belong to this instance)
|
125
159
|
if (info.activatedAt.eqz()) { return false; } // not closeable: not yet activated
|
126
|
-
if (info.
|
127
|
-
if (info.
|
160
|
+
if (info.activatedAt > TimestampLib.blockTimestamp()) { return false; } // not yet active
|
161
|
+
if (info.expiredAt <= TimestampLib.blockTimestamp()) { return false; } // already expired
|
162
|
+
|
163
|
+
return true;
|
164
|
+
}
|
128
165
|
|
129
|
-
|
130
|
-
|
166
|
+
function claims(NftId policyNftId)
|
167
|
+
public
|
168
|
+
view
|
169
|
+
returns (uint16 claims)
|
170
|
+
{
|
171
|
+
return getPolicyInfo(policyNftId).claimsCount;
|
172
|
+
}
|
131
173
|
|
132
|
-
// not closeable: not yet expired
|
133
|
-
if (TimestampLib.blockTimestamp() < info.expiredAt) { return false; }
|
134
174
|
|
135
|
-
|
136
|
-
|
175
|
+
function getClaimId(uint idx)
|
176
|
+
public
|
177
|
+
view
|
178
|
+
returns (ClaimId claimId)
|
179
|
+
{
|
180
|
+
return ClaimIdLib.toClaimId(idx + 1);
|
137
181
|
}
|
138
182
|
|
139
183
|
function getClaimInfo(NftId policyNftId, ClaimId claimId)
|
@@ -147,6 +191,7 @@ contract InstanceReader {
|
|
147
191
|
}
|
148
192
|
}
|
149
193
|
|
194
|
+
|
150
195
|
function getClaimState(NftId policyNftId, ClaimId claimId)
|
151
196
|
public
|
152
197
|
view
|
@@ -155,6 +200,34 @@ contract InstanceReader {
|
|
155
200
|
return _store.getState(claimId.toKey32(policyNftId));
|
156
201
|
}
|
157
202
|
|
203
|
+
|
204
|
+
function payouts(NftId policyNftId, ClaimId claimId)
|
205
|
+
public
|
206
|
+
view
|
207
|
+
returns (uint24 payouts)
|
208
|
+
{
|
209
|
+
return getClaimInfo(policyNftId, claimId).payoutsCount;
|
210
|
+
}
|
211
|
+
|
212
|
+
|
213
|
+
function getPayoutId(ClaimId claimId, uint24 idx)
|
214
|
+
public
|
215
|
+
view
|
216
|
+
returns (PayoutId payoutId)
|
217
|
+
{
|
218
|
+
return PayoutIdLib.toPayoutId(claimId, idx + 1);
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
function getRemainingClaimableAmount(NftId policyNftId)
|
223
|
+
public
|
224
|
+
view
|
225
|
+
returns (Amount remainingClaimableAmount)
|
226
|
+
{
|
227
|
+
IPolicy.PolicyInfo memory info = getPolicyInfo(policyNftId);
|
228
|
+
return info.sumInsuredAmount - info.claimAmount;
|
229
|
+
}
|
230
|
+
|
158
231
|
function getPayoutInfo(NftId policyNftId, PayoutId payoutId)
|
159
232
|
public
|
160
233
|
view
|
@@ -174,6 +247,38 @@ contract InstanceReader {
|
|
174
247
|
return _store.getState(payoutId.toKey32(policyNftId));
|
175
248
|
}
|
176
249
|
|
250
|
+
function risks(NftId productNftId)
|
251
|
+
public
|
252
|
+
view
|
253
|
+
returns (uint256 activeRisks)
|
254
|
+
{
|
255
|
+
return _riskSet.risks(productNftId);
|
256
|
+
}
|
257
|
+
|
258
|
+
function getRiskId(NftId productNftId, uint256 idx)
|
259
|
+
public
|
260
|
+
view
|
261
|
+
returns (RiskId riskId)
|
262
|
+
{
|
263
|
+
return _riskSet.getRiskId(productNftId, idx);
|
264
|
+
}
|
265
|
+
|
266
|
+
function activeRisks(NftId productNftId)
|
267
|
+
public
|
268
|
+
view
|
269
|
+
returns (uint256 activeRisks)
|
270
|
+
{
|
271
|
+
return _riskSet.activeRisks(productNftId);
|
272
|
+
}
|
273
|
+
|
274
|
+
function getActiveRiskId(NftId productNftId, uint256 idx)
|
275
|
+
public
|
276
|
+
view
|
277
|
+
returns (RiskId riskId)
|
278
|
+
{
|
279
|
+
return _riskSet.getActiveRiskId(productNftId, idx);
|
280
|
+
}
|
281
|
+
|
177
282
|
function getRiskInfo(RiskId riskId)
|
178
283
|
public
|
179
284
|
view
|
@@ -185,6 +290,44 @@ contract InstanceReader {
|
|
185
290
|
}
|
186
291
|
}
|
187
292
|
|
293
|
+
function getRiskState(RiskId riskId)
|
294
|
+
public
|
295
|
+
view
|
296
|
+
returns (StateId stateId)
|
297
|
+
{
|
298
|
+
bytes memory data = _store.getData(riskId.toKey32());
|
299
|
+
return _store.getState(riskId.toKey32());
|
300
|
+
}
|
301
|
+
|
302
|
+
function policiesForRisk(RiskId riskId)
|
303
|
+
public
|
304
|
+
view
|
305
|
+
returns (uint256 linkedPolicies)
|
306
|
+
{
|
307
|
+
return _riskSet.linkedPolicies(riskId);
|
308
|
+
}
|
309
|
+
|
310
|
+
function getPolicyNftIdForRisk(RiskId riskId, uint256 idx)
|
311
|
+
public
|
312
|
+
view
|
313
|
+
returns (NftId linkedPolicyNftId)
|
314
|
+
{
|
315
|
+
return _riskSet.getLinkedPolicyNftId(riskId, idx);
|
316
|
+
}
|
317
|
+
|
318
|
+
function getWallet(NftId componentNftId)
|
319
|
+
public
|
320
|
+
view
|
321
|
+
returns (address tokenHandler)
|
322
|
+
{
|
323
|
+
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
324
|
+
|
325
|
+
if (data.length > 0) {
|
326
|
+
IComponents.ComponentInfo memory info = abi.decode(data, (IComponents.ComponentInfo));
|
327
|
+
return info.tokenHandler.getWallet();
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
188
331
|
function getTokenHandler(NftId componentNftId)
|
189
332
|
public
|
190
333
|
view
|
@@ -265,6 +408,17 @@ contract InstanceReader {
|
|
265
408
|
}
|
266
409
|
}
|
267
410
|
|
411
|
+
function getFeeInfo(NftId productNftId)
|
412
|
+
public
|
413
|
+
view
|
414
|
+
returns (IComponents.FeeInfo memory feeInfo)
|
415
|
+
{
|
416
|
+
bytes memory data = _store.getData(toFeeKey(productNftId));
|
417
|
+
if (data.length > 0) {
|
418
|
+
return abi.decode(data, (IComponents.FeeInfo));
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
268
422
|
function getPoolInfo(NftId poolNftId)
|
269
423
|
public
|
270
424
|
view
|
@@ -375,7 +529,7 @@ contract InstanceReader {
|
|
375
529
|
}
|
376
530
|
|
377
531
|
|
378
|
-
function
|
532
|
+
function isLocked(address target) public view returns (bool) {
|
379
533
|
return _instance.getInstanceAdmin().isTargetLocked(target);
|
380
534
|
}
|
381
535
|
|
@@ -411,6 +565,10 @@ contract InstanceReader {
|
|
411
565
|
return productNftId.toKey32(PRODUCT());
|
412
566
|
}
|
413
567
|
|
568
|
+
function toFeeKey(NftId productNftId) public pure returns (Key32) {
|
569
|
+
return productNftId.toKey32(FEE());
|
570
|
+
}
|
571
|
+
|
414
572
|
// low level function
|
415
573
|
function getInstance() external view returns (IInstance instance) {
|
416
574
|
return _instance;
|
@@ -420,6 +578,14 @@ contract InstanceReader {
|
|
420
578
|
return _store;
|
421
579
|
}
|
422
580
|
|
581
|
+
function getBundleSet() external view returns (BundleSet bundleSet) {
|
582
|
+
return _bundleSet;
|
583
|
+
}
|
584
|
+
|
585
|
+
function getRiskSet() external view returns (RiskSet riskSet) {
|
586
|
+
return _riskSet;
|
587
|
+
}
|
588
|
+
|
423
589
|
function toUFixed(uint256 value, int8 exp) public pure returns (UFixed) {
|
424
590
|
return UFixedLib.toUFixed(value, exp);
|
425
591
|
}
|
@@ -2,41 +2,33 @@
|
|
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
5
|
|
7
6
|
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
8
7
|
import {Amount} from "../type/Amount.sol";
|
9
8
|
import {BundleSet} from "./BundleSet.sol";
|
9
|
+
import {RiskSet} from "./RiskSet.sol";
|
10
10
|
import {ChainNft} from "../registry/ChainNft.sol";
|
11
11
|
import {NftId} from "../type/NftId.sol";
|
12
12
|
import {RoleId} from "../type/RoleId.sol";
|
13
|
-
import {
|
14
|
-
import {
|
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";
|
13
|
+
import {UFixed} from "../type/UFixed.sol";
|
14
|
+
import {ObjectType, INSTANCE, COMPONENT, INSTANCE, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
17
15
|
|
18
16
|
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
17
|
|
26
18
|
import {IRegistry} from "../registry/IRegistry.sol";
|
27
19
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
28
20
|
import {IStakingService} from "../staking/IStakingService.sol";
|
29
21
|
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
30
22
|
|
23
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
31
24
|
import {Instance} from "./Instance.sol";
|
32
|
-
import {IModuleAuthorization} from "../authorization/IModuleAuthorization.sol";
|
33
25
|
import {IInstance} from "./IInstance.sol";
|
34
26
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
35
27
|
import {IInstanceService} from "./IInstanceService.sol";
|
36
28
|
import {InstanceReader} from "./InstanceReader.sol";
|
37
29
|
import {InstanceStore} from "./InstanceStore.sol";
|
38
30
|
import {Seconds} from "../type/Seconds.sol";
|
39
|
-
import {VersionPart
|
31
|
+
import {VersionPart} from "../type/Version.sol";
|
40
32
|
|
41
33
|
|
42
34
|
contract InstanceService is
|
@@ -49,12 +41,14 @@ contract InstanceService is
|
|
49
41
|
|
50
42
|
IRegistryService internal _registryService;
|
51
43
|
IStakingService internal _stakingService;
|
44
|
+
IComponentService internal _componentService;
|
52
45
|
|
53
46
|
address internal _masterAccessManager;
|
54
47
|
address internal _masterInstanceAdmin;
|
55
48
|
address internal _masterInstance;
|
56
49
|
address internal _masterInstanceReader;
|
57
50
|
address internal _masterInstanceBundleSet;
|
51
|
+
address internal _masterInstanceRiskSet;
|
58
52
|
address internal _masterInstanceStore;
|
59
53
|
|
60
54
|
|
@@ -70,7 +64,7 @@ contract InstanceService is
|
|
70
64
|
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
71
65
|
}
|
72
66
|
|
73
|
-
VersionPart instanceVersion = IInstance(instanceAddress).
|
67
|
+
VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
|
74
68
|
if (instanceVersion != getVersion().toMajorPart()) {
|
75
69
|
revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
|
76
70
|
}
|
@@ -97,8 +91,8 @@ contract InstanceService is
|
|
97
91
|
function createInstance()
|
98
92
|
external
|
99
93
|
returns (
|
100
|
-
|
101
|
-
NftId
|
94
|
+
IInstance instance,
|
95
|
+
NftId instanceNftId
|
102
96
|
)
|
103
97
|
{
|
104
98
|
// tx sender will become instance owner
|
@@ -106,24 +100,24 @@ contract InstanceService is
|
|
106
100
|
|
107
101
|
// create instance admin and instance
|
108
102
|
InstanceAdmin instanceAdmin = _createInstanceAdmin();
|
109
|
-
|
103
|
+
instance = _createInstance(instanceAdmin, instanceOwner);
|
110
104
|
|
111
105
|
// register cloned instance with registry
|
112
|
-
|
113
|
-
|
106
|
+
instanceNftId = _registryService.registerInstance(
|
107
|
+
instance, instanceOwner).nftId;
|
114
108
|
|
115
109
|
// register cloned instance as staking target
|
116
110
|
_stakingService.createInstanceTarget(
|
117
|
-
|
111
|
+
instanceNftId,
|
118
112
|
TargetManagerLib.getDefaultLockingPeriod(),
|
119
113
|
TargetManagerLib.getDefaultRewardRate());
|
120
114
|
|
121
115
|
// MUST be set after instance is set up and registered
|
122
|
-
instanceAdmin.initializeInstanceAuthorization(address(
|
116
|
+
instanceAdmin.initializeInstanceAuthorization(address(instance));
|
123
117
|
|
124
118
|
emit LogInstanceCloned(
|
125
|
-
|
126
|
-
address(
|
119
|
+
instanceNftId,
|
120
|
+
address(instance));
|
127
121
|
}
|
128
122
|
|
129
123
|
|
@@ -176,34 +170,6 @@ contract InstanceService is
|
|
176
170
|
dipAmount);
|
177
171
|
}
|
178
172
|
|
179
|
-
|
180
|
-
function setComponentLocked(bool locked)
|
181
|
-
external
|
182
|
-
virtual
|
183
|
-
onlyComponent()
|
184
|
-
{
|
185
|
-
// checks
|
186
|
-
address componentAddress = msg.sender;
|
187
|
-
|
188
|
-
if (!IInstanceLinkedComponent(componentAddress).supportsInterface(type(IInstanceLinkedComponent).interfaceId)) {
|
189
|
-
revert ErrorInstanceServiceComponentNotInstanceLinked(componentAddress);
|
190
|
-
}
|
191
|
-
|
192
|
-
IRegistry registry = getRegistry();
|
193
|
-
NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
|
194
|
-
|
195
|
-
IInstance instance = IInstance(
|
196
|
-
registry.getObjectInfo(
|
197
|
-
instanceNftId).objectAddress);
|
198
|
-
|
199
|
-
// no revert in case already locked
|
200
|
-
// TODO refactor/implement
|
201
|
-
// instance.getInstanceAdmin().setTargetLockedByService(
|
202
|
-
// componentAddress,
|
203
|
-
// locked);
|
204
|
-
}
|
205
|
-
|
206
|
-
|
207
173
|
function getMasterInstanceReader() external view returns (address) {
|
208
174
|
return _masterInstanceReader;
|
209
175
|
}
|
@@ -216,7 +182,7 @@ contract InstanceService is
|
|
216
182
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
217
183
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
218
184
|
if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
|
219
|
-
|
185
|
+
if(_masterInstanceRiskSet != address(0)) { revert ErrorInstanceServiceMasterRiskSetAlreadySet(); }
|
220
186
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
221
187
|
|
222
188
|
IInstance instance = IInstance(instanceAddress);
|
@@ -225,28 +191,34 @@ contract InstanceService is
|
|
225
191
|
address instanceAdminAddress = address(instanceAdmin);
|
226
192
|
InstanceReader instanceReader = instance.getInstanceReader();
|
227
193
|
address instanceReaderAddress = address(instanceReader);
|
228
|
-
BundleSet
|
229
|
-
address
|
194
|
+
BundleSet bundleSet = instance.getBundleSet();
|
195
|
+
address bundleSetAddress = address(bundleSet);
|
196
|
+
RiskSet riskSet = instance.getRiskSet();
|
197
|
+
address riskSetAddress = address(riskSet);
|
230
198
|
InstanceStore instanceStore = instance.getInstanceStore();
|
231
199
|
address instanceStoreAddress = address(instanceStore);
|
232
200
|
|
233
201
|
if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
|
234
202
|
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
235
203
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
236
|
-
if(
|
204
|
+
if(bundleSetAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
|
205
|
+
if(riskSetAddress == address(0)) { revert ErrorInstanceServiceRiskSetZero(); }
|
237
206
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
238
207
|
|
239
208
|
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
240
|
-
if(
|
209
|
+
if(bundleSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
210
|
+
if(riskSet.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceRiskSetAuthorityMismatch(); }
|
241
211
|
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
242
|
-
if(
|
212
|
+
if(bundleSet.getInstance() != instance) { revert ErrorInstanceServiceBundleSetInstanceMismatch(); }
|
213
|
+
if(riskSet.getInstance() != instance) { revert ErrorInstanceServiceRiskSetInstanceMismatch(); }
|
243
214
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
244
215
|
|
245
216
|
_masterAccessManager = accessManagerAddress;
|
246
217
|
_masterInstanceAdmin = instanceAdminAddress;
|
247
218
|
_masterInstance = instanceAddress;
|
248
219
|
_masterInstanceReader = instanceReaderAddress;
|
249
|
-
_masterInstanceBundleSet =
|
220
|
+
_masterInstanceBundleSet = bundleSetAddress;
|
221
|
+
_masterInstanceRiskSet = riskSetAddress;
|
250
222
|
_masterInstanceStore = instanceStoreAddress;
|
251
223
|
|
252
224
|
IInstance masterInstance = IInstance(_masterInstance);
|
@@ -267,7 +239,9 @@ contract InstanceService is
|
|
267
239
|
|
268
240
|
function upgradeInstanceReader(NftId instanceNftId)
|
269
241
|
external
|
242
|
+
nonReentrant()
|
270
243
|
onlyInstanceOwner(instanceNftId)
|
244
|
+
onlyNftOfType(instanceNftId, INSTANCE())
|
271
245
|
{
|
272
246
|
IRegistry registry = getRegistry();
|
273
247
|
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
@@ -278,67 +252,6 @@ contract InstanceService is
|
|
278
252
|
instance.setInstanceReader(upgradedInstanceReaderClone);
|
279
253
|
}
|
280
254
|
|
281
|
-
|
282
|
-
function createGifTarget(
|
283
|
-
NftId instanceNftId,
|
284
|
-
address targetAddress,
|
285
|
-
string memory targetName,
|
286
|
-
bytes4[][] memory selectors,
|
287
|
-
RoleId[] memory roles
|
288
|
-
)
|
289
|
-
external
|
290
|
-
virtual
|
291
|
-
restricted()
|
292
|
-
{
|
293
|
-
_createGifTarget(
|
294
|
-
instanceNftId,
|
295
|
-
targetAddress,
|
296
|
-
targetName,
|
297
|
-
roles,
|
298
|
-
selectors
|
299
|
-
);
|
300
|
-
}
|
301
|
-
|
302
|
-
|
303
|
-
function initializeAuthorization(
|
304
|
-
NftId instanceNftId,
|
305
|
-
IInstanceLinkedComponent component
|
306
|
-
)
|
307
|
-
external
|
308
|
-
virtual
|
309
|
-
restricted()
|
310
|
-
{
|
311
|
-
(IInstance instance, ) = _validateInstanceAndComponent(
|
312
|
-
instanceNftId,
|
313
|
-
address(component));
|
314
|
-
|
315
|
-
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
316
|
-
instanceAdmin.initializeComponentAuthorization(
|
317
|
-
component,
|
318
|
-
component.getAuthorization());
|
319
|
-
}
|
320
|
-
|
321
|
-
|
322
|
-
function createComponentTarget(
|
323
|
-
NftId instanceNftId,
|
324
|
-
address targetAddress,
|
325
|
-
string memory targetName,
|
326
|
-
bytes4[][] memory selectors,
|
327
|
-
RoleId[] memory roles
|
328
|
-
)
|
329
|
-
external
|
330
|
-
virtual
|
331
|
-
restricted()
|
332
|
-
{
|
333
|
-
_createGifTarget(
|
334
|
-
instanceNftId,
|
335
|
-
targetAddress,
|
336
|
-
targetName,
|
337
|
-
roles,
|
338
|
-
selectors
|
339
|
-
);
|
340
|
-
}
|
341
|
-
|
342
255
|
/// @dev create new cloned instance admin
|
343
256
|
/// function used to setup a new instance
|
344
257
|
function _createInstanceAdmin()
|
@@ -355,9 +268,11 @@ contract InstanceService is
|
|
355
268
|
clonedAccessManager.initialize(
|
356
269
|
address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
|
357
270
|
|
271
|
+
address authorization = address(
|
272
|
+
InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
|
358
273
|
clonedInstanceAdmin.initialize(
|
359
274
|
clonedAccessManager,
|
360
|
-
|
275
|
+
authorization);
|
361
276
|
}
|
362
277
|
|
363
278
|
|
@@ -369,21 +284,24 @@ contract InstanceService is
|
|
369
284
|
)
|
370
285
|
internal
|
371
286
|
virtual
|
372
|
-
returns (
|
287
|
+
returns (IInstance)
|
373
288
|
{
|
374
289
|
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
375
290
|
BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
|
291
|
+
RiskSet clonedRiskSet = RiskSet(Clones.clone(_masterInstanceRiskSet));
|
376
292
|
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
377
293
|
|
378
294
|
// clone instance
|
379
|
-
clonedInstance = Instance(Clones.clone(_masterInstance));
|
295
|
+
Instance clonedInstance = Instance(Clones.clone(_masterInstance));
|
380
296
|
clonedInstance.initialize(
|
381
297
|
instanceAdmin,
|
382
298
|
clonedInstanceStore,
|
383
299
|
clonedBundleSet,
|
300
|
+
clonedRiskSet,
|
384
301
|
clonedInstanceReader,
|
385
302
|
getRegistry(),
|
386
303
|
instanceOwner);
|
304
|
+
return clonedInstance;
|
387
305
|
}
|
388
306
|
|
389
307
|
|
@@ -426,15 +344,15 @@ contract InstanceService is
|
|
426
344
|
initializer()
|
427
345
|
{
|
428
346
|
(
|
429
|
-
address registryAddress
|
430
|
-
//address managerAddress
|
347
|
+
address registryAddress,
|
431
348
|
address authority
|
432
|
-
) = abi.decode(data, (address, address
|
349
|
+
) = abi.decode(data, (address, address));
|
433
350
|
|
434
351
|
_initializeService(registryAddress, authority, owner);
|
435
352
|
|
436
353
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
437
354
|
_stakingService = IStakingService(_getServiceAddress(STAKING()));
|
355
|
+
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
438
356
|
|
439
357
|
_registerInterface(type(IInstanceService).interfaceId);
|
440
358
|
}
|
@@ -451,13 +369,20 @@ contract InstanceService is
|
|
451
369
|
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
452
370
|
}
|
453
371
|
|
454
|
-
|
455
|
-
|
456
|
-
|
372
|
+
if (registry.getNftIdForAddress(componentAddress).gtz()) {
|
373
|
+
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
374
|
+
|
375
|
+
if(componentInfo.parentNftId != instanceNftId) {
|
376
|
+
revert ErrorInstanceServiceInstanceComponentMismatch(instanceNftId, componentInfo.nftId);
|
377
|
+
}
|
378
|
+
|
379
|
+
componentNftId = componentInfo.nftId;
|
380
|
+
} else {
|
381
|
+
|
457
382
|
}
|
458
383
|
|
459
384
|
instance = Instance(instanceInfo.objectAddress);
|
460
|
-
|
385
|
+
|
461
386
|
}
|
462
387
|
|
463
388
|
// From IService
|