@etherisc/gif-next 0.0.2-b3a8633-027 → 0.0.2-b3a9c97-695
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 +16 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +21 -21
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +77 -64
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +43 -38
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +237 -74
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +66 -38
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +43 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +71 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +44 -44
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +14 -14
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +80 -122
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +16 -16
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +9 -9
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +72 -194
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/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 +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +51 -51
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +30 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +27 -35
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +54 -99
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +438 -51
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +102 -26
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +205 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +44 -57
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +158 -54
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +44 -95
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +281 -90
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -19
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +21 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +9 -17
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +19 -38
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +129 -58
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +42 -30
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +5 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +16 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +188 -108
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +19 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +339 -167
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +66 -26
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +7 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +19 -38
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +2 -2
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +2 -2
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +16 -40
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +12 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +50 -165
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +114 -239
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +35 -16
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +0 -38
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +326 -62
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +72 -32
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- 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 +153 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/{ERC165.sol/ERC165.json → InitializableERC165.sol/InitializableERC165.json} +4 -4
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +19 -38
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +53 -6
- package/artifacts/contracts/shared/TokenTransferLib.sol/TokenTransferLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenTransferLib.sol/TokenTransferLib.json +42 -0
- 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/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +12 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +60 -74
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +31 -19
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +22 -22
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +12 -12
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +17 -12
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +7 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +37 -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/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +7 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- 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 +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +39 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +1 -0
- package/contracts/distribution/BasicDistribution.sol +4 -15
- package/contracts/distribution/BasicDistributionAuthorization.sol +5 -1
- package/contracts/distribution/Distribution.sol +22 -10
- package/contracts/distribution/DistributionService.sol +46 -11
- package/contracts/distribution/IDistributionComponent.sol +8 -4
- package/contracts/distribution/IDistributionService.sol +10 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +2 -0
- package/contracts/instance/InstanceReader.sol +10 -7
- package/contracts/instance/InstanceService.sol +51 -27
- package/contracts/instance/InstanceStore.sol +2 -1
- package/contracts/instance/base/ObjectLifecycle.sol +2 -3
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +1 -7
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +1 -1
- package/contracts/mock/Dip.sol +1 -1
- package/contracts/oracle/IOracleComponent.sol +2 -1
- package/contracts/oracle/Oracle.sol +15 -6
- package/contracts/pool/BasicPool.sol +7 -5
- package/contracts/pool/BasicPoolAuthorization.sol +11 -2
- package/contracts/pool/BundleService.sol +169 -16
- package/contracts/pool/IBundleService.sol +32 -5
- package/contracts/pool/IPoolComponent.sol +6 -0
- package/contracts/pool/IPoolService.sol +14 -17
- package/contracts/pool/Pool.sol +32 -15
- package/contracts/pool/PoolService.sol +146 -58
- package/contracts/product/ApplicationService.sol +37 -17
- package/contracts/product/BasicProduct.sol +3 -33
- package/contracts/product/BasicProductAuthorization.sol +3 -0
- package/contracts/product/ClaimService.sol +9 -8
- package/contracts/product/IApplicationService.sol +1 -0
- package/contracts/product/IClaimService.sol +1 -0
- package/contracts/product/IPolicyService.sol +23 -17
- package/contracts/product/IProductComponent.sol +1 -0
- package/contracts/product/PolicyService.sol +251 -131
- package/contracts/product/PricingService.sol +5 -1
- package/contracts/product/Product.sol +27 -6
- package/contracts/registry/ChainNft.sol +27 -28
- package/contracts/registry/IRegistry.sol +3 -2
- package/contracts/registry/Registry.sol +69 -60
- package/contracts/registry/RegistryAdmin.sol +49 -131
- package/contracts/registry/ReleaseRegistry.sol +24 -72
- package/contracts/shared/Component.sol +21 -21
- package/contracts/shared/ComponentService.sol +73 -14
- package/contracts/shared/IComponent.sol +4 -3
- package/contracts/shared/IComponentService.sol +15 -9
- package/contracts/shared/IInstanceLinkedComponent.sol +9 -3
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +1 -1
- package/contracts/shared/InstanceLinkedComponent.sol +21 -0
- package/contracts/shared/NftOwnable.sol +2 -2
- package/contracts/shared/PolicyHolder.sol +2 -5
- package/contracts/shared/TokenHandler.sol +4 -0
- package/contracts/shared/TokenTransferLib.sol +60 -0
- package/contracts/staking/Staking.sol +9 -3
- package/contracts/staking/StakingService.sol +8 -12
- package/contracts/type/Amount.sol +12 -5
- package/contracts/type/Blocknumber.sol +7 -1
- package/contracts/type/Referral.sol +1 -0
- package/contracts/type/Seconds.sol +13 -1
- package/contracts/type/Timestamp.sol +11 -1
- package/contracts/type/UFixed.sol +29 -10
- package/package.json +1 -1
- package/artifacts/contracts/registry/GlobalRegistry.sol/GlobalRegistry.dbg.json +0 -4
- package/artifacts/contracts/registry/GlobalRegistry.sol/GlobalRegistry.json +0 -1503
- package/artifacts/contracts/registry/GlobalRegistryAdmin.sol/GlobalRegistryAdmin.dbg.json +0 -4
- package/artifacts/contracts/registry/GlobalRegistryAdmin.sol/GlobalRegistryAdmin.json +0 -1881
- package/artifacts/contracts/registry/IGlobalRegistry.sol/IGlobalRegistry.dbg.json +0 -4
- package/artifacts/contracts/registry/IGlobalRegistry.sol/IGlobalRegistry.json +0 -974
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/MainnetId.sol/MainnetContract.dbg.json +0 -4
- package/artifacts/contracts/shared/MainnetId.sol/MainnetContract.json +0 -34
- package/artifacts/contracts/shared/MainnetId.sol/MainnetId.dbg.json +0 -4
- package/artifacts/contracts/shared/MainnetId.sol/MainnetId.json +0 -24
- package/artifacts/contracts/shared/MainnetId.sol/SidenetContract.dbg.json +0 -4
- package/artifacts/contracts/shared/MainnetId.sol/SidenetContract.json +0 -34
- package/contracts/registry/GlobalRegistry.sol +0 -95
- package/contracts/registry/GlobalRegistryAdmin.sol +0 -38
- package/contracts/registry/IGlobalRegistry.sol +0 -17
- package/contracts/shared/MainnetId.sol +0 -29
@@ -7,13 +7,13 @@ import {IRegistry} from "./IRegistry.sol";
|
|
7
7
|
import {IService} from "../shared/IService.sol";
|
8
8
|
import {IServiceAuthorization} from "../authorization/IServiceAuthorization.sol";
|
9
9
|
import {IStaking} from "../staking/IStaking.sol";
|
10
|
-
import {ObjectType, ObjectTypeLib, ALL,
|
10
|
+
import {ObjectType, ObjectTypeLib, ALL, POOL, RELEASE} from "../type/ObjectType.sol";
|
11
11
|
import {ReleaseRegistry} from "./ReleaseRegistry.sol";
|
12
12
|
import {RoleId, RoleIdLib, ADMIN_ROLE, GIF_MANAGER_ROLE, GIF_ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
13
13
|
import {StakingStore} from "../staking/StakingStore.sol";
|
14
|
+
import {STAKING} from "../type/ObjectType.sol";
|
14
15
|
import {TokenRegistry} from "./TokenRegistry.sol";
|
15
16
|
import {VersionPart} from "../type/Version.sol";
|
16
|
-
import {SidenetContract} from "../shared/MainnetId.sol";
|
17
17
|
|
18
18
|
/*
|
19
19
|
1) GIF_MANAGER_ROLE
|
@@ -26,34 +26,37 @@ import {SidenetContract} from "../shared/MainnetId.sol";
|
|
26
26
|
- MUST have 1 member at any time
|
27
27
|
- granted/revoked ONLY in transferAdminRole() -> consider lock out situations!!!
|
28
28
|
- responsible for creation and activation of releases
|
29
|
+
|
30
|
+
createServiceTarget(type, release)
|
31
|
+
createServiceRole(type,release)
|
32
|
+
getServiceRole(type, release)
|
29
33
|
*/
|
30
34
|
contract RegistryAdmin is
|
31
|
-
SidenetContract,
|
32
35
|
AccessAdmin
|
33
36
|
{
|
37
|
+
error ErrorRegistryAdminIsAlreadySetUp();
|
38
|
+
|
34
39
|
string public constant GIF_ADMIN_ROLE_NAME = "GifAdminRole";
|
35
40
|
string public constant GIF_MANAGER_ROLE_NAME = "GifManagerRole";
|
36
41
|
string public constant POOL_SERVICE_ROLE_NAME = "PoolServiceRole";
|
37
42
|
string public constant RELEASE_REGISTRY_ROLE_NAME = "ReleaseRegistryRole";
|
38
|
-
string public constant REGISTRY_SERVICE_ROLE_NAME = "RegistryServiceRole";
|
39
43
|
string public constant STAKING_SERVICE_ROLE_NAME = "StakingServiceRole";
|
40
44
|
string public constant STAKING_ROLE_NAME = "StakingRole";
|
41
45
|
|
42
|
-
string public constant REGISTRY_TARGET_NAME = "Registry";
|
43
46
|
string public constant RELEASE_REGISTRY_TARGET_NAME = "ReleaseRegistry";
|
44
47
|
string public constant TOKEN_REGISTRY_TARGET_NAME = "TokenRegistry";
|
45
48
|
string public constant STAKING_TARGET_NAME = "Staking";
|
46
49
|
string public constant STAKING_STORE_TARGET_NAME = "StakingStore";
|
47
50
|
|
48
51
|
uint8 public constant MAX_NUM_RELEASES = 99;
|
49
|
-
|
52
|
+
|
50
53
|
mapping(address service => VersionPart majorVersion) private _ServiceRelease;
|
51
54
|
|
52
|
-
address internal _registry;
|
53
55
|
address private _releaseRegistry;
|
54
56
|
address private _tokenRegistry;
|
55
57
|
address private _staking;
|
56
58
|
address private _stakingStore;
|
59
|
+
bool private _setupCompleted;
|
57
60
|
|
58
61
|
constructor() AccessAdmin() { }
|
59
62
|
|
@@ -63,10 +66,11 @@ contract RegistryAdmin is
|
|
63
66
|
address gifManager
|
64
67
|
)
|
65
68
|
external
|
66
|
-
initializer
|
67
69
|
onlyDeployer()
|
68
70
|
{
|
69
|
-
|
71
|
+
if (_setupCompleted) { revert ErrorRegistryAdminIsAlreadySetUp(); }
|
72
|
+
else { _setupCompleted = true; }
|
73
|
+
|
70
74
|
_releaseRegistry = registry.getReleaseRegistryAddress();
|
71
75
|
_tokenRegistry = registry.getTokenRegistryAddress();
|
72
76
|
_staking = registry.getStakingAddress();
|
@@ -79,7 +83,6 @@ contract RegistryAdmin is
|
|
79
83
|
_setupGifAdminRole(gifAdmin);
|
80
84
|
_setupGifManagerRole(gifManager);
|
81
85
|
|
82
|
-
_setupRegistry();
|
83
86
|
_setupReleaseRegistry();
|
84
87
|
_setupStaking();
|
85
88
|
}
|
@@ -90,46 +93,15 @@ contract RegistryAdmin is
|
|
90
93
|
/// Permissioned function: Access is restricted to release manager.
|
91
94
|
function authorizeService(
|
92
95
|
IServiceAuthorization serviceAuthorization,
|
93
|
-
IService service
|
94
|
-
ObjectType serviceDomain,
|
95
|
-
VersionPart releaseVersion
|
96
|
+
IService service
|
96
97
|
)
|
97
98
|
external
|
98
99
|
restricted()
|
99
100
|
{
|
100
|
-
_createServiceTargetAndRole(service
|
101
|
-
_authorizeServiceFunctions(serviceAuthorization, service
|
101
|
+
_createServiceTargetAndRole(service);
|
102
|
+
_authorizeServiceFunctions(serviceAuthorization, service);
|
102
103
|
}
|
103
104
|
|
104
|
-
function grantServiceRole(
|
105
|
-
IService service,
|
106
|
-
ObjectType domain,
|
107
|
-
VersionPart version
|
108
|
-
)
|
109
|
-
external
|
110
|
-
restricted()
|
111
|
-
{
|
112
|
-
_grantRoleToAccount(
|
113
|
-
RoleIdLib.roleForTypeAndVersion(
|
114
|
-
domain,
|
115
|
-
version),
|
116
|
-
address(service));
|
117
|
-
}
|
118
|
-
|
119
|
-
function revokeServiceRole(
|
120
|
-
IService service,
|
121
|
-
ObjectType domain,
|
122
|
-
VersionPart version
|
123
|
-
)
|
124
|
-
external
|
125
|
-
restricted()
|
126
|
-
{
|
127
|
-
_revokeRoleFromAccount(
|
128
|
-
RoleIdLib.roleForTypeAndVersion(
|
129
|
-
domain,
|
130
|
-
version),
|
131
|
-
address(service));
|
132
|
-
}
|
133
105
|
|
134
106
|
function grantServiceRoleForAllVersions(IService service, ObjectType domain)
|
135
107
|
external
|
@@ -140,44 +112,14 @@ contract RegistryAdmin is
|
|
140
112
|
address(service));
|
141
113
|
}
|
142
114
|
|
143
|
-
function revokeServiceRoleForAllVersions(IService service, ObjectType domain)
|
144
|
-
external
|
145
|
-
restricted()
|
146
|
-
{
|
147
|
-
_revokeRoleFromAccount(
|
148
|
-
RoleIdLib.roleForTypeAndAllVersions(domain),
|
149
|
-
address(service));
|
150
|
-
}
|
151
|
-
|
152
|
-
/*function transferAdmin(address to)
|
153
|
-
external
|
154
|
-
restricted // only with GIF_ADMIN_ROLE or nft owner
|
155
|
-
{
|
156
|
-
_accessManager.revoke(GIF_ADMIN_ROLE, );
|
157
|
-
_accesssManager.grant(GIF_ADMIN_ROLE, to, 0);
|
158
|
-
}*/
|
159
|
-
|
160
|
-
//--- view functions ----------------------------------------------------//
|
161
|
-
|
162
|
-
function getGifAdminRole() external view returns (RoleId) {
|
163
|
-
return GIF_ADMIN_ROLE();
|
164
|
-
}
|
165
|
-
|
166
|
-
function getGifManagerRole() external view returns (RoleId) {
|
167
|
-
return GIF_MANAGER_ROLE();
|
168
|
-
}
|
169
|
-
|
170
|
-
//--- private functions -------------------------------------------------//
|
171
115
|
|
172
|
-
function _createServiceTargetAndRole(
|
173
|
-
IService service,
|
174
|
-
ObjectType serviceDomain,
|
175
|
-
VersionPart releaseVersion
|
176
|
-
)
|
116
|
+
function _createServiceTargetAndRole(IService service)
|
177
117
|
private
|
178
118
|
{
|
119
|
+
ObjectType serviceDomain = service.getDomain();
|
179
120
|
string memory baseName = ObjectTypeLib.toName(serviceDomain);
|
180
|
-
|
121
|
+
VersionPart version = service.getVersion().toMajorPart();
|
122
|
+
uint256 versionInt = version.toInt();
|
181
123
|
|
182
124
|
// create service target
|
183
125
|
string memory serviceTargetName = ObjectTypeLib.toVersionedName(
|
@@ -192,7 +134,7 @@ contract RegistryAdmin is
|
|
192
134
|
// create service role
|
193
135
|
RoleId serviceRoleId = RoleIdLib.roleForTypeAndVersion(
|
194
136
|
serviceDomain,
|
195
|
-
|
137
|
+
version);
|
196
138
|
|
197
139
|
_createRole(
|
198
140
|
serviceRoleId,
|
@@ -213,15 +155,15 @@ contract RegistryAdmin is
|
|
213
155
|
|
214
156
|
function _authorizeServiceFunctions(
|
215
157
|
IServiceAuthorization serviceAuthorization,
|
216
|
-
IService service
|
217
|
-
ObjectType serviceDomain,
|
218
|
-
VersionPart releaseVersion
|
158
|
+
IService service
|
219
159
|
)
|
220
160
|
private
|
221
161
|
{
|
162
|
+
ObjectType serviceDomain = service.getDomain();
|
222
163
|
ObjectType authorizedDomain;
|
223
164
|
RoleId authorizedRoleId;
|
224
165
|
|
166
|
+
VersionPart release = service.getVersion().toMajorPart();
|
225
167
|
ObjectType[] memory authorizedDomains = serviceAuthorization.getAuthorizedDomains(serviceDomain);
|
226
168
|
|
227
169
|
for (uint256 i = 0; i < authorizedDomains.length; i++) {
|
@@ -233,7 +175,7 @@ contract RegistryAdmin is
|
|
233
175
|
} else {
|
234
176
|
authorizedRoleId = RoleIdLib.roleForTypeAndVersion(
|
235
177
|
authorizedDomain,
|
236
|
-
|
178
|
+
release);
|
237
179
|
}
|
238
180
|
|
239
181
|
// get authorized functions for authorized domain
|
@@ -248,12 +190,27 @@ contract RegistryAdmin is
|
|
248
190
|
}
|
249
191
|
}
|
250
192
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
private
|
255
|
-
onlyInitializing()
|
193
|
+
/*function transferAdmin(address to)
|
194
|
+
external
|
195
|
+
restricted // only with GIF_ADMIN_ROLE or nft owner
|
256
196
|
{
|
197
|
+
_accessManager.revoke(GIF_ADMIN_ROLE, );
|
198
|
+
_accesssManager.grant(GIF_ADMIN_ROLE, to, 0);
|
199
|
+
}*/
|
200
|
+
|
201
|
+
//--- view functions ----------------------------------------------------//
|
202
|
+
|
203
|
+
function getGifAdminRole() external view returns (RoleId) {
|
204
|
+
return GIF_ADMIN_ROLE();
|
205
|
+
}
|
206
|
+
|
207
|
+
function getGifManagerRole() external view returns (RoleId) {
|
208
|
+
return GIF_MANAGER_ROLE();
|
209
|
+
}
|
210
|
+
|
211
|
+
//--- private functions -------------------------------------------------//
|
212
|
+
|
213
|
+
function _setupGifAdminRole(address gifAdmin) private {
|
257
214
|
|
258
215
|
_createRole(
|
259
216
|
GIF_ADMIN_ROLE(),
|
@@ -275,10 +232,7 @@ contract RegistryAdmin is
|
|
275
232
|
_grantRoleToAccount(GIF_ADMIN_ROLE(), gifAdmin);
|
276
233
|
}
|
277
234
|
|
278
|
-
function _setupGifManagerRole(address gifManager)
|
279
|
-
private
|
280
|
-
onlyInitializing()
|
281
|
-
{
|
235
|
+
function _setupGifManagerRole(address gifManager) private {
|
282
236
|
|
283
237
|
_createRole(
|
284
238
|
GIF_MANAGER_ROLE(),
|
@@ -308,37 +262,8 @@ contract RegistryAdmin is
|
|
308
262
|
_grantRoleToAccount(GIF_MANAGER_ROLE(), gifManager);
|
309
263
|
}
|
310
264
|
|
311
|
-
function _setupRegistry()
|
312
|
-
internal
|
313
|
-
virtual
|
314
|
-
onlyInitializing()
|
315
|
-
{
|
316
|
-
_createTarget(_registry, REGISTRY_TARGET_NAME, true, false);
|
317
|
-
|
318
|
-
// registry function authorization for registry service
|
319
|
-
RoleId registryServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(REGISTRY());
|
320
|
-
_createRole(
|
321
|
-
registryServiceRoleId,
|
322
|
-
toRole({
|
323
|
-
adminRoleId: ADMIN_ROLE(),
|
324
|
-
roleType: RoleType.Contract,
|
325
|
-
maxMemberCount: MAX_NUM_RELEASES,
|
326
|
-
name: REGISTRY_SERVICE_ROLE_NAME}));
|
327
|
-
|
328
|
-
FunctionInfo[] memory functions;
|
329
|
-
functions = new FunctionInfo[](2);
|
330
|
-
functions[0] = toFunction(IRegistry.register.selector, "register");
|
331
|
-
functions[1] = toFunction(IRegistry.registerWithCustomType.selector, "registerWithCustomType");
|
332
|
-
// TODO add registerChainRegistry()
|
333
|
-
|
334
|
-
_authorizeTargetFunctions(_registry, registryServiceRoleId, functions);
|
335
|
-
}
|
336
|
-
|
337
265
|
|
338
|
-
function _setupReleaseRegistry()
|
339
|
-
private
|
340
|
-
onlyInitializing()
|
341
|
-
{
|
266
|
+
function _setupReleaseRegistry() private {
|
342
267
|
|
343
268
|
_createTarget(_releaseRegistry, RELEASE_REGISTRY_TARGET_NAME, true, false);
|
344
269
|
|
@@ -352,23 +277,16 @@ contract RegistryAdmin is
|
|
352
277
|
name: RELEASE_REGISTRY_ROLE_NAME}));
|
353
278
|
|
354
279
|
FunctionInfo[] memory functions;
|
355
|
-
functions = new FunctionInfo[](
|
280
|
+
functions = new FunctionInfo[](2);
|
356
281
|
functions[0] = toFunction(RegistryAdmin.authorizeService.selector, "authorizeService");
|
357
282
|
functions[1] = toFunction(RegistryAdmin.grantServiceRoleForAllVersions.selector, "grantServiceRoleForAllVersions");
|
358
|
-
functions[2] = toFunction(RegistryAdmin.revokeServiceRoleForAllVersions.selector, "revokeServiceRoleForAllVersions");
|
359
|
-
functions[3] = toFunction(RegistryAdmin.grantServiceRole.selector, "grantServiceRole");
|
360
|
-
functions[4] = toFunction(RegistryAdmin.revokeServiceRole.selector, "revokeServiceRole");
|
361
|
-
|
362
283
|
_authorizeTargetFunctions(address(this), releaseRegistryRoleId, functions);
|
363
284
|
|
364
285
|
_grantRoleToAccount(releaseRegistryRoleId, _releaseRegistry);
|
365
286
|
}
|
366
287
|
|
367
288
|
|
368
|
-
function _setupStaking()
|
369
|
-
private
|
370
|
-
onlyInitializing()
|
371
|
-
{
|
289
|
+
function _setupStaking() private {
|
372
290
|
_createTarget(_staking, STAKING_TARGET_NAME, true, false);
|
373
291
|
_createTarget(_stakingStore, STAKING_STORE_TARGET_NAME, true, false);
|
374
292
|
|
@@ -9,7 +9,7 @@ import {AccessManaged} from "@openzeppelin/contracts/access/manager/AccessManage
|
|
9
9
|
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
10
10
|
|
11
11
|
import {NftId} from "../type/NftId.sol";
|
12
|
-
import {RoleId,
|
12
|
+
import {RoleId, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
13
13
|
import {ObjectType, ObjectTypeLib, POOL, RELEASE, REGISTRY, SERVICE, STAKING} from "../type/ObjectType.sol";
|
14
14
|
import {Version, VersionLib, VersionPart, VersionPartLib} from "../type/Version.sol";
|
15
15
|
import {Timestamp, TimestampLib, zeroTimestamp, ltTimestamp} from "../type/Timestamp.sol";
|
@@ -32,8 +32,6 @@ import {Registry} from "./Registry.sol";
|
|
32
32
|
import {TokenRegistry} from "./TokenRegistry.sol";
|
33
33
|
import {ReleaseLifecycle} from "./ReleaseLifecycle.sol";
|
34
34
|
|
35
|
-
// TODO rename to something that does not end with 'Manager'
|
36
|
-
// everywhere else *Manager points to an upgradeable contract
|
37
35
|
contract ReleaseRegistry is
|
38
36
|
AccessManaged,
|
39
37
|
ReleaseLifecycle,
|
@@ -99,6 +97,9 @@ contract ReleaseRegistry is
|
|
99
97
|
mapping(VersionPart version => IRegistry.ReleaseInfo info) internal _releaseInfo;
|
100
98
|
mapping(VersionPart version => IServiceAuthorization authz) internal _serviceAuthorization;
|
101
99
|
|
100
|
+
// TODO check where/why this is used
|
101
|
+
mapping(address registryService => VersionPart version) _releaseVersionByAddress;
|
102
|
+
|
102
103
|
VersionPart private _initial;// first active version
|
103
104
|
VersionPart internal _latest; // latest active version
|
104
105
|
VersionPart internal _next; // version to create and activate
|
@@ -228,29 +229,22 @@ contract ReleaseRegistry is
|
|
228
229
|
revert ErrorReleaseRegistryServiceDomainMismatch(expectedDomain, serviceDomain);
|
229
230
|
}
|
230
231
|
|
231
|
-
//
|
232
|
+
// register service with registry
|
233
|
+
nftId = _registry.registerService(info, serviceVersion, serviceDomain);
|
234
|
+
service.linkToRegisteredNftId();
|
235
|
+
_registeredServices++;
|
232
236
|
|
233
237
|
// setup service authorization
|
234
238
|
_admin.authorizeService(
|
235
239
|
_serviceAuthorization[releaseVersion],
|
236
|
-
service
|
237
|
-
serviceDomain,
|
238
|
-
releaseVersion);
|
240
|
+
service);
|
239
241
|
|
242
|
+
// TODO consider to extend this to REGISTRY
|
240
243
|
// special roles for registry/staking/pool service
|
241
|
-
if (
|
242
|
-
|
243
|
-
serviceDomain == STAKING() ||
|
244
|
-
serviceDomain == POOL())
|
245
|
-
{
|
244
|
+
if (serviceDomain == STAKING() || serviceDomain == POOL()) {
|
245
|
+
// TODO rename to grantServiceDomainRole()
|
246
246
|
_admin.grantServiceRoleForAllVersions(service, serviceDomain);
|
247
247
|
}
|
248
|
-
|
249
|
-
_registeredServices++;
|
250
|
-
|
251
|
-
// register service with registry
|
252
|
-
nftId = _registry.registerService(info, serviceVersion, serviceDomain);
|
253
|
-
service.linkToRegisteredNftId();
|
254
248
|
}
|
255
249
|
|
256
250
|
|
@@ -281,6 +275,7 @@ contract ReleaseRegistry is
|
|
281
275
|
_latest = version;
|
282
276
|
_state[version] = newState;
|
283
277
|
|
278
|
+
_releaseVersionByAddress[service] = version;
|
284
279
|
_releaseInfo[version].activatedAt = TimestampLib.blockTimestamp();
|
285
280
|
|
286
281
|
emit LogReleaseActivation(version);
|
@@ -299,7 +294,8 @@ contract ReleaseRegistry is
|
|
299
294
|
revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
|
300
295
|
}
|
301
296
|
|
302
|
-
|
297
|
+
// TODO come up with a substitute
|
298
|
+
//_releaseAccessManager[version].disable();
|
303
299
|
|
304
300
|
_state[version] = newState;
|
305
301
|
_releaseInfo[version].disabledAt = TimestampLib.blockTimestamp();
|
@@ -321,7 +317,8 @@ contract ReleaseRegistry is
|
|
321
317
|
revert ErrorReleaseRegistryReleaseActivationDisallowed(version, state);
|
322
318
|
}
|
323
319
|
|
324
|
-
|
320
|
+
// TODO come up with a substitute
|
321
|
+
// _releaseAccessManager[version].enable();
|
325
322
|
|
326
323
|
_state[version] = newState;
|
327
324
|
_releaseInfo[version].disabledAt = zeroTimestamp();
|
@@ -339,6 +336,11 @@ contract ReleaseRegistry is
|
|
339
336
|
return Clones.predictDeterministicAddress(implementation, salt, deployer);
|
340
337
|
}
|
341
338
|
|
339
|
+
function isActiveRegistryService(address service) external view returns(bool) {
|
340
|
+
VersionPart version = _releaseVersionByAddress[service];
|
341
|
+
return isActiveRelease(version);
|
342
|
+
}
|
343
|
+
|
342
344
|
function isActiveRelease(VersionPart version) public view returns(bool) {
|
343
345
|
return _state[version] == ACTIVE();
|
344
346
|
}
|
@@ -387,57 +389,6 @@ contract ReleaseRegistry is
|
|
387
389
|
|
388
390
|
//--- private functions ----------------------------------------------------//
|
389
391
|
|
390
|
-
function _revokeReleaseRoles(VersionPart version)
|
391
|
-
private
|
392
|
-
{
|
393
|
-
address service;
|
394
|
-
ObjectType domain;
|
395
|
-
|
396
|
-
ObjectType[] memory domains = _serviceAuthorization[version].getServiceDomains();
|
397
|
-
for(uint idx = 0; idx < domains.length; idx++)
|
398
|
-
{
|
399
|
-
domain = domains[idx];
|
400
|
-
service = _registry.getServiceAddress(domain, version);
|
401
|
-
_admin.revokeServiceRole(IService(service), domain, version);
|
402
|
-
|
403
|
-
// special roles for registry/staking/pool service
|
404
|
-
if(
|
405
|
-
domain == REGISTRY() ||
|
406
|
-
domain == STAKING() ||
|
407
|
-
domain == POOL()
|
408
|
-
)
|
409
|
-
{
|
410
|
-
_admin.revokeServiceRoleForAllVersions(IService(service), domain);
|
411
|
-
}
|
412
|
-
}
|
413
|
-
}
|
414
|
-
|
415
|
-
function _grantReleaseRoles(VersionPart version)
|
416
|
-
private
|
417
|
-
{
|
418
|
-
address service;
|
419
|
-
ObjectType domain;
|
420
|
-
|
421
|
-
// TODO consider getting domains from local store
|
422
|
-
ObjectType[] memory domains = _serviceAuthorization[version].getServiceDomains();
|
423
|
-
for(uint idx = 0; idx < domains.length; idx++)
|
424
|
-
{
|
425
|
-
domain = domains[idx];
|
426
|
-
service = _registry.getServiceAddress(domain, version);
|
427
|
-
_admin.grantServiceRole(IService(service), domain, version);
|
428
|
-
|
429
|
-
// special roles for registry/staking/pool service
|
430
|
-
if(
|
431
|
-
domain == REGISTRY() ||
|
432
|
-
domain == STAKING() ||
|
433
|
-
domain == POOL()
|
434
|
-
)
|
435
|
-
{
|
436
|
-
_admin.grantServiceRoleForAllVersions(IService(service), domain);
|
437
|
-
}
|
438
|
-
}
|
439
|
-
}
|
440
|
-
|
441
392
|
function _verifyService(IService service)
|
442
393
|
internal
|
443
394
|
view
|
@@ -521,7 +472,8 @@ contract ReleaseRegistry is
|
|
521
472
|
if (registryAddress == address(0)) {
|
522
473
|
return false;
|
523
474
|
}
|
524
|
-
// TODO try catch and return false in case of revert
|
475
|
+
// TODO try catch and return false in case of revert
|
476
|
+
// or just panic
|
525
477
|
// check if contract returns a zero nft id for its own address
|
526
478
|
if (IRegistry(registryAddress).getNftId(registryAddress).eqz()) {
|
527
479
|
return false;
|
@@ -6,7 +6,7 @@ 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
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
10
10
|
import {IComponent} from "./IComponent.sol";
|
11
11
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
12
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
@@ -26,7 +26,6 @@ abstract contract Component is
|
|
26
26
|
struct ComponentStorage {
|
27
27
|
string _name; // unique (per instance) component name
|
28
28
|
IERC20Metadata _token; // token for this component
|
29
|
-
TokenHandler _tokenHandler;
|
30
29
|
address _wallet;
|
31
30
|
bool _isInterceptor;
|
32
31
|
bytes _data;
|
@@ -40,6 +39,12 @@ abstract contract Component is
|
|
40
39
|
_;
|
41
40
|
}
|
42
41
|
|
42
|
+
modifier onlyNftOwner(NftId nftId) {
|
43
|
+
if(msg.sender != getRegistry().ownerOf(nftId)) {
|
44
|
+
revert ErrorNftOwnableNotOwner(msg.sender);
|
45
|
+
}
|
46
|
+
_;
|
47
|
+
}
|
43
48
|
|
44
49
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
45
50
|
assembly {
|
@@ -78,7 +83,6 @@ abstract contract Component is
|
|
78
83
|
ComponentStorage storage $ = _getComponentStorage();
|
79
84
|
$._name = name;
|
80
85
|
$._token = IERC20Metadata(token);
|
81
|
-
$._tokenHandler = TokenHandler(address(0));
|
82
86
|
$._wallet = address(this);
|
83
87
|
$._isInterceptor = isInterceptor;
|
84
88
|
$._data = componentData;
|
@@ -105,11 +109,11 @@ abstract contract Component is
|
|
105
109
|
revert ErrorComponentWalletNotComponent();
|
106
110
|
}
|
107
111
|
|
112
|
+
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount);
|
113
|
+
|
108
114
|
IERC20Metadata(token).approve(
|
109
115
|
address(getTokenHandler()),
|
110
116
|
spendingLimitAmount.toInt());
|
111
|
-
|
112
|
-
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount);
|
113
117
|
}
|
114
118
|
|
115
119
|
function setWallet(address newWallet)
|
@@ -128,7 +132,7 @@ abstract contract Component is
|
|
128
132
|
// move tokens from component smart contract to external wallet
|
129
133
|
} else {
|
130
134
|
// move tokens from external wallet to component smart contract or another external wallet
|
131
|
-
uint256 allowance = token.allowance(currentWallet, address(
|
135
|
+
uint256 allowance = token.allowance(currentWallet, address(getTokenHandler()));
|
132
136
|
if (allowance < currentBalance) {
|
133
137
|
revert ErrorComponentWalletAllowanceTooSmall(currentWallet, newWallet, allowance, currentBalance);
|
134
138
|
}
|
@@ -140,14 +144,15 @@ abstract contract Component is
|
|
140
144
|
|
141
145
|
// interactions
|
142
146
|
if (currentBalance > 0) {
|
147
|
+
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
148
|
+
|
143
149
|
// transfer tokens from current wallet to new wallet
|
144
150
|
if (currentWallet == address(this)) {
|
145
151
|
// transferFrom requires self allowance too
|
146
|
-
token.approve(address(
|
152
|
+
token.approve(address(getTokenHandler()), currentBalance);
|
147
153
|
}
|
148
154
|
|
149
|
-
|
150
|
-
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
155
|
+
getTokenHandler().transfer(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
151
156
|
}
|
152
157
|
}
|
153
158
|
|
@@ -253,29 +258,24 @@ abstract contract Component is
|
|
253
258
|
}
|
254
259
|
|
255
260
|
|
256
|
-
/// @dev for component contracts that hold its own component information
|
257
|
-
/// this function creates and sets a token hanlder for the components tokens
|
258
|
-
function _createAndSetTokenHandler()
|
259
|
-
internal
|
260
|
-
{
|
261
|
-
ComponentStorage storage $ = _getComponentStorage();
|
262
|
-
$._tokenHandler = new TokenHandler(address($._token));
|
263
|
-
}
|
264
|
-
|
265
|
-
|
266
261
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
267
262
|
/// eg for instance linked components that externally store this information with the instance store contract
|
268
263
|
function _getComponentInfo() internal virtual view returns (IComponents.ComponentInfo memory info) {
|
269
264
|
ComponentStorage storage $ = _getComponentStorage();
|
270
|
-
|
265
|
+
|
271
266
|
return IComponents.ComponentInfo({
|
272
267
|
name: $._name,
|
273
268
|
productNftId: NftIdLib.zero(),
|
274
269
|
token: $._token,
|
275
|
-
tokenHandler:
|
270
|
+
tokenHandler: TokenHandler(address(0)),
|
276
271
|
wallet: $._wallet, // initial wallet address
|
277
272
|
data: $._data // user specific component data
|
278
273
|
});
|
279
274
|
}
|
280
275
|
|
276
|
+
function _approveTokenHandler(uint256 amount) internal {
|
277
|
+
ComponentStorage storage $ = _getComponentStorage();
|
278
|
+
$._token.approve(address(getComponentInfo().tokenHandler), amount);
|
279
|
+
}
|
280
|
+
|
281
281
|
}
|