@etherisc/gif-next 0.0.2-7f39e38-904 → 0.0.2-804cdbf-724
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 +32 -3
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1253 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +358 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1032 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +258 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +290 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +390 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1505 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +410 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +36 -255
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +147 -96
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +86 -59
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +82 -151
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +52 -17
- 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 +77 -78
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +149 -52
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +91 -132
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1626 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +601 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +230 -65
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +216 -119
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +70 -51
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +260 -137
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1155 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +418 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +772 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1063 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1477 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +410 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +102 -59
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +74 -43
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +20 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +18 -207
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +35 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +25 -315
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +84 -42
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +63 -40
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +79 -36
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +68 -37
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1299 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +410 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +119 -68
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +88 -53
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +20 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +20 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +20 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +20 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +24 -47
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +20 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +97 -46
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +77 -42
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +105 -62
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +81 -50
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +31 -165
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +61 -26
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +59 -32
- 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 +86 -74
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -184
- 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 +255 -112
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1746 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +69 -15
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +51 -35
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1159 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +214 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +19 -11
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +18 -12
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +96 -70
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +73 -54
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +20 -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/IComponent.sol/IComponent.json +11 -5
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +27 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +24 -5
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -15
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +7 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +7 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +20 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +31 -65
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -99
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +13 -7
- 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 +35 -16
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +14 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +20 -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/IStaking.sol/IStaking.json +121 -118
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +222 -71
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +102 -44
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +186 -183
- 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 +71 -58
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +263 -39
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +271 -135
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +67 -47
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +734 -187
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +95 -18
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +68 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +12 -12
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +28 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +26 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +21 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
- package/contracts/authorization/AccessAdmin.sol +591 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/authorization/IAccessAdmin.sol +136 -0
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/authorization/IServiceAuthorization.sol +38 -0
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +90 -0
- package/contracts/distribution/BasicDistribution.sol +149 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +43 -0
- package/contracts/distribution/Distribution.sol +126 -106
- package/contracts/distribution/DistributionService.sol +13 -9
- package/contracts/distribution/DistributionServiceManager.sol +0 -12
- package/contracts/distribution/IDistributionComponent.sol +17 -35
- package/contracts/distribution/IDistributionService.sol +5 -1
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +25 -16
- package/contracts/instance/IInstanceService.sol +36 -27
- package/contracts/instance/Instance.sol +113 -87
- package/contracts/instance/InstanceAdmin.sol +266 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +52 -13
- package/contracts/instance/InstanceService.sol +175 -99
- package/contracts/instance/InstanceStore.sol +38 -22
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +11 -14
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +157 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +26 -26
- package/contracts/pool/IPoolComponent.sol +0 -60
- package/contracts/pool/IPoolService.sol +3 -0
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +38 -11
- package/contracts/product/ApplicationService.sol +5 -5
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +11 -6
- package/contracts/product/IClaimService.sol +6 -0
- package/contracts/product/IProductComponent.sol +6 -9
- package/contracts/product/PolicyService.sol +8 -6
- package/contracts/product/PricingService.sol +7 -8
- package/contracts/product/Product.sol +103 -88
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/ChainNft.sol +1 -0
- package/contracts/registry/IRegistry.sol +33 -24
- package/contracts/registry/IRegistryService.sol +7 -6
- package/contracts/registry/Registry.sol +146 -148
- package/contracts/registry/RegistryAdmin.sol +365 -0
- package/contracts/registry/RegistryService.sol +8 -8
- package/contracts/registry/RegistryServiceManager.sol +0 -19
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseRegistry.sol +487 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +22 -61
- package/contracts/shared/Component.sol +8 -13
- package/contracts/shared/ComponentService.sol +50 -64
- package/contracts/shared/ComponentVerifyingService.sol +13 -7
- package/contracts/shared/IComponent.sol +3 -7
- package/contracts/shared/IComponentService.sol +11 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +4 -0
- package/contracts/shared/IKeyValueStore.sol +2 -1
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/INftOwnable.sol +1 -1
- package/contracts/shared/IService.sol +7 -0
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +26 -20
- package/contracts/shared/KeyValueStore.sol +7 -6
- package/contracts/shared/Lifecycle.sol +16 -60
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/shared/NftOwnable.sol +2 -13
- package/contracts/shared/PolicyHolder.sol +2 -1
- package/contracts/shared/ProxyManager.sol +6 -3
- package/contracts/shared/Service.sol +27 -21
- package/contracts/shared/UpgradableProxyWithAdmin.sol +1 -3
- package/contracts/staking/IStaking.sol +40 -25
- package/contracts/staking/IStakingService.sol +42 -44
- package/contracts/staking/StakeManagerLib.sol +101 -26
- package/contracts/staking/Staking.sol +136 -127
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +10 -22
- package/contracts/staking/StakingReader.sol +75 -36
- package/contracts/staking/StakingService.sol +124 -88
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/staking/StakingStore.sol +401 -115
- package/contracts/staking/TargetManagerLib.sol +28 -0
- package/contracts/type/Amount.sol +15 -1
- package/contracts/type/NftId.sol +8 -8
- package/contracts/type/ObjectType.sol +171 -69
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RoleId.sol +103 -72
- package/contracts/type/Seconds.sol +10 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +12 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +6 -2
- package/contracts/type/UFixed.sol +6 -0
- package/contracts/type/Version.sol +3 -1
- package/package.json +8 -5
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -132
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -322
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1151
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingManager.sol/IStakingManager.json +0 -37
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.dbg.json +0 -4
- package/artifacts/contracts/staking/IStakingStore.sol/IStakingStore.json +0 -357
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -336
- package/contracts/registry/RegistryAccessManager.sol +0 -196
- package/contracts/registry/ReleaseManager.sol +0 -563
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- package/contracts/staking/IStakingManager.sol +0 -15
- package/contracts/staking/IStakingStore.sol +0 -130
@@ -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";
|
@@ -27,12 +26,22 @@ import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
|
27
26
|
import {Version, VersionLib} from "../type/Version.sol";
|
28
27
|
import {Versionable} from "../shared/Versionable.sol";
|
29
28
|
|
29
|
+
import {RegistryAdmin} from "../registry/RegistryAdmin.sol";
|
30
|
+
import {StakingLifecycle} from "./StakingLifecycle.sol";
|
31
|
+
|
30
32
|
|
31
33
|
contract StakingStore is
|
32
34
|
AccessManaged,
|
33
|
-
KeyValueStore
|
35
|
+
KeyValueStore,
|
36
|
+
StakingLifecycle
|
34
37
|
{
|
35
38
|
|
39
|
+
event LogStakingStoreReserveBalanceIncreased(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdatedIn);
|
40
|
+
event LogStakingStoreReserveBalanceDecreased(NftId targetNftId, Amount dipAmount, Amount reserveBalance, Blocknumber lastUpdatedIn);
|
41
|
+
|
42
|
+
event LogStakingStoreTotalValueLockedIncreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdatedIn);
|
43
|
+
event LogStakingStoreTotalValueLockedDecreased(NftId targetNftId, address token, Amount amount, Amount newBalance, Blocknumber lastUpdatedIn);
|
44
|
+
|
36
45
|
event LogStakingStoreStakesIncreased(NftId nftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn);
|
37
46
|
event LogStakingStoreStakesDecreased(NftId nftId, Amount addedAmount, Amount newBalance, Blocknumber lastUpdatedIn);
|
38
47
|
|
@@ -41,50 +50,84 @@ contract StakingStore is
|
|
41
50
|
|
42
51
|
event LogStakingStoreRewardsRestaked(NftId nftId, Amount amount, Amount rewardAmount, Amount rewardIncrementAmount, Amount newBalance, Blocknumber lastUpdatedIn);
|
43
52
|
|
53
|
+
// in/decreasing reward reserves
|
54
|
+
error ErrorStakingStoreNotTarget(NftId targetNftId);
|
55
|
+
error ErrorStakingStoreRewardReservesInsufficient(NftId targetNftId, Amount dipAmount, Amount reservesBalanceAmount);
|
56
|
+
|
44
57
|
// creating and updating of balance
|
45
58
|
error ErrorStakingStoreBalanceAlreadyInitialized(NftId nftId);
|
46
59
|
error ErrorStakingStoreBalanceNotInitialized(NftId nftId);
|
47
60
|
|
48
61
|
// update balance
|
62
|
+
error ErrorStakingStoreTvlBalanceNotInitialized(NftId nftId);
|
49
63
|
|
50
64
|
IRegistry private _registry;
|
51
|
-
|
65
|
+
NftIdSet private _targetNftIdSet;
|
52
66
|
StakingReader private _reader;
|
53
67
|
|
68
|
+
// staking rate
|
69
|
+
mapping(uint256 chainId => mapping(address token => UFixed stakingRate)) private _stakingRate;
|
70
|
+
|
71
|
+
// total, stake and reward balances
|
54
72
|
mapping(NftId nftId => Amount stakes) private _stakeBalance;
|
55
73
|
mapping(NftId nftId => Amount rewards) private _rewardBalance;
|
74
|
+
mapping(NftId nftId => Amount reserves) private _reserveBalance;
|
56
75
|
|
57
|
-
// TODO check if this is made redundant by *Info struct updates
|
58
76
|
mapping(NftId nftId => Timestamp lastUpdatedAt) private _lastUpdatedAt;
|
59
77
|
mapping(NftId nftId => Blocknumber lastUpdatedIn) private _lastUpdatedIn;
|
60
78
|
|
79
|
+
// total value locked balance
|
80
|
+
mapping(NftId nftId => mapping(address token => Amount tvl)) private _tvlBalance;
|
81
|
+
mapping(NftId nftId => mapping(address token => Amount tvlInDip)) private _tvlInDip;
|
82
|
+
mapping(NftId nftId => Amount tvlRequiredDip) private _tvlRequiredDip;
|
83
|
+
mapping(NftId nftId => Blocknumber lastUpdatedIn) private _tvlLastUpdatedIn;
|
61
84
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
)
|
66
|
-
AccessManaged(initialAuthority)
|
85
|
+
|
86
|
+
constructor(IRegistry registry, StakingReader reader)
|
87
|
+
AccessManaged(msg.sender)
|
67
88
|
{
|
68
|
-
|
69
|
-
|
70
|
-
|
89
|
+
// set final authority
|
90
|
+
setAuthority(registry.getAuthority());
|
91
|
+
|
92
|
+
// set internal variables
|
93
|
+
_registry = registry; //TODO if keeps registry -> RegistryLinked and checks registry address
|
94
|
+
_reader = reader;
|
95
|
+
_targetNftIdSet = new NftIdSet();
|
96
|
+
|
97
|
+
// register protocol target
|
98
|
+
_createTarget(
|
99
|
+
NftIdLib.toNftId(1101),
|
100
|
+
IStaking.TargetInfo({
|
101
|
+
objectType: PROTOCOL(),
|
102
|
+
chainId: 1,
|
103
|
+
lockingPeriod: TargetManagerLib.getDefaultLockingPeriod(),
|
104
|
+
rewardRate: TargetManagerLib.getDefaultRewardRate()}));
|
71
105
|
}
|
72
106
|
|
73
107
|
|
74
|
-
//---
|
108
|
+
//--- staking rate specific functions -----------------------------------//
|
109
|
+
|
110
|
+
function setStakingRate(
|
111
|
+
uint256 chainId,
|
112
|
+
address token,
|
113
|
+
UFixed stakingRate
|
114
|
+
)
|
115
|
+
external
|
116
|
+
restricted()
|
117
|
+
{
|
118
|
+
_stakingRate[chainId][token] = stakingRate;
|
119
|
+
}
|
120
|
+
|
121
|
+
//--- target specific functions -----------------------------------------//
|
75
122
|
|
76
123
|
function createTarget(
|
77
124
|
NftId targetNftId,
|
78
125
|
IStaking.TargetInfo memory targetInfo
|
79
126
|
)
|
80
127
|
external
|
128
|
+
restricted()
|
81
129
|
{
|
82
|
-
|
83
|
-
targetNftId.toKey32(TARGET()),
|
84
|
-
abi.encode(targetInfo));
|
85
|
-
|
86
|
-
_createBalance(targetNftId, AmountLib.zero());
|
87
|
-
_targetManager.add(targetNftId);
|
130
|
+
_createTarget(targetNftId, targetInfo);
|
88
131
|
}
|
89
132
|
|
90
133
|
|
@@ -93,26 +136,134 @@ contract StakingStore is
|
|
93
136
|
IStaking.TargetInfo memory targetInfo
|
94
137
|
)
|
95
138
|
external
|
139
|
+
restricted()
|
96
140
|
{
|
97
141
|
_update(
|
98
142
|
targetNftId.toKey32(TARGET()),
|
99
143
|
abi.encode(targetInfo), KEEP_STATE());
|
100
144
|
}
|
101
145
|
|
146
|
+
|
147
|
+
function increaseReserves(
|
148
|
+
NftId targetNftId,
|
149
|
+
Amount dipAmount
|
150
|
+
)
|
151
|
+
external
|
152
|
+
restricted()
|
153
|
+
returns (Amount newReserveBalance)
|
154
|
+
{
|
155
|
+
newReserveBalance = _reserveBalance[targetNftId] + dipAmount;
|
156
|
+
Blocknumber lastUpdatedIn = _updateReserves(targetNftId, newReserveBalance);
|
157
|
+
|
158
|
+
emit LogStakingStoreReserveBalanceIncreased(targetNftId, dipAmount, newReserveBalance, lastUpdatedIn);
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
function decreaseReserves(
|
163
|
+
NftId targetNftId,
|
164
|
+
Amount dipAmount
|
165
|
+
)
|
166
|
+
external
|
167
|
+
restricted()
|
168
|
+
returns (Amount newReserveBalance)
|
169
|
+
{
|
170
|
+
Amount reserveAmount = _reserveBalance[targetNftId];
|
171
|
+
if (dipAmount > reserveAmount) {
|
172
|
+
revert ErrorStakingStoreRewardReservesInsufficient(
|
173
|
+
targetNftId,
|
174
|
+
dipAmount,
|
175
|
+
reserveAmount);
|
176
|
+
}
|
177
|
+
|
178
|
+
newReserveBalance = _reserveBalance[targetNftId] - dipAmount;
|
179
|
+
Blocknumber lastUpdatedIn = _updateReserves(targetNftId, newReserveBalance);
|
180
|
+
|
181
|
+
emit LogStakingStoreReserveBalanceDecreased(targetNftId, dipAmount, newReserveBalance, lastUpdatedIn);
|
182
|
+
}
|
183
|
+
|
184
|
+
|
185
|
+
//--- tvl specific functions -------------------------------------//
|
186
|
+
|
187
|
+
function increaseTotalValueLocked(
|
188
|
+
NftId targetNftId,
|
189
|
+
UFixed stakingRate,
|
190
|
+
address token,
|
191
|
+
Amount amount
|
192
|
+
)
|
193
|
+
external
|
194
|
+
restricted()
|
195
|
+
returns (Amount newBalance)
|
196
|
+
{
|
197
|
+
(
|
198
|
+
Blocknumber tvlLastUpdatedIn,
|
199
|
+
Amount oldBalance,
|
200
|
+
Amount oldDipBalance
|
201
|
+
) = _getAndVerifyTvl(targetNftId, token);
|
202
|
+
|
203
|
+
newBalance = oldBalance + amount;
|
204
|
+
Amount newDipBalance = newBalance.multiplyWith(stakingRate);
|
205
|
+
|
206
|
+
// update new tvl balances
|
207
|
+
_tvlBalance[targetNftId][token] = newBalance;
|
208
|
+
_tvlInDip[targetNftId][token] = newDipBalance;
|
209
|
+
|
210
|
+
// update new amount of required dip
|
211
|
+
_tvlRequiredDip[targetNftId] = _tvlRequiredDip[targetNftId] - oldDipBalance + newDipBalance;
|
212
|
+
|
213
|
+
// update last updated in
|
214
|
+
_tvlLastUpdatedIn[targetNftId] = BlocknumberLib.currentBlocknumber();
|
215
|
+
|
216
|
+
emit LogStakingStoreTotalValueLockedIncreased(targetNftId, token, amount, newBalance, tvlLastUpdatedIn);
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
function decreaseTotalValueLocked(
|
221
|
+
NftId targetNftId,
|
222
|
+
UFixed stakingRate,
|
223
|
+
address token,
|
224
|
+
Amount amount
|
225
|
+
)
|
226
|
+
external
|
227
|
+
restricted()
|
228
|
+
returns (Amount newBalance)
|
229
|
+
{
|
230
|
+
(
|
231
|
+
Blocknumber tvlLastUpdatedIn,
|
232
|
+
Amount oldBalance,
|
233
|
+
Amount oldDipBalance
|
234
|
+
) = _getAndVerifyTvl(targetNftId, token);
|
235
|
+
|
236
|
+
newBalance = oldBalance - amount;
|
237
|
+
Amount newDipBalance = AmountLib.toAmount((
|
238
|
+
stakingRate * newBalance.toUFixed()).toInt());
|
239
|
+
|
240
|
+
// update new tvl balances
|
241
|
+
_tvlBalance[targetNftId][token] = newBalance;
|
242
|
+
_tvlInDip[targetNftId][token] = newDipBalance;
|
243
|
+
|
244
|
+
// update new amount of required dip
|
245
|
+
_tvlRequiredDip[targetNftId] = _tvlRequiredDip[targetNftId] - oldDipBalance + newDipBalance;
|
246
|
+
|
247
|
+
// update last updated in
|
248
|
+
_tvlLastUpdatedIn[targetNftId] = BlocknumberLib.currentBlocknumber();
|
249
|
+
|
250
|
+
emit LogStakingStoreTotalValueLockedDecreased(targetNftId, token, amount, newBalance, tvlLastUpdatedIn);
|
251
|
+
}
|
252
|
+
|
102
253
|
//--- stake specific functions -------------------------------------//
|
103
254
|
|
104
255
|
function create(
|
105
256
|
NftId stakeNftId,
|
106
|
-
IStaking.StakeInfo memory stakeInfo
|
107
|
-
Amount stakeAmount
|
257
|
+
IStaking.StakeInfo memory stakeInfo
|
108
258
|
)
|
109
259
|
external
|
260
|
+
restricted()
|
110
261
|
{
|
111
262
|
_create(
|
112
263
|
stakeNftId.toKey32(STAKE()),
|
113
264
|
abi.encode(stakeInfo));
|
114
265
|
|
115
|
-
|
266
|
+
_createStakeBalance(stakeNftId);
|
116
267
|
}
|
117
268
|
|
118
269
|
function update(
|
@@ -120,6 +271,7 @@ contract StakingStore is
|
|
120
271
|
IStaking.StakeInfo memory stakeInfo
|
121
272
|
)
|
122
273
|
external
|
274
|
+
restricted()
|
123
275
|
{
|
124
276
|
_update(
|
125
277
|
stakeNftId.toKey32(STAKE()),
|
@@ -130,57 +282,52 @@ contract StakingStore is
|
|
130
282
|
//--- general functions --------------------------------------------//
|
131
283
|
|
132
284
|
|
133
|
-
function
|
285
|
+
function increaseStake(
|
286
|
+
NftId nftId,
|
287
|
+
NftId targetNftId,
|
288
|
+
Amount amount
|
289
|
+
)
|
134
290
|
external
|
291
|
+
restricted()
|
135
292
|
{
|
136
|
-
Blocknumber lastUpdatedIn =
|
137
|
-
bool updated = false;
|
138
|
-
|
139
|
-
if (lastUpdatedIn.eqz()) {
|
140
|
-
revert ErrorStakingStoreBalanceNotInitialized(nftId);
|
141
|
-
}
|
293
|
+
Blocknumber lastUpdatedIn = _checkBalanceExists(nftId);
|
142
294
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
emit LogStakingStoreStakesIncreased(nftId, amount, _stakeBalance[nftId], lastUpdatedIn);
|
148
|
-
}
|
295
|
+
_updateStakeBalance(
|
296
|
+
nftId,
|
297
|
+
_stakeBalance[nftId] + amount, // new stake balance
|
298
|
+
_rewardBalance[nftId]); // unchanged reward balance
|
149
299
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
_rewardBalance[
|
154
|
-
emit LogStakingStoreRewardsIncreased(nftId, rewardIncrementAmount, _rewardBalance[nftId], lastUpdatedIn);
|
155
|
-
}
|
300
|
+
_updateTargetBalance(
|
301
|
+
targetNftId,
|
302
|
+
_stakeBalance[targetNftId] + amount,
|
303
|
+
_rewardBalance[targetNftId]);
|
156
304
|
|
157
|
-
|
158
|
-
_lastUpdatedAt[nftId] = TimestampLib.blockTimestamp();
|
159
|
-
_lastUpdatedIn[nftId] = BlocknumberLib.currentBlocknumber();
|
160
|
-
}
|
305
|
+
emit LogStakingStoreStakesIncreased(nftId, amount, _stakeBalance[nftId], lastUpdatedIn);
|
161
306
|
}
|
162
307
|
|
163
308
|
|
164
309
|
function restakeRewards(
|
165
310
|
NftId nftId,
|
311
|
+
NftId targetNftId,
|
166
312
|
Amount rewardIncrementAmount
|
167
313
|
)
|
168
314
|
external
|
315
|
+
restricted()
|
169
316
|
{
|
170
|
-
Blocknumber lastUpdatedIn =
|
317
|
+
Blocknumber lastUpdatedIn = _checkBalanceExists(nftId);
|
171
318
|
Amount stakeAmount = _stakeBalance[nftId];
|
172
319
|
Amount rewardAmount = _rewardBalance[nftId];
|
173
320
|
|
174
|
-
if (lastUpdatedIn.eqz()) {
|
175
|
-
revert ErrorStakingStoreBalanceNotInitialized(nftId);
|
176
|
-
}
|
177
|
-
|
178
321
|
// move all rewards to stake balance
|
179
|
-
|
180
|
-
|
322
|
+
_updateStakeBalance(
|
323
|
+
nftId,
|
324
|
+
stakeAmount + rewardAmount + rewardIncrementAmount, // new stake balance
|
325
|
+
AmountLib.zero()); // new reward balance
|
181
326
|
|
182
|
-
|
183
|
-
|
327
|
+
_updateTargetBalance(
|
328
|
+
targetNftId,
|
329
|
+
_stakeBalance[targetNftId] + rewardAmount + rewardIncrementAmount,
|
330
|
+
_rewardBalance[targetNftId] - rewardAmount);
|
184
331
|
|
185
332
|
emit LogStakingStoreRewardsRestaked(nftId, stakeAmount, rewardAmount, rewardIncrementAmount, _stakeBalance[nftId], lastUpdatedIn);
|
186
333
|
}
|
@@ -188,22 +335,24 @@ contract StakingStore is
|
|
188
335
|
|
189
336
|
function updateRewards(
|
190
337
|
NftId nftId,
|
338
|
+
NftId targetNftId,
|
191
339
|
Amount rewardIncrementAmount
|
192
340
|
)
|
193
341
|
external
|
342
|
+
restricted()
|
194
343
|
{
|
195
|
-
Blocknumber lastUpdatedIn =
|
196
|
-
Amount rewardAmount = _rewardBalance[nftId];
|
344
|
+
Blocknumber lastUpdatedIn = _checkBalanceExists(nftId);
|
197
345
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
_rewardBalance[nftId] = rewardAmount + rewardIncrementAmount;
|
346
|
+
// increse rewards by increment
|
347
|
+
_updateStakeBalance(
|
348
|
+
nftId,
|
349
|
+
_stakeBalance[nftId], // unchanged stake balance
|
350
|
+
_rewardBalance[nftId] + rewardIncrementAmount); // new reward balance
|
204
351
|
|
205
|
-
|
206
|
-
|
352
|
+
_updateTargetBalance(
|
353
|
+
targetNftId,
|
354
|
+
_stakeBalance[targetNftId],
|
355
|
+
_rewardBalance[targetNftId] + rewardIncrementAmount);
|
207
356
|
|
208
357
|
emit LogStakingStoreRewardsIncreased(nftId, rewardIncrementAmount, _rewardBalance[nftId], lastUpdatedIn);
|
209
358
|
}
|
@@ -211,73 +360,62 @@ contract StakingStore is
|
|
211
360
|
|
212
361
|
function claimUpTo(
|
213
362
|
NftId nftId,
|
214
|
-
|
363
|
+
NftId targetNftId,
|
364
|
+
Amount maxClaimAmount
|
215
365
|
)
|
216
366
|
external
|
217
|
-
|
367
|
+
restricted()
|
368
|
+
returns (Amount claimedAmount)
|
218
369
|
{
|
219
|
-
Blocknumber lastUpdatedIn =
|
220
|
-
bool updated = false;
|
221
|
-
|
222
|
-
if (lastUpdatedIn.eqz()) {
|
223
|
-
revert ErrorStakingStoreBalanceNotInitialized(nftId);
|
224
|
-
}
|
370
|
+
Blocknumber lastUpdatedIn = _checkBalanceExists(nftId);
|
225
371
|
|
226
372
|
// determine the claimable rewards amount
|
227
|
-
|
228
|
-
rewardsClaimedAmount = _rewardBalance[nftId];
|
229
|
-
} else {
|
230
|
-
rewardsClaimedAmount = maxRewardAmount;
|
231
|
-
}
|
373
|
+
claimedAmount = AmountLib.min(maxClaimAmount, _rewardBalance[nftId]);
|
232
374
|
|
233
|
-
// decrease
|
234
|
-
|
375
|
+
// decrease rewards by claimed amount
|
376
|
+
_updateStakeBalance(
|
377
|
+
nftId,
|
378
|
+
_stakeBalance[nftId], // unchanged stake balance
|
379
|
+
_rewardBalance[nftId] - claimedAmount); // new reward balance
|
235
380
|
|
236
|
-
|
237
|
-
|
381
|
+
_updateTargetBalance(
|
382
|
+
targetNftId,
|
383
|
+
_stakeBalance[targetNftId],
|
384
|
+
_rewardBalance[targetNftId] - claimedAmount);
|
238
385
|
|
239
|
-
emit LogStakingStoreRewardsDecreased(nftId,
|
386
|
+
emit LogStakingStoreRewardsDecreased(nftId, claimedAmount, _rewardBalance[nftId], lastUpdatedIn);
|
240
387
|
}
|
241
388
|
|
242
389
|
|
243
390
|
function unstakeUpTo(
|
244
391
|
NftId nftId,
|
392
|
+
NftId targetNftId,
|
245
393
|
Amount maxUnstakeAmount,
|
246
394
|
Amount maxClaimAmount
|
247
395
|
)
|
248
396
|
external
|
397
|
+
restricted()
|
249
398
|
returns (
|
250
399
|
Amount unstakedAmount,
|
251
400
|
Amount claimedAmount
|
252
401
|
)
|
253
402
|
{
|
254
|
-
Blocknumber lastUpdatedIn =
|
255
|
-
bool updated = false;
|
256
|
-
|
257
|
-
if (lastUpdatedIn.eqz()) {
|
258
|
-
revert ErrorStakingStoreBalanceNotInitialized(nftId);
|
259
|
-
}
|
403
|
+
Blocknumber lastUpdatedIn = _checkBalanceExists(nftId);
|
260
404
|
|
261
|
-
// determine
|
262
|
-
|
263
|
-
|
264
|
-
} else {
|
265
|
-
unstakedAmount = maxUnstakeAmount;
|
266
|
-
}
|
267
|
-
|
268
|
-
// determine the claimable rewards amount
|
269
|
-
if (maxClaimAmount > _rewardBalance[nftId]) {
|
270
|
-
claimedAmount = _rewardBalance[nftId];
|
271
|
-
} else {
|
272
|
-
claimedAmount = maxClaimAmount;
|
273
|
-
}
|
405
|
+
// determine amounts
|
406
|
+
unstakedAmount = AmountLib.min(maxUnstakeAmount, _stakeBalance[nftId]);
|
407
|
+
claimedAmount = AmountLib.min(maxClaimAmount, _rewardBalance[nftId]);
|
274
408
|
|
275
|
-
// decrease
|
276
|
-
|
277
|
-
|
409
|
+
// decrease stakes and rewards as determined
|
410
|
+
_updateStakeBalance(
|
411
|
+
nftId,
|
412
|
+
_stakeBalance[nftId] - unstakedAmount, // unchanged stake balance
|
413
|
+
_rewardBalance[nftId] - claimedAmount); // new reward balance
|
278
414
|
|
279
|
-
|
280
|
-
|
415
|
+
_updateTargetBalance(
|
416
|
+
targetNftId,
|
417
|
+
_stakeBalance[targetNftId] - unstakedAmount,
|
418
|
+
_rewardBalance[targetNftId] - claimedAmount);
|
281
419
|
|
282
420
|
emit LogStakingStoreStakesDecreased(nftId, unstakedAmount, _stakeBalance[nftId], lastUpdatedIn);
|
283
421
|
emit LogStakingStoreRewardsDecreased(nftId, claimedAmount, _rewardBalance[nftId], lastUpdatedIn);
|
@@ -289,41 +427,189 @@ contract StakingStore is
|
|
289
427
|
return _reader;
|
290
428
|
}
|
291
429
|
|
292
|
-
|
293
|
-
|
430
|
+
// TODO rename
|
431
|
+
function getTargetNftIdSet() external view returns (NftIdSet targetNftIdSet){
|
432
|
+
return _targetNftIdSet;
|
294
433
|
}
|
295
434
|
|
296
|
-
function
|
297
|
-
|
298
|
-
}
|
435
|
+
function getStakingRate(uint256 chainId, address token) external view returns (UFixed stakingRate) { return _stakingRate[chainId][token]; }
|
436
|
+
|
437
|
+
function exists(NftId stakeNftId) external view returns (bool) { return exists(stakeNftId.toKey32(STAKE())); }
|
438
|
+
|
439
|
+
function getTotalValueLocked(NftId nftId, address token) external view returns (Amount tvlBalanceAmount) { return _tvlBalance[nftId][token]; }
|
440
|
+
function getRequiredStakeBalance(NftId nftId) external view returns (Amount requiredAmount) { return _tvlRequiredDip[nftId]; }
|
299
441
|
|
442
|
+
function getReserveBalance(NftId nftId) external view returns (Amount balanceAmount) { return _reserveBalance[nftId]; }
|
300
443
|
function getStakeBalance(NftId nftId) external view returns (Amount balanceAmount) { return _stakeBalance[nftId]; }
|
301
444
|
function getRewardBalance(NftId nftId) external view returns (Amount rewardAmount) { return _rewardBalance[nftId]; }
|
302
445
|
function getBalanceUpdatedAt(NftId nftId) external view returns (Timestamp updatedAt) { return _lastUpdatedAt[nftId]; }
|
446
|
+
function getBalanceUpdatedIn(NftId nftId) external view returns (Blocknumber blocknumber) { return _lastUpdatedIn[nftId]; }
|
303
447
|
|
304
|
-
|
448
|
+
|
449
|
+
function getTargetBalances(NftId nftId)
|
305
450
|
external
|
306
451
|
view
|
307
452
|
returns (
|
308
453
|
Amount stakeBalance,
|
454
|
+
Amount rewardBalance,
|
455
|
+
Amount reserveBalance,
|
456
|
+
Blocknumber lastUpdatedIn
|
457
|
+
)
|
458
|
+
{
|
459
|
+
stakeBalance = _stakeBalance[nftId];
|
460
|
+
rewardBalance = _rewardBalance[nftId];
|
461
|
+
reserveBalance = _reserveBalance[nftId];
|
462
|
+
lastUpdatedIn = _lastUpdatedIn[nftId];
|
463
|
+
}
|
464
|
+
|
465
|
+
|
466
|
+
function getStakeBalances(NftId nftId)
|
467
|
+
external
|
468
|
+
view
|
469
|
+
returns (
|
470
|
+
Amount stakeBalance,
|
471
|
+
Amount rewardBalance,
|
309
472
|
Timestamp lastUpdatedAt
|
310
473
|
)
|
311
474
|
{
|
312
475
|
stakeBalance = _stakeBalance[nftId];
|
476
|
+
rewardBalance = _rewardBalance[nftId];
|
313
477
|
lastUpdatedAt = _lastUpdatedAt[nftId];
|
314
478
|
}
|
315
479
|
|
316
480
|
//--- private functions -------------------------------------------//
|
317
481
|
|
318
|
-
function
|
482
|
+
function _createTarget(
|
483
|
+
NftId targetNftId,
|
484
|
+
IStaking.TargetInfo memory targetInfo
|
485
|
+
)
|
486
|
+
private
|
487
|
+
{
|
488
|
+
_create(
|
489
|
+
targetNftId.toKey32(TARGET()),
|
490
|
+
abi.encode(targetInfo));
|
491
|
+
|
492
|
+
// initialize tvl and stake balance
|
493
|
+
_tvlLastUpdatedIn[targetNftId]= BlocknumberLib.currentBlocknumber();
|
494
|
+
_createTargetBalance(targetNftId);
|
495
|
+
|
496
|
+
_targetNftIdSet.add(targetNftId);
|
497
|
+
}
|
498
|
+
|
499
|
+
function _updateReserves(
|
500
|
+
NftId targetNftId,
|
501
|
+
Amount newRewardBalance
|
502
|
+
)
|
503
|
+
private
|
504
|
+
returns (Blocknumber lastUpdatedIn)
|
505
|
+
{
|
506
|
+
if (_lastUpdatedIn[targetNftId].eqz()) {
|
507
|
+
revert ErrorStakingStoreNotTarget(targetNftId);
|
508
|
+
}
|
509
|
+
|
510
|
+
lastUpdatedIn = _lastUpdatedIn[targetNftId];
|
511
|
+
|
512
|
+
_reserveBalance[targetNftId] = newRewardBalance;
|
513
|
+
_lastUpdatedIn[targetNftId] = BlocknumberLib.currentBlocknumber();
|
514
|
+
}
|
515
|
+
|
516
|
+
|
517
|
+
function _createTargetBalance(NftId nftId)
|
518
|
+
private
|
519
|
+
{
|
520
|
+
if (_lastUpdatedIn[nftId].gtz()) {
|
521
|
+
revert ErrorStakingStoreBalanceAlreadyInitialized(nftId);
|
522
|
+
}
|
523
|
+
|
524
|
+
// set target balances to 0
|
525
|
+
_stakeBalance[nftId] = AmountLib.zero();
|
526
|
+
_rewardBalance[nftId] = AmountLib.zero();
|
527
|
+
_reserveBalance[nftId] = AmountLib.zero();
|
528
|
+
|
529
|
+
// set last updated in to current block number
|
530
|
+
// we don't need last updated at timestamp for targets
|
531
|
+
_lastUpdatedIn[nftId] = BlocknumberLib.currentBlocknumber();
|
532
|
+
}
|
533
|
+
|
534
|
+
|
535
|
+
function _createStakeBalance(NftId nftId)
|
536
|
+
private
|
537
|
+
{
|
319
538
|
if (_lastUpdatedIn[nftId].gtz()) {
|
320
539
|
revert ErrorStakingStoreBalanceAlreadyInitialized(nftId);
|
321
540
|
}
|
322
541
|
|
323
|
-
|
542
|
+
// set stake balances to 0
|
543
|
+
_stakeBalance[nftId] = AmountLib.zero();
|
324
544
|
_rewardBalance[nftId] = AmountLib.zero();
|
325
545
|
|
546
|
+
// set last updated at/in to current timestamp/block number
|
326
547
|
_lastUpdatedAt[nftId] = TimestampLib.blockTimestamp();
|
327
548
|
_lastUpdatedIn[nftId] = BlocknumberLib.currentBlocknumber();
|
328
549
|
}
|
550
|
+
|
551
|
+
|
552
|
+
function _updateStakeBalance(
|
553
|
+
NftId stakeNftId,
|
554
|
+
Amount newStakeAmount,
|
555
|
+
Amount newRewardAmount
|
556
|
+
)
|
557
|
+
private
|
558
|
+
{
|
559
|
+
_stakeBalance[stakeNftId] = newStakeAmount;
|
560
|
+
_rewardBalance[stakeNftId] = newRewardAmount;
|
561
|
+
|
562
|
+
_lastUpdatedAt[stakeNftId] = TimestampLib.blockTimestamp();
|
563
|
+
_lastUpdatedIn[stakeNftId] = BlocknumberLib.currentBlocknumber();
|
564
|
+
}
|
565
|
+
|
566
|
+
|
567
|
+
function _updateTargetBalance(
|
568
|
+
NftId targetNftId,
|
569
|
+
Amount newStakeAmount,
|
570
|
+
Amount newRewardAmount
|
571
|
+
)
|
572
|
+
private
|
573
|
+
{
|
574
|
+
_stakeBalance[targetNftId] = newStakeAmount;
|
575
|
+
_rewardBalance[targetNftId] = newRewardAmount;
|
576
|
+
|
577
|
+
// for targets we don't need the timestamp, just the blocknumber
|
578
|
+
_lastUpdatedIn[targetNftId] = BlocknumberLib.currentBlocknumber();
|
579
|
+
}
|
580
|
+
|
581
|
+
function _checkBalanceExists(NftId nftId)
|
582
|
+
private
|
583
|
+
view
|
584
|
+
returns (Blocknumber lastUpdatedIn)
|
585
|
+
{
|
586
|
+
lastUpdatedIn = _lastUpdatedIn[nftId];
|
587
|
+
|
588
|
+
if (lastUpdatedIn.eqz()) {
|
589
|
+
revert ErrorStakingStoreBalanceNotInitialized(nftId);
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
593
|
+
|
594
|
+
function _getAndVerifyTvl(
|
595
|
+
NftId targetNftId,
|
596
|
+
address token
|
597
|
+
)
|
598
|
+
private
|
599
|
+
view
|
600
|
+
returns (
|
601
|
+
Blocknumber tvlLastUpdatedIn,
|
602
|
+
Amount oldBalance,
|
603
|
+
Amount oldDipBalance
|
604
|
+
)
|
605
|
+
{
|
606
|
+
tvlLastUpdatedIn = _tvlLastUpdatedIn[targetNftId];
|
607
|
+
|
608
|
+
if (tvlLastUpdatedIn.eqz()) {
|
609
|
+
revert ErrorStakingStoreTvlBalanceNotInitialized(targetNftId);
|
610
|
+
}
|
611
|
+
|
612
|
+
oldBalance = _tvlBalance[targetNftId][token];
|
613
|
+
oldDipBalance = _tvlInDip[targetNftId][token];
|
614
|
+
}
|
329
615
|
}
|