@etherisc/gif-next 0.0.2-e8b06c8-540 → 0.0.2-e8ea17d-715
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +13 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +38 -33
- 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 +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +8 -8
- 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/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +8 -8
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +23 -4
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +26 -26
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +19 -19
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +74 -74
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +55 -55
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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 +7 -7
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +10 -5
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +19 -19
- 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 +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +31 -31
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +58 -58
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +44 -39
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +35 -35
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +83 -84
- 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 +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 +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +16 -16
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +21 -21
- 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/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +32 -32
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -34
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +19 -19
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +55 -55
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +40 -40
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +36 -36
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +36 -36
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +32 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -34
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +19 -19
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +72 -72
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +54 -54
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- 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 +50 -50
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +43 -43
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +58 -58
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +47 -47
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +20 -20
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +28 -28
- 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 +0 -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 +100 -95
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +27 -27
- 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 +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -7
- 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 +62 -62
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -49
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- 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/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- 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/IVersionable.sol/IVersionable.dbg.json +1 -1
- 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/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/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -14
- 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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- 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 +32 -32
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -44
- 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 -40
- 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 +26 -26
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -31
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +145 -169
- 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 +2 -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 +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
- 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 +14 -14
- 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 +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +2 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +2 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +4 -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 +2 -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/contracts/authorization/AccessAdmin.sol +8 -39
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/IServiceAuthorization.sol +3 -0
- package/contracts/authorization/ModuleAuthorization.sol +0 -125
- package/contracts/authorization/ServiceAuthorization.sol +4 -0
- package/contracts/distribution/DistributionService.sol +0 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -30
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +7 -7
- package/contracts/instance/IInstanceService.sol +6 -5
- package/contracts/instance/Instance.sol +8 -47
- package/contracts/instance/InstanceAdmin.sol +201 -269
- package/contracts/instance/InstanceAuthorizationV3.sol +14 -25
- package/contracts/instance/InstanceReader.sol +0 -5
- package/contracts/instance/InstanceService.sol +30 -103
- package/contracts/instance/InstanceStore.sol +6 -3
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +5 -5
- package/contracts/pool/BundleService.sol +8 -8
- package/contracts/pool/PoolService.sol +0 -1
- package/contracts/registry/IRegistry.sol +26 -16
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +80 -86
- package/contracts/registry/RegistryAdmin.sol +24 -22
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/{ReleaseManager.sol → ReleaseRegistry.sol} +148 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +5 -7
- package/contracts/registry/TokenRegistry.sol +2 -2
- package/contracts/shared/ComponentService.sol +2 -47
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/InstanceLinkedComponent.sol +0 -1
- package/contracts/shared/KeyValueStore.sol +6 -2
- package/contracts/shared/Lifecycle.sol +16 -69
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/staking/IStaking.sol +0 -1
- package/contracts/staking/IStakingService.sol +12 -5
- package/contracts/staking/Staking.sol +1 -3
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +0 -1
- package/contracts/staking/StakingReader.sol +6 -7
- package/contracts/staking/StakingStore.sol +10 -8
- package/contracts/type/ObjectType.sol +3 -7
- package/contracts/type/RoleId.sol +10 -38
- package/contracts/type/Version.sol +3 -1
- package/package.json +3 -3
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +0 -4
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +0 -1385
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -703
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +0 -1616
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -181
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1237
- 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 -1747
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1760
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1838
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1856
- 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/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/contracts/authorization/InstanceAdmin.sol +0 -108
- package/contracts/instance/InstanceAdminNew.sol +0 -261
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -422
- package/contracts/shared/AccessManagerCustom.sol +0 -741
- package/contracts/shared/AccessManagerExtended.sol +0 -481
- 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
@@ -282,18 +282,6 @@ contract ComponentService is
|
|
282
282
|
{
|
283
283
|
address contractAddress = msg.sender;
|
284
284
|
|
285
|
-
// TODO cleanup
|
286
|
-
// RoleId[] memory roles = new RoleId[](2);
|
287
|
-
// bytes4[][] memory selectors = new bytes4[][](2);
|
288
|
-
|
289
|
-
// // authorizaion for pool owner
|
290
|
-
// roles[0] = POOL_OWNER_ROLE();
|
291
|
-
// selectors[0] = _createSelectors(IPoolComponent.setFees.selector);
|
292
|
-
|
293
|
-
// // authorizaion for product service
|
294
|
-
// roles[1] = POLICY_SERVICE_ROLE();
|
295
|
-
// selectors[1] = _createSelectors(IPoolComponent.verifyApplication.selector);
|
296
|
-
|
297
285
|
// register/create component setup
|
298
286
|
(
|
299
287
|
, // instance reader
|
@@ -476,47 +464,14 @@ contract ComponentService is
|
|
476
464
|
|
477
465
|
IComponents.ComponentInfo memory componentInfo = component.getComponentInfo();
|
478
466
|
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
467
|
+
|
479
468
|
instanceStore.createComponent(
|
480
469
|
component.getNftId(),
|
481
470
|
componentInfo);
|
482
471
|
|
472
|
+
// TODO add logging
|
483
473
|
}
|
484
474
|
|
485
|
-
// TODO cleanup
|
486
|
-
// /// @dev registers the component represented by the provided address
|
487
|
-
// function _registerOld(
|
488
|
-
// address componentAddress, // address of component to register
|
489
|
-
// ObjectType requiredType, // required type for component for registration
|
490
|
-
// RoleId requiredRole, // role required for comonent owner for registration
|
491
|
-
// RoleId[] memory roles, // roles with write access to component
|
492
|
-
// bytes4[][] memory selectors // authorized functions per role with write access
|
493
|
-
// )
|
494
|
-
// internal
|
495
|
-
// virtual
|
496
|
-
// returns (
|
497
|
-
// InstanceReader instanceReader,
|
498
|
-
// InstanceStore instanceStore,
|
499
|
-
// NftId componentNftId
|
500
|
-
// )
|
501
|
-
// {
|
502
|
-
// (
|
503
|
-
// instanceReader,
|
504
|
-
// instanceStore,
|
505
|
-
// componentNftId
|
506
|
-
// ) = _register(
|
507
|
-
// componentAddress,
|
508
|
-
// requiredType,
|
509
|
-
// requiredRole);
|
510
|
-
|
511
|
-
// // configure instance authorization
|
512
|
-
// _instanceService.createComponentTarget(
|
513
|
-
// instance.getNftId(),
|
514
|
-
// componentAddress,
|
515
|
-
// component.getName(),
|
516
|
-
// selectors,
|
517
|
-
// roles);
|
518
|
-
// }
|
519
|
-
|
520
475
|
|
521
476
|
/// @dev link the component info corresponding to the componentNftId to the provided productNftId
|
522
477
|
function _linkToProduct(
|
@@ -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,
|
@@ -13,7 +13,6 @@ import {IAuthorization} from "../authorization/IAuthorization.sol";
|
|
13
13
|
import {IComponents} from "../instance/module/IComponents.sol";
|
14
14
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
15
15
|
import {IInstance} from "../instance/IInstance.sol";
|
16
|
-
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
17
16
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
18
17
|
import {IRegistry} from "../registry/IRegistry.sol";
|
19
18
|
import {NftId} from "../type/NftId.sol";
|
@@ -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;
|
@@ -1,15 +1,11 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
|
6
|
-
import {NftId} from "../type/NftId.sol";
|
7
|
-
import {ObjectType, COMPONENT, BUNDLE, POLICY, REQUEST, RISK, CLAIM, PAYOUT} from "../type/ObjectType.sol";
|
8
|
-
import {StateId, ACTIVE, PAUSED, ARCHIVED, CLOSED, APPLIED, COLLATERALIZED, REVOKED, SUBMITTED, CONFIRMED, DECLINED, EXPECTED, PAID, FULFILLED, FAILED, CANCELLED} from "../type/StateId.sol";
|
4
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
5
|
+
import {StateId, zeroStateId} from "../type/StateId.sol";
|
9
6
|
import {ILifecycle} from "./ILifecycle.sol";
|
10
7
|
|
11
|
-
contract Lifecycle is
|
12
|
-
Initializable,
|
8
|
+
abstract contract Lifecycle is
|
13
9
|
ILifecycle
|
14
10
|
{
|
15
11
|
mapping(ObjectType objectType => StateId initialState)
|
@@ -18,16 +14,17 @@ contract Lifecycle is
|
|
18
14
|
mapping(ObjectType objectType => mapping(StateId stateFrom => mapping(StateId stateTo => bool isValid)))
|
19
15
|
private _isValidTransition;
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
{
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
17
|
+
/// @dev child class must implement and CALL setup func at deployment/initializaton time
|
18
|
+
function _setupLifecycle() internal virtual;
|
19
|
+
|
20
|
+
function setInitialState(ObjectType ttype, StateId state) internal virtual {
|
21
|
+
assert(_initialState[ttype] == zeroStateId());
|
22
|
+
_initialState[ttype] = state;
|
23
|
+
}
|
24
|
+
|
25
|
+
function setStateTransition(ObjectType ttype, StateId oldState, StateId newState) internal virtual {
|
26
|
+
assert(_isValidTransition[ttype][oldState][newState] == false);
|
27
|
+
_isValidTransition[ttype][oldState][newState] = true;
|
31
28
|
}
|
32
29
|
|
33
30
|
function hasLifecycle(
|
@@ -59,9 +56,9 @@ contract Lifecycle is
|
|
59
56
|
public
|
60
57
|
view
|
61
58
|
{
|
62
|
-
//
|
59
|
+
// revert if no life cycle support
|
63
60
|
if (_initialState[objectType].eqz()) {
|
64
|
-
|
61
|
+
revert ErrorNoLifecycle(objectType);
|
65
62
|
}
|
66
63
|
|
67
64
|
// enforce valid state transition
|
@@ -77,54 +74,4 @@ contract Lifecycle is
|
|
77
74
|
) public view returns (bool) {
|
78
75
|
return _isValidTransition[objectType][fromId][toId];
|
79
76
|
}
|
80
|
-
|
81
|
-
function _setupComponentLifecycle() internal {
|
82
|
-
_initialState[COMPONENT()] = ACTIVE();
|
83
|
-
_isValidTransition[COMPONENT()][ACTIVE()][PAUSED()] = true;
|
84
|
-
_isValidTransition[COMPONENT()][PAUSED()][ACTIVE()] = true;
|
85
|
-
_isValidTransition[COMPONENT()][PAUSED()][ARCHIVED()] = true;
|
86
|
-
}
|
87
|
-
|
88
|
-
function _setupBundleLifecycle() internal {
|
89
|
-
_initialState[BUNDLE()] = ACTIVE();
|
90
|
-
_isValidTransition[BUNDLE()][ACTIVE()][PAUSED()] = true;
|
91
|
-
_isValidTransition[BUNDLE()][ACTIVE()][CLOSED()] = true;
|
92
|
-
_isValidTransition[BUNDLE()][PAUSED()][ACTIVE()] = true;
|
93
|
-
_isValidTransition[BUNDLE()][PAUSED()][CLOSED()] = true;
|
94
|
-
}
|
95
|
-
|
96
|
-
function _setupPolicyLifecycle() internal {
|
97
|
-
_initialState[POLICY()] = APPLIED();
|
98
|
-
_isValidTransition[POLICY()][APPLIED()][REVOKED()] = true;
|
99
|
-
_isValidTransition[POLICY()][APPLIED()][DECLINED()] = true;
|
100
|
-
_isValidTransition[POLICY()][APPLIED()][COLLATERALIZED()] = true;
|
101
|
-
_isValidTransition[POLICY()][APPLIED()][ACTIVE()] = true;
|
102
|
-
_isValidTransition[POLICY()][COLLATERALIZED()][ACTIVE()] = true;
|
103
|
-
_isValidTransition[POLICY()][ACTIVE()][CLOSED()] = true;
|
104
|
-
}
|
105
|
-
|
106
|
-
function _setupClaimAndPayoutLifecycle() internal {
|
107
|
-
_initialState[CLAIM()] = SUBMITTED();
|
108
|
-
_isValidTransition[CLAIM()][SUBMITTED()][CONFIRMED()] = true;
|
109
|
-
_isValidTransition[CLAIM()][SUBMITTED()][DECLINED()] = true;
|
110
|
-
_isValidTransition[CLAIM()][CONFIRMED()][CLOSED()] = true;
|
111
|
-
|
112
|
-
_initialState[PAYOUT()] = EXPECTED();
|
113
|
-
_isValidTransition[PAYOUT()][EXPECTED()][PAID()] = true;
|
114
|
-
}
|
115
|
-
|
116
|
-
function _setupRiskLifecycle() internal {
|
117
|
-
_initialState[RISK()] = ACTIVE();
|
118
|
-
_isValidTransition[RISK()][ACTIVE()][PAUSED()] = true;
|
119
|
-
_isValidTransition[RISK()][PAUSED()][ACTIVE()] = true;
|
120
|
-
_isValidTransition[RISK()][PAUSED()][ARCHIVED()] = true;
|
121
|
-
}
|
122
|
-
|
123
|
-
function _setupRequestLifecycle() internal {
|
124
|
-
_initialState[REQUEST()] = ACTIVE();
|
125
|
-
_isValidTransition[REQUEST()][ACTIVE()][FULFILLED()] = true;
|
126
|
-
_isValidTransition[REQUEST()][ACTIVE()][FAILED()] = true;
|
127
|
-
_isValidTransition[REQUEST()][FAILED()][FULFILLED()] = true;
|
128
|
-
_isValidTransition[REQUEST()][ACTIVE()][CANCELLED()] = true;
|
129
|
-
}
|
130
77
|
}
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {LibNftIdSet} from "../type/NftIdSet.sol";
|
5
5
|
import {NftId} from "../type/NftId.sol";
|
6
6
|
|
7
|
-
contract
|
7
|
+
contract NftIdSet {
|
8
8
|
|
9
9
|
error ErrorNftIdSetManagerNotOwner(address owner, address sender);
|
10
10
|
error ErrorNftIdSetManagerOwnerAlreadySet(address owner);
|
@@ -5,7 +5,6 @@ import {Amount} from "../type/Amount.sol";
|
|
5
5
|
import {IComponent} from "../shared/IComponent.sol";
|
6
6
|
import {IVersionable} from "../shared/IVersionable.sol";
|
7
7
|
import {NftId} from "../type/NftId.sol";
|
8
|
-
import {NftIdSetManager} from "../shared/NftIdSetManager.sol";
|
9
8
|
import {ObjectType} from "../type/ObjectType.sol";
|
10
9
|
import {Seconds} from "../type/Seconds.sol";
|
11
10
|
import {StakingReader} from "./StakingReader.sol";
|
@@ -44,6 +44,13 @@ interface IStakingService is IService
|
|
44
44
|
error ErrorStakingServiceDipBalanceInsufficient(NftId targetNftId, uint256 amount, uint256 balance);
|
45
45
|
error ErrorStakingServiceDipAllowanceInsufficient(NftId targetNftId, address tokenHandler, uint256 amount, uint256 allowance);
|
46
46
|
|
47
|
+
/// @dev Set the protocol reward rate stake locking period to the specified duration.
|
48
|
+
/// Permissioned: only staking owner
|
49
|
+
// TODO implement
|
50
|
+
// function setProtocolRewardRate(UFixed rewardRate) external;
|
51
|
+
// function setProtocolLockingPeriod(Seconds lockingPeriod) external;
|
52
|
+
// TODO also make sure that protocol rewards can be refilled and withdrawn
|
53
|
+
|
47
54
|
/// @dev creates/registers an on-chain instance staking target.
|
48
55
|
/// function granted to instance service
|
49
56
|
function createInstanceTarget(
|
@@ -53,11 +60,11 @@ interface IStakingService is IService
|
|
53
60
|
) external;
|
54
61
|
|
55
62
|
/// @dev Set the instance stake locking period to the specified duration.
|
56
|
-
///
|
63
|
+
/// Permissioned: Only owner of the specified target.
|
57
64
|
function setInstanceLockingPeriod(NftId instanceNftId, Seconds lockingPeriod) external;
|
58
65
|
|
59
|
-
/// @dev Set the instance reward rate to the specified value
|
60
|
-
///
|
66
|
+
/// @dev Set the instance reward rate to the specified value.
|
67
|
+
/// Permissioned: Only owner of the specified target.
|
61
68
|
function setInstanceRewardRate(NftId instanceNftId, UFixed rewardRate) external;
|
62
69
|
|
63
70
|
/// @dev (Re)fills the staking reward reserves for the specified target using the dips provided by the reward provider.
|
@@ -68,8 +75,8 @@ interface IStakingService is IService
|
|
68
75
|
/// unpermissioned: anybody may fill up staking reward reserves
|
69
76
|
function refillRewardReservesBySender(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
70
77
|
|
71
|
-
/// @dev
|
72
|
-
///
|
78
|
+
/// @dev Defunds the staking reward reserves for the specified target
|
79
|
+
/// Permissioned: only the target owner may call this function
|
73
80
|
function withdrawInstanceRewardReserves(NftId instanceNftId, Amount dipAmount) external returns (Amount newBalance);
|
74
81
|
|
75
82
|
/// @dev create a new stake with amount DIP to the specified target
|
@@ -9,9 +9,7 @@ import {IRegistryService} from "../registry/IRegistryService.sol";
|
|
9
9
|
import {IStaking} from "./IStaking.sol";
|
10
10
|
import {IVersionable} from "../shared/IVersionable.sol";
|
11
11
|
import {Key32} from "../type/Key32.sol";
|
12
|
-
import {LibNftIdSet} from "../type/NftIdSet.sol";
|
13
12
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
14
|
-
import {NftIdSetManager} from "../shared/NftIdSetManager.sol";
|
15
13
|
import {ObjectType, INSTANCE, PROTOCOL, STAKE, STAKING, TARGET} from "../type/ObjectType.sol";
|
16
14
|
import {Seconds, SecondsLib} from "../type/Seconds.sol";
|
17
15
|
import {StakeManagerLib} from "./StakeManagerLib.sol";
|
@@ -54,7 +52,7 @@ contract Staking is
|
|
54
52
|
|
55
53
|
|
56
54
|
modifier onlyTarget(NftId targetNftId) {
|
57
|
-
if (!_getStakingStorage()._store.
|
55
|
+
if (!_getStakingStorage()._store.getTargetNftIdSet().exists(targetNftId)) {
|
58
56
|
revert ErrorStakingNotTarget(targetNftId);
|
59
57
|
}
|
60
58
|
_;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {TARGET, COMPONENT, STAKE} from "../type/ObjectType.sol";
|
5
|
+
import {INITIAL} from "../type/StateId.sol";
|
6
|
+
import {Lifecycle} from "../shared/Lifecycle.sol";
|
7
|
+
|
8
|
+
contract StakingLifecycle is
|
9
|
+
Lifecycle
|
10
|
+
{
|
11
|
+
constructor() {
|
12
|
+
_setupLifecycle();
|
13
|
+
}
|
14
|
+
|
15
|
+
function _setupLifecycle()
|
16
|
+
internal
|
17
|
+
override
|
18
|
+
{
|
19
|
+
setInitialState(TARGET(), INITIAL());
|
20
|
+
setInitialState(COMPONENT(), INITIAL());
|
21
|
+
setInitialState(STAKE(), INITIAL());
|
22
|
+
}
|
23
|
+
}
|
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IVersionable} from "../shared/IVersionable.sol";
|
5
5
|
import {ProxyManager} from "../shared/ProxyManager.sol";
|
6
|
-
import {ReleaseManager} from "../registry/ReleaseManager.sol";
|
7
6
|
import {Staking} from "./Staking.sol";
|
8
7
|
import {StakingReader} from "./StakingReader.sol";
|
9
8
|
import {StakingStore} from "./StakingStore.sol";
|
@@ -11,7 +11,6 @@ import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
|
11
11
|
import {IStaking} from "../staking/IStaking.sol";
|
12
12
|
import {IVersionable} from "../shared/IVersionable.sol";
|
13
13
|
import {NftId} from "../type/NftId.sol";
|
14
|
-
import {NftIdSetManager} from "../shared/NftIdSetManager.sol";
|
15
14
|
import {ObjectType, STAKE, TARGET} from "../type/ObjectType.sol";
|
16
15
|
import {Seconds} from "../type/Seconds.sol";
|
17
16
|
import {StakingStore} from "./StakingStore.sol";
|
@@ -60,32 +59,32 @@ contract StakingReader is
|
|
60
59
|
|
61
60
|
|
62
61
|
function isTarget(NftId targetNftId) external view returns (bool) {
|
63
|
-
return _store.
|
62
|
+
return _store.getTargetNftIdSet().exists(targetNftId);
|
64
63
|
}
|
65
64
|
|
66
65
|
|
67
66
|
function targets() external view returns (uint256) {
|
68
|
-
return _store.
|
67
|
+
return _store.getTargetNftIdSet().nftIds();
|
69
68
|
}
|
70
69
|
|
71
70
|
|
72
71
|
function getTargetNftId(uint256 idx) external view returns (NftId) {
|
73
|
-
return _store.
|
72
|
+
return _store.getTargetNftIdSet().getNftId(idx);
|
74
73
|
}
|
75
74
|
|
76
75
|
|
77
76
|
function isActive(NftId targetNftId) external view returns (bool) {
|
78
|
-
return _store.
|
77
|
+
return _store.getTargetNftIdSet().isActive(targetNftId);
|
79
78
|
}
|
80
79
|
|
81
80
|
|
82
81
|
function activeTargets() external view returns (uint256) {
|
83
|
-
return _store.
|
82
|
+
return _store.getTargetNftIdSet().activeNftIds();
|
84
83
|
}
|
85
84
|
|
86
85
|
|
87
86
|
function getActiveTargetNftId(uint256 idx) external view returns (NftId) {
|
88
|
-
return _store.
|
87
|
+
return _store.getTargetNftIdSet().getActiveNftId(idx);
|
89
88
|
}
|
90
89
|
|
91
90
|
|
@@ -14,9 +14,8 @@ import {IVersionable} from "../shared/IVersionable.sol";
|
|
14
14
|
import {Key32} from "../type/Key32.sol";
|
15
15
|
import {KeyValueStore} from "../shared/KeyValueStore.sol";
|
16
16
|
import {KEEP_STATE} from "../type/StateId.sol";
|
17
|
-
import {LibNftIdSet} from "../type/NftIdSet.sol";
|
18
17
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
19
|
-
import {
|
18
|
+
import {NftIdSet} from "../shared/NftIdSet.sol";
|
20
19
|
import {ObjectType, INSTANCE, PROTOCOL, STAKE, STAKING, TARGET} from "../type/ObjectType.sol";
|
21
20
|
import {Seconds, SecondsLib} from "../type/Seconds.sol";
|
22
21
|
import {StakingReader} from "./StakingReader.sol";
|
@@ -28,11 +27,13 @@ import {Version, VersionLib} from "../type/Version.sol";
|
|
28
27
|
import {Versionable} from "../shared/Versionable.sol";
|
29
28
|
|
30
29
|
import {RegistryAdmin} from "../registry/RegistryAdmin.sol";
|
30
|
+
import {StakingLifecycle} from "./StakingLifecycle.sol";
|
31
31
|
|
32
32
|
|
33
33
|
contract StakingStore is
|
34
34
|
AccessManaged,
|
35
|
-
KeyValueStore
|
35
|
+
KeyValueStore,
|
36
|
+
StakingLifecycle
|
36
37
|
{
|
37
38
|
|
38
39
|
event LogStakingStoreReserveBalanceIncreased(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdatedIn);
|
@@ -61,7 +62,7 @@ contract StakingStore is
|
|
61
62
|
error ErrorStakingStoreTvlBalanceNotInitialized(NftId nftId);
|
62
63
|
|
63
64
|
IRegistry private _registry;
|
64
|
-
|
65
|
+
NftIdSet private _targetNftIdSet;
|
65
66
|
StakingReader private _reader;
|
66
67
|
|
67
68
|
// staking rate
|
@@ -91,7 +92,7 @@ contract StakingStore is
|
|
91
92
|
// set internal variables
|
92
93
|
_registry = registry; //TODO if keeps registry -> RegistryLinked and checks registry address
|
93
94
|
_reader = reader;
|
94
|
-
|
95
|
+
_targetNftIdSet = new NftIdSet();
|
95
96
|
|
96
97
|
// register protocol target
|
97
98
|
_createTarget(
|
@@ -426,8 +427,9 @@ contract StakingStore is
|
|
426
427
|
return _reader;
|
427
428
|
}
|
428
429
|
|
429
|
-
|
430
|
-
|
430
|
+
// TODO rename
|
431
|
+
function getTargetNftIdSet() external view returns (NftIdSet targetNftIdSet){
|
432
|
+
return _targetNftIdSet;
|
431
433
|
}
|
432
434
|
|
433
435
|
function getStakingRate(uint256 chainId, address token) external view returns (UFixed stakingRate) { return _stakingRate[chainId][token]; }
|
@@ -491,7 +493,7 @@ contract StakingStore is
|
|
491
493
|
_tvlLastUpdatedIn[targetNftId]= BlocknumberLib.currentBlocknumber();
|
492
494
|
_createTargetBalance(targetNftId);
|
493
495
|
|
494
|
-
|
496
|
+
_targetNftIdSet.add(targetNftId);
|
495
497
|
}
|
496
498
|
|
497
499
|
function _updateReserves(
|
@@ -27,20 +27,16 @@ function STAKING() pure returns (ObjectType) {
|
|
27
27
|
return ObjectType.wrap(3);
|
28
28
|
}
|
29
29
|
|
30
|
-
function TOKEN() pure returns (ObjectType) {
|
31
|
-
return ObjectType.wrap(6);
|
32
|
-
}
|
33
|
-
|
34
30
|
function RELEASE() pure returns (ObjectType) {
|
35
|
-
return ObjectType.wrap(
|
31
|
+
return ObjectType.wrap(6);
|
36
32
|
}
|
37
33
|
|
38
34
|
function ROLE() pure returns (ObjectType) {
|
39
|
-
return ObjectType.wrap(
|
35
|
+
return ObjectType.wrap(7);
|
40
36
|
}
|
41
37
|
|
42
38
|
function SERVICE() pure returns (ObjectType) {
|
43
|
-
return ObjectType.wrap(
|
39
|
+
return ObjectType.wrap(8);
|
44
40
|
}
|
45
41
|
|
46
42
|
function INSTANCE() pure returns (ObjectType) {
|
@@ -19,6 +19,16 @@ using {
|
|
19
19
|
|
20
20
|
// general pure free functions
|
21
21
|
|
22
|
+
// @dev Returns true iff role ids a and b are identical
|
23
|
+
function eqRoleId(RoleId a, RoleId b) pure returns (bool isSame) {
|
24
|
+
return RoleId.unwrap(a) == RoleId.unwrap(b);
|
25
|
+
}
|
26
|
+
|
27
|
+
// @dev Returns true iff role ids a and b are different
|
28
|
+
function neRoleId(RoleId a, RoleId b) pure returns (bool isDifferent) {
|
29
|
+
return RoleId.unwrap(a) != RoleId.unwrap(b);
|
30
|
+
}
|
31
|
+
|
22
32
|
//--- OpenZeppelin provided roles -------------------------------------------//
|
23
33
|
|
24
34
|
/// @dev Role ID needs to match with oz AccessManager.ADMIN_ROLE
|
@@ -90,44 +100,6 @@ function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(14)
|
|
90
100
|
|
91
101
|
function CUSTOM_ROLE_MIN() pure returns (RoleId) { return RoleIdLib.toRoleId(1000000); }
|
92
102
|
|
93
|
-
// TODO cleanup
|
94
|
-
/// @dev role associated with the staking contract
|
95
|
-
// function REGISTRY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1800); }
|
96
|
-
// /// @dev instance specific role for instance service
|
97
|
-
// function INSTANCE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2000); }
|
98
|
-
// /// @dev role for registering gif components
|
99
|
-
// function COMPONENT_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2001); }
|
100
|
-
// /// @dev instance specific role for distribution service
|
101
|
-
// function DISTRIBUTION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2100); }
|
102
|
-
// /// @dev instance specific role for oracle service
|
103
|
-
// function ORACLE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2150); }
|
104
|
-
// /// @dev instance specific role for pool service
|
105
|
-
// function POOL_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2200); }
|
106
|
-
// /// @dev instance specific role for product service
|
107
|
-
// function PRODUCT_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2300); }
|
108
|
-
// /// @dev instance specific role for application service
|
109
|
-
// function APPLICATION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2400); }
|
110
|
-
// /// @dev instance specific role for policy service
|
111
|
-
// function POLICY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2410); }
|
112
|
-
// /// @dev instance specific role for claim service
|
113
|
-
// function CLAIM_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2420); }
|
114
|
-
// /// @dev instance specific role for bundle service
|
115
|
-
// function BUNDLE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2500); }
|
116
|
-
// /// @dev instance specific role for pricing service
|
117
|
-
// function PRICING_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2800); }
|
118
|
-
// /// @dev instance specific role for staking service
|
119
|
-
|
120
|
-
// function STAKING_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2900);
|
121
|
-
// @dev Returns true iff role ids a and b are identical
|
122
|
-
function eqRoleId(RoleId a, RoleId b) pure returns (bool isSame) {
|
123
|
-
return RoleId.unwrap(a) == RoleId.unwrap(b);
|
124
|
-
}
|
125
|
-
|
126
|
-
// @dev Returns true iff role ids a and b are different
|
127
|
-
function neRoleId(RoleId a, RoleId b) pure returns (bool isDifferent) {
|
128
|
-
return RoleId.unwrap(a) != RoleId.unwrap(b);
|
129
|
-
}
|
130
|
-
|
131
103
|
library RoleIdLib {
|
132
104
|
|
133
105
|
uint64 public constant ALL_VERSIONS = 99;
|
@@ -7,6 +7,7 @@ using {
|
|
7
7
|
versionPartGt as >,
|
8
8
|
versionPartEq as ==,
|
9
9
|
versionPartNe as !=,
|
10
|
+
VersionPartLib.eqz,
|
10
11
|
VersionPartLib.toInt
|
11
12
|
}
|
12
13
|
for VersionPart global;
|
@@ -16,7 +17,8 @@ function versionPartEq(VersionPart a, VersionPart b) pure returns(bool isSame) {
|
|
16
17
|
function versionPartNe(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) != VersionPart.unwrap(b); }
|
17
18
|
|
18
19
|
library VersionPartLib {
|
19
|
-
function
|
20
|
+
function eqz(VersionPart a) external pure returns(bool) { return VersionPart.unwrap(a) == 0; }
|
21
|
+
function toInt(VersionPart a) external pure returns(uint256) { return VersionPart.unwrap(a); }
|
20
22
|
function toVersionPart(uint256 a) external pure returns(VersionPart) { return VersionPart.wrap(uint8(a)); }
|
21
23
|
}
|
22
24
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@etherisc/gif-next",
|
3
|
-
"version": "0.0.2-
|
3
|
+
"version": "0.0.2-e8ea17d-715",
|
4
4
|
"description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -43,8 +43,8 @@
|
|
43
43
|
"typescript": "^5"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@openzeppelin/contracts": "5.0.
|
47
|
-
"@openzeppelin/contracts-upgradeable": "5.0.
|
46
|
+
"@openzeppelin/contracts": "5.0.2",
|
47
|
+
"@openzeppelin/contracts-upgradeable": "5.0.2",
|
48
48
|
"@openzeppelin/upgrades-core": "^1.34.1",
|
49
49
|
"abi-coder": "^5.0.0",
|
50
50
|
"antlr4ng": "^3.0.4",
|