@etherisc/gif-next 0.0.2-8bdd2eb-413 → 0.0.2-8d6e553-386
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 +1524 -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 +26 -232
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +138 -93
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +65 -57
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +80 -136
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +45 -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 +1208 -290
- 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 -57
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +215 -108
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +49 -49
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +260 -127
- 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 +1155 -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 +772 -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 +1063 -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 +1477 -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 +89 -60
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +50 -42
- 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 +7 -202
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +7 -303
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -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 +66 -37
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +44 -36
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1299 -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 +106 -69
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -52
- 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 +13 -42
- 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 +84 -47
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +57 -49
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +13 -153
- 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 -46
- 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 -73
- 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 +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +198 -77
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +76 -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/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +81 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +13 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -5
- 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 +13 -53
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -89
- 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/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +49 -7
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
- 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 +40 -56
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +39 -47
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +200 -152
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- 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 +8 -8
- 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 +4 -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 +2 -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 +149 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +43 -0
- package/contracts/distribution/Distribution.sol +141 -101
- package/contracts/distribution/DistributionService.sol +15 -25
- package/contracts/distribution/DistributionServiceManager.sol +2 -5
- package/contracts/distribution/IDistributionComponent.sol +22 -39
- package/contracts/distribution/IDistributionService.sol +5 -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 +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +157 -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 +49 -0
- package/contracts/pool/BundleService.sol +32 -44
- package/contracts/pool/BundleServiceManager.sol +2 -5
- package/contracts/pool/IPoolComponent.sol +0 -60
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +17 -34
- 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 +40 -0
- package/contracts/product/ClaimService.sol +10 -36
- package/contracts/product/ClaimServiceManager.sol +2 -2
- package/contracts/product/IClaimService.sol +6 -0
- package/contracts/product/IProductComponent.sol +6 -9
- package/contracts/product/PolicyService.sol +5 -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/IRegistry.sol +26 -16
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +85 -85
- 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 +2 -2
- package/contracts/shared/Component.sol +8 -12
- package/contracts/shared/ComponentService.sol +81 -60
- package/contracts/shared/ComponentServiceManager.sol +2 -2
- package/contracts/shared/ComponentVerifyingService.sol +13 -7
- package/contracts/shared/IComponentService.sol +17 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +4 -0
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/IService.sol +8 -1
- package/contracts/shared/InstanceLinkedComponent.sol +26 -19
- package/contracts/shared/KeyValueStore.sol +6 -2
- 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 +1 -2
- package/contracts/staking/IStakingService.sol +22 -11
- package/contracts/staking/StakeManagerLib.sol +52 -0
- package/contracts/staking/Staking.sol +75 -112
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +2 -6
- package/contracts/staking/StakingReader.sol +12 -16
- package/contracts/staking/StakingService.sol +61 -56
- package/contracts/staking/StakingServiceManager.sol +2 -3
- package/contracts/staking/StakingStore.sol +93 -60
- package/contracts/type/ObjectType.sol +171 -69
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RoleId.sol +103 -72
- 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/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/{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)
|
@@ -13,6 +13,7 @@ import {NftId, NftIdLib} from "../type/NftId.sol";
|
|
13
13
|
import {ObjectType} from "../type/ObjectType.sol";
|
14
14
|
import {Registerable} from "../shared/Registerable.sol";
|
15
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
+
import {VersionPartLib} from "../type/Version.sol";
|
16
17
|
|
17
18
|
abstract contract Component is
|
18
19
|
AccessManagedUpgradeable,
|
@@ -25,7 +26,6 @@ abstract contract Component is
|
|
25
26
|
struct ComponentStorage {
|
26
27
|
string _name; // unique (per instance) component name
|
27
28
|
IERC20Metadata _token; // token for this component
|
28
|
-
TokenHandler _tokenHandler;
|
29
29
|
address _wallet;
|
30
30
|
bool _isInterceptor;
|
31
31
|
bytes _data;
|
@@ -77,7 +77,6 @@ abstract contract Component is
|
|
77
77
|
ComponentStorage storage $ = _getComponentStorage();
|
78
78
|
$._name = name;
|
79
79
|
$._token = IERC20Metadata(token);
|
80
|
-
$._tokenHandler = TokenHandler(address(0));
|
81
80
|
$._wallet = address(this);
|
82
81
|
$._isInterceptor = isInterceptor;
|
83
82
|
$._data = componentData;
|
@@ -251,28 +250,25 @@ abstract contract Component is
|
|
251
250
|
|
252
251
|
}
|
253
252
|
|
254
|
-
/// @dev for component contracts that hold its own component information
|
255
|
-
/// this function creates and sets a token hanlder for the components tokens
|
256
|
-
function _createAndSetTokenHandler()
|
257
|
-
internal
|
258
|
-
{
|
259
|
-
ComponentStorage storage $ = _getComponentStorage();
|
260
|
-
$._tokenHandler = new TokenHandler(address($._token));
|
261
|
-
}
|
262
253
|
|
263
254
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
264
255
|
/// eg for instance linked components that externally store this information with the instance store contract
|
265
256
|
function _getComponentInfo() internal virtual view returns (IComponents.ComponentInfo memory info) {
|
266
257
|
ComponentStorage storage $ = _getComponentStorage();
|
267
|
-
|
258
|
+
|
268
259
|
return IComponents.ComponentInfo({
|
269
260
|
name: $._name,
|
270
261
|
productNftId: NftIdLib.zero(),
|
271
262
|
token: $._token,
|
272
|
-
tokenHandler:
|
263
|
+
tokenHandler: TokenHandler(address(0)),
|
273
264
|
wallet: $._wallet, // initial wallet address
|
274
265
|
data: $._data // user specific component data
|
275
266
|
});
|
276
267
|
}
|
277
268
|
|
269
|
+
function _approveTokenHandler(uint256 amount) internal {
|
270
|
+
ComponentStorage storage $ = _getComponentStorage();
|
271
|
+
$._token.approve(address(getComponentInfo().tokenHandler), amount);
|
272
|
+
}
|
273
|
+
|
278
274
|
}
|
@@ -4,18 +4,17 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
5
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
6
6
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
7
|
+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
8
|
import {IInstanceLinkedComponent} from "./IInstanceLinkedComponent.sol";
|
8
9
|
import {IRegistry} from "../registry/IRegistry.sol";
|
9
10
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
10
11
|
import {IInstance} from "../instance/IInstance.sol";
|
11
|
-
import {IAccess} from "../instance/module/IAccess.sol";
|
12
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
|
13
|
+
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
14
|
+
import {RoleId, DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE} from "../type/RoleId.sol";
|
15
15
|
import {KEEP_STATE} from "../type/StateId.sol";
|
16
16
|
import {IComponents} from "../instance/module/IComponents.sol";
|
17
17
|
import {IComponentService} from "./IComponentService.sol";
|
18
|
-
import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
|
19
18
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
20
19
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
21
20
|
import {IProductComponent} from "../product/IProductComponent.sol";
|
@@ -27,6 +26,7 @@ contract ComponentService is
|
|
27
26
|
ComponentVerifyingService,
|
28
27
|
IComponentService
|
29
28
|
{
|
29
|
+
using AmountLib for Amount;
|
30
30
|
|
31
31
|
error ErrorComponentServiceAlreadyRegistered(address component);
|
32
32
|
error ErrorComponentServiceNotComponent(address component);
|
@@ -64,11 +64,6 @@ contract ComponentService is
|
|
64
64
|
registerInterface(type(IComponentService).interfaceId);
|
65
65
|
}
|
66
66
|
|
67
|
-
|
68
|
-
function getDomain() public pure virtual override returns(ObjectType) {
|
69
|
-
return COMPONENT();
|
70
|
-
}
|
71
|
-
|
72
67
|
//-------- component ----------------------------------------------------//
|
73
68
|
|
74
69
|
function setWallet(address newWallet) external virtual {
|
@@ -99,6 +94,42 @@ contract ComponentService is
|
|
99
94
|
// TODO implement
|
100
95
|
function unlock() external virtual {}
|
101
96
|
|
97
|
+
function withdrawFees(Amount feeAmount)
|
98
|
+
external
|
99
|
+
virtual
|
100
|
+
returns (Amount withdrawnAmount)
|
101
|
+
{
|
102
|
+
(NftId componentNftId,, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
103
|
+
IComponents.ComponentInfo memory info = instance.getInstanceReader().getComponentInfo(componentNftId);
|
104
|
+
address componentWallet = info.wallet;
|
105
|
+
|
106
|
+
// determine withdrawal amount
|
107
|
+
withdrawnAmount = feeAmount;
|
108
|
+
if (withdrawnAmount.eq(AmountLib.max())) {
|
109
|
+
withdrawnAmount = instance.getInstanceReader().getFeeAmount(componentNftId);
|
110
|
+
} else {
|
111
|
+
Amount withdrawLimit = instance.getInstanceReader().getFeeAmount(componentNftId);
|
112
|
+
if (withdrawnAmount.gt(withdrawLimit)) {
|
113
|
+
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, withdrawLimit);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
// check allowance
|
118
|
+
TokenHandler tokenHandler = info.tokenHandler;
|
119
|
+
IERC20Metadata token = IERC20Metadata(info.token);
|
120
|
+
uint256 tokenAllowance = token.allowance(componentWallet, address(tokenHandler));
|
121
|
+
if (tokenAllowance < withdrawnAmount.toInt()) {
|
122
|
+
revert ErrorComponentServiceWalletAllowanceTooSmall(componentWallet, address(tokenHandler), tokenAllowance, withdrawnAmount.toInt());
|
123
|
+
}
|
124
|
+
|
125
|
+
// decrease fee counters by withdrawnAmount
|
126
|
+
_changeTargetBalance(DECREASE, instance.getInstanceStore(), componentNftId, AmountLib.zero(), withdrawnAmount);
|
127
|
+
|
128
|
+
// transfer amount to component owner
|
129
|
+
address componentOwner = getRegistry().ownerOf(componentNftId);
|
130
|
+
tokenHandler.transfer(componentWallet, componentOwner, withdrawnAmount);
|
131
|
+
}
|
132
|
+
|
102
133
|
|
103
134
|
//-------- product ------------------------------------------------------//
|
104
135
|
|
@@ -107,12 +138,6 @@ contract ComponentService is
|
|
107
138
|
virtual
|
108
139
|
{
|
109
140
|
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
141
|
|
117
142
|
// register/create component setup
|
118
143
|
(
|
@@ -122,9 +147,7 @@ contract ComponentService is
|
|
122
147
|
) = _register(
|
123
148
|
contractAddress,
|
124
149
|
PRODUCT(),
|
125
|
-
PRODUCT_OWNER_ROLE()
|
126
|
-
roles,
|
127
|
-
selectors);
|
150
|
+
PRODUCT_OWNER_ROLE());
|
128
151
|
|
129
152
|
// create product info
|
130
153
|
IComponents.ProductInfo memory productInfo = IProductComponent(contractAddress).getInitialProductInfo();
|
@@ -198,24 +221,12 @@ contract ComponentService is
|
|
198
221
|
virtual
|
199
222
|
{
|
200
223
|
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
224
|
|
212
225
|
// register/create component info
|
213
226
|
_register(
|
214
227
|
contractAddress,
|
215
228
|
DISTRIBUTION(),
|
216
|
-
DISTRIBUTION_OWNER_ROLE()
|
217
|
-
roles,
|
218
|
-
selectors);
|
229
|
+
DISTRIBUTION_OWNER_ROLE());
|
219
230
|
}
|
220
231
|
|
221
232
|
|
@@ -280,24 +291,32 @@ contract ComponentService is
|
|
280
291
|
_changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
|
281
292
|
}
|
282
293
|
|
283
|
-
//--------
|
294
|
+
//-------- oracle -------------------------------------------------------//
|
284
295
|
|
285
|
-
|
286
|
-
function registerPool()
|
296
|
+
function registerOracle()
|
287
297
|
external
|
288
298
|
virtual
|
289
299
|
{
|
290
300
|
address contractAddress = msg.sender;
|
291
|
-
RoleId[] memory roles = new RoleId[](2);
|
292
|
-
bytes4[][] memory selectors = new bytes4[][](2);
|
293
301
|
|
294
|
-
//
|
295
|
-
|
296
|
-
|
302
|
+
// register/create component setup
|
303
|
+
(
|
304
|
+
, // instance reader
|
305
|
+
InstanceStore instanceStore,
|
306
|
+
NftId componentNftId
|
307
|
+
) = _register(
|
308
|
+
contractAddress,
|
309
|
+
ORACLE(),
|
310
|
+
ORACLE_OWNER_ROLE());
|
311
|
+
}
|
312
|
+
|
313
|
+
//-------- pool ---------------------------------------------------------//
|
297
314
|
|
298
|
-
|
299
|
-
|
300
|
-
|
315
|
+
function registerPool()
|
316
|
+
external
|
317
|
+
virtual
|
318
|
+
{
|
319
|
+
address contractAddress = msg.sender;
|
301
320
|
|
302
321
|
// register/create component setup
|
303
322
|
(
|
@@ -307,14 +326,13 @@ contract ComponentService is
|
|
307
326
|
) = _register(
|
308
327
|
contractAddress,
|
309
328
|
POOL(),
|
310
|
-
POOL_OWNER_ROLE()
|
311
|
-
roles,
|
312
|
-
selectors);
|
329
|
+
POOL_OWNER_ROLE());
|
313
330
|
|
314
331
|
// create info
|
315
332
|
instanceStore.createPool(
|
316
333
|
componentNftId,
|
317
|
-
IPoolComponent(
|
334
|
+
IPoolComponent(
|
335
|
+
contractAddress).getInitialPoolInfo());
|
318
336
|
}
|
319
337
|
|
320
338
|
|
@@ -444,9 +462,7 @@ contract ComponentService is
|
|
444
462
|
function _register(
|
445
463
|
address componentAddress, // address of component to register
|
446
464
|
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
|
465
|
+
RoleId requiredRole // role required for comonent owner for registration
|
450
466
|
)
|
451
467
|
internal
|
452
468
|
virtual
|
@@ -473,21 +489,23 @@ contract ComponentService is
|
|
473
489
|
|
474
490
|
component.linkToRegisteredNftId();
|
475
491
|
|
492
|
+
// setup initial component authorization
|
493
|
+
_instanceService.initializeAuthorization(
|
494
|
+
instance.getNftId(),
|
495
|
+
component);
|
496
|
+
|
476
497
|
// save amended component info with instance
|
477
498
|
instanceReader = instance.getInstanceReader();
|
478
499
|
instanceStore = instance.getInstanceStore();
|
479
500
|
|
480
501
|
IComponents.ComponentInfo memory componentInfo = component.getComponentInfo();
|
481
502
|
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
component.getName(),
|
489
|
-
selectors,
|
490
|
-
roles);
|
503
|
+
|
504
|
+
instanceStore.createComponent(
|
505
|
+
component.getNftId(),
|
506
|
+
componentInfo);
|
507
|
+
|
508
|
+
// TODO add logging
|
491
509
|
}
|
492
510
|
|
493
511
|
|
@@ -588,9 +606,12 @@ contract ComponentService is
|
|
588
606
|
instance = _getInstance(info.parentNftId);
|
589
607
|
owner = info.initialOwner;
|
590
608
|
|
591
|
-
(
|
592
|
-
if(!hasRole) {
|
609
|
+
if(!instance.getInstanceAdmin().hasRole(owner, requiredRole)) {
|
593
610
|
revert ErrorComponentServiceExpectedRoleMissing(info.parentNftId, requiredRole, owner);
|
594
611
|
}
|
595
612
|
}
|
613
|
+
|
614
|
+
function _getDomain() internal pure virtual override returns(ObjectType) {
|
615
|
+
return COMPONENT();
|
616
|
+
}
|
596
617
|
}
|
@@ -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
|
|
@@ -27,6 +27,9 @@ interface IComponentService is
|
|
27
27
|
error ErrorComponentServiceWalletAddressZero();
|
28
28
|
error ErrorComponentServiceWalletAddressIsSameAsCurrent();
|
29
29
|
|
30
|
+
error ErrorComponentServiceWithdrawAmountExceedsLimit(Amount withdrawnAmount, Amount withdrawLimit);
|
31
|
+
error ErrorComponentServiceWalletAllowanceTooSmall(address wallet, address spender, uint256 allowance, uint256 amount);
|
32
|
+
|
30
33
|
event LogComponentServiceWalletAddressChanged(NftId componentNftId, address currentWallet, address newWallet);
|
31
34
|
event LogComponentServiceProductFeesUpdated(NftId productNftId);
|
32
35
|
event LogComponentServiceDistributionFeesUpdated(NftId distributionNftId);
|
@@ -51,7 +54,12 @@ interface IComponentService is
|
|
51
54
|
/// @dev unlocks the component associated with the caller
|
52
55
|
function unlock() external;
|
53
56
|
|
57
|
+
/// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
|
58
|
+
function withdrawFees(Amount withdrawAmount) external returns (Amount withdrawnAmount);
|
59
|
+
|
54
60
|
//-------- product ------------------------------------------------------//
|
61
|
+
|
62
|
+
/// @dev registers the sending component as a product component
|
55
63
|
function registerProduct() external;
|
56
64
|
|
57
65
|
function setProductFees(
|
@@ -63,6 +71,8 @@ interface IComponentService is
|
|
63
71
|
function decreaseProductFees(InstanceStore instanceStore, NftId productNftId, Amount feeAmount) external;
|
64
72
|
|
65
73
|
//-------- distribution -------------------------------------------------//
|
74
|
+
|
75
|
+
/// @dev registers the sending component as a distribution component
|
66
76
|
function registerDistribution() external;
|
67
77
|
|
68
78
|
function setDistributionFees(
|
@@ -73,7 +83,14 @@ interface IComponentService is
|
|
73
83
|
function increaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
74
84
|
function decreaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
75
85
|
|
86
|
+
//-------- oracle -------------------------------------------------------//
|
87
|
+
|
88
|
+
/// @dev registers the sending component as an oracle component
|
89
|
+
function registerOracle() external;
|
90
|
+
|
76
91
|
//-------- pool ---------------------------------------------------------//
|
92
|
+
|
93
|
+
/// @dev registers the sending component as a pool component
|
77
94
|
function registerPool() external;
|
78
95
|
|
79
96
|
function setPoolFees(
|
@@ -5,6 +5,7 @@ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessMana
|
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
7
|
import {IComponent} from "../shared/IComponent.sol";
|
8
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
8
9
|
import {IComponents} from "../instance/module/IComponents.sol";
|
9
10
|
import {IInstance} from "../instance/IInstance.sol";
|
10
11
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
@@ -43,4 +44,7 @@ interface IInstanceLinkedComponent is
|
|
43
44
|
/// this is only relevant for pool and distribution components
|
44
45
|
function getProductNftId() external view returns (NftId productNftId);
|
45
46
|
|
47
|
+
/// @dev returns the initial component authorization specification.
|
48
|
+
function getAuthorization() external view returns (IAuthorization authorization);
|
49
|
+
|
46
50
|
}
|
@@ -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
|
|
@@ -1,13 +1,12 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {NftId} from "../type/NftId.sol";
|
5
4
|
import {ObjectType} from "../type/ObjectType.sol";
|
6
5
|
import {StateId} from "../type/StateId.sol";
|
7
6
|
|
8
7
|
interface ILifecycle {
|
9
8
|
|
10
|
-
error ErrorNoLifecycle(
|
9
|
+
error ErrorNoLifecycle(ObjectType objectType);
|
11
10
|
error ErrorInvalidStateTransition(
|
12
11
|
ObjectType objectType,
|
13
12
|
StateId fromStateId,
|
@@ -4,8 +4,9 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
6
|
import {IRegisterable} from "./IRegisterable.sol";
|
7
|
-
import {IVersionable} from "
|
7
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
8
8
|
import {ObjectType} from "../type/ObjectType.sol";
|
9
|
+
import {RoleId} from "../type/RoleId.sol";
|
9
10
|
|
10
11
|
interface IService is
|
11
12
|
IRegisterable,
|
@@ -14,5 +15,11 @@ interface IService is
|
|
14
15
|
{
|
15
16
|
error ErrorServiceNotImplemented();
|
16
17
|
|
18
|
+
/// @dev returns the domain for this service.
|
19
|
+
/// In any GIF release only one service for any given domain may be deployed.
|
17
20
|
function getDomain() external pure returns(ObjectType serviceDomain);
|
21
|
+
|
22
|
+
/// @dev returns the GIF release specific role id.
|
23
|
+
/// These role ids are used to authorize service to service communication.
|
24
|
+
function getRoleId() external pure returns(RoleId serviceRoleId);
|
18
25
|
}
|
@@ -9,10 +9,10 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
|
|
9
9
|
import {Component} from "./Component.sol";
|
10
10
|
import {IComponentService} from "./IComponentService.sol";
|
11
11
|
import {IInstanceLinkedComponent} from "./IInstanceLinkedComponent.sol";
|
12
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
12
13
|
import {IComponents} from "../instance/module/IComponents.sol";
|
13
14
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
14
15
|
import {IInstance} from "../instance/IInstance.sol";
|
15
|
-
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
16
16
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
17
17
|
import {IRegistry} from "../registry/IRegistry.sol";
|
18
18
|
import {NftId} from "../type/NftId.sol";
|
@@ -35,6 +35,27 @@ abstract contract InstanceLinkedComponent is
|
|
35
35
|
struct InstanceLinkedComponentStorage {
|
36
36
|
IInstance _instance; // instance for this component
|
37
37
|
InstanceReader _instanceReader; // instance reader for this component
|
38
|
+
IAuthorization _initialAuthorization;
|
39
|
+
}
|
40
|
+
|
41
|
+
function lock() external onlyOwner {
|
42
|
+
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
43
|
+
}
|
44
|
+
|
45
|
+
function unlock() external onlyOwner {
|
46
|
+
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
47
|
+
}
|
48
|
+
|
49
|
+
function getInstance() public view override returns (IInstance instance) {
|
50
|
+
return _getInstanceLinkedComponentStorage()._instance;
|
51
|
+
}
|
52
|
+
|
53
|
+
function getProductNftId() public view override returns (NftId productNftId) {
|
54
|
+
return getComponentInfo().productNftId;
|
55
|
+
}
|
56
|
+
|
57
|
+
function getAuthorization() external view returns (IAuthorization authorization) {
|
58
|
+
return _getInstanceLinkedComponentStorage()._initialAuthorization;
|
38
59
|
}
|
39
60
|
|
40
61
|
function _getInstanceLinkedComponentStorage() private pure returns (InstanceLinkedComponentStorage storage $) {
|
@@ -43,18 +64,19 @@ abstract contract InstanceLinkedComponent is
|
|
43
64
|
}
|
44
65
|
}
|
45
66
|
|
46
|
-
function
|
67
|
+
function _initializeInstanceLinkedComponent(
|
47
68
|
address registry,
|
48
69
|
NftId instanceNftId,
|
49
70
|
string memory name,
|
50
71
|
address token,
|
51
72
|
ObjectType componentType,
|
73
|
+
IAuthorization authorization,
|
52
74
|
bool isInterceptor,
|
53
75
|
address initialOwner,
|
54
76
|
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
55
77
|
bytes memory componentData // data that will saved with the component info in the instance store
|
56
78
|
)
|
57
|
-
|
79
|
+
internal
|
58
80
|
virtual
|
59
81
|
onlyInitializing()
|
60
82
|
{
|
@@ -82,6 +104,7 @@ abstract contract InstanceLinkedComponent is
|
|
82
104
|
|
83
105
|
// set component state
|
84
106
|
$._instanceReader = $._instance.getInstanceReader();
|
107
|
+
$._initialAuthorization = authorization;
|
85
108
|
|
86
109
|
registerInterface(type(IAccessManaged).interfaceId);
|
87
110
|
registerInterface(type(IInstanceLinkedComponent).interfaceId);
|
@@ -93,22 +116,6 @@ abstract contract InstanceLinkedComponent is
|
|
93
116
|
IComponentService(_getServiceAddress(COMPONENT())).setWallet(newWallet);
|
94
117
|
}
|
95
118
|
|
96
|
-
function lock() external onlyOwner {
|
97
|
-
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(true);
|
98
|
-
}
|
99
|
-
|
100
|
-
function unlock() external onlyOwner {
|
101
|
-
IInstanceService(_getServiceAddress(INSTANCE())).setComponentLocked(false);
|
102
|
-
}
|
103
|
-
|
104
|
-
function getInstance() public view override returns (IInstance instance) {
|
105
|
-
return _getInstanceLinkedComponentStorage()._instance;
|
106
|
-
}
|
107
|
-
|
108
|
-
function getProductNftId() public view override returns (NftId productNftId) {
|
109
|
-
return getComponentInfo().productNftId;
|
110
|
-
}
|
111
|
-
|
112
119
|
|
113
120
|
function _getComponentInfo() internal virtual override view returns (IComponents.ComponentInfo memory info) {
|
114
121
|
NftId componentNftId = getRegistry().getNftId(address(this));
|
@@ -11,7 +11,7 @@ import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
|
11
11
|
import {Lifecycle} from "./Lifecycle.sol";
|
12
12
|
import {IKeyValueStore} from "./IKeyValueStore.sol";
|
13
13
|
|
14
|
-
contract KeyValueStore is
|
14
|
+
abstract contract KeyValueStore is
|
15
15
|
Lifecycle,
|
16
16
|
IKeyValueStore
|
17
17
|
{
|
@@ -34,8 +34,12 @@ contract KeyValueStore is
|
|
34
34
|
revert ErrorKeyValueStoreAlreadyCreated(key32, objectType);
|
35
35
|
}
|
36
36
|
|
37
|
+
if(!hasLifecycle(objectType)) {
|
38
|
+
revert ErrorKeyValueStoreNoLifecycle(objectType);
|
39
|
+
}
|
40
|
+
|
37
41
|
Blocknumber blocknumber = blockBlocknumber();
|
38
|
-
StateId initialState =
|
42
|
+
StateId initialState = getInitialState(objectType);
|
39
43
|
|
40
44
|
// set metadata
|
41
45
|
metadata.objectType = objectType;
|