@etherisc/gif-next 0.0.2-a307d03-692 → 0.0.2-a33f6f4-689
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -32
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -26
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +361 -246
- 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 +8 -39
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +96 -23
- 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 +278 -184
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +32 -0
- 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 +21 -134
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +96 -41
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +0 -86
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +156 -85
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +56 -52
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -86
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +64 -1
- 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 +19 -49
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +96 -41
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +67 -105
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +96 -41
- 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 +71 -162
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +96 -41
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +20 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +24 -67
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +96 -41
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +35 -72
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +96 -41
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +93 -15
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +61 -12
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +113 -38
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +509 -413
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +96 -41
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +104 -75
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +93 -64
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -36
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +54 -44
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- 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 +14 -35
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +93 -30
- 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 +0 -21
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -21
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -42
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -31
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -21
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +96 -41
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -58
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -39
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +0 -21
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +0 -21
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +2 -2
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -62
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +41 -41
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +90 -24
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -22
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -21
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +96 -41
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -80
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -50
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +42 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +21 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +0 -21
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +31 -4
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +62 -62
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +41 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +73 -52
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -36
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +0 -21
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +79 -28
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +34 -22
- 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/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +440 -350
- 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 +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +474 -369
- 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 +128 -124
- 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 +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +0 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +242 -96
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +48 -40
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +60 -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 +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +165 -35
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -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/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- 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 +0 -21
- 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/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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +74 -30
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +71 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +123 -84
- 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 +41 -37
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +30 -57
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +105 -26
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +27 -23
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +142 -128
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +24 -14
- 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/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/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 +9 -4
- 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/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/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +56 -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/authorization/AccessAdmin.sol +201 -186
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +40 -31
- package/contracts/authorization/Authorization.sol +61 -33
- package/contracts/authorization/IAccessAdmin.sol +63 -36
- package/contracts/authorization/IAuthorization.sol +6 -0
- package/contracts/distribution/BasicDistribution.sol +6 -6
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +3 -48
- package/contracts/distribution/DistributionService.sol +32 -5
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +4 -2
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FireProduct.sol +1 -6
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +4 -8
- package/contracts/instance/IInstance.sol +45 -10
- package/contracts/instance/IInstanceService.sol +19 -3
- package/contracts/instance/Instance.sol +74 -26
- package/contracts/instance/InstanceAdmin.sol +119 -118
- package/contracts/instance/InstanceAuthorizationV3.sol +43 -24
- package/contracts/instance/InstanceReader.sol +13 -0
- package/contracts/instance/InstanceService.sol +128 -73
- package/contracts/instance/module/IComponents.sol +0 -1
- package/contracts/instance/module/IDistribution.sol +3 -1
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/Oracle.sol +0 -2
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +0 -2
- package/contracts/pool/PoolService.sol +1 -3
- package/contracts/product/ApplicationService.sol +21 -6
- package/contracts/product/BasicProduct.sol +0 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +0 -18
- package/contracts/product/PricingService.sol +5 -0
- package/contracts/product/Product.sol +6 -17
- package/contracts/product/RiskService.sol +16 -7
- package/contracts/registry/RegistryAdmin.sol +133 -229
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/ReleaseAdmin.sol +30 -22
- package/contracts/registry/ReleaseRegistry.sol +39 -33
- package/contracts/registry/ServiceAuthorizationV3.sol +6 -1
- package/contracts/shared/Component.sol +11 -27
- package/contracts/shared/ComponentService.sol +219 -135
- package/contracts/shared/ContractLib.sol +28 -0
- package/contracts/shared/IComponent.sol +0 -3
- package/contracts/shared/IComponentService.sol +21 -9
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +0 -2
- package/contracts/shared/NftOwnable.sol +1 -1
- package/contracts/shared/Registerable.sol +1 -4
- package/contracts/shared/TokenHandler.sol +5 -4
- package/contracts/staking/IStaking.sol +12 -2
- package/contracts/staking/IStakingService.sol +8 -1
- package/contracts/staking/Staking.sol +35 -15
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +79 -22
- package/contracts/staking/StakingReader.sol +5 -15
- package/contracts/staking/StakingService.sol +36 -2
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/ObjectType.sol +5 -14
- package/contracts/type/RiskId.sol +4 -3
- package/contracts/type/Version.sol +39 -0
- package/package.json +2 -2
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
@@ -5,17 +5,14 @@ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessMana
|
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
7
|
import {Amount} from "../type/Amount.sol";
|
8
|
-
import {ContractLib} from "./ContractLib.sol";
|
9
8
|
import {IComponent} from "./IComponent.sol";
|
10
9
|
import {IComponents} from "../instance/module/IComponents.sol";
|
11
10
|
import {IComponentService} from "./IComponentService.sol";
|
12
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
13
|
-
import {IRelease} from "../registry/IRelease.sol";
|
14
11
|
import {NftId} from "../type/NftId.sol";
|
15
|
-
import {ObjectType, COMPONENT
|
12
|
+
import {ObjectType, COMPONENT} from "../type/ObjectType.sol";
|
16
13
|
import {Registerable} from "../shared/Registerable.sol";
|
17
14
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
18
|
-
import {Version, VersionLib
|
15
|
+
import {Version, VersionLib} from "../type/Version.sol";
|
19
16
|
|
20
17
|
|
21
18
|
abstract contract Component is
|
@@ -27,7 +24,6 @@ abstract contract Component is
|
|
27
24
|
|
28
25
|
struct ComponentStorage {
|
29
26
|
string _name; // unique (per instance) component name
|
30
|
-
IERC20Metadata _token; // token for this component
|
31
27
|
bool _isInterceptor;
|
32
28
|
bytes _data;
|
33
29
|
IComponentService _componentService;
|
@@ -43,6 +39,7 @@ abstract contract Component is
|
|
43
39
|
|
44
40
|
|
45
41
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
42
|
+
// solhint-disable-next-line no-inline-assembly
|
46
43
|
assembly {
|
47
44
|
$.slot := COMPONENT_LOCATION_V1
|
48
45
|
}
|
@@ -54,7 +51,6 @@ abstract contract Component is
|
|
54
51
|
address registry,
|
55
52
|
NftId parentNftId,
|
56
53
|
string memory name,
|
57
|
-
address token,
|
58
54
|
ObjectType componentType,
|
59
55
|
bool isInterceptor,
|
60
56
|
address initialOwner,
|
@@ -65,20 +61,6 @@ abstract contract Component is
|
|
65
61
|
virtual
|
66
62
|
onlyInitializing()
|
67
63
|
{
|
68
|
-
address tokenRegistry = IRegistry(registry).getTokenRegistryAddress();
|
69
|
-
VersionPart release = IRelease(authority).getRelease();
|
70
|
-
|
71
|
-
// special case for staking: component intitialization happens before
|
72
|
-
// GIF core contract setup is complete. at that time token registry
|
73
|
-
// is not yet available. therefore we skip the check for staking.
|
74
|
-
if (componentType != STAKING()) {
|
75
|
-
|
76
|
-
// check if provided token is whitelisted and active
|
77
|
-
if (!ContractLib.isActiveToken(tokenRegistry, token, block.chainid, release)) {
|
78
|
-
revert ErrorComponentTokenInvalid(token);
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
64
|
if (bytes(name).length == 0) {
|
83
65
|
revert ErrorComponentNameLengthZero();
|
84
66
|
}
|
@@ -95,7 +77,6 @@ abstract contract Component is
|
|
95
77
|
// set component state
|
96
78
|
ComponentStorage storage $ = _getComponentStorage();
|
97
79
|
$._name = name;
|
98
|
-
$._token = IERC20Metadata(token);
|
99
80
|
$._isInterceptor = isInterceptor;
|
100
81
|
$._data = componentData;
|
101
82
|
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
@@ -125,7 +106,7 @@ abstract contract Component is
|
|
125
106
|
}
|
126
107
|
|
127
108
|
function getToken() public view virtual returns (IERC20Metadata token) {
|
128
|
-
return
|
109
|
+
return getTokenHandler().TOKEN();
|
129
110
|
}
|
130
111
|
|
131
112
|
function getName() public view override returns(string memory name) {
|
@@ -183,10 +164,14 @@ abstract contract Component is
|
|
183
164
|
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
184
165
|
internal
|
185
166
|
virtual
|
186
|
-
|
167
|
+
// solhint-disable-next-line no-empty-blocks
|
168
|
+
{
|
169
|
+
// empty default implementation
|
170
|
+
}
|
187
171
|
|
188
172
|
|
189
|
-
/// @dev
|
173
|
+
/// @dev Sets the components wallet to the specified address.
|
174
|
+
/// Depending on the source of the component information this function needs to be overwritten.
|
190
175
|
/// eg for instance linked components that externally store this information with the instance store contract
|
191
176
|
function _setWallet(
|
192
177
|
address newWallet
|
@@ -201,7 +186,7 @@ abstract contract Component is
|
|
201
186
|
internal
|
202
187
|
virtual
|
203
188
|
{
|
204
|
-
_getComponentStorage()._componentService.
|
189
|
+
_getComponentStorage()._componentService.setLocked(locked);
|
205
190
|
}
|
206
191
|
|
207
192
|
|
@@ -212,7 +197,6 @@ abstract contract Component is
|
|
212
197
|
|
213
198
|
return IComponents.ComponentInfo({
|
214
199
|
name: $._name,
|
215
|
-
token: $._token,
|
216
200
|
tokenHandler: TokenHandler(address(0)),
|
217
201
|
data: $._data // user specific component data
|
218
202
|
});
|
@@ -19,6 +19,7 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
19
19
|
import {IRegistry} from "../registry/IRegistry.sol";
|
20
20
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
21
21
|
|
22
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
22
23
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
23
24
|
import {ContractLib} from "../shared/ContractLib.sol";
|
24
25
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
@@ -42,6 +43,31 @@ contract ComponentService is
|
|
42
43
|
IRegistryService private _registryService;
|
43
44
|
IInstanceService private _instanceService;
|
44
45
|
|
46
|
+
modifier onlyComponent(address component) {
|
47
|
+
_checkSupportsInterface(component);
|
48
|
+
_;
|
49
|
+
}
|
50
|
+
|
51
|
+
modifier onlyInstance() {
|
52
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
53
|
+
if (instanceNftId.eqz()) {
|
54
|
+
revert ErrorComponentServiceNotRegistered(msg.sender);
|
55
|
+
}
|
56
|
+
|
57
|
+
ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
|
58
|
+
if (objectType != INSTANCE()) {
|
59
|
+
revert ErrorComponentServiceNotInstance(msg.sender, objectType);
|
60
|
+
}
|
61
|
+
|
62
|
+
VersionPart instanceVersion = IInstance(msg.sender).getRelease();
|
63
|
+
if (instanceVersion != getVersion().toMajorPart()) {
|
64
|
+
revert ErrorComponentServiceInstanceVersionMismatch(msg.sender, instanceVersion);
|
65
|
+
}
|
66
|
+
|
67
|
+
_;
|
68
|
+
}
|
69
|
+
|
70
|
+
|
45
71
|
function _initialize(
|
46
72
|
address owner,
|
47
73
|
bytes memory data
|
@@ -66,46 +92,37 @@ contract ComponentService is
|
|
66
92
|
|
67
93
|
//-------- component ----------------------------------------------------//
|
68
94
|
|
69
|
-
|
70
|
-
function registerComponent(address componentAddress)
|
95
|
+
function registerComponent(address component)
|
71
96
|
external
|
72
97
|
virtual
|
73
|
-
|
98
|
+
onlyComponent(component)
|
74
99
|
returns (NftId componentNftId)
|
75
100
|
{
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
IRegistry.ObjectInfo memory componentInfo // initial component info
|
81
|
-
) = _getAndVerifyRegisterableComponent(
|
82
|
-
componentAddress,
|
83
|
-
productNftId);
|
84
|
-
ObjectType componentType = componentInfo.objectType;
|
101
|
+
// type specific registration
|
102
|
+
IRegistry.ObjectInfo memory componentObjectInfo = IInstanceLinkedComponent(component).getInitialInfo();
|
103
|
+
ObjectType componentType = componentObjectInfo.objectType;
|
104
|
+
IComponent productComponent = IComponent(getRegistry().getObjectAddress(componentObjectInfo.parentNftId));
|
85
105
|
|
86
106
|
if (componentType == POOL()) {
|
87
|
-
|
88
|
-
return _registerPool(instance, productNftId, pool, componentInfo);
|
107
|
+
return _registerPool(component, address(productComponent.getToken()));
|
89
108
|
}
|
90
109
|
if (componentType == DISTRIBUTION()) {
|
91
|
-
return _registerDistribution(
|
110
|
+
return _registerDistribution(component, address(productComponent.getToken()));
|
92
111
|
}
|
93
112
|
if (componentType == ORACLE()) {
|
94
|
-
return _registerOracle(
|
113
|
+
return _registerOracle(component, address(productComponent.getToken()));
|
95
114
|
}
|
96
115
|
|
97
116
|
// fail
|
98
|
-
revert
|
117
|
+
revert ErrorComponentServiceTypeNotSupported(component, componentType);
|
99
118
|
}
|
100
119
|
|
101
|
-
/// @inheritdoc IComponentService
|
102
120
|
function approveTokenHandler(
|
103
121
|
IERC20Metadata token,
|
104
122
|
Amount amount
|
105
123
|
)
|
106
124
|
external
|
107
125
|
virtual
|
108
|
-
restricted()
|
109
126
|
{
|
110
127
|
// checks
|
111
128
|
(NftId componentNftId, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
@@ -116,11 +133,10 @@ contract ComponentService is
|
|
116
133
|
tokenHandler.approve(token, amount);
|
117
134
|
}
|
118
135
|
|
119
|
-
|
136
|
+
|
120
137
|
function setWallet(address newWallet)
|
121
138
|
external
|
122
139
|
virtual
|
123
|
-
restricted()
|
124
140
|
{
|
125
141
|
// checks
|
126
142
|
(NftId componentNftId, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
@@ -132,14 +148,17 @@ contract ComponentService is
|
|
132
148
|
}
|
133
149
|
|
134
150
|
/// @inheritdoc IComponentService
|
135
|
-
function
|
151
|
+
function setLocked(bool locked)
|
136
152
|
external
|
137
153
|
virtual
|
138
154
|
restricted()
|
139
155
|
{
|
140
|
-
// TODO inactive component can lock/unlock other components?
|
141
156
|
(, IInstance instance) = _getAndVerifyComponent(COMPONENT(), false);
|
142
|
-
|
157
|
+
|
158
|
+
address component = msg.sender;
|
159
|
+
instance.getInstanceAdmin().setComponentLocked(
|
160
|
+
component,
|
161
|
+
locked);
|
143
162
|
}
|
144
163
|
|
145
164
|
/// @inheritdoc IComponentService
|
@@ -195,37 +214,24 @@ contract ComponentService is
|
|
195
214
|
|
196
215
|
//-------- product ------------------------------------------------------//
|
197
216
|
|
198
|
-
function registerProduct(address productAddress)
|
217
|
+
function registerProduct(address productAddress, address token)
|
199
218
|
external
|
200
219
|
virtual
|
201
|
-
restricted()
|
202
220
|
nonReentrant()
|
221
|
+
onlyComponent(productAddress)
|
203
222
|
returns (NftId productNftId)
|
204
223
|
{
|
205
|
-
//
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
(
|
211
|
-
,
|
212
|
-
IRegistry.ObjectInfo memory productInfo // initial product info
|
213
|
-
) = _getAndVerifyRegisterableComponent(
|
224
|
+
// register/create component setup
|
225
|
+
InstanceAdmin instanceAdmin;
|
226
|
+
InstanceStore instanceStore;
|
227
|
+
(, instanceAdmin, instanceStore,, productNftId) = _register(
|
214
228
|
productAddress,
|
215
|
-
|
229
|
+
PRODUCT(),
|
230
|
+
token);
|
216
231
|
|
217
|
-
|
218
|
-
revert ErrorComponentServiceComponentTypeNotSupported(productAddress, productInfo.objectType);
|
219
|
-
}
|
220
|
-
|
221
|
-
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
222
|
-
InstanceStore instanceStore = instance.getInstanceStore();
|
223
|
-
|
224
|
-
// register/create component info
|
232
|
+
// get product
|
225
233
|
IProductComponent product = IProductComponent(productAddress);
|
226
|
-
|
227
|
-
|
228
|
-
// create product in instance instanceStore
|
234
|
+
|
229
235
|
IComponents.ProductInfo memory initialProductInfo = product.getInitialProductInfo();
|
230
236
|
// force initialization of linked components with empty values to
|
231
237
|
// ensure no components are linked upon initialization of the product
|
@@ -250,7 +256,6 @@ contract ComponentService is
|
|
250
256
|
)
|
251
257
|
external
|
252
258
|
virtual
|
253
|
-
restricted()
|
254
259
|
nonReentrant()
|
255
260
|
{
|
256
261
|
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -280,26 +285,24 @@ contract ComponentService is
|
|
280
285
|
//-------- distribution -------------------------------------------------//
|
281
286
|
|
282
287
|
/// @dev registers the sending component as a distribution component
|
283
|
-
function _registerDistribution(
|
284
|
-
IInstance instance,
|
285
|
-
NftId productNftId,
|
286
|
-
IInstanceLinkedComponent distribution,
|
287
|
-
IRegistry.ObjectInfo memory info
|
288
|
-
)
|
288
|
+
function _registerDistribution(address distributioAddress, address token)
|
289
289
|
internal
|
290
290
|
virtual
|
291
291
|
nonReentrant()
|
292
292
|
returns (NftId distributionNftId)
|
293
293
|
{
|
294
|
-
InstanceReader reader = instance.getInstanceReader();
|
295
|
-
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
296
|
-
InstanceStore instanceStore = instance.getInstanceStore();
|
297
|
-
|
298
294
|
// register/create component info
|
299
|
-
|
295
|
+
InstanceReader instanceReader;
|
296
|
+
InstanceAdmin instanceAdmin;
|
297
|
+
InstanceStore instanceStore;
|
298
|
+
NftId productNftId;
|
299
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, distributionNftId) = _register(
|
300
|
+
distributioAddress,
|
301
|
+
DISTRIBUTION(),
|
302
|
+
token);
|
300
303
|
|
301
304
|
// check product is still expecting a distribution registration
|
302
|
-
IComponents.ProductInfo memory productInfo =
|
305
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
303
306
|
if (!productInfo.hasDistribution) {
|
304
307
|
revert ErrorProductServiceNoDistributionExpected(productNftId);
|
305
308
|
}
|
@@ -319,7 +322,6 @@ contract ComponentService is
|
|
319
322
|
)
|
320
323
|
external
|
321
324
|
virtual
|
322
|
-
restricted()
|
323
325
|
{
|
324
326
|
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
325
327
|
(NftId productNftId, IComponents.FeeInfo memory feeInfo) = _getLinkedFeeInfo(
|
@@ -348,25 +350,24 @@ contract ComponentService is
|
|
348
350
|
|
349
351
|
//-------- oracle -------------------------------------------------------//
|
350
352
|
|
351
|
-
function _registerOracle(
|
352
|
-
IInstance instance,
|
353
|
-
NftId productNftId,
|
354
|
-
IInstanceLinkedComponent oracle,
|
355
|
-
IRegistry.ObjectInfo memory info
|
356
|
-
)
|
353
|
+
function _registerOracle(address oracleAddress, address token)
|
357
354
|
internal
|
358
355
|
virtual
|
359
356
|
returns (NftId oracleNftId)
|
360
357
|
{
|
361
|
-
|
362
|
-
|
363
|
-
|
358
|
+
// register/create component setup
|
359
|
+
InstanceReader instanceReader;
|
360
|
+
InstanceAdmin instanceAdmin;
|
361
|
+
InstanceStore instanceStore;
|
362
|
+
NftId productNftId;
|
364
363
|
|
365
|
-
|
366
|
-
|
364
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, oracleNftId) = _register(
|
365
|
+
oracleAddress,
|
366
|
+
ORACLE(),
|
367
|
+
token);
|
367
368
|
|
368
369
|
// check product is still expecting an oracle registration
|
369
|
-
IComponents.ProductInfo memory productInfo =
|
370
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
370
371
|
if (productInfo.expectedNumberOfOracles == 0) {
|
371
372
|
revert ErrorProductServiceNoOraclesExpected(productNftId);
|
372
373
|
}
|
@@ -382,30 +383,30 @@ contract ComponentService is
|
|
382
383
|
|
383
384
|
//-------- pool ---------------------------------------------------------//
|
384
385
|
|
385
|
-
function _registerPool(
|
386
|
-
IInstance instance,
|
387
|
-
NftId productNftId,
|
388
|
-
IPoolComponent pool,
|
389
|
-
IRegistry.ObjectInfo memory info
|
390
|
-
)
|
386
|
+
function _registerPool(address poolAddress, address token)
|
391
387
|
internal
|
392
388
|
virtual
|
393
389
|
returns (NftId poolNftId)
|
394
390
|
{
|
395
|
-
|
396
|
-
|
397
|
-
|
391
|
+
// register/create component setup
|
392
|
+
InstanceReader instanceReader;
|
393
|
+
InstanceAdmin instanceAdmin;
|
394
|
+
InstanceStore instanceStore;
|
395
|
+
NftId productNftId;
|
398
396
|
|
399
|
-
|
400
|
-
|
397
|
+
(instanceReader, instanceAdmin, instanceStore, productNftId, poolNftId) = _register(
|
398
|
+
poolAddress,
|
399
|
+
POOL(),
|
400
|
+
token);
|
401
401
|
|
402
402
|
// check product is still expecting a pool registration
|
403
|
-
IComponents.ProductInfo memory productInfo =
|
403
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
404
404
|
if (productInfo.poolNftId.gtz()) {
|
405
405
|
revert ErrorProductServicePoolAlreadyRegistered(productNftId, productInfo.poolNftId);
|
406
406
|
}
|
407
407
|
|
408
408
|
// create info
|
409
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
409
410
|
instanceStore.createPool(
|
410
411
|
poolNftId,
|
411
412
|
pool.getInitialPoolInfo());
|
@@ -422,7 +423,6 @@ contract ComponentService is
|
|
422
423
|
Fee memory performanceFee // pool fee on profits from capital investors
|
423
424
|
)
|
424
425
|
external
|
425
|
-
restricted()
|
426
426
|
virtual
|
427
427
|
{
|
428
428
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
@@ -460,48 +460,84 @@ contract ComponentService is
|
|
460
460
|
|
461
461
|
/// @dev Registers the component represented by the provided address.
|
462
462
|
function _register(
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
IRegistry.ObjectInfo memory info
|
463
|
+
address componentAddress, // address of component to register
|
464
|
+
ObjectType requiredType, // required type for component for registration
|
465
|
+
address token
|
467
466
|
)
|
468
467
|
internal
|
469
468
|
virtual
|
470
|
-
returns (
|
469
|
+
returns (
|
470
|
+
InstanceReader instanceReader,
|
471
|
+
InstanceAdmin instanceAdmin,
|
472
|
+
InstanceStore instanceStore,
|
473
|
+
NftId parentNftId,
|
474
|
+
NftId componentNftId
|
475
|
+
)
|
471
476
|
{
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
+
NftId instanceNftId;
|
478
|
+
IInstance instance;
|
479
|
+
IInstanceLinkedComponent component;
|
480
|
+
address initialOwner;
|
481
|
+
|
482
|
+
(
|
483
|
+
instanceNftId,
|
484
|
+
instance,
|
485
|
+
parentNftId,
|
486
|
+
component,
|
487
|
+
initialOwner
|
488
|
+
) = _getAndVerifyRegisterableComponent(
|
489
|
+
getRegistry(),
|
490
|
+
componentAddress,
|
491
|
+
requiredType);
|
492
|
+
|
493
|
+
if (! instance.isTokenRegistryDisabled()) {
|
494
|
+
// check if provided token is whitelisted and active
|
495
|
+
if (!ContractLib.isActiveToken(
|
496
|
+
getRegistry().getTokenRegistryAddress(),
|
497
|
+
token,
|
498
|
+
block.chainid,
|
499
|
+
AccessManagerCloneable(authority()).getRelease())
|
500
|
+
) {
|
501
|
+
revert ErrorComponentServiceTokenInvalid(token);
|
502
|
+
}
|
503
|
+
}
|
504
|
+
|
505
|
+
// get instance supporting contracts (as function return values)
|
506
|
+
instanceReader = instance.getInstanceReader();
|
507
|
+
instanceAdmin = instance.getInstanceAdmin();
|
508
|
+
instanceStore = instance.getInstanceStore();
|
509
|
+
|
510
|
+
// register with registry
|
511
|
+
if (requiredType == PRODUCT()) {
|
512
|
+
componentNftId = _registryService.registerProduct(
|
513
|
+
component, initialOwner).nftId;
|
514
|
+
} else {
|
515
|
+
componentNftId = _registryService.registerProductLinkedComponent(
|
516
|
+
component, requiredType, initialOwner).nftId;
|
517
|
+
}
|
477
518
|
|
478
519
|
// deploy and wire token handler
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
520
|
+
{
|
521
|
+
IComponents.ComponentInfo memory componentInfo = component.getInitialComponentInfo();
|
522
|
+
componentInfo.tokenHandler = TokenHandlerDeployerLib.deployTokenHandler(
|
523
|
+
address(getRegistry()),
|
524
|
+
componentAddress, // initially, component is its own wallet
|
525
|
+
token,
|
526
|
+
address(instanceAdmin.authority()));
|
527
|
+
|
528
|
+
// register component with instance
|
529
|
+
instanceStore.createComponent(
|
530
|
+
componentNftId,
|
531
|
+
componentInfo);
|
532
|
+
}
|
492
533
|
|
493
534
|
// link component contract to nft id
|
494
535
|
component.linkToRegisteredNftId();
|
495
536
|
|
496
537
|
// authorize
|
497
|
-
instanceAdmin.initializeComponentAuthorization(
|
538
|
+
instanceAdmin.initializeComponentAuthorization(componentAddress, requiredType);
|
498
539
|
|
499
|
-
emit LogComponentServiceRegistered(
|
500
|
-
componentNftId,
|
501
|
-
info.objectType,
|
502
|
-
address(component),
|
503
|
-
address(token),
|
504
|
-
info.initialOwner);
|
540
|
+
emit LogComponentServiceRegistered(instanceNftId, componentNftId, requiredType, componentAddress, token, initialOwner);
|
505
541
|
}
|
506
542
|
|
507
543
|
|
@@ -535,47 +571,89 @@ contract ComponentService is
|
|
535
571
|
info = instanceReader.getFeeInfo(productNftId);
|
536
572
|
}
|
537
573
|
|
574
|
+
|
538
575
|
/// @dev Based on the provided component address required type the component
|
539
576
|
/// and related instance contract this function reverts iff:
|
577
|
+
/// - the sender is not registered
|
540
578
|
/// - the component contract does not support IInstanceLinkedComponent
|
541
|
-
/// - the component
|
542
|
-
/// - the component version does not match with the service release
|
579
|
+
/// - the component type does not match with the required type
|
543
580
|
/// - the component has already been registered
|
544
581
|
function _getAndVerifyRegisterableComponent(
|
582
|
+
IRegistry registry,
|
545
583
|
address componentAddress,
|
546
|
-
|
584
|
+
ObjectType requiredType
|
547
585
|
)
|
548
586
|
internal
|
549
587
|
view
|
550
588
|
returns (
|
589
|
+
NftId instanceNftId,
|
590
|
+
IInstance instance,
|
591
|
+
NftId parentNftId,
|
551
592
|
IInstanceLinkedComponent component,
|
552
|
-
|
593
|
+
address initialOwner
|
553
594
|
)
|
554
595
|
{
|
555
|
-
// check
|
556
|
-
|
557
|
-
|
596
|
+
// check sender (instance or product) is registered
|
597
|
+
IRegistry.ObjectInfo memory senderInfo = registry.getObjectInfo(msg.sender);
|
598
|
+
if (senderInfo.nftId.eqz()) {
|
599
|
+
revert ErrorComponentServiceSenderNotRegistered(msg.sender);
|
558
600
|
}
|
559
601
|
|
602
|
+
// the sender is the parent of the component to be registered
|
603
|
+
// an instance caller wanting to register a product - or -
|
604
|
+
// a product caller wantint go register a distribution, oracle or pool
|
605
|
+
parentNftId = senderInfo.nftId;
|
606
|
+
|
607
|
+
// check component is of required type
|
560
608
|
component = IInstanceLinkedComponent(componentAddress);
|
561
|
-
info = component.getInitialInfo();
|
609
|
+
IRegistry.ObjectInfo memory info = component.getInitialInfo();
|
610
|
+
if(info.objectType != requiredType) {
|
611
|
+
revert ErrorComponentServiceInvalidType(componentAddress, requiredType, info.objectType);
|
612
|
+
}
|
562
613
|
|
563
|
-
// check component
|
564
|
-
if(
|
565
|
-
revert
|
614
|
+
// check component has not already been registered
|
615
|
+
if (getRegistry().getNftIdForAddress(componentAddress).gtz()) {
|
616
|
+
revert ErrorComponentServiceAlreadyRegistered(componentAddress);
|
566
617
|
}
|
567
618
|
|
568
|
-
//
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
619
|
+
// component release matches servie release
|
620
|
+
address parentAddress = registry.getObjectAddress(parentNftId);
|
621
|
+
if (component.getRelease() != getRelease()) {
|
622
|
+
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), getRelease());
|
623
|
+
// component release matches parent release
|
624
|
+
} else if (component.getRelease() != IRegisterable(parentAddress).getRelease()){
|
625
|
+
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), IRegisterable(parentAddress).getRelease());
|
573
626
|
}
|
574
627
|
|
575
|
-
// check component
|
576
|
-
|
577
|
-
|
628
|
+
// check component belongs to same product cluster
|
629
|
+
// parent of product must be instance, parent of other componet types must be product
|
630
|
+
if (info.parentNftId != senderInfo.nftId) {
|
631
|
+
revert ErrorComponentServiceSenderNotComponentParent(senderInfo.nftId, info.parentNftId);
|
578
632
|
}
|
633
|
+
|
634
|
+
// verify parent is registered instance
|
635
|
+
if (requiredType == PRODUCT()) {
|
636
|
+
if (senderInfo.objectType != INSTANCE()) {
|
637
|
+
revert ErrorComponentServiceParentNotInstance(senderInfo.nftId, senderInfo.objectType);
|
638
|
+
}
|
639
|
+
|
640
|
+
instanceNftId = senderInfo.nftId;
|
641
|
+
// verify parent is registered product
|
642
|
+
} else {
|
643
|
+
if (senderInfo.objectType != PRODUCT()) {
|
644
|
+
revert ErrorComponentServiceParentNotProduct(senderInfo.nftId, senderInfo.objectType);
|
645
|
+
}
|
646
|
+
|
647
|
+
instanceNftId = senderInfo.parentNftId;
|
648
|
+
}
|
649
|
+
|
650
|
+
// get initial owner and instance
|
651
|
+
initialOwner = info.initialOwner;
|
652
|
+
instance = IInstance(registry.getObjectAddress(instanceNftId));
|
653
|
+
}
|
654
|
+
|
655
|
+
function _setLocked(InstanceAdmin instanceAdmin, address componentAddress, bool locked) internal {
|
656
|
+
instanceAdmin.setTargetLocked(componentAddress, locked);
|
579
657
|
}
|
580
658
|
|
581
659
|
function _getAndVerifyActiveComponent(ObjectType expectedType)
|
@@ -621,4 +699,10 @@ contract ComponentService is
|
|
621
699
|
function _getDomain() internal pure virtual override returns(ObjectType) {
|
622
700
|
return COMPONENT();
|
623
701
|
}
|
702
|
+
|
703
|
+
function _checkSupportsInterface(address component) internal view {
|
704
|
+
if (!ContractLib.supportsInterface(component, type(IInstanceLinkedComponent).interfaceId)) {
|
705
|
+
revert ErrorComponentServiceNotInstanceLinkedComponent(component);
|
706
|
+
}
|
707
|
+
}
|
624
708
|
}
|