@etherisc/gif-next 0.0.2-a105567-464 → 0.0.2-a221fa7-461
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1253 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +358 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1032 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +258 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +290 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +390 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1548 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +410 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +57 -239
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +317 -95
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +97 -57
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +104 -136
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +158 -16
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +64 -84
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +152 -45
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +78 -146
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1214 -280
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +601 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +227 -62
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +221 -106
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +52 -48
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +260 -137
- 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/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1185 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +418 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +802 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1093 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1496 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +410 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +95 -58
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +53 -41
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +30 -206
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +28 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +37 -314
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +77 -41
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +42 -38
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +72 -35
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +47 -35
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1318 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +410 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +112 -67
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +67 -51
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +36 -46
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +90 -45
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +56 -40
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +98 -61
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +60 -48
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +43 -164
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +54 -25
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +38 -30
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +50 -59
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -183
- 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 +101 -104
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1506 -167
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +50 -13
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +37 -25
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1159 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +214 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +22 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +11 -11
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +242 -77
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +80 -56
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +4 -4
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +117 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +36 -4
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -15
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
- 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/IService.sol/IService.json +13 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +43 -64
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -99
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -6
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +6 -6
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +13 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +114 -117
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +215 -70
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +102 -44
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +179 -182
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +43 -43
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +223 -21
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +264 -134
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +41 -45
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +771 -216
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +95 -18
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +68 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +12 -12
- 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/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +28 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +26 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +21 -2
- 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 +21 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +617 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +591 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/authorization/IAccessAdmin.sol +136 -0
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/authorization/IServiceAuthorization.sol +38 -0
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +90 -0
- package/contracts/distribution/BasicDistribution.sol +138 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +144 -110
- package/contracts/distribution/DistributionService.sol +80 -26
- package/contracts/distribution/DistributionServiceManager.sol +2 -5
- package/contracts/distribution/IDistributionComponent.sol +25 -39
- package/contracts/distribution/IDistributionService.sol +18 -1
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +20 -13
- package/contracts/instance/IInstanceService.sol +34 -23
- package/contracts/instance/Instance.sol +108 -89
- package/contracts/instance/InstanceAdmin.sol +202 -267
- package/contracts/instance/InstanceAuthorizationV3.sol +204 -0
- package/contracts/instance/InstanceReader.sol +49 -9
- package/contracts/instance/InstanceService.sol +159 -78
- package/contracts/instance/InstanceServiceManager.sol +2 -6
- package/contracts/instance/InstanceStore.sol +38 -22
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +11 -14
- package/contracts/instance/module/IComponents.sol +0 -1
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +166 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +52 -0
- package/contracts/pool/BundleService.sol +32 -44
- package/contracts/pool/BundleServiceManager.sol +2 -5
- package/contracts/pool/IPoolComponent.sol +0 -61
- package/contracts/pool/IPoolService.sol +3 -0
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +45 -33
- package/contracts/pool/PoolServiceManager.sol +2 -5
- package/contracts/product/ApplicationService.sol +17 -41
- package/contracts/product/ApplicationServiceManager.sol +2 -2
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +43 -0
- package/contracts/product/ClaimService.sol +16 -37
- package/contracts/product/ClaimServiceManager.sol +2 -2
- package/contracts/product/IClaimService.sol +6 -0
- package/contracts/product/IProductComponent.sol +7 -9
- package/contracts/product/PolicyService.sol +7 -5
- package/contracts/product/PolicyServiceManager.sol +2 -5
- package/contracts/product/PricingService.sol +5 -6
- package/contracts/product/PricingServiceManager.sol +2 -5
- package/contracts/product/Product.sol +103 -88
- package/contracts/product/ProductService.sol +12 -37
- package/contracts/product/ProductServiceManager.sol +2 -5
- package/contracts/registry/ChainNft.sol +1 -0
- package/contracts/registry/IRegistry.sol +26 -18
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +86 -95
- package/contracts/registry/RegistryAdmin.sol +283 -155
- package/contracts/registry/RegistryService.sol +9 -23
- package/contracts/registry/RegistryServiceManager.sol +2 -7
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseRegistry.sol +487 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +9 -52
- package/contracts/shared/Component.sol +19 -25
- package/contracts/shared/ComponentService.sol +94 -68
- package/contracts/shared/ComponentServiceManager.sol +2 -2
- package/contracts/shared/ComponentVerifyingService.sol +13 -7
- package/contracts/shared/IComponent.sol +3 -7
- package/contracts/shared/IComponentService.sol +21 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +10 -0
- package/contracts/shared/IKeyValueStore.sol +2 -1
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/IService.sol +8 -1
- package/contracts/shared/InstanceLinkedComponent.sol +47 -19
- package/contracts/shared/KeyValueStore.sol +7 -6
- package/contracts/shared/Lifecycle.sol +16 -60
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/shared/Service.sol +27 -22
- package/contracts/staking/IStaking.sol +41 -26
- package/contracts/staking/IStakingService.sol +42 -44
- package/contracts/staking/StakeManagerLib.sol +101 -26
- package/contracts/staking/Staking.sol +144 -126
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +2 -6
- package/contracts/staking/StakingReader.sol +73 -36
- package/contracts/staking/StakingService.sol +121 -86
- package/contracts/staking/StakingServiceManager.sol +2 -3
- package/contracts/staking/StakingStore.sol +401 -127
- package/contracts/staking/TargetManagerLib.sol +28 -0
- package/contracts/type/Amount.sol +15 -1
- package/contracts/type/NftId.sol +8 -8
- package/contracts/type/ObjectType.sol +171 -69
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RoleId.sol +103 -72
- package/contracts/type/Seconds.sol +10 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +12 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +6 -2
- package/contracts/type/UFixed.sol +6 -0
- package/contracts/type/Version.sol +3 -1
- package/contracts/{shared → upgradeability}/ProxyManager.sol +3 -4
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/package.json +8 -5
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -204
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1292
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +0 -1193
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +0 -1715
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1728
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1806
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1824
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +0 -1562
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +0 -1600
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.json +0 -37
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.json +0 -357
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -349
- package/contracts/registry/ReleaseManager.sol +0 -599
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerCustom.sol +0 -736
- package/contracts/shared/AccessManagerExtended.sol +0 -470
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +0 -13
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +0 -137
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +0 -14
- package/contracts/shared/IAccessManagerExtended.sol +0 -74
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +0 -18
- package/contracts/staking/IStakingManager.sol +0 -15
- package/contracts/staking/IStakingStore.sol +0 -130
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
- /package/contracts/{shared → upgradeability}/Versionable.sol +0 -0
@@ -12,7 +12,7 @@ import {IRegisterable} from "../shared/IRegisterable.sol";
|
|
12
12
|
|
13
13
|
import {IRegistry} from "./IRegistry.sol";
|
14
14
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
15
|
-
import {
|
15
|
+
import {ReleaseRegistry} from "./ReleaseRegistry.sol";
|
16
16
|
import {RegistryAdmin} from "./RegistryAdmin.sol";
|
17
17
|
|
18
18
|
|
@@ -49,7 +49,7 @@ contract TokenRegistry is
|
|
49
49
|
TokenInfo [] internal _token;
|
50
50
|
|
51
51
|
IRegistry internal _registry;
|
52
|
-
|
52
|
+
ReleaseRegistry internal _releaseRegistry;
|
53
53
|
IERC20Metadata internal _dipToken;
|
54
54
|
|
55
55
|
/// @dev enforces msg.sender is owner of nft (or initial owner of nft ownable)
|
@@ -60,16 +60,15 @@ contract TokenRegistry is
|
|
60
60
|
_;
|
61
61
|
}
|
62
62
|
|
63
|
-
constructor(IRegistry registry)
|
63
|
+
constructor(IRegistry registry, IERC20Metadata dipToken)
|
64
64
|
AccessManaged(msg.sender)
|
65
65
|
{
|
66
66
|
// set authority
|
67
67
|
address authority = RegistryAdmin(registry.getRegistryAdminAddress()).authority();
|
68
68
|
setAuthority(authority);
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
_dipToken = IERC20Metadata(_registry.getDipTokenAddress());
|
70
|
+
_registry = registry;
|
71
|
+
_dipToken = dipToken;
|
73
72
|
|
74
73
|
// register dip token
|
75
74
|
uint256 chainId = block.chainid;
|
@@ -80,52 +79,6 @@ contract TokenRegistry is
|
|
80
79
|
_dipToken.symbol());
|
81
80
|
}
|
82
81
|
|
83
|
-
// TODO cleanup
|
84
|
-
// function initialize(
|
85
|
-
// address initialOwner
|
86
|
-
// )
|
87
|
-
// public
|
88
|
-
// initializer()
|
89
|
-
// {
|
90
|
-
// initializeNftOwnable(initialOwner, _registryAddress);
|
91
|
-
|
92
|
-
// // initialize release manager
|
93
|
-
// _releaseManager = ReleaseManager(msg.sender);
|
94
|
-
|
95
|
-
|
96
|
-
// // register dip token
|
97
|
-
// uint256 chainId = block.chainid;
|
98
|
-
// _registerToken(
|
99
|
-
// chainId,
|
100
|
-
// address(_dipToken),
|
101
|
-
// _dipToken.decimals(),
|
102
|
-
// _dipToken.symbol());
|
103
|
-
// }
|
104
|
-
|
105
|
-
|
106
|
-
// /// @dev link token registry ownership to nft owner of registry service and register dip token.
|
107
|
-
// function linkToRegistryService()
|
108
|
-
// external
|
109
|
-
// {
|
110
|
-
// // link token registry ownership to registry service
|
111
|
-
// address registryService = getRegistry().getServiceAddress(
|
112
|
-
// REGISTRY(),
|
113
|
-
// _releaseManager.getInitialVersion());
|
114
|
-
|
115
|
-
// _linkToNftOwnable(registryService);
|
116
|
-
|
117
|
-
// // activate dip for initial gif version
|
118
|
-
// // as token registry is created in constructor of release manager
|
119
|
-
// // release manager can not yet be called in constructor of token registry
|
120
|
-
// uint256 chainId = block.chainid;
|
121
|
-
// address dipToken = address(_dipToken);
|
122
|
-
// VersionPart majorVersion = _releaseManager.getInitialVersion();
|
123
|
-
// bool active = true;
|
124
|
-
// _active[chainId][dipToken][majorVersion] = active;
|
125
|
-
|
126
|
-
// emit LogTokenRegistryTokenStateSet(chainId, dipToken, majorVersion, active);
|
127
|
-
// }
|
128
|
-
|
129
82
|
|
130
83
|
/// @dev register an onchain token.
|
131
84
|
/// this function verifies that the provided token address is a contract that implements
|
@@ -268,6 +221,10 @@ contract TokenRegistry is
|
|
268
221
|
return _active[chainId][token][majorVersion];
|
269
222
|
}
|
270
223
|
|
224
|
+
function getDipTokenAddress() external view returns (address) {
|
225
|
+
return address(_dipToken);
|
226
|
+
}
|
227
|
+
|
271
228
|
//--- IRegistryLinked --------------------------------------------------//
|
272
229
|
|
273
230
|
/// @dev returns the dip token for this chain
|
@@ -6,21 +6,14 @@ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessMana
|
|
6
6
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
7
|
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
8
8
|
|
9
|
+
import {Amount} from "../type/Amount.sol";
|
9
10
|
import {IComponent} from "./IComponent.sol";
|
10
11
|
import {IComponents} from "../instance/module/IComponents.sol";
|
11
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
12
|
-
import {IInstance} from "../instance/IInstance.sol";
|
13
|
-
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
14
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
15
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
16
12
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
17
|
-
import {ObjectType
|
18
|
-
import {VersionPart} from "../type/Version.sol";
|
13
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
19
14
|
import {Registerable} from "../shared/Registerable.sol";
|
20
|
-
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
21
|
-
import {IAccess} from "../instance/module/IAccess.sol";
|
22
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
23
|
-
import {
|
16
|
+
import {VersionPartLib} from "../type/Version.sol";
|
24
17
|
|
25
18
|
abstract contract Component is
|
26
19
|
AccessManagedUpgradeable,
|
@@ -33,7 +26,6 @@ abstract contract Component is
|
|
33
26
|
struct ComponentStorage {
|
34
27
|
string _name; // unique (per instance) component name
|
35
28
|
IERC20Metadata _token; // token for this component
|
36
|
-
TokenHandler _tokenHandler;
|
37
29
|
address _wallet;
|
38
30
|
bool _isInterceptor;
|
39
31
|
bytes _data;
|
@@ -47,6 +39,12 @@ abstract contract Component is
|
|
47
39
|
_;
|
48
40
|
}
|
49
41
|
|
42
|
+
modifier onlyNftOwner(NftId nftId) {
|
43
|
+
if(msg.sender != getRegistry().ownerOf(nftId)) {
|
44
|
+
revert ErrorNftOwnableNotOwner(msg.sender);
|
45
|
+
}
|
46
|
+
_;
|
47
|
+
}
|
50
48
|
|
51
49
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
52
50
|
assembly {
|
@@ -85,7 +83,6 @@ abstract contract Component is
|
|
85
83
|
ComponentStorage storage $ = _getComponentStorage();
|
86
84
|
$._name = name;
|
87
85
|
$._token = IERC20Metadata(token);
|
88
|
-
$._tokenHandler = TokenHandler(address(0));
|
89
86
|
$._wallet = address(this);
|
90
87
|
$._isInterceptor = isInterceptor;
|
91
88
|
$._data = componentData;
|
@@ -95,7 +92,7 @@ abstract contract Component is
|
|
95
92
|
}
|
96
93
|
|
97
94
|
|
98
|
-
function approveTokenHandler(
|
95
|
+
function approveTokenHandler(Amount spendingLimitAmount)
|
99
96
|
external
|
100
97
|
virtual
|
101
98
|
onlyOwner
|
@@ -103,7 +100,7 @@ abstract contract Component is
|
|
103
100
|
approveTokenHandler(address(getToken()), spendingLimitAmount);
|
104
101
|
}
|
105
102
|
|
106
|
-
function approveTokenHandler(address token,
|
103
|
+
function approveTokenHandler(address token, Amount spendingLimitAmount)
|
107
104
|
public
|
108
105
|
virtual
|
109
106
|
onlyOwner
|
@@ -114,7 +111,7 @@ abstract contract Component is
|
|
114
111
|
|
115
112
|
IERC20Metadata(token).approve(
|
116
113
|
address(getTokenHandler()),
|
117
|
-
spendingLimitAmount);
|
114
|
+
spendingLimitAmount.toInt());
|
118
115
|
|
119
116
|
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount);
|
120
117
|
}
|
@@ -259,28 +256,25 @@ abstract contract Component is
|
|
259
256
|
|
260
257
|
}
|
261
258
|
|
262
|
-
/// @dev for component contracts that hold its own component information
|
263
|
-
/// this function creates and sets a token hanlder for the components tokens
|
264
|
-
function _createAndSetTokenHandler()
|
265
|
-
internal
|
266
|
-
{
|
267
|
-
ComponentStorage storage $ = _getComponentStorage();
|
268
|
-
$._tokenHandler = new TokenHandler(address($._token));
|
269
|
-
}
|
270
259
|
|
271
260
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
272
261
|
/// eg for instance linked components that externally store this information with the instance store contract
|
273
262
|
function _getComponentInfo() internal virtual view returns (IComponents.ComponentInfo memory info) {
|
274
263
|
ComponentStorage storage $ = _getComponentStorage();
|
275
|
-
|
264
|
+
|
276
265
|
return IComponents.ComponentInfo({
|
277
266
|
name: $._name,
|
278
267
|
productNftId: NftIdLib.zero(),
|
279
268
|
token: $._token,
|
280
|
-
tokenHandler:
|
269
|
+
tokenHandler: TokenHandler(address(0)),
|
281
270
|
wallet: $._wallet, // initial wallet address
|
282
271
|
data: $._data // user specific component data
|
283
272
|
});
|
284
273
|
}
|
285
274
|
|
275
|
+
function _approveTokenHandler(uint256 amount) internal {
|
276
|
+
ComponentStorage storage $ = _getComponentStorage();
|
277
|
+
$._token.approve(address(getComponentInfo().tokenHandler), amount);
|
278
|
+
}
|
279
|
+
|
286
280
|
}
|
@@ -1,32 +1,33 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
+
|
4
6
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
7
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
6
8
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
7
|
-
import {IInstanceLinkedComponent} from "./IInstanceLinkedComponent.sol";
|
8
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
-
import {IRegistryService} from "../registry/IRegistryService.sol";
|
10
|
-
import {IInstance} from "../instance/IInstance.sol";
|
11
|
-
import {IAccess} from "../instance/module/IAccess.sol";
|
12
|
-
import {NftId} from "../type/NftId.sol";
|
13
|
-
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
14
|
-
import {RoleId, DISTRIBUTION_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, POLICY_SERVICE_ROLE, PRODUCT_SERVICE_ROLE} from "../type/RoleId.sol";
|
15
|
-
import {KEEP_STATE} from "../type/StateId.sol";
|
16
9
|
import {IComponents} from "../instance/module/IComponents.sol";
|
17
10
|
import {IComponentService} from "./IComponentService.sol";
|
18
|
-
import {
|
11
|
+
import {IInstance} from "../instance/IInstance.sol";
|
12
|
+
import {IInstanceLinkedComponent} from "./IInstanceLinkedComponent.sol";
|
13
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
14
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
19
15
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
20
16
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
21
17
|
import {IProductComponent} from "../product/IProductComponent.sol";
|
22
|
-
import {
|
23
|
-
import {
|
18
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
19
|
+
import {IRegistryService} from "../registry/IRegistryService.sol";
|
20
|
+
import {KEEP_STATE} from "../type/StateId.sol";
|
21
|
+
import {NftId} from "../type/NftId.sol";
|
22
|
+
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
23
|
+
import {RoleId, DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE} from "../type/RoleId.sol";
|
24
24
|
import {TokenHandler} from "./TokenHandler.sol";
|
25
25
|
|
26
26
|
contract ComponentService is
|
27
27
|
ComponentVerifyingService,
|
28
28
|
IComponentService
|
29
29
|
{
|
30
|
+
using AmountLib for Amount;
|
30
31
|
|
31
32
|
error ErrorComponentServiceAlreadyRegistered(address component);
|
32
33
|
error ErrorComponentServiceNotComponent(address component);
|
@@ -64,11 +65,6 @@ contract ComponentService is
|
|
64
65
|
registerInterface(type(IComponentService).interfaceId);
|
65
66
|
}
|
66
67
|
|
67
|
-
|
68
|
-
function getDomain() public pure virtual override returns(ObjectType) {
|
69
|
-
return COMPONENT();
|
70
|
-
}
|
71
|
-
|
72
68
|
//-------- component ----------------------------------------------------//
|
73
69
|
|
74
70
|
function setWallet(address newWallet) external virtual {
|
@@ -99,6 +95,46 @@ contract ComponentService is
|
|
99
95
|
// TODO implement
|
100
96
|
function unlock() external virtual {}
|
101
97
|
|
98
|
+
function withdrawFees(Amount amount)
|
99
|
+
external
|
100
|
+
virtual
|
101
|
+
returns (Amount withdrawnAmount)
|
102
|
+
{
|
103
|
+
(NftId componentNftId,, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
104
|
+
IComponents.ComponentInfo memory info = instance.getInstanceReader().getComponentInfo(componentNftId);
|
105
|
+
address componentWallet = info.wallet;
|
106
|
+
|
107
|
+
// determine withdrawn amount
|
108
|
+
withdrawnAmount = amount;
|
109
|
+
if (withdrawnAmount.eq(AmountLib.max())) {
|
110
|
+
withdrawnAmount = instance.getInstanceReader().getFeeAmount(componentNftId);
|
111
|
+
} else if (withdrawnAmount.eqz()) {
|
112
|
+
revert ErrorComponentServiceWithdrawAmountIsZero();
|
113
|
+
} else {
|
114
|
+
Amount withdrawLimit = instance.getInstanceReader().getFeeAmount(componentNftId);
|
115
|
+
if (withdrawnAmount.gt(withdrawLimit)) {
|
116
|
+
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, withdrawLimit);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
// check allowance
|
121
|
+
TokenHandler tokenHandler = info.tokenHandler;
|
122
|
+
IERC20Metadata token = IERC20Metadata(info.token);
|
123
|
+
uint256 tokenAllowance = token.allowance(componentWallet, address(tokenHandler));
|
124
|
+
if (tokenAllowance < withdrawnAmount.toInt()) {
|
125
|
+
revert ErrorComponentServiceWalletAllowanceTooSmall(componentWallet, address(tokenHandler), tokenAllowance, withdrawnAmount.toInt());
|
126
|
+
}
|
127
|
+
|
128
|
+
// decrease fee counters by withdrawnAmount
|
129
|
+
_changeTargetBalance(DECREASE, instance.getInstanceStore(), componentNftId, AmountLib.zero(), withdrawnAmount);
|
130
|
+
|
131
|
+
// transfer amount to component owner
|
132
|
+
address componentOwner = getRegistry().ownerOf(componentNftId);
|
133
|
+
tokenHandler.transfer(componentWallet, componentOwner, withdrawnAmount);
|
134
|
+
|
135
|
+
emit LogComponentServiceComponentFeesWithdrawn(componentNftId, componentOwner, address(token), withdrawnAmount);
|
136
|
+
}
|
137
|
+
|
102
138
|
|
103
139
|
//-------- product ------------------------------------------------------//
|
104
140
|
|
@@ -107,12 +143,6 @@ contract ComponentService is
|
|
107
143
|
virtual
|
108
144
|
{
|
109
145
|
address contractAddress = msg.sender;
|
110
|
-
RoleId[] memory roles = new RoleId[](1);
|
111
|
-
bytes4[][] memory selectors = new bytes4[][](1);
|
112
|
-
|
113
|
-
// authorizaion for distribution owner
|
114
|
-
roles[0] = PRODUCT_OWNER_ROLE();
|
115
|
-
selectors[0] = _createSelectors(IProductComponent.setFees.selector);
|
116
146
|
|
117
147
|
// register/create component setup
|
118
148
|
(
|
@@ -122,9 +152,7 @@ contract ComponentService is
|
|
122
152
|
) = _register(
|
123
153
|
contractAddress,
|
124
154
|
PRODUCT(),
|
125
|
-
PRODUCT_OWNER_ROLE()
|
126
|
-
roles,
|
127
|
-
selectors);
|
155
|
+
PRODUCT_OWNER_ROLE());
|
128
156
|
|
129
157
|
// create product info
|
130
158
|
IComponents.ProductInfo memory productInfo = IProductComponent(contractAddress).getInitialProductInfo();
|
@@ -198,24 +226,12 @@ contract ComponentService is
|
|
198
226
|
virtual
|
199
227
|
{
|
200
228
|
address contractAddress = msg.sender;
|
201
|
-
RoleId[] memory roles = new RoleId[](2);
|
202
|
-
bytes4[][] memory selectors = new bytes4[][](2);
|
203
|
-
|
204
|
-
// authorizaion for distribution owner
|
205
|
-
roles[0] = DISTRIBUTION_OWNER_ROLE();
|
206
|
-
selectors[0] = _createSelectors(IDistributionComponent.setFees.selector);
|
207
|
-
|
208
|
-
// authorizaion for product service
|
209
|
-
roles[1] = PRODUCT_SERVICE_ROLE();
|
210
|
-
selectors[1] = _createSelectors(IDistributionComponent.processRenewal.selector);
|
211
229
|
|
212
230
|
// register/create component info
|
213
231
|
_register(
|
214
232
|
contractAddress,
|
215
233
|
DISTRIBUTION(),
|
216
|
-
DISTRIBUTION_OWNER_ROLE()
|
217
|
-
roles,
|
218
|
-
selectors);
|
234
|
+
DISTRIBUTION_OWNER_ROLE());
|
219
235
|
}
|
220
236
|
|
221
237
|
|
@@ -280,24 +296,32 @@ contract ComponentService is
|
|
280
296
|
_changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
|
281
297
|
}
|
282
298
|
|
283
|
-
//--------
|
299
|
+
//-------- oracle -------------------------------------------------------//
|
284
300
|
|
285
|
-
|
286
|
-
function registerPool()
|
301
|
+
function registerOracle()
|
287
302
|
external
|
288
303
|
virtual
|
289
304
|
{
|
290
305
|
address contractAddress = msg.sender;
|
291
|
-
RoleId[] memory roles = new RoleId[](2);
|
292
|
-
bytes4[][] memory selectors = new bytes4[][](2);
|
293
306
|
|
294
|
-
//
|
295
|
-
|
296
|
-
|
307
|
+
// register/create component setup
|
308
|
+
(
|
309
|
+
, // instance reader
|
310
|
+
InstanceStore instanceStore,
|
311
|
+
NftId componentNftId
|
312
|
+
) = _register(
|
313
|
+
contractAddress,
|
314
|
+
ORACLE(),
|
315
|
+
ORACLE_OWNER_ROLE());
|
316
|
+
}
|
297
317
|
|
298
|
-
|
299
|
-
|
300
|
-
|
318
|
+
//-------- pool ---------------------------------------------------------//
|
319
|
+
|
320
|
+
function registerPool()
|
321
|
+
external
|
322
|
+
virtual
|
323
|
+
{
|
324
|
+
address contractAddress = msg.sender;
|
301
325
|
|
302
326
|
// register/create component setup
|
303
327
|
(
|
@@ -307,14 +331,13 @@ contract ComponentService is
|
|
307
331
|
) = _register(
|
308
332
|
contractAddress,
|
309
333
|
POOL(),
|
310
|
-
POOL_OWNER_ROLE()
|
311
|
-
roles,
|
312
|
-
selectors);
|
334
|
+
POOL_OWNER_ROLE());
|
313
335
|
|
314
336
|
// create info
|
315
337
|
instanceStore.createPool(
|
316
338
|
componentNftId,
|
317
|
-
IPoolComponent(
|
339
|
+
IPoolComponent(
|
340
|
+
contractAddress).getInitialPoolInfo());
|
318
341
|
}
|
319
342
|
|
320
343
|
|
@@ -444,9 +467,7 @@ contract ComponentService is
|
|
444
467
|
function _register(
|
445
468
|
address componentAddress, // address of component to register
|
446
469
|
ObjectType requiredType, // required type for component for registration
|
447
|
-
RoleId requiredRole
|
448
|
-
RoleId[] memory roles, // roles with write access to component
|
449
|
-
bytes4[][] memory selectors // authorized functions per role with write access
|
470
|
+
RoleId requiredRole // role required for comonent owner for registration
|
450
471
|
)
|
451
472
|
internal
|
452
473
|
virtual
|
@@ -473,21 +494,23 @@ contract ComponentService is
|
|
473
494
|
|
474
495
|
component.linkToRegisteredNftId();
|
475
496
|
|
497
|
+
// setup initial component authorization
|
498
|
+
_instanceService.initializeAuthorization(
|
499
|
+
instance.getNftId(),
|
500
|
+
component);
|
501
|
+
|
476
502
|
// save amended component info with instance
|
477
503
|
instanceReader = instance.getInstanceReader();
|
478
504
|
instanceStore = instance.getInstanceStore();
|
479
505
|
|
480
506
|
IComponents.ComponentInfo memory componentInfo = component.getComponentInfo();
|
481
507
|
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
component.getName(),
|
489
|
-
selectors,
|
490
|
-
roles);
|
508
|
+
|
509
|
+
instanceStore.createComponent(
|
510
|
+
component.getNftId(),
|
511
|
+
componentInfo);
|
512
|
+
|
513
|
+
// TODO add logging
|
491
514
|
}
|
492
515
|
|
493
516
|
|
@@ -588,9 +611,12 @@ contract ComponentService is
|
|
588
611
|
instance = _getInstance(info.parentNftId);
|
589
612
|
owner = info.initialOwner;
|
590
613
|
|
591
|
-
(
|
592
|
-
if(!hasRole) {
|
614
|
+
if(!instance.getInstanceAdmin().hasRole(owner, requiredRole)) {
|
593
615
|
revert ErrorComponentServiceExpectedRoleMissing(info.parentNftId, requiredRole, owner);
|
594
616
|
}
|
595
617
|
}
|
618
|
+
|
619
|
+
function _getDomain() internal pure virtual override returns(ObjectType) {
|
620
|
+
return COMPONENT();
|
621
|
+
}
|
596
622
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "./IVersionable.sol";
|
5
|
-
import {ProxyManager} from "./ProxyManager.sol";
|
6
4
|
import {ComponentService} from "./ComponentService.sol";
|
5
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
6
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
7
7
|
|
8
8
|
contract ComponentServiceManager is ProxyManager {
|
9
9
|
|
@@ -33,12 +33,10 @@ abstract contract ComponentVerifyingService is
|
|
33
33
|
)
|
34
34
|
{
|
35
35
|
componentNftId = getRegistry().getNftId(msg.sender);
|
36
|
-
(componentInfo, instance) = _getAndVerifyComponentInfo(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
41
|
-
}
|
36
|
+
(componentInfo, instance) = _getAndVerifyComponentInfo(
|
37
|
+
componentNftId,
|
38
|
+
expectedType,
|
39
|
+
true); // only active
|
42
40
|
}
|
43
41
|
|
44
42
|
|
@@ -48,7 +46,8 @@ abstract contract ComponentVerifyingService is
|
|
48
46
|
/// - the component has the wrong object type
|
49
47
|
function _getAndVerifyComponentInfo(
|
50
48
|
NftId componentNftId,
|
51
|
-
ObjectType expectedType // assume always of `component` type
|
49
|
+
ObjectType expectedType, // assume always of `component` type
|
50
|
+
bool onlyActive
|
52
51
|
)
|
53
52
|
internal
|
54
53
|
virtual
|
@@ -85,6 +84,13 @@ abstract contract ComponentVerifyingService is
|
|
85
84
|
}
|
86
85
|
|
87
86
|
instance = _getInstance(info.parentNftId);
|
87
|
+
|
88
|
+
// ensure component is not locked
|
89
|
+
if (onlyActive) {
|
90
|
+
if (instance.getInstanceAdmin().isTargetLocked(info.objectAddress)) {
|
91
|
+
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
92
|
+
}
|
93
|
+
}
|
88
94
|
}
|
89
95
|
|
90
96
|
|
@@ -4,14 +4,10 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
7
8
|
import {IComponents} from "../instance/module/IComponents.sol";
|
8
|
-
import {IInstance} from "../instance/IInstance.sol";
|
9
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
|
-
import {IProductService} from "../product/IProductService.sol";
|
11
9
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
12
10
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
|
-
import {NftId} from "../type/NftId.sol";
|
14
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
15
11
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
12
|
|
17
13
|
/// @dev component base class
|
@@ -32,12 +28,12 @@ interface IComponent is
|
|
32
28
|
|
33
29
|
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
34
30
|
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
35
|
-
event LogComponentTokenHandlerApproved(address token,
|
31
|
+
event LogComponentTokenHandlerApproved(address token, Amount limit);
|
36
32
|
|
37
33
|
/// @dev approves token hanlder to spend up to the specified amount of tokens
|
38
34
|
/// reverts if component wallet is not component itself
|
39
35
|
/// only component owner (nft holder) is authorizes to call this function
|
40
|
-
function approveTokenHandler(
|
36
|
+
function approveTokenHandler(Amount spendingLimitAmount) external;
|
41
37
|
|
42
38
|
/// @dev sets the wallet address for the component
|
43
39
|
/// if the current wallet has tokens, these will be transferred
|
@@ -27,7 +27,12 @@ interface IComponentService is
|
|
27
27
|
error ErrorComponentServiceWalletAddressZero();
|
28
28
|
error ErrorComponentServiceWalletAddressIsSameAsCurrent();
|
29
29
|
|
30
|
+
error ErrorComponentServiceWithdrawAmountIsZero();
|
31
|
+
error ErrorComponentServiceWithdrawAmountExceedsLimit(Amount withdrawnAmount, Amount withdrawLimit);
|
32
|
+
error ErrorComponentServiceWalletAllowanceTooSmall(address wallet, address spender, uint256 allowance, uint256 amount);
|
33
|
+
|
30
34
|
event LogComponentServiceWalletAddressChanged(NftId componentNftId, address currentWallet, address newWallet);
|
35
|
+
event LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, address token, Amount withdrawnAmount);
|
31
36
|
event LogComponentServiceProductFeesUpdated(NftId productNftId);
|
32
37
|
event LogComponentServiceDistributionFeesUpdated(NftId distributionNftId);
|
33
38
|
event LogComponentServicePoolFeesUpdated(NftId poolNftId);
|
@@ -51,7 +56,14 @@ interface IComponentService is
|
|
51
56
|
/// @dev unlocks the component associated with the caller
|
52
57
|
function unlock() external;
|
53
58
|
|
59
|
+
/// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
|
60
|
+
/// @param withdrawAmount the amount to withdraw
|
61
|
+
/// @return withdrawnAmount the amount that was actually withdrawn
|
62
|
+
function withdrawFees(Amount withdrawAmount) external returns (Amount withdrawnAmount);
|
63
|
+
|
54
64
|
//-------- product ------------------------------------------------------//
|
65
|
+
|
66
|
+
/// @dev registers the sending component as a product component
|
55
67
|
function registerProduct() external;
|
56
68
|
|
57
69
|
function setProductFees(
|
@@ -63,6 +75,8 @@ interface IComponentService is
|
|
63
75
|
function decreaseProductFees(InstanceStore instanceStore, NftId productNftId, Amount feeAmount) external;
|
64
76
|
|
65
77
|
//-------- distribution -------------------------------------------------//
|
78
|
+
|
79
|
+
/// @dev registers the sending component as a distribution component
|
66
80
|
function registerDistribution() external;
|
67
81
|
|
68
82
|
function setDistributionFees(
|
@@ -73,7 +87,14 @@ interface IComponentService is
|
|
73
87
|
function increaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
74
88
|
function decreaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
75
89
|
|
90
|
+
//-------- oracle -------------------------------------------------------//
|
91
|
+
|
92
|
+
/// @dev registers the sending component as an oracle component
|
93
|
+
function registerOracle() external;
|
94
|
+
|
76
95
|
//-------- pool ---------------------------------------------------------//
|
96
|
+
|
97
|
+
/// @dev registers the sending component as a pool component
|
77
98
|
function registerPool() external;
|
78
99
|
|
79
100
|
function setPoolFees(
|
@@ -4,7 +4,9 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
7
8
|
import {IComponent} from "../shared/IComponent.sol";
|
9
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
8
10
|
import {IComponents} from "../instance/module/IComponents.sol";
|
9
11
|
import {IInstance} from "../instance/IInstance.sol";
|
10
12
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
@@ -43,4 +45,12 @@ interface IInstanceLinkedComponent is
|
|
43
45
|
/// this is only relevant for pool and distribution components
|
44
46
|
function getProductNftId() external view returns (NftId productNftId);
|
45
47
|
|
48
|
+
/// @dev returns the initial component authorization specification.
|
49
|
+
function getAuthorization() external view returns (IAuthorization authorization);
|
50
|
+
|
51
|
+
/// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
|
52
|
+
/// @param amount the amount to withdraw
|
53
|
+
/// @return withdrawnAmount the amount that was actually withdrawn
|
54
|
+
function withdrawFees(Amount amount) external returns (Amount withdrawnAmount);
|
55
|
+
|
46
56
|
}
|
@@ -13,6 +13,7 @@ interface IKeyValueStore is ILifecycle {
|
|
13
13
|
|
14
14
|
error ErrorKeyValueStoreTypeUndefined(ObjectType objectType);
|
15
15
|
error ErrorKeyValueStoreAlreadyCreated(Key32 key, ObjectType objectType);
|
16
|
+
error ErrorKeyValueStoreNoLifecycle(ObjectType objectType);
|
16
17
|
error ErrorKeyValueStoreStateZero(Key32 key);
|
17
18
|
error ErrorKeyValueStoreNotExisting(Key32 key);
|
18
19
|
|
@@ -32,7 +33,7 @@ interface IKeyValueStore is ILifecycle {
|
|
32
33
|
// eg account outside gif objects that initiated the tx
|
33
34
|
// implies the caller needs to be propagated through all calls up to key values store itself
|
34
35
|
// to always have the instance address there doesn't seem to make sense
|
35
|
-
address updatedBy;
|
36
|
+
// address updatedBy;
|
36
37
|
Blocknumber updatedIn;
|
37
38
|
Blocknumber createdIn;
|
38
39
|
}
|