@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
@@ -13,6 +13,7 @@ import {NftId, NftIdLib} from "../type/NftId.sol";
|
|
13
13
|
import {ObjectType} from "../type/ObjectType.sol";
|
14
14
|
import {Registerable} from "../shared/Registerable.sol";
|
15
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
+
import {VersionPartLib} from "../type/Version.sol";
|
16
17
|
|
17
18
|
abstract contract Component is
|
18
19
|
AccessManagedUpgradeable,
|
@@ -251,6 +252,7 @@ abstract contract Component is
|
|
251
252
|
|
252
253
|
}
|
253
254
|
|
255
|
+
|
254
256
|
/// @dev for component contracts that hold its own component information
|
255
257
|
/// this function creates and sets a token hanlder for the components tokens
|
256
258
|
function _createAndSetTokenHandler()
|
@@ -260,6 +262,7 @@ abstract contract Component is
|
|
260
262
|
$._tokenHandler = new TokenHandler(address($._token));
|
261
263
|
}
|
262
264
|
|
265
|
+
|
263
266
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
264
267
|
/// eg for instance linked components that externally store this information with the instance store contract
|
265
268
|
function _getComponentInfo() internal virtual view returns (IComponents.ComponentInfo memory info) {
|
@@ -10,8 +10,8 @@ import {IRegistryService} from "../registry/IRegistryService.sol";
|
|
10
10
|
import {IInstance} from "../instance/IInstance.sol";
|
11
11
|
import {IAccess} from "../instance/module/IAccess.sol";
|
12
12
|
import {NftId} from "../type/NftId.sol";
|
13
|
-
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
14
|
-
import {RoleId, DISTRIBUTION_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, POLICY_SERVICE_ROLE, PRODUCT_SERVICE_ROLE} from "../type/RoleId.sol";
|
13
|
+
import {ObjectType, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
14
|
+
import {RoleId, DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, POLICY_SERVICE_ROLE, PRODUCT_SERVICE_ROLE} from "../type/RoleId.sol";
|
15
15
|
import {KEEP_STATE} from "../type/StateId.sol";
|
16
16
|
import {IComponents} from "../instance/module/IComponents.sol";
|
17
17
|
import {IComponentService} from "./IComponentService.sol";
|
@@ -64,11 +64,6 @@ contract ComponentService is
|
|
64
64
|
registerInterface(type(IComponentService).interfaceId);
|
65
65
|
}
|
66
66
|
|
67
|
-
|
68
|
-
function getDomain() public pure virtual override returns(ObjectType) {
|
69
|
-
return COMPONENT();
|
70
|
-
}
|
71
|
-
|
72
67
|
//-------- component ----------------------------------------------------//
|
73
68
|
|
74
69
|
function setWallet(address newWallet) external virtual {
|
@@ -280,9 +275,31 @@ contract ComponentService is
|
|
280
275
|
_changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
|
281
276
|
}
|
282
277
|
|
278
|
+
//-------- oracle -------------------------------------------------------//
|
279
|
+
|
280
|
+
function registerOracle()
|
281
|
+
external
|
282
|
+
virtual
|
283
|
+
{
|
284
|
+
address contractAddress = msg.sender;
|
285
|
+
RoleId[] memory roles = new RoleId[](0);
|
286
|
+
bytes4[][] memory selectors = new bytes4[][](0);
|
287
|
+
|
288
|
+
// register/create component setup
|
289
|
+
(
|
290
|
+
, // instance reader
|
291
|
+
InstanceStore instanceStore,
|
292
|
+
NftId componentNftId
|
293
|
+
) = _register(
|
294
|
+
contractAddress,
|
295
|
+
ORACLE(),
|
296
|
+
ORACLE_OWNER_ROLE(),
|
297
|
+
roles,
|
298
|
+
selectors);
|
299
|
+
}
|
300
|
+
|
283
301
|
//-------- pool ---------------------------------------------------------//
|
284
302
|
|
285
|
-
/// @dev registers the sending component as a distribution component
|
286
303
|
function registerPool()
|
287
304
|
external
|
288
305
|
virtual
|
@@ -291,7 +308,7 @@ contract ComponentService is
|
|
291
308
|
RoleId[] memory roles = new RoleId[](2);
|
292
309
|
bytes4[][] memory selectors = new bytes4[][](2);
|
293
310
|
|
294
|
-
// authorizaion for
|
311
|
+
// authorizaion for pool owner
|
295
312
|
roles[0] = POOL_OWNER_ROLE();
|
296
313
|
selectors[0] = _createSelectors(IPoolComponent.setFees.selector);
|
297
314
|
|
@@ -593,4 +610,8 @@ contract ComponentService is
|
|
593
610
|
revert ErrorComponentServiceExpectedRoleMissing(info.parentNftId, requiredRole, owner);
|
594
611
|
}
|
595
612
|
}
|
613
|
+
|
614
|
+
function _getDomain() internal pure virtual override returns(ObjectType) {
|
615
|
+
return COMPONENT();
|
616
|
+
}
|
596
617
|
}
|
@@ -33,12 +33,10 @@ abstract contract ComponentVerifyingService is
|
|
33
33
|
)
|
34
34
|
{
|
35
35
|
componentNftId = getRegistry().getNftId(msg.sender);
|
36
|
-
(componentInfo, instance) = _getAndVerifyComponentInfo(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
41
|
-
}
|
36
|
+
(componentInfo, instance) = _getAndVerifyComponentInfo(
|
37
|
+
componentNftId,
|
38
|
+
expectedType,
|
39
|
+
true); // only active
|
42
40
|
}
|
43
41
|
|
44
42
|
|
@@ -48,7 +46,8 @@ abstract contract ComponentVerifyingService is
|
|
48
46
|
/// - the component has the wrong object type
|
49
47
|
function _getAndVerifyComponentInfo(
|
50
48
|
NftId componentNftId,
|
51
|
-
ObjectType expectedType // assume always of `component` type
|
49
|
+
ObjectType expectedType, // assume always of `component` type
|
50
|
+
bool onlyActive
|
52
51
|
)
|
53
52
|
internal
|
54
53
|
virtual
|
@@ -85,6 +84,13 @@ abstract contract ComponentVerifyingService is
|
|
85
84
|
}
|
86
85
|
|
87
86
|
instance = _getInstance(info.parentNftId);
|
87
|
+
|
88
|
+
// ensure component is not locked
|
89
|
+
if (onlyActive) {
|
90
|
+
if (instance.getInstanceAccessManager().isTargetClosed(info.objectAddress)) {
|
91
|
+
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
92
|
+
}
|
93
|
+
}
|
88
94
|
}
|
89
95
|
|
90
96
|
|
@@ -52,6 +52,8 @@ interface IComponentService is
|
|
52
52
|
function unlock() external;
|
53
53
|
|
54
54
|
//-------- product ------------------------------------------------------//
|
55
|
+
|
56
|
+
/// @dev registers the sending component as a product component
|
55
57
|
function registerProduct() external;
|
56
58
|
|
57
59
|
function setProductFees(
|
@@ -63,6 +65,8 @@ interface IComponentService is
|
|
63
65
|
function decreaseProductFees(InstanceStore instanceStore, NftId productNftId, Amount feeAmount) external;
|
64
66
|
|
65
67
|
//-------- distribution -------------------------------------------------//
|
68
|
+
|
69
|
+
/// @dev registers the sending component as a distribution component
|
66
70
|
function registerDistribution() external;
|
67
71
|
|
68
72
|
function setDistributionFees(
|
@@ -73,7 +77,14 @@ interface IComponentService is
|
|
73
77
|
function increaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
74
78
|
function decreaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
75
79
|
|
80
|
+
//-------- oracle -------------------------------------------------------//
|
81
|
+
|
82
|
+
/// @dev registers the sending component as an oracle component
|
83
|
+
function registerOracle() external;
|
84
|
+
|
76
85
|
//-------- pool ---------------------------------------------------------//
|
86
|
+
|
87
|
+
/// @dev registers the sending component as a pool component
|
77
88
|
function registerPool() external;
|
78
89
|
|
79
90
|
function setPoolFees(
|
@@ -6,6 +6,7 @@ import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessMana
|
|
6
6
|
import {IRegisterable} from "./IRegisterable.sol";
|
7
7
|
import {IVersionable} from "./IVersionable.sol";
|
8
8
|
import {ObjectType} from "../type/ObjectType.sol";
|
9
|
+
import {RoleId} from "../type/RoleId.sol";
|
9
10
|
|
10
11
|
interface IService is
|
11
12
|
IRegisterable,
|
@@ -14,5 +15,11 @@ interface IService is
|
|
14
15
|
{
|
15
16
|
error ErrorServiceNotImplemented();
|
16
17
|
|
18
|
+
/// @dev returns the domain for this service.
|
19
|
+
/// In any GIF release only one service for any given domain may be deployed.
|
17
20
|
function getDomain() external pure returns(ObjectType serviceDomain);
|
21
|
+
|
22
|
+
/// @dev returns the GIF release specific role id.
|
23
|
+
/// These role ids are used to authorize service to service communication.
|
24
|
+
function getRoleId() external pure returns(RoleId serviceRoleId);
|
18
25
|
}
|
@@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
5
5
|
|
6
6
|
import {NftId} from "../type/NftId.sol";
|
7
|
-
import {ObjectType, COMPONENT, BUNDLE, POLICY, RISK, CLAIM, PAYOUT} from "../type/ObjectType.sol";
|
8
|
-
import {StateId, ACTIVE, PAUSED, ARCHIVED, CLOSED, APPLIED, COLLATERALIZED, REVOKED, SUBMITTED, CONFIRMED, DECLINED, EXPECTED, PAID} from "../type/StateId.sol";
|
7
|
+
import {ObjectType, COMPONENT, BUNDLE, POLICY, REQUEST, RISK, CLAIM, PAYOUT} from "../type/ObjectType.sol";
|
8
|
+
import {StateId, ACTIVE, PAUSED, ARCHIVED, CLOSED, APPLIED, COLLATERALIZED, REVOKED, SUBMITTED, CONFIRMED, DECLINED, EXPECTED, PAID, FULFILLED, FAILED, CANCELLED} from "../type/StateId.sol";
|
9
9
|
import {ILifecycle} from "./ILifecycle.sol";
|
10
10
|
|
11
11
|
contract Lifecycle is
|
@@ -27,6 +27,7 @@ contract Lifecycle is
|
|
27
27
|
_setupPolicyLifecycle();
|
28
28
|
_setupClaimAndPayoutLifecycle();
|
29
29
|
_setupRiskLifecycle();
|
30
|
+
_setupRequestLifecycle();
|
30
31
|
}
|
31
32
|
|
32
33
|
function hasLifecycle(
|
@@ -118,4 +119,12 @@ contract Lifecycle is
|
|
118
119
|
_isValidTransition[RISK()][PAUSED()][ACTIVE()] = true;
|
119
120
|
_isValidTransition[RISK()][PAUSED()][ARCHIVED()] = true;
|
120
121
|
}
|
122
|
+
|
123
|
+
function _setupRequestLifecycle() internal {
|
124
|
+
_initialState[REQUEST()] = ACTIVE();
|
125
|
+
_isValidTransition[REQUEST()][ACTIVE()][FULFILLED()] = true;
|
126
|
+
_isValidTransition[REQUEST()][ACTIVE()][FAILED()] = true;
|
127
|
+
_isValidTransition[REQUEST()][FAILED()][FULFILLED()] = true;
|
128
|
+
_isValidTransition[REQUEST()][ACTIVE()][CANCELLED()] = true;
|
129
|
+
}
|
121
130
|
}
|
@@ -4,17 +4,15 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {Version, VersionPart, VersionLib, VersionPartLib} from "../type/Version.sol";
|
10
|
-
|
11
|
-
import {Versionable} from "./Versionable.sol";
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
12
8
|
import {IService} from "./IService.sol";
|
13
9
|
import {IVersionable} from "./IVersionable.sol";
|
14
|
-
import {
|
10
|
+
import {NftId} from "../type/NftId.sol";
|
11
|
+
import {ObjectType, REGISTRY, SERVICE} from "../type/ObjectType.sol";
|
15
12
|
import {Registerable} from "./Registerable.sol";
|
16
|
-
|
17
|
-
import {
|
13
|
+
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
14
|
+
import {Version, VersionPart, VersionLib, VersionPartLib} from "../type/Version.sol";
|
15
|
+
import {Versionable} from "./Versionable.sol";
|
18
16
|
|
19
17
|
|
20
18
|
/// @dev service base contract
|
@@ -27,15 +25,6 @@ abstract contract Service is
|
|
27
25
|
|
28
26
|
uint8 private constant GIF_MAJOR_VERSION = 3;
|
29
27
|
|
30
|
-
// from Versionable
|
31
|
-
function getVersion()
|
32
|
-
public
|
33
|
-
pure
|
34
|
-
virtual override (IVersionable, Versionable)
|
35
|
-
returns(Version)
|
36
|
-
{
|
37
|
-
return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
|
38
|
-
}
|
39
28
|
|
40
29
|
function initializeService(
|
41
30
|
address registry,
|
@@ -58,9 +47,7 @@ abstract contract Service is
|
|
58
47
|
if(authority != address(0)) {
|
59
48
|
__AccessManaged_init(authority);
|
60
49
|
} else {
|
61
|
-
address registryServiceAddress =
|
62
|
-
REGISTRY(),
|
63
|
-
VersionPartLib.toVersionPart(GIF_MAJOR_VERSION));
|
50
|
+
address registryServiceAddress = _getServiceAddress(REGISTRY());
|
64
51
|
|
65
52
|
// copy authority from already registered registry services
|
66
53
|
__AccessManaged_init(IAccessManaged(registryServiceAddress).authority());
|
@@ -70,8 +57,27 @@ abstract contract Service is
|
|
70
57
|
registerInterface(type(IService).interfaceId);
|
71
58
|
}
|
72
59
|
|
60
|
+
function getDomain() external virtual pure returns(ObjectType serviceDomain) {
|
61
|
+
return _getDomain();
|
62
|
+
}
|
63
|
+
|
64
|
+
function getRoleId() external virtual pure returns(RoleId serviceRoleId) {
|
65
|
+
return RoleIdLib.roleForTypeAndVersion(_getDomain(), VersionPartLib.toVersionPart(GIF_MAJOR_VERSION));
|
66
|
+
}
|
67
|
+
|
68
|
+
// from Versionable
|
69
|
+
function getVersion()
|
70
|
+
public
|
71
|
+
pure
|
72
|
+
virtual override (IVersionable, Versionable)
|
73
|
+
returns(Version)
|
74
|
+
{
|
75
|
+
return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
|
76
|
+
}
|
77
|
+
|
78
|
+
function _getDomain() internal virtual pure returns (ObjectType);
|
73
79
|
|
74
80
|
function _getServiceAddress(ObjectType domain) internal view returns (address) {
|
75
|
-
return getRegistry().getServiceAddress(domain,
|
81
|
+
return getRegistry().getServiceAddress(domain, VersionPartLib.toVersionPart(GIF_MAJOR_VERSION));
|
76
82
|
}
|
77
83
|
}
|
@@ -52,21 +52,25 @@ interface IStakingService is IService
|
|
52
52
|
UFixed initialRewardRate
|
53
53
|
) external;
|
54
54
|
|
55
|
-
/// @dev
|
55
|
+
/// @dev Set the instance stake locking period to the specified duration.
|
56
56
|
/// permissioned: only the owner of the specified target may set the locking period
|
57
|
-
function
|
57
|
+
function setInstanceLockingPeriod(NftId instanceNftId, Seconds lockingPeriod) external;
|
58
58
|
|
59
|
-
/// @dev
|
59
|
+
/// @dev Set the instance reward rate to the specified value
|
60
60
|
/// permissioned: only the owner of the specified target may set the locking period
|
61
|
-
function
|
61
|
+
function setInstanceRewardRate(NftId instanceNftId, UFixed rewardRate) external;
|
62
62
|
|
63
|
-
/// @dev (
|
63
|
+
/// @dev (Re)fills the staking reward reserves for the specified target using the dips provided by the reward provider.
|
64
64
|
/// unpermissioned: anybody may fill up staking reward reserves
|
65
|
-
function
|
65
|
+
function refillInstanceRewardReserves(NftId instanceNftId, address rewardProvider, Amount dipAmount) external returns (Amount newBalance);
|
66
|
+
|
67
|
+
/// @dev (Re)fills the staking reward reserves for the specified target using the dips provided by the sender
|
68
|
+
/// unpermissioned: anybody may fill up staking reward reserves
|
69
|
+
function refillRewardReservesBySender(NftId targetNftId, Amount dipAmount) external returns (Amount newBalance);
|
66
70
|
|
67
71
|
/// @dev defunds the staking reward reserves for the specified target
|
68
72
|
/// permissioned: only the target owner may call this function
|
69
|
-
function
|
73
|
+
function withdrawInstanceRewardReserves(NftId instanceNftId, Amount dipAmount) external returns (Amount newBalance);
|
70
74
|
|
71
75
|
/// @dev create a new stake with amount DIP to the specified target
|
72
76
|
/// returns the id of the newly minted stake nft
|
@@ -13,12 +13,64 @@ import {NftId} from "../type/NftId.sol";
|
|
13
13
|
import {ObjectType, INSTANCE, PROTOCOL, TARGET} from "../type/ObjectType.sol";
|
14
14
|
import {Seconds, SecondsLib} from "../type/Seconds.sol";
|
15
15
|
import {StakingReader} from "./StakingReader.sol";
|
16
|
+
import {StakingStore} from "./StakingStore.sol";
|
16
17
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
17
18
|
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
18
19
|
|
19
20
|
|
20
21
|
library StakeManagerLib {
|
21
22
|
|
23
|
+
function stake(
|
24
|
+
IRegistry registry,
|
25
|
+
StakingReader stakingReader,
|
26
|
+
StakingStore stakingStore,
|
27
|
+
NftId stakeNftId,
|
28
|
+
Amount stakeAmount
|
29
|
+
)
|
30
|
+
external
|
31
|
+
returns (Amount stakeBalance)
|
32
|
+
{
|
33
|
+
// check that target is active for staking
|
34
|
+
(
|
35
|
+
UFixed rewardRate,
|
36
|
+
Seconds lockingPeriod
|
37
|
+
) = checkStakeParameters(
|
38
|
+
stakingReader,
|
39
|
+
stakeNftId);
|
40
|
+
|
41
|
+
// calculate new rewards (if any)
|
42
|
+
(
|
43
|
+
Amount rewardIncrementAmount,
|
44
|
+
Amount currentTotalDipAmount
|
45
|
+
) = calculateRewardIncrease(
|
46
|
+
stakingReader,
|
47
|
+
stakeNftId,
|
48
|
+
rewardRate);
|
49
|
+
|
50
|
+
stakeBalance = currentTotalDipAmount + stakeAmount;
|
51
|
+
|
52
|
+
// TODO check that additional dip, rewards and rewards increment
|
53
|
+
// are still ok with max target staking amount
|
54
|
+
NftId targetNftId = registry.getObjectInfo(stakeNftId).parentNftId;
|
55
|
+
|
56
|
+
stakingStore.restakeRewards(
|
57
|
+
stakeNftId,
|
58
|
+
targetNftId,
|
59
|
+
rewardIncrementAmount);
|
60
|
+
|
61
|
+
stakingStore.increaseStake(
|
62
|
+
stakeNftId,
|
63
|
+
targetNftId,
|
64
|
+
stakeAmount);
|
65
|
+
|
66
|
+
// update locked until with target locking period
|
67
|
+
stakingStore.update(
|
68
|
+
stakeNftId,
|
69
|
+
IStaking.StakeInfo({
|
70
|
+
lockedUntil: TimestampLib.blockTimestamp().addSeconds(
|
71
|
+
lockingPeriod)}));
|
72
|
+
|
73
|
+
}
|
22
74
|
|
23
75
|
function checkCreateParameters(
|
24
76
|
StakingReader stakingReader,
|