@etherisc/gif-next 0.0.2-8bdd2eb-413 → 0.0.2-8d9d4d6-542
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/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1502 -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 +1168 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +110 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +129 -0
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +1639 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +134 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +171 -0
- 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 +108 -79
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +48 -40
- 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/distribution/IDistributionService.sol/IDistributionService.json +13 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +32 -101
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +58 -65
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +120 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -79
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +22 -22
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +1676 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +289 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +70 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +192 -56
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +201 -34
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +41 -17
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +248 -108
- 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/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -71
- 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/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +10 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -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 +1146 -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/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +78 -49
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +33 -25
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -41
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +25 -21
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -37
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +27 -19
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -69
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +47 -35
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +84 -47
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +36 -24
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +40 -32
- 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 +54 -25
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +21 -13
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -0
- 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 +19 -19
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1678 -153
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -14
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +20 -8
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +99 -154
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +195 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +52 -20
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +52 -20
- 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 +107 -71
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +44 -36
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +20 -0
- 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/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +13 -0
- 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 +8 -8
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +6 -6
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +13 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- 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/IStakingService.sol/IStakingService.json +49 -7
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +23 -39
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +33 -41
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +186 -114
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +18 -18
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- 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 +2 -2
- 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 +125 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +114 -4
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- 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/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +749 -0
- package/contracts/authorization/IAccess.sol +43 -0
- package/contracts/authorization/IAccessAdmin.sol +130 -0
- package/contracts/authorization/IModuleAuthorization.sol +27 -0
- package/contracts/authorization/IServiceAuthorization.sol +35 -0
- package/contracts/authorization/InstanceAdmin.sol +108 -0
- package/contracts/authorization/ModuleAuthorization.sol +116 -0
- package/contracts/authorization/ServiceAuthorization.sol +86 -0
- package/contracts/distribution/DistributionService.sol +3 -4
- package/contracts/instance/IInstance.sol +14 -6
- package/contracts/instance/IInstanceService.sol +24 -8
- package/contracts/instance/Instance.sol +63 -39
- package/contracts/instance/InstanceAdminNew.sol +74 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +176 -0
- package/contracts/instance/InstanceAuthorizationsLib.sol +31 -3
- package/contracts/instance/InstanceReader.sol +29 -2
- package/contracts/instance/InstanceService.sol +85 -8
- package/contracts/instance/InstanceStore.sol +29 -20
- 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/ObjectManager.sol +1 -3
- package/contracts/oracle/IOracle.sol +20 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +145 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BundleService.sol +19 -19
- package/contracts/pool/PoolService.sol +6 -7
- package/contracts/product/ApplicationService.sol +5 -5
- package/contracts/product/ClaimService.sol +5 -5
- package/contracts/product/IClaimService.sol +6 -0
- package/contracts/product/PolicyService.sol +5 -5
- package/contracts/product/PricingService.sol +5 -6
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/IRegistry.sol +1 -1
- package/contracts/registry/Registry.sol +7 -1
- package/contracts/registry/RegistryAdmin.sol +236 -148
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/registry/RegistryServiceManager.sol +0 -5
- package/contracts/registry/ReleaseManager.sol +102 -172
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/shared/AccessManagerCustom.sol +6 -1
- package/contracts/shared/AccessManagerExtended.sol +12 -1
- package/contracts/shared/Component.sol +3 -0
- package/contracts/shared/ComponentService.sol +30 -9
- package/contracts/shared/ComponentVerifyingService.sol +13 -7
- package/contracts/shared/IComponentService.sol +11 -0
- package/contracts/shared/IService.sol +7 -0
- package/contracts/shared/Lifecycle.sol +11 -2
- package/contracts/shared/Service.sol +27 -21
- package/contracts/staking/IStakingService.sol +11 -7
- package/contracts/staking/StakeManagerLib.sol +52 -0
- package/contracts/staking/Staking.sol +58 -96
- package/contracts/staking/StakingService.sol +61 -56
- package/contracts/staking/StakingServiceManager.sol +0 -1
- package/contracts/staking/StakingStore.sol +79 -38
- package/contracts/type/ObjectType.sol +162 -67
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RoleId.sol +77 -19
- 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/package.json +3 -3
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
@@ -9,7 +9,6 @@ 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 {KEEP_STATE} from "../type/StateId.sol";
|
13
12
|
import {LibNftIdSet} from "../type/NftIdSet.sol";
|
14
13
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
14
|
import {NftIdSetManager} from "../shared/NftIdSetManager.sol";
|
@@ -61,22 +60,11 @@ contract Staking is
|
|
61
60
|
_;
|
62
61
|
}
|
63
62
|
|
64
|
-
|
65
|
-
// from Versionable
|
66
|
-
function getVersion()
|
67
|
-
public
|
68
|
-
pure
|
69
|
-
virtual override (IVersionable, Versionable)
|
70
|
-
returns(Version)
|
71
|
-
{
|
72
|
-
return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
|
73
|
-
}
|
74
|
-
|
75
63
|
// set/update staking reader
|
76
64
|
function setStakingReader(StakingReader stakingReader)
|
77
65
|
external
|
78
66
|
virtual
|
79
|
-
onlyOwner
|
67
|
+
onlyOwner()
|
80
68
|
{
|
81
69
|
if(stakingReader.getStaking() != IStaking(this)) {
|
82
70
|
revert ErrorStakingStakingReaderStakingMismatch(address(stakingReader.getStaking()));
|
@@ -90,7 +78,7 @@ contract Staking is
|
|
90
78
|
function setStakingRate(uint256 chainId, address token, UFixed stakingRate)
|
91
79
|
external
|
92
80
|
virtual
|
93
|
-
onlyOwner
|
81
|
+
onlyOwner()
|
94
82
|
{
|
95
83
|
StakingStorage storage $ = _getStakingStorage();
|
96
84
|
|
@@ -104,8 +92,6 @@ contract Staking is
|
|
104
92
|
emit LogStakingStakingRateSet(chainId, token, oldStakingRate, stakingRate);
|
105
93
|
}
|
106
94
|
|
107
|
-
// reward management
|
108
|
-
|
109
95
|
// target management
|
110
96
|
|
111
97
|
function registerTarget(
|
@@ -117,7 +103,7 @@ contract Staking is
|
|
117
103
|
)
|
118
104
|
external
|
119
105
|
virtual
|
120
|
-
|
106
|
+
restricted()
|
121
107
|
{
|
122
108
|
TargetManagerLib.checkTargetParameters(
|
123
109
|
getRegistry(),
|
@@ -143,7 +129,7 @@ contract Staking is
|
|
143
129
|
)
|
144
130
|
external
|
145
131
|
virtual
|
146
|
-
|
132
|
+
restricted()
|
147
133
|
onlyTarget(targetNftId)
|
148
134
|
{
|
149
135
|
(
|
@@ -165,7 +151,7 @@ contract Staking is
|
|
165
151
|
function setRewardRate(NftId targetNftId, UFixed rewardRate)
|
166
152
|
external
|
167
153
|
virtual
|
168
|
-
|
154
|
+
restricted()
|
169
155
|
onlyTarget(targetNftId)
|
170
156
|
{
|
171
157
|
(
|
@@ -185,7 +171,7 @@ contract Staking is
|
|
185
171
|
function refillRewardReserves(NftId targetNftId, Amount dipAmount)
|
186
172
|
external
|
187
173
|
virtual
|
188
|
-
|
174
|
+
restricted()
|
189
175
|
returns (Amount newBalance)
|
190
176
|
{
|
191
177
|
// update book keeping of reward reserves
|
@@ -197,8 +183,7 @@ contract Staking is
|
|
197
183
|
function withdrawRewardReserves(NftId targetNftId, Amount dipAmount)
|
198
184
|
external
|
199
185
|
virtual
|
200
|
-
|
201
|
-
// onlyNftOwner(targetNftId)
|
186
|
+
restricted()
|
202
187
|
returns (Amount newBalance)
|
203
188
|
{
|
204
189
|
// update book keeping of reward reserves
|
@@ -210,7 +195,7 @@ contract Staking is
|
|
210
195
|
function increaseTotalValueLocked(NftId targetNftId, address token, Amount amount)
|
211
196
|
external
|
212
197
|
virtual
|
213
|
-
|
198
|
+
restricted() // only pool service
|
214
199
|
returns (Amount newBalance)
|
215
200
|
{
|
216
201
|
StakingStorage storage $ = _getStakingStorage();
|
@@ -223,7 +208,7 @@ contract Staking is
|
|
223
208
|
function decreaseTotalValueLocked(NftId targetNftId, address token, Amount amount)
|
224
209
|
external
|
225
210
|
virtual
|
226
|
-
|
211
|
+
restricted() // only pool service
|
227
212
|
returns (Amount newBalance)
|
228
213
|
{
|
229
214
|
StakingStorage storage $ = _getStakingStorage();
|
@@ -236,6 +221,7 @@ contract Staking is
|
|
236
221
|
function registerRemoteTarget(NftId targetNftId, TargetInfo memory targetInfo)
|
237
222
|
external
|
238
223
|
virtual
|
224
|
+
restricted()
|
239
225
|
onlyOwner // or CCIP
|
240
226
|
{
|
241
227
|
|
@@ -244,6 +230,7 @@ contract Staking is
|
|
244
230
|
function updateRemoteTvl(NftId targetNftId, address token, Amount amount)
|
245
231
|
external
|
246
232
|
virtual
|
233
|
+
restricted()
|
247
234
|
onlyOwner // or CCIP
|
248
235
|
{
|
249
236
|
|
@@ -258,7 +245,7 @@ contract Staking is
|
|
258
245
|
)
|
259
246
|
external
|
260
247
|
virtual
|
261
|
-
|
248
|
+
restricted() // only staking service
|
262
249
|
{
|
263
250
|
StakingStorage storage $ = _getStakingStorage();
|
264
251
|
Timestamp lockedUntil = StakeManagerLib.checkCreateParameters(
|
@@ -286,51 +273,17 @@ contract Staking is
|
|
286
273
|
)
|
287
274
|
external
|
288
275
|
virtual
|
289
|
-
|
276
|
+
restricted() // only staking service
|
290
277
|
onlyStake(stakeNftId)
|
291
278
|
returns (Amount stakeBalance)
|
292
279
|
{
|
293
280
|
StakingStorage storage $ = _getStakingStorage();
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
Seconds lockingPeriod
|
299
|
-
) = StakeManagerLib.checkStakeParameters(
|
300
|
-
$._reader,
|
301
|
-
stakeNftId);
|
302
|
-
|
303
|
-
// calculate new rewards (if any)
|
304
|
-
(
|
305
|
-
Amount rewardIncrementAmount,
|
306
|
-
Amount currentTotalDipAmount
|
307
|
-
) = StakeManagerLib.calculateRewardIncrease(
|
308
|
-
$._reader,
|
281
|
+
stakeBalance = StakeManagerLib.stake(
|
282
|
+
getRegistry(),
|
283
|
+
$._reader,
|
284
|
+
$._store,
|
309
285
|
stakeNftId,
|
310
|
-
rewardRate);
|
311
|
-
|
312
|
-
stakeBalance = currentTotalDipAmount + stakeAmount;
|
313
|
-
|
314
|
-
// TODO check that additional dip, rewards and rewards increment
|
315
|
-
// are still ok with max target staking amount
|
316
|
-
NftId targetNftId = getRegistry().getObjectInfo(stakeNftId).parentNftId;
|
317
|
-
|
318
|
-
$._store.restakeRewards(
|
319
|
-
stakeNftId,
|
320
|
-
targetNftId,
|
321
|
-
rewardIncrementAmount);
|
322
|
-
|
323
|
-
$._store.increaseStake(
|
324
|
-
stakeNftId,
|
325
|
-
targetNftId,
|
326
286
|
stakeAmount);
|
327
|
-
|
328
|
-
// update locked until with target locking period
|
329
|
-
$._store.update(
|
330
|
-
stakeNftId,
|
331
|
-
StakeInfo({
|
332
|
-
lockedUntil: TimestampLib.blockTimestamp().addSeconds(
|
333
|
-
lockingPeriod)}));
|
334
287
|
}
|
335
288
|
|
336
289
|
|
@@ -340,7 +293,7 @@ contract Staking is
|
|
340
293
|
)
|
341
294
|
external
|
342
295
|
virtual
|
343
|
-
|
296
|
+
restricted() // only staking service
|
344
297
|
onlyStake(stakeNftId)
|
345
298
|
returns (NftId newStakeNftId)
|
346
299
|
{
|
@@ -354,7 +307,7 @@ contract Staking is
|
|
354
307
|
function updateRewards(NftId stakeNftId)
|
355
308
|
external
|
356
309
|
virtual
|
357
|
-
|
310
|
+
restricted() // only staking service
|
358
311
|
onlyStake(stakeNftId)
|
359
312
|
{
|
360
313
|
StakingStorage storage $ = _getStakingStorage();
|
@@ -365,7 +318,7 @@ contract Staking is
|
|
365
318
|
function claimRewards(NftId stakeNftId)
|
366
319
|
external
|
367
320
|
virtual
|
368
|
-
|
321
|
+
restricted() // only staking service
|
369
322
|
onlyStake(stakeNftId)
|
370
323
|
returns (
|
371
324
|
Amount rewardsClaimedAmount
|
@@ -390,7 +343,7 @@ contract Staking is
|
|
390
343
|
function unstake(NftId stakeNftId)
|
391
344
|
external
|
392
345
|
virtual
|
393
|
-
|
346
|
+
restricted() // only staking service
|
394
347
|
onlyStake(stakeNftId)
|
395
348
|
returns (
|
396
349
|
Amount unstakedAmount,
|
@@ -419,35 +372,11 @@ contract Staking is
|
|
419
372
|
|
420
373
|
|
421
374
|
|
422
|
-
function _updateRewards(
|
423
|
-
StakingReader reader,
|
424
|
-
StakingStore store,
|
425
|
-
NftId stakeNftId
|
426
|
-
)
|
427
|
-
internal
|
428
|
-
virtual
|
429
|
-
returns (NftId targetNftId)
|
430
|
-
{
|
431
|
-
UFixed rewardRate;
|
432
|
-
|
433
|
-
(targetNftId, rewardRate) = reader.getTargetRewardRate(stakeNftId);
|
434
|
-
(Amount rewardIncrement, ) = StakeManagerLib.calculateRewardIncrease(
|
435
|
-
reader,
|
436
|
-
stakeNftId,
|
437
|
-
rewardRate);
|
438
|
-
|
439
|
-
store.updateRewards(
|
440
|
-
stakeNftId,
|
441
|
-
targetNftId,
|
442
|
-
rewardIncrement);
|
443
|
-
}
|
444
|
-
|
445
|
-
|
446
375
|
//--- other functions ---------------------------------------------------//
|
447
376
|
|
448
377
|
function collectDipAmount(address from, Amount dipAmount)
|
449
378
|
external
|
450
|
-
|
379
|
+
restricted() // only staking service
|
451
380
|
{
|
452
381
|
TokenHandler tokenHandler = getTokenHandler();
|
453
382
|
address stakingWallet = getWallet();
|
@@ -464,7 +393,7 @@ contract Staking is
|
|
464
393
|
|
465
394
|
function transferDipAmount(address to, Amount dipAmount)
|
466
395
|
external
|
467
|
-
|
396
|
+
restricted() // only staking service
|
468
397
|
{
|
469
398
|
TokenHandler tokenHandler = getTokenHandler();
|
470
399
|
address stakingWallet = getWallet();
|
@@ -493,8 +422,43 @@ contract Staking is
|
|
493
422
|
return address(_getStakingStorage()._tokenRegistry);
|
494
423
|
}
|
495
424
|
|
425
|
+
|
426
|
+
// from Versionable
|
427
|
+
function getVersion()
|
428
|
+
public
|
429
|
+
pure
|
430
|
+
virtual override (IVersionable, Versionable)
|
431
|
+
returns(Version)
|
432
|
+
{
|
433
|
+
return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
|
434
|
+
}
|
435
|
+
|
496
436
|
//--- internal functions ------------------------------------------------//
|
497
437
|
|
438
|
+
function _updateRewards(
|
439
|
+
StakingReader reader,
|
440
|
+
StakingStore store,
|
441
|
+
NftId stakeNftId
|
442
|
+
)
|
443
|
+
internal
|
444
|
+
virtual
|
445
|
+
returns (NftId targetNftId)
|
446
|
+
{
|
447
|
+
UFixed rewardRate;
|
448
|
+
|
449
|
+
(targetNftId, rewardRate) = reader.getTargetRewardRate(stakeNftId);
|
450
|
+
(Amount rewardIncrement, ) = StakeManagerLib.calculateRewardIncrease(
|
451
|
+
reader,
|
452
|
+
stakeNftId,
|
453
|
+
rewardRate);
|
454
|
+
|
455
|
+
store.updateRewards(
|
456
|
+
stakeNftId,
|
457
|
+
targetNftId,
|
458
|
+
rewardIncrement);
|
459
|
+
}
|
460
|
+
|
461
|
+
|
498
462
|
function _initialize(
|
499
463
|
address owner,
|
500
464
|
bytes memory data
|
@@ -530,7 +494,6 @@ contract Staking is
|
|
530
494
|
|
531
495
|
_createAndSetTokenHandler();
|
532
496
|
|
533
|
-
|
534
497
|
// wiring to external contracts
|
535
498
|
StakingStorage storage $ = _getStakingStorage();
|
536
499
|
$._protocolNftId = getRegistry().getProtocolNftId();
|
@@ -547,5 +510,4 @@ contract Staking is
|
|
547
510
|
$.slot := STAKING_LOCATION_V1
|
548
511
|
}
|
549
512
|
}
|
550
|
-
|
551
513
|
}
|
@@ -45,29 +45,6 @@ contract StakingService is
|
|
45
45
|
_;
|
46
46
|
}
|
47
47
|
|
48
|
-
function getDomain() public pure override returns(ObjectType) {
|
49
|
-
return STAKING();
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
function registerProtocolTarget()
|
54
|
-
external
|
55
|
-
virtual
|
56
|
-
{
|
57
|
-
uint256 protocolId = ChainNft(
|
58
|
-
getRegistry().getChainNftAddress()).PROTOCOL_NFT_ID();
|
59
|
-
|
60
|
-
NftId protocolNftId = NftIdLib.toNftId(protocolId);
|
61
|
-
_getStakingServiceStorage()._staking.registerTarget(
|
62
|
-
protocolNftId,
|
63
|
-
PROTOCOL(),
|
64
|
-
1, // protocol is registered on mainnet
|
65
|
-
TargetManagerLib.getDefaultLockingPeriod(),
|
66
|
-
TargetManagerLib.getDefaultRewardRate());
|
67
|
-
|
68
|
-
emit LogStakingServiceProtocolTargetRegistered(protocolNftId);
|
69
|
-
}
|
70
|
-
|
71
48
|
|
72
49
|
function createInstanceTarget(
|
73
50
|
NftId targetNftId,
|
@@ -76,7 +53,7 @@ contract StakingService is
|
|
76
53
|
)
|
77
54
|
external
|
78
55
|
virtual
|
79
|
-
|
56
|
+
restricted()
|
80
57
|
{
|
81
58
|
uint256 chainId = block.chainid;
|
82
59
|
_getStakingServiceStorage()._staking.registerTarget(
|
@@ -90,66 +67,66 @@ contract StakingService is
|
|
90
67
|
}
|
91
68
|
|
92
69
|
|
93
|
-
function
|
70
|
+
function setInstanceLockingPeriod(NftId instanceNftId, Seconds lockingPeriod)
|
94
71
|
external
|
95
72
|
virtual
|
96
|
-
|
73
|
+
restricted()
|
97
74
|
{
|
98
75
|
_getStakingServiceStorage()._staking.setLockingPeriod(
|
99
|
-
|
76
|
+
instanceNftId,
|
77
|
+
lockingPeriod);
|
100
78
|
}
|
101
79
|
|
102
80
|
|
103
|
-
function
|
81
|
+
function setInstanceRewardRate(NftId instanceNftId, UFixed rewardRate)
|
104
82
|
external
|
105
83
|
virtual
|
106
|
-
|
84
|
+
restricted()
|
107
85
|
{
|
108
86
|
_getStakingServiceStorage()._staking.setRewardRate(
|
109
|
-
|
110
|
-
|
87
|
+
instanceNftId,
|
88
|
+
rewardRate);
|
111
89
|
}
|
112
90
|
|
113
91
|
|
114
|
-
function
|
92
|
+
function refillInstanceRewardReserves(NftId instanceNftId, address rewardProvider, Amount dipAmount)
|
115
93
|
external
|
116
94
|
virtual
|
95
|
+
restricted()
|
117
96
|
returns (Amount newBalance)
|
118
97
|
{
|
119
|
-
|
98
|
+
return _refillRewardReserves(instanceNftId, rewardProvider, dipAmount);
|
99
|
+
}
|
120
100
|
|
121
|
-
// update reward reserve book keeping
|
122
|
-
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
123
|
-
newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
|
124
101
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
102
|
+
function refillRewardReservesBySender(NftId targetNftId, Amount dipAmount)
|
103
|
+
external
|
104
|
+
virtual
|
105
|
+
restricted()
|
106
|
+
returns (Amount newBalance)
|
107
|
+
{
|
108
|
+
address rewardProvider = msg.sender;
|
109
|
+
return _refillRewardReserves(targetNftId, rewardProvider, dipAmount);
|
131
110
|
}
|
132
111
|
|
133
112
|
|
134
|
-
function
|
113
|
+
function withdrawInstanceRewardReserves(NftId instanceNftId, Amount dipAmount)
|
135
114
|
external
|
136
115
|
virtual
|
137
|
-
|
116
|
+
restricted()
|
138
117
|
returns (Amount newBalance)
|
139
118
|
{
|
140
|
-
// modifyier checks that sender is owner
|
141
|
-
address targetOwner = msg.sender;
|
142
|
-
|
143
119
|
// update reward reserve book keeping
|
144
120
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
145
|
-
newBalance = $._staking.withdrawRewardReserves(
|
121
|
+
newBalance = $._staking.withdrawRewardReserves(instanceNftId, dipAmount);
|
146
122
|
|
147
123
|
// transfer withdrawal amount to target owner
|
124
|
+
address instanceOwner = getRegistry().ownerOf(instanceNftId);
|
148
125
|
$._staking.transferDipAmount(
|
149
|
-
|
126
|
+
instanceOwner,
|
150
127
|
dipAmount);
|
151
128
|
|
152
|
-
emit LogStakingServiceRewardReservesDecreased(
|
129
|
+
emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
|
153
130
|
}
|
154
131
|
|
155
132
|
|
@@ -165,7 +142,7 @@ contract StakingService is
|
|
165
142
|
)
|
166
143
|
external
|
167
144
|
virtual
|
168
|
-
|
145
|
+
restricted()
|
169
146
|
returns (
|
170
147
|
NftId stakeNftId
|
171
148
|
)
|
@@ -207,7 +184,7 @@ contract StakingService is
|
|
207
184
|
)
|
208
185
|
external
|
209
186
|
virtual
|
210
|
-
|
187
|
+
restricted()
|
211
188
|
onlyNftOwner(stakeNftId)
|
212
189
|
{
|
213
190
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
@@ -235,7 +212,7 @@ contract StakingService is
|
|
235
212
|
)
|
236
213
|
external
|
237
214
|
virtual
|
238
|
-
|
215
|
+
restricted()
|
239
216
|
onlyNftOwner(stakeNftId)
|
240
217
|
returns (
|
241
218
|
NftId newStakeNftId
|
@@ -250,7 +227,8 @@ contract StakingService is
|
|
250
227
|
NftId stakeNftId
|
251
228
|
)
|
252
229
|
external
|
253
|
-
|
230
|
+
virtual
|
231
|
+
restricted()
|
254
232
|
{
|
255
233
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
256
234
|
$._staking.updateRewards(stakeNftId);
|
@@ -262,7 +240,7 @@ contract StakingService is
|
|
262
240
|
function claimRewards(NftId stakeNftId)
|
263
241
|
external
|
264
242
|
virtual
|
265
|
-
|
243
|
+
restricted()
|
266
244
|
onlyNftOwner(stakeNftId)
|
267
245
|
{
|
268
246
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
@@ -280,7 +258,7 @@ contract StakingService is
|
|
280
258
|
function unstake(NftId stakeNftId)
|
281
259
|
external
|
282
260
|
virtual
|
283
|
-
|
261
|
+
restricted()
|
284
262
|
onlyNftOwner(stakeNftId)
|
285
263
|
{
|
286
264
|
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
@@ -307,10 +285,13 @@ contract StakingService is
|
|
307
285
|
)
|
308
286
|
external
|
309
287
|
virtual
|
288
|
+
restricted()
|
310
289
|
{
|
290
|
+
// TODO implement
|
311
291
|
|
312
292
|
}
|
313
293
|
|
294
|
+
//--- view functions ----------------------------------------------------//
|
314
295
|
|
315
296
|
function getDipToken()
|
316
297
|
external
|
@@ -338,6 +319,7 @@ contract StakingService is
|
|
338
319
|
return _getStakingServiceStorage()._staking;
|
339
320
|
}
|
340
321
|
|
322
|
+
//--- internal functions ------------------------------------------------//
|
341
323
|
|
342
324
|
function _initialize(
|
343
325
|
address owner,
|
@@ -398,9 +380,32 @@ contract StakingService is
|
|
398
380
|
}
|
399
381
|
|
400
382
|
|
383
|
+
function _refillRewardReserves(NftId targetNftId, address rewardProvider, Amount dipAmount)
|
384
|
+
internal
|
385
|
+
virtual
|
386
|
+
returns (Amount newBalance)
|
387
|
+
{
|
388
|
+
// update reward reserve book keeping
|
389
|
+
StakingServiceStorage storage $ = _getStakingServiceStorage();
|
390
|
+
newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
|
391
|
+
|
392
|
+
// collect reward dip from provider
|
393
|
+
$._staking.collectDipAmount(
|
394
|
+
rewardProvider,
|
395
|
+
dipAmount);
|
396
|
+
|
397
|
+
emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
|
398
|
+
}
|
399
|
+
|
400
|
+
|
401
401
|
function _getStakingServiceStorage() private pure returns (StakingServiceStorage storage $) {
|
402
402
|
assembly {
|
403
403
|
$.slot := STAKING_SERVICE_LOCATION_V1
|
404
404
|
}
|
405
405
|
}
|
406
|
+
|
407
|
+
|
408
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
409
|
+
return STAKING();
|
410
|
+
}
|
406
411
|
}
|