@etherisc/gif-next 0.0.2-bf51045-496 → 0.0.2-bf9f7e6-880
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +44 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +69 -62
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +29 -31
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +33 -9
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +454 -253
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +227 -26
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +353 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +105 -18
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +74 -157
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +212 -38
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +39 -95
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +271 -185
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +66 -60
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +26 -82
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +159 -72
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +92 -88
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +193 -51
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +248 -237
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +212 -38
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +132 -173
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +212 -38
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +75 -68
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +123 -116
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +193 -51
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +338 -242
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +212 -38
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +158 -29
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +108 -9
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +187 -54
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +677 -325
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +193 -51
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +496 -324
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +121 -85
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -38
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +619 -559
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +96 -53
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +60 -51
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +194 -40
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +30 -21
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +44 -35
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +75 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -36
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +65 -56
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +193 -51
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -207
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +42 -64
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +44 -86
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +40 -31
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +138 -193
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +53 -44
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +254 -299
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +70 -56
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +123 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +37 -27
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +176 -152
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +212 -38
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +244 -187
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -74
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +69 -3
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +105 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +48 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +157 -133
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +58 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +193 -173
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +54 -56
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +96 -108
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +35 -57
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +170 -146
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +131 -81
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -28
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +36 -12
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +74 -50
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +553 -434
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +22 -24
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +333 -63
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +43 -34
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +147 -165
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +48 -50
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +113 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +30 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +71 -72
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +30 -21
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +43 -34
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +113 -39
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +131 -7
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +169 -97
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +44 -32
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +168 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -29
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +10 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +93 -37
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +30 -6
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +3 -4
- package/contracts/accounting/AccountingServiceManager.sol +1 -1
- package/contracts/accounting/IAccountingService.sol +2 -2
- package/contracts/authorization/AccessAdmin.sol +293 -204
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +307 -231
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +69 -36
- package/contracts/authorization/IAuthorization.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +13 -11
- package/contracts/distribution/BasicDistributionAuthorization.sol +21 -8
- package/contracts/distribution/Distribution.sol +13 -56
- package/contracts/distribution/DistributionService.sol +83 -55
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +18 -15
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -1
- package/contracts/examples/fire/FireProduct.sol +4 -7
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -5
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +29 -8
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +1 -1
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +51 -16
- package/contracts/instance/IInstanceService.sol +20 -2
- package/contracts/instance/Instance.sol +90 -25
- package/contracts/instance/InstanceAdmin.sol +261 -99
- package/contracts/instance/InstanceAuthorizationV3.sol +49 -36
- package/contracts/instance/InstanceReader.sol +103 -34
- package/contracts/instance/InstanceService.sol +154 -87
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +11 -12
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +19 -7
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +4 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +1 -3
- package/contracts/oracle/OracleService.sol +16 -15
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +21 -13
- package/contracts/pool/BundleService.sol +28 -58
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +13 -19
- package/contracts/pool/IPoolService.sol +50 -38
- package/contracts/pool/Pool.sol +9 -11
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +294 -154
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +24 -9
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -2
- package/contracts/product/BasicProductAuthorization.sol +23 -8
- package/contracts/product/ClaimService.sol +157 -139
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +11 -6
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +86 -158
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +30 -21
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +55 -15
- package/contracts/product/RiskService.sol +76 -29
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +12 -15
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryAdmin.sol +143 -342
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +146 -115
- package/contracts/registry/ServiceAuthorizationV3.sol +126 -2
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +17 -26
- package/contracts/shared/ComponentService.sol +141 -129
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/ContractLib.sol +60 -3
- package/contracts/shared/IComponent.sol +0 -4
- package/contracts/shared/IComponentService.sol +9 -13
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +2 -4
- package/contracts/shared/NftOwnable.sol +5 -5
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +45 -92
- package/contracts/staking/IStaking.sol +12 -10
- package/contracts/staking/IStakingService.sol +16 -1
- package/contracts/staking/Staking.sol +59 -28
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +6 -16
- package/contracts/staking/StakingService.sol +68 -44
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/ObjectType.sol +47 -39
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +27 -10
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +2 -2
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -3,9 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {Amount, AmountLib} from "../type/Amount.sol";
|
7
|
-
import {ContractLib} from "../shared/ContractLib.sol";
|
8
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
9
6
|
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
10
7
|
import {IComponent} from "../shared/IComponent.sol";
|
11
8
|
import {IComponents} from "../instance/module/IComponents.sol";
|
@@ -22,11 +19,12 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
22
19
|
import {IRegistry} from "../registry/IRegistry.sol";
|
23
20
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
24
21
|
|
22
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
25
23
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
26
24
|
import {ContractLib} from "../shared/ContractLib.sol";
|
27
25
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
28
26
|
import {KEEP_STATE} from "../type/StateId.sol";
|
29
|
-
import {NftId} from "../type/NftId.sol";
|
27
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
30
28
|
import {ObjectType, ACCOUNTING, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
31
29
|
import {Service} from "../shared/Service.sol";
|
32
30
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
@@ -79,11 +77,11 @@ contract ComponentService is
|
|
79
77
|
initializer()
|
80
78
|
{
|
81
79
|
(
|
82
|
-
address
|
83
|
-
address
|
80
|
+
address authority,
|
81
|
+
address registry
|
84
82
|
) = abi.decode(data, (address, address));
|
85
83
|
|
86
|
-
|
84
|
+
__Service_init(authority, registry, owner);
|
87
85
|
|
88
86
|
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
89
87
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
@@ -101,15 +99,18 @@ contract ComponentService is
|
|
101
99
|
returns (NftId componentNftId)
|
102
100
|
{
|
103
101
|
// type specific registration
|
104
|
-
|
102
|
+
IRegistry.ObjectInfo memory componentObjectInfo = IInstanceLinkedComponent(component).getInitialInfo();
|
103
|
+
ObjectType componentType = componentObjectInfo.objectType;
|
104
|
+
IComponent productComponent = IComponent(getRegistry().getObjectAddress(componentObjectInfo.parentNftId));
|
105
|
+
|
105
106
|
if (componentType == POOL()) {
|
106
|
-
return _registerPool(component);
|
107
|
+
return _registerPool(component, address(productComponent.getToken()));
|
107
108
|
}
|
108
109
|
if (componentType == DISTRIBUTION()) {
|
109
|
-
return _registerDistribution(component);
|
110
|
+
return _registerDistribution(component, address(productComponent.getToken()));
|
110
111
|
}
|
111
112
|
if (componentType == ORACLE()) {
|
112
|
-
return _registerOracle(component);
|
113
|
+
return _registerOracle(component, address(productComponent.getToken()));
|
113
114
|
}
|
114
115
|
|
115
116
|
// fail
|
@@ -133,24 +134,6 @@ contract ComponentService is
|
|
133
134
|
}
|
134
135
|
|
135
136
|
|
136
|
-
function approveStakingTokenHandler(
|
137
|
-
IERC20Metadata token,
|
138
|
-
Amount amount
|
139
|
-
)
|
140
|
-
external
|
141
|
-
virtual
|
142
|
-
{
|
143
|
-
// checks
|
144
|
-
ContractLib.getAndVerifyStaking(
|
145
|
-
getRegistry(),
|
146
|
-
msg.sender); // only active
|
147
|
-
|
148
|
-
// effects
|
149
|
-
TokenHandler tokenHandler = IComponent(msg.sender).getTokenHandler();
|
150
|
-
tokenHandler.approve(token, amount);
|
151
|
-
}
|
152
|
-
|
153
|
-
|
154
137
|
function setWallet(address newWallet)
|
155
138
|
external
|
156
139
|
virtual
|
@@ -165,62 +148,73 @@ contract ComponentService is
|
|
165
148
|
}
|
166
149
|
|
167
150
|
/// @inheritdoc IComponentService
|
168
|
-
function
|
151
|
+
function setLocked(bool locked)
|
169
152
|
external
|
170
153
|
virtual
|
171
|
-
|
172
|
-
{
|
173
|
-
address instanceAddress = msg.sender;
|
174
|
-
// NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
175
|
-
IInstance instance = IInstance(instanceAddress);
|
176
|
-
_setLocked(instance.getInstanceAdmin(), componentAddress, locked);
|
177
|
-
}
|
178
|
-
|
179
|
-
/// @inheritdoc IComponentService
|
180
|
-
function setLockedFromComponent(address componentAddress, bool locked)
|
181
|
-
external
|
182
|
-
virtual
|
183
|
-
onlyComponent(msg.sender)
|
154
|
+
restricted()
|
184
155
|
{
|
185
156
|
(, IInstance instance) = _getAndVerifyComponent(COMPONENT(), false);
|
186
|
-
|
157
|
+
|
158
|
+
address component = msg.sender;
|
159
|
+
instance.getInstanceAdmin().setComponentLocked(
|
160
|
+
component,
|
161
|
+
locked);
|
187
162
|
}
|
188
163
|
|
164
|
+
/// @inheritdoc IComponentService
|
189
165
|
function withdrawFees(Amount amount)
|
190
166
|
external
|
191
167
|
virtual
|
168
|
+
restricted()
|
192
169
|
returns (Amount withdrawnAmount)
|
193
170
|
{
|
171
|
+
// checks
|
194
172
|
(NftId componentNftId, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
195
|
-
|
196
|
-
address componentWallet = info.tokenHandler.getWallet();
|
173
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
197
174
|
|
198
175
|
// determine withdrawn amount
|
176
|
+
Amount maxAvailableAmount = instanceReader.getFeeAmount(componentNftId);
|
199
177
|
withdrawnAmount = amount;
|
200
|
-
|
201
|
-
|
202
|
-
|
178
|
+
|
179
|
+
// max amount -> withraw all available fees
|
180
|
+
if (amount == AmountLib.max()) {
|
181
|
+
withdrawnAmount = maxAvailableAmount;
|
182
|
+
}
|
183
|
+
|
184
|
+
// check modified withdrawn amount
|
185
|
+
if (withdrawnAmount.eqz()) {
|
203
186
|
revert ErrorComponentServiceWithdrawAmountIsZero();
|
204
|
-
} else {
|
205
|
-
|
206
|
-
if (withdrawnAmount.gt(withdrawLimit)) {
|
207
|
-
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, withdrawLimit);
|
208
|
-
}
|
187
|
+
} else if (withdrawnAmount > maxAvailableAmount) {
|
188
|
+
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, maxAvailableAmount);
|
209
189
|
}
|
210
190
|
|
191
|
+
// effects
|
211
192
|
// decrease fee counters by withdrawnAmount
|
212
|
-
_accountingService.decreaseComponentFees(
|
193
|
+
_accountingService.decreaseComponentFees(
|
194
|
+
instance.getInstanceStore(),
|
195
|
+
componentNftId,
|
196
|
+
withdrawnAmount);
|
213
197
|
|
214
198
|
// transfer amount to component owner
|
215
199
|
address componentOwner = getRegistry().ownerOf(componentNftId);
|
216
|
-
|
217
|
-
|
200
|
+
TokenHandler tokenHandler = instanceReader.getTokenHandler(componentNftId);
|
201
|
+
emit LogComponentServiceComponentFeesWithdrawn(
|
202
|
+
componentNftId,
|
203
|
+
componentOwner,
|
204
|
+
address(tokenHandler.TOKEN()),
|
205
|
+
withdrawnAmount);
|
206
|
+
|
207
|
+
// interactions
|
208
|
+
// transfer amount to component owner
|
209
|
+
tokenHandler.pushFeeToken(
|
210
|
+
componentOwner,
|
211
|
+
withdrawnAmount);
|
218
212
|
}
|
219
213
|
|
220
214
|
|
221
215
|
//-------- product ------------------------------------------------------//
|
222
216
|
|
223
|
-
function registerProduct(address productAddress)
|
217
|
+
function registerProduct(address productAddress, address token)
|
224
218
|
external
|
225
219
|
virtual
|
226
220
|
nonReentrant()
|
@@ -232,18 +226,27 @@ contract ComponentService is
|
|
232
226
|
InstanceStore instanceStore;
|
233
227
|
(, instanceAdmin, instanceStore,, productNftId) = _register(
|
234
228
|
productAddress,
|
235
|
-
PRODUCT()
|
229
|
+
PRODUCT(),
|
230
|
+
token);
|
236
231
|
|
237
232
|
// get product
|
238
233
|
IProductComponent product = IProductComponent(productAddress);
|
234
|
+
|
235
|
+
IComponents.ProductInfo memory initialProductInfo = product.getInitialProductInfo();
|
236
|
+
// force initialization of linked components with empty values to
|
237
|
+
// ensure no components are linked upon initialization of the product
|
238
|
+
initialProductInfo.poolNftId = NftIdLib.zero();
|
239
|
+
initialProductInfo.distributionNftId = NftIdLib.zero();
|
240
|
+
initialProductInfo.oracleNftId = new NftId[](initialProductInfo.expectedNumberOfOracles);
|
239
241
|
|
240
242
|
// create info
|
241
243
|
instanceStore.createProduct(
|
242
244
|
productNftId,
|
243
|
-
|
245
|
+
initialProductInfo);
|
244
246
|
|
245
|
-
|
246
|
-
|
247
|
+
instanceStore.createFee(
|
248
|
+
productNftId,
|
249
|
+
product.getInitialFeeInfo());
|
247
250
|
}
|
248
251
|
|
249
252
|
|
@@ -256,25 +259,25 @@ contract ComponentService is
|
|
256
259
|
nonReentrant()
|
257
260
|
{
|
258
261
|
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
259
|
-
IComponents.
|
262
|
+
IComponents.FeeInfo memory feeInfo = instance.getInstanceReader().getFeeInfo(productNftId);
|
260
263
|
bool feesChanged = false;
|
261
264
|
|
262
265
|
// update product fee if required
|
263
|
-
if(!FeeLib.eq(
|
264
|
-
_logUpdateFee(productNftId, "ProductFee",
|
265
|
-
|
266
|
+
if(!FeeLib.eq(feeInfo.productFee, productFee)) {
|
267
|
+
_logUpdateFee(productNftId, "ProductFee", feeInfo.productFee, productFee);
|
268
|
+
feeInfo.productFee = productFee;
|
266
269
|
feesChanged = true;
|
267
270
|
}
|
268
271
|
|
269
272
|
// update processing fee if required
|
270
|
-
if(!FeeLib.eq(
|
271
|
-
_logUpdateFee(productNftId, "ProcessingFee",
|
272
|
-
|
273
|
+
if(!FeeLib.eq(feeInfo.processingFee, processingFee)) {
|
274
|
+
_logUpdateFee(productNftId, "ProcessingFee", feeInfo.processingFee, processingFee);
|
275
|
+
feeInfo.processingFee = processingFee;
|
273
276
|
feesChanged = true;
|
274
277
|
}
|
275
278
|
|
276
279
|
if(feesChanged) {
|
277
|
-
instance.getInstanceStore().
|
280
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
278
281
|
emit LogComponentServiceProductFeesUpdated(productNftId);
|
279
282
|
}
|
280
283
|
}
|
@@ -282,7 +285,7 @@ contract ComponentService is
|
|
282
285
|
//-------- distribution -------------------------------------------------//
|
283
286
|
|
284
287
|
/// @dev registers the sending component as a distribution component
|
285
|
-
function _registerDistribution(address distributioAddress)
|
288
|
+
function _registerDistribution(address distributioAddress, address token)
|
286
289
|
internal
|
287
290
|
virtual
|
288
291
|
nonReentrant()
|
@@ -295,7 +298,8 @@ contract ComponentService is
|
|
295
298
|
NftId productNftId;
|
296
299
|
(instanceReader, instanceAdmin, instanceStore, productNftId, distributionNftId) = _register(
|
297
300
|
distributioAddress,
|
298
|
-
DISTRIBUTION()
|
301
|
+
DISTRIBUTION(),
|
302
|
+
token);
|
299
303
|
|
300
304
|
// check product is still expecting a distribution registration
|
301
305
|
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
@@ -309,10 +313,6 @@ contract ComponentService is
|
|
309
313
|
// set distribution in product info
|
310
314
|
productInfo.distributionNftId = distributionNftId;
|
311
315
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
312
|
-
|
313
|
-
// authorize
|
314
|
-
instanceAdmin.initializeComponentAuthorization(
|
315
|
-
IInstanceLinkedComponent(distributioAddress));
|
316
316
|
}
|
317
317
|
|
318
318
|
|
@@ -324,33 +324,33 @@ contract ComponentService is
|
|
324
324
|
virtual
|
325
325
|
{
|
326
326
|
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
327
|
-
(NftId productNftId, IComponents.
|
327
|
+
(NftId productNftId, IComponents.FeeInfo memory feeInfo) = _getLinkedFeeInfo(
|
328
328
|
instance.getInstanceReader(), distributionNftId);
|
329
329
|
bool feesChanged = false;
|
330
330
|
|
331
331
|
// update distributino fee if required
|
332
|
-
if(!FeeLib.eq(
|
333
|
-
_logUpdateFee(productNftId, "DistributionFee",
|
334
|
-
|
332
|
+
if(!FeeLib.eq(feeInfo.distributionFee, distributionFee)) {
|
333
|
+
_logUpdateFee(productNftId, "DistributionFee", feeInfo.distributionFee, distributionFee);
|
334
|
+
feeInfo.distributionFee = distributionFee;
|
335
335
|
feesChanged = true;
|
336
336
|
}
|
337
337
|
|
338
338
|
// update min distribution owner fee if required
|
339
|
-
if(!FeeLib.eq(
|
340
|
-
_logUpdateFee(productNftId, "MinDistributionOwnerFee",
|
341
|
-
|
339
|
+
if(!FeeLib.eq(feeInfo.minDistributionOwnerFee, minDistributionOwnerFee)) {
|
340
|
+
_logUpdateFee(productNftId, "MinDistributionOwnerFee", feeInfo.minDistributionOwnerFee, minDistributionOwnerFee);
|
341
|
+
feeInfo.minDistributionOwnerFee = minDistributionOwnerFee;
|
342
342
|
feesChanged = true;
|
343
343
|
}
|
344
344
|
|
345
345
|
if(feesChanged) {
|
346
|
-
instance.getInstanceStore().
|
346
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
347
347
|
emit LogComponentServiceDistributionFeesUpdated(distributionNftId);
|
348
348
|
}
|
349
349
|
}
|
350
350
|
|
351
351
|
//-------- oracle -------------------------------------------------------//
|
352
352
|
|
353
|
-
function _registerOracle(address oracleAddress)
|
353
|
+
function _registerOracle(address oracleAddress, address token)
|
354
354
|
internal
|
355
355
|
virtual
|
356
356
|
returns (NftId oracleNftId)
|
@@ -363,7 +363,8 @@ contract ComponentService is
|
|
363
363
|
|
364
364
|
(instanceReader, instanceAdmin, instanceStore, productNftId, oracleNftId) = _register(
|
365
365
|
oracleAddress,
|
366
|
-
ORACLE()
|
366
|
+
ORACLE(),
|
367
|
+
token);
|
367
368
|
|
368
369
|
// check product is still expecting an oracle registration
|
369
370
|
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
@@ -378,15 +379,11 @@ contract ComponentService is
|
|
378
379
|
productInfo.oracleNftId[productInfo.numberOfOracles] = oracleNftId;
|
379
380
|
productInfo.numberOfOracles++;
|
380
381
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
381
|
-
|
382
|
-
// authorize
|
383
|
-
instanceAdmin.initializeComponentAuthorization(
|
384
|
-
IInstanceLinkedComponent(oracleAddress));
|
385
382
|
}
|
386
383
|
|
387
384
|
//-------- pool ---------------------------------------------------------//
|
388
385
|
|
389
|
-
function _registerPool(address poolAddress)
|
386
|
+
function _registerPool(address poolAddress, address token)
|
390
387
|
internal
|
391
388
|
virtual
|
392
389
|
returns (NftId poolNftId)
|
@@ -399,7 +396,8 @@ contract ComponentService is
|
|
399
396
|
|
400
397
|
(instanceReader, instanceAdmin, instanceStore, productNftId, poolNftId) = _register(
|
401
398
|
poolAddress,
|
402
|
-
POOL()
|
399
|
+
POOL(),
|
400
|
+
token);
|
403
401
|
|
404
402
|
// check product is still expecting a pool registration
|
405
403
|
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
@@ -416,9 +414,6 @@ contract ComponentService is
|
|
416
414
|
// update pool in product info
|
417
415
|
productInfo.poolNftId = poolNftId;
|
418
416
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
419
|
-
|
420
|
-
// authorize
|
421
|
-
instanceAdmin.initializeComponentAuthorization(pool);
|
422
417
|
}
|
423
418
|
|
424
419
|
|
@@ -432,33 +427,33 @@ contract ComponentService is
|
|
432
427
|
{
|
433
428
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
434
429
|
|
435
|
-
(NftId productNftId, IComponents.
|
430
|
+
(NftId productNftId, IComponents.FeeInfo memory feeInfo) = _getLinkedFeeInfo(
|
436
431
|
instance.getInstanceReader(), poolNftId);
|
437
432
|
bool feesChanged = false;
|
438
433
|
|
439
434
|
// update pool fee if required
|
440
|
-
if(!FeeLib.eq(
|
441
|
-
_logUpdateFee(productNftId, "PoolFee",
|
442
|
-
|
435
|
+
if(!FeeLib.eq(feeInfo.poolFee, poolFee)) {
|
436
|
+
_logUpdateFee(productNftId, "PoolFee", feeInfo.poolFee, poolFee);
|
437
|
+
feeInfo.poolFee = poolFee;
|
443
438
|
feesChanged = true;
|
444
439
|
}
|
445
440
|
|
446
441
|
// update staking fee if required
|
447
|
-
if(!FeeLib.eq(
|
448
|
-
_logUpdateFee(productNftId, "StakingFee",
|
449
|
-
|
442
|
+
if(!FeeLib.eq(feeInfo.stakingFee, stakingFee)) {
|
443
|
+
_logUpdateFee(productNftId, "StakingFee", feeInfo.stakingFee, stakingFee);
|
444
|
+
feeInfo.stakingFee = stakingFee;
|
450
445
|
feesChanged = true;
|
451
446
|
}
|
452
447
|
|
453
448
|
// update performance fee if required
|
454
|
-
if(!FeeLib.eq(
|
455
|
-
_logUpdateFee(productNftId, "PerformanceFee",
|
456
|
-
|
449
|
+
if(!FeeLib.eq(feeInfo.performanceFee, performanceFee)) {
|
450
|
+
_logUpdateFee(productNftId, "PerformanceFee", feeInfo.performanceFee, performanceFee);
|
451
|
+
feeInfo.performanceFee = performanceFee;
|
457
452
|
feesChanged = true;
|
458
453
|
}
|
459
454
|
|
460
455
|
if(feesChanged) {
|
461
|
-
instance.getInstanceStore().
|
456
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
462
457
|
emit LogComponentServicePoolFeesUpdated(poolNftId);
|
463
458
|
}
|
464
459
|
}
|
@@ -466,7 +461,8 @@ contract ComponentService is
|
|
466
461
|
/// @dev Registers the component represented by the provided address.
|
467
462
|
function _register(
|
468
463
|
address componentAddress, // address of component to register
|
469
|
-
ObjectType requiredType // required type for component for registration
|
464
|
+
ObjectType requiredType, // required type for component for registration
|
465
|
+
address token
|
470
466
|
)
|
471
467
|
internal
|
472
468
|
virtual
|
@@ -494,6 +490,18 @@ contract ComponentService is
|
|
494
490
|
componentAddress,
|
495
491
|
requiredType);
|
496
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
|
+
|
497
505
|
// get instance supporting contracts (as function return values)
|
498
506
|
instanceReader = instance.getInstanceReader();
|
499
507
|
instanceAdmin = instance.getInstanceAdmin();
|
@@ -509,26 +517,27 @@ contract ComponentService is
|
|
509
517
|
}
|
510
518
|
|
511
519
|
// deploy and wire token handler
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
componentNftId,
|
526
|
-
componentInfo);
|
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
|
+
}
|
527
533
|
|
528
534
|
// link component contract to nft id
|
529
535
|
component.linkToRegisteredNftId();
|
530
536
|
|
531
|
-
|
537
|
+
// authorize
|
538
|
+
instanceAdmin.initializeComponentAuthorization(componentAddress, requiredType);
|
539
|
+
|
540
|
+
emit LogComponentServiceRegistered(instanceNftId, componentNftId, requiredType, componentAddress, token, initialOwner);
|
532
541
|
}
|
533
542
|
|
534
543
|
|
@@ -547,7 +556,7 @@ contract ComponentService is
|
|
547
556
|
}
|
548
557
|
|
549
558
|
|
550
|
-
function
|
559
|
+
function _getLinkedFeeInfo(
|
551
560
|
InstanceReader instanceReader,
|
552
561
|
NftId componentNftId
|
553
562
|
)
|
@@ -555,11 +564,11 @@ contract ComponentService is
|
|
555
564
|
view
|
556
565
|
returns(
|
557
566
|
NftId productNftId,
|
558
|
-
IComponents.
|
567
|
+
IComponents.FeeInfo memory info
|
559
568
|
)
|
560
569
|
{
|
561
|
-
productNftId = getRegistry().
|
562
|
-
info = instanceReader.
|
570
|
+
productNftId = getRegistry().getParentNftId(componentNftId);
|
571
|
+
info = instanceReader.getFeeInfo(productNftId);
|
563
572
|
}
|
564
573
|
|
565
574
|
|
@@ -607,9 +616,12 @@ contract ComponentService is
|
|
607
616
|
revert ErrorComponentServiceAlreadyRegistered(componentAddress);
|
608
617
|
}
|
609
618
|
|
610
|
-
//
|
619
|
+
// component release matches servie release
|
611
620
|
address parentAddress = registry.getObjectAddress(parentNftId);
|
612
|
-
if (component.getRelease() !=
|
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()){
|
613
625
|
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), IRegisterable(parentAddress).getRelease());
|
614
626
|
}
|
615
627
|
|
@@ -17,7 +17,7 @@ contract ComponentServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
ComponentService svc = new ComponentService();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|
@@ -116,7 +116,7 @@ abstract contract ComponentVerifyingService is
|
|
116
116
|
/// @dev returns the product nft id from the registry.
|
117
117
|
/// assumes the component nft id is valid and represents a product linked component.
|
118
118
|
function _getProductNftId(NftId componentNftId) internal view returns (NftId productNftId) {
|
119
|
-
productNftId = getRegistry().
|
119
|
+
productNftId = getRegistry().getParentNftId(componentNftId);
|
120
120
|
}
|
121
121
|
|
122
122
|
|
@@ -2,12 +2,15 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
5
|
+
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
|
6
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
7
|
|
6
8
|
// import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
7
9
|
import {IRegistry} from "../registry/IRegistry.sol";
|
8
10
|
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
9
11
|
import {NftId} from "../type/NftId.sol";
|
10
12
|
import {ObjectType, PRODUCT, DISTRIBUTION, ORACLE, POOL, STAKING} from "../type/ObjectType.sol";
|
13
|
+
import {VersionPart} from "../type/Version.sol";
|
11
14
|
|
12
15
|
interface ITargetHelper {
|
13
16
|
function isTargetLocked(address target) external view returns (bool);
|
@@ -17,6 +20,10 @@ interface IInstanceAdminHelper {
|
|
17
20
|
function getInstanceAdmin() external view returns (ITargetHelper);
|
18
21
|
}
|
19
22
|
|
23
|
+
interface ITokenRegistryHelper {
|
24
|
+
function isActive(uint256 chainId, address token, VersionPart release) external view returns (bool);
|
25
|
+
}
|
26
|
+
|
20
27
|
library ContractLib {
|
21
28
|
|
22
29
|
error ErrorContractLibNotRegistered(address target);
|
@@ -25,7 +32,6 @@ library ContractLib {
|
|
25
32
|
error ErrorContractLibComponentTypeMismatch(NftId componentNftId, ObjectType expectedType, ObjectType actualType);
|
26
33
|
error ErrorContractLibComponentInactive(NftId componentNftId);
|
27
34
|
|
28
|
-
|
29
35
|
function getAndVerifyComponent(
|
30
36
|
IRegistry registry,
|
31
37
|
address target,
|
@@ -130,17 +136,68 @@ library ContractLib {
|
|
130
136
|
view
|
131
137
|
returns (address instance)
|
132
138
|
{
|
133
|
-
NftId productNftId = registry.
|
134
|
-
NftId instanceNftId = registry.
|
139
|
+
NftId productNftId = registry.getParentNftId(componentNftId);
|
140
|
+
NftId instanceNftId = registry.getParentNftId(productNftId);
|
135
141
|
return registry.getObjectInfo(instanceNftId).objectAddress;
|
136
142
|
}
|
137
143
|
|
138
144
|
|
145
|
+
function isActiveToken(
|
146
|
+
address tokenRegistryAddress,
|
147
|
+
address token,
|
148
|
+
uint256 chainId,
|
149
|
+
VersionPart release
|
150
|
+
)
|
151
|
+
external
|
152
|
+
view
|
153
|
+
returns (bool)
|
154
|
+
{
|
155
|
+
return ITokenRegistryHelper(
|
156
|
+
tokenRegistryAddress).isActive(
|
157
|
+
chainId, token, release);
|
158
|
+
}
|
159
|
+
|
139
160
|
function isPolicyHolder(address target) external view returns (bool) {
|
140
161
|
return ERC165Checker.supportsInterface(target, type(IPolicyHolder).interfaceId);
|
141
162
|
}
|
142
163
|
|
143
164
|
|
165
|
+
function isAuthority(address authority) public view returns (bool) {
|
166
|
+
if (!isContract(authority)) {
|
167
|
+
return false;
|
168
|
+
}
|
169
|
+
|
170
|
+
return supportsInterface(authority, type(IAccessManager).interfaceId);
|
171
|
+
}
|
172
|
+
|
173
|
+
|
174
|
+
function isAccessManaged(address target)
|
175
|
+
public
|
176
|
+
view
|
177
|
+
returns (bool)
|
178
|
+
{
|
179
|
+
if (!isContract(target)) {
|
180
|
+
return false;
|
181
|
+
}
|
182
|
+
|
183
|
+
(bool success, ) = target.staticcall(
|
184
|
+
abi.encodeWithSelector(
|
185
|
+
IAccessManaged.authority.selector));
|
186
|
+
|
187
|
+
return success;
|
188
|
+
}
|
189
|
+
|
190
|
+
|
191
|
+
function isRegistered(address registry, address caller, ObjectType expectedType) public view returns (bool) {
|
192
|
+
NftId nftId = IRegistry(registry).getNftIdForAddress(caller);
|
193
|
+
if (nftId.eqz()) {
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
|
197
|
+
return IRegistry(registry).getObjectInfo(nftId).objectType == expectedType;
|
198
|
+
}
|
199
|
+
|
200
|
+
|
144
201
|
function isRegistry(address registry) public view returns (bool) {
|
145
202
|
if (!isContract(registry)) {
|
146
203
|
return false;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
5
|
|
7
6
|
import {Amount} from "../type/Amount.sol";
|
@@ -13,7 +12,6 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
13
12
|
/// @dev component base class
|
14
13
|
/// component examples are staking, product, distribution, pool and oracle
|
15
14
|
interface IComponent is
|
16
|
-
IAccessManaged,
|
17
15
|
IRegisterable,
|
18
16
|
ITransferInterceptor
|
19
17
|
{
|
@@ -23,8 +21,6 @@ interface IComponent is
|
|
23
21
|
|
24
22
|
error ErrorComponentNotChainNft(address caller);
|
25
23
|
|
26
|
-
error ErrorComponentTokenAddressNonzero();
|
27
|
-
error ErrorComponentTokenAddressZero();
|
28
24
|
error ErrorComponentWalletAddressZero();
|
29
25
|
error ErrorComponentWalletAddressIsSameAsCurrent();
|
30
26
|
error ErrorComponentWalletNotComponent();
|