@etherisc/gif-next 0.0.2-7ca6cd9-950 → 0.0.2-7d65090-351
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/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/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +6 -6
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- 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 +72 -116
- 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 +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +13 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +66 -29
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +27 -15
- 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/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.json +129 -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 +1647 -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 +80 -154
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.json +171 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +187 -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/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.json +1559 -0
- 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 +94 -73
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +41 -37
- 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/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.json +1189 -0
- 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 +13 -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 +2 -2
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +2 -2
- 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 +83 -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 +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- 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/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/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/distribution/DistributionService.sol +3 -4
- package/contracts/instance/IInstance.sol +10 -5
- package/contracts/instance/IInstanceService.sol +24 -8
- package/contracts/instance/Instance.sol +59 -32
- package/contracts/instance/InstanceReader.sol +2 -0
- package/contracts/instance/InstanceService.sol +85 -8
- package/contracts/instance/InstanceStore.sol +4 -16
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectManager.sol +1 -3
- package/contracts/oracle/OracleService.sol +5 -4
- 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/PolicyService.sol +5 -5
- package/contracts/product/PricingService.sol +4 -5
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/IServiceAuthorization.sol +35 -0
- package/contracts/registry/Registry.sol +6 -0
- package/contracts/registry/RegistryAdmin.sol +244 -148
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/registry/RegistryServiceManager.sol +0 -5
- package/contracts/registry/ReleaseManager.sol +96 -169
- package/contracts/registry/ServiceAuthorization.sol +86 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/shared/AccessAdmin.sol +759 -0
- package/contracts/shared/AccessManagerCustom.sol +6 -1
- package/contracts/shared/AccessManagerExtended.sol +12 -1
- package/contracts/shared/ComponentService.sol +4 -5
- package/contracts/shared/IAccessAdmin.sol +168 -0
- package/contracts/shared/IService.sol +7 -0
- 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 +135 -62
- package/contracts/type/RoleId.sol +74 -19
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/String.sol +53 -0
- package/package.json +1 -1
- 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
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
|
6
|
+
import {Amount} from "../type/Amount.sol";
|
6
7
|
import {ClaimId} from "../type/ClaimId.sol";
|
7
8
|
import {DistributorType} from "../type/DistributorType.sol";
|
8
9
|
import {PayoutId} from "../type/PayoutId.sol";
|
@@ -13,6 +14,8 @@ import {RiskId} from "../type/RiskId.sol";
|
|
13
14
|
import {VersionPart} from "../type/Version.sol";
|
14
15
|
import {Key32} from "../type/Key32.sol";
|
15
16
|
import {RoleId} from "../type/RoleId.sol";
|
17
|
+
import {Seconds} from "../type/Seconds.sol";
|
18
|
+
import {UFixed} from "../type/UFixed.sol";
|
16
19
|
|
17
20
|
import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtendedInitializeable.sol";
|
18
21
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
@@ -67,11 +70,13 @@ interface IInstance is
|
|
67
70
|
function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
|
68
71
|
function setTargetLocked(address target, bool locked) external;
|
69
72
|
|
70
|
-
function
|
71
|
-
function
|
72
|
-
function
|
73
|
-
|
74
|
-
|
73
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
74
|
+
function setStakingRewardRate(UFixed rewardRate) external;
|
75
|
+
function refillStakingRewardReserves(Amount dipAmount) external;
|
76
|
+
|
77
|
+
/// @dev defunds the staking reward reserves for the specified target
|
78
|
+
/// permissioned: only the target owner may call this function
|
79
|
+
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
75
80
|
|
76
81
|
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
77
82
|
function getInstanceReader() external view returns (InstanceReader);
|
@@ -1,19 +1,24 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../type/Amount.sol";
|
5
|
+
import {BundleManager} from "./BundleManager.sol";
|
6
|
+
import {Instance} from "./Instance.sol";
|
7
|
+
import {IService} from "../shared/IService.sol";
|
4
8
|
import {NftId} from "../type/NftId.sol";
|
5
9
|
import {ObjectType} from "../type/ObjectType.sol";
|
6
10
|
import {RoleId} from "../type/RoleId.sol";
|
7
|
-
import {
|
8
|
-
|
9
|
-
import {
|
10
|
-
import {Instance} from "./Instance.sol";
|
11
|
-
import {InstanceReader} from "./InstanceReader.sol";
|
12
|
-
import {BundleManager} from "./BundleManager.sol";
|
13
|
-
import {InstanceStore} from "./InstanceStore.sol";
|
11
|
+
import {Seconds} from "../type/Seconds.sol";
|
12
|
+
import {UFixed} from "../type/UFixed.sol";
|
13
|
+
import {VersionPart} from "../type/Version.sol";
|
14
14
|
|
15
15
|
interface IInstanceService is IService {
|
16
16
|
|
17
|
+
// onlyInstance
|
18
|
+
error ErrorInstanceServiceNotRegistered(address instance);
|
19
|
+
error ErrorInstanceServiceNotInstance(address instance, ObjectType objectType);
|
20
|
+
error ErrorInstanceServiceInstanceVersionMismatch(address instance, VersionPart instanceVersion);
|
21
|
+
|
17
22
|
error ErrorInstanceServiceComponentNotInstanceLinked(address component);
|
18
23
|
|
19
24
|
error ErrorInstanceServiceMasterInstanceAlreadySet();
|
@@ -39,7 +44,7 @@ interface IInstanceService is IService {
|
|
39
44
|
error ErrorInstanceServiceInstanceStoreAuthorityMismatch();
|
40
45
|
|
41
46
|
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
42
|
-
error
|
47
|
+
error ErrorInstanceServiceNotInstanceNftId(NftId nftId);
|
43
48
|
error ErrorInstanceServiceComponentNotRegistered(address componentAddress);
|
44
49
|
error ErrorInstanceServiceInstanceComponentMismatch(NftId instanceNftId, NftId componentNftId);
|
45
50
|
error ErrorInstanceServiceInvalidComponentType(address componentAddress, ObjectType expectedType, ObjectType componentType);
|
@@ -57,10 +62,21 @@ interface IInstanceService is IService {
|
|
57
62
|
function createInstanceClone()
|
58
63
|
external
|
59
64
|
returns (
|
65
|
+
// TODO check if Instance can be changed to IInstance
|
60
66
|
Instance clonedInstance,
|
61
67
|
NftId instanceNftId
|
62
68
|
);
|
63
69
|
|
70
|
+
|
71
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
72
|
+
function setStakingRewardRate(UFixed rewardRate) external;
|
73
|
+
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount) external;
|
74
|
+
|
75
|
+
/// @dev defunds the staking reward reserves for the specified target
|
76
|
+
/// permissioned: only the target owner may call this function
|
77
|
+
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
78
|
+
|
79
|
+
|
64
80
|
function createComponentTarget(
|
65
81
|
NftId instanceNftId,
|
66
82
|
address targetAddress,
|
@@ -3,16 +3,19 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
|
6
|
+
import {Amount} from "../type/Amount.sol";
|
6
7
|
import {Key32} from "../type/Key32.sol";
|
7
8
|
import {NftId} from "../type/NftId.sol";
|
8
9
|
import {RiskId} from "../type/RiskId.sol";
|
9
10
|
import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../type/ObjectType.sol";
|
10
11
|
import {RoleId, RoleIdLib, eqRoleId, ADMIN_ROLE, INSTANCE_ROLE, INSTANCE_OWNER_ROLE} from "../type/RoleId.sol";
|
11
|
-
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
12
12
|
import {ClaimId} from "../type/ClaimId.sol";
|
13
13
|
import {ReferralId} from "../type/Referral.sol";
|
14
14
|
import {PayoutId} from "../type/PayoutId.sol";
|
15
15
|
import {DistributorType} from "../type/DistributorType.sol";
|
16
|
+
import {Seconds} from "../type/Seconds.sol";
|
17
|
+
import {UFixed} from "../type/UFixed.sol";
|
18
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
16
19
|
|
17
20
|
import {Registerable} from "../shared/Registerable.sol";
|
18
21
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
@@ -21,6 +24,7 @@ import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtend
|
|
21
24
|
import {IRegistry} from "../registry/IRegistry.sol";
|
22
25
|
|
23
26
|
import {IInstance} from "./IInstance.sol";
|
27
|
+
import {IInstanceService} from "./IInstanceService.sol";
|
24
28
|
import {InstanceReader} from "./InstanceReader.sol";
|
25
29
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
26
30
|
import {BundleManager} from "./BundleManager.sol";
|
@@ -49,6 +53,7 @@ contract Instance is
|
|
49
53
|
|
50
54
|
bool private _initialized;
|
51
55
|
|
56
|
+
IInstanceService internal _instanceService;
|
52
57
|
InstanceAdmin internal _instanceAdmin;
|
53
58
|
InstanceReader internal _instanceReader;
|
54
59
|
BundleManager internal _bundleManager;
|
@@ -74,13 +79,52 @@ contract Instance is
|
|
74
79
|
IRegistry registry = IRegistry(registryAddress);
|
75
80
|
initializeRegisterable(registryAddress, registry.getNftId(), INSTANCE(), true, initialOwner, "");
|
76
81
|
|
82
|
+
_instanceService = IInstanceService(
|
83
|
+
getRegistry().getServiceAddress(
|
84
|
+
INSTANCE(),
|
85
|
+
getMajorVersion()));
|
86
|
+
|
77
87
|
registerInterface(type(IInstance).interfaceId);
|
78
88
|
}
|
79
89
|
|
90
|
+
//--- Staking ----------------------------------------------------------//
|
91
|
+
|
92
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
93
|
+
external
|
94
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
95
|
+
onlyOwner()
|
96
|
+
{
|
97
|
+
_instanceService.setStakingLockingPeriod(stakeLockingPeriod);
|
98
|
+
}
|
99
|
+
|
100
|
+
function setStakingRewardRate(UFixed rewardRate)
|
101
|
+
external
|
102
|
+
onlyOwner()
|
103
|
+
{
|
104
|
+
_instanceService.setStakingRewardRate(rewardRate);
|
105
|
+
}
|
106
|
+
|
107
|
+
function refillStakingRewardReserves(Amount dipAmount)
|
108
|
+
external
|
109
|
+
onlyOwner()
|
110
|
+
{
|
111
|
+
address instanceOwner = msg.sender;
|
112
|
+
_instanceService.refillStakingRewardReserves(instanceOwner, dipAmount);
|
113
|
+
}
|
114
|
+
|
115
|
+
function withdrawStakingRewardReserves(Amount dipAmount)
|
116
|
+
external
|
117
|
+
onlyOwner()
|
118
|
+
returns (Amount newBalance)
|
119
|
+
{
|
120
|
+
return _instanceService.withdrawStakingRewardReserves(dipAmount);
|
121
|
+
}
|
122
|
+
|
80
123
|
//--- Roles ------------------------------------------------------------//
|
81
124
|
|
82
125
|
function createRole(string memory roleName, string memory adminName)
|
83
126
|
external
|
127
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
84
128
|
restricted // INSTANCE_OWNER_ROLE
|
85
129
|
returns (RoleId roleId, RoleId admin)
|
86
130
|
{
|
@@ -89,6 +133,7 @@ contract Instance is
|
|
89
133
|
|
90
134
|
function grantRole(RoleId roleId, address account)
|
91
135
|
external
|
136
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
92
137
|
restricted // INSTANCE_OWNER_ROLE
|
93
138
|
{
|
94
139
|
AccessManagerExtendedInitializeable(authority()).grantRole(roleId.toInt(), account, 0);
|
@@ -96,6 +141,7 @@ contract Instance is
|
|
96
141
|
|
97
142
|
function revokeRole(RoleId roleId, address account)
|
98
143
|
external
|
144
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
99
145
|
restricted // INSTANCE_OWNER_ROLE
|
100
146
|
{
|
101
147
|
AccessManagerExtendedInitializeable(authority()).revokeRole(roleId.toInt(), account);
|
@@ -105,6 +151,7 @@ contract Instance is
|
|
105
151
|
|
106
152
|
function createTarget(address target, string memory name)
|
107
153
|
external
|
154
|
+
// TODO decide if onlyOwner or restricted to instance owner role is better
|
108
155
|
restricted // INSTANCE_OWNER_ROLE
|
109
156
|
{
|
110
157
|
_instanceAdmin.createTarget(target, name);
|
@@ -176,6 +223,16 @@ contract Instance is
|
|
176
223
|
_instanceReader = instanceReader;
|
177
224
|
}
|
178
225
|
|
226
|
+
function setInstanceStore(InstanceStore instanceStore) external restricted {
|
227
|
+
if(address(_instanceStore) != address(0)) {
|
228
|
+
revert ErrorInstanceInstanceStoreAlreadySet(address(_instanceStore));
|
229
|
+
}
|
230
|
+
if(instanceStore.authority() != authority()) {
|
231
|
+
revert ErrorInstanceInstanceStoreAuthorityMismatch(authority());
|
232
|
+
}
|
233
|
+
_instanceStore = instanceStore;
|
234
|
+
}
|
235
|
+
|
179
236
|
//--- external view functions -------------------------------------------//
|
180
237
|
|
181
238
|
function getInstanceReader() external view returns (InstanceReader) {
|
@@ -194,43 +251,13 @@ contract Instance is
|
|
194
251
|
return AccessManagerExtendedInitializeable(authority());
|
195
252
|
}
|
196
253
|
|
197
|
-
function setInstanceStore(InstanceStore instanceStore) external restricted {
|
198
|
-
if(address(_instanceStore) != address(0)) {
|
199
|
-
revert ErrorInstanceInstanceStoreAlreadySet(address(_instanceStore));
|
200
|
-
}
|
201
|
-
if(instanceStore.authority() != authority()) {
|
202
|
-
revert ErrorInstanceInstanceStoreAuthorityMismatch(authority());
|
203
|
-
}
|
204
|
-
_instanceStore = instanceStore;
|
205
|
-
}
|
206
|
-
|
207
254
|
function getInstanceStore() external view returns (InstanceStore) {
|
208
255
|
return _instanceStore;
|
209
256
|
}
|
210
257
|
|
211
|
-
function getMajorVersion()
|
258
|
+
function getMajorVersion() public pure returns (VersionPart majorVersion) {
|
212
259
|
return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
|
213
260
|
}
|
214
261
|
|
215
|
-
function getDistributionService() external view returns (IDistributionService) {
|
216
|
-
return IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), VersionPart.wrap(3)));
|
217
|
-
}
|
218
|
-
|
219
|
-
function getProductService() external view returns (IProductService) {
|
220
|
-
return IProductService(getRegistry().getServiceAddress(PRODUCT(), VersionPart.wrap(3)));
|
221
|
-
}
|
222
|
-
|
223
|
-
function getPoolService() external view returns (IPoolService) {
|
224
|
-
return IPoolService(getRegistry().getServiceAddress(POOL(), VersionPart.wrap(3)));
|
225
|
-
}
|
226
|
-
|
227
|
-
function getPolicyService() external view returns (IPolicyService) {
|
228
|
-
return IPolicyService(getRegistry().getServiceAddress(POLICY(), VersionPart.wrap(3)));
|
229
|
-
}
|
230
|
-
|
231
|
-
function getBundleService() external view returns (IBundleService) {
|
232
|
-
return IBundleService(getRegistry().getServiceAddress(BUNDLE(), VersionPart.wrap(3)));
|
233
|
-
}
|
234
|
-
|
235
262
|
//--- internal view/pure functions --------------------------------------//
|
236
263
|
}
|
@@ -337,11 +337,13 @@ contract InstanceReader {
|
|
337
337
|
);
|
338
338
|
}
|
339
339
|
|
340
|
+
|
340
341
|
function hasRole(address account, RoleId roleId) public view returns (bool isMember) {
|
341
342
|
(isMember, ) = _instance.getInstanceAccessManager().hasRole(
|
342
343
|
roleId.toInt(), account);
|
343
344
|
}
|
344
345
|
|
346
|
+
|
345
347
|
function toPolicyKey(NftId policyNftId) public pure returns (Key32) {
|
346
348
|
return policyNftId.toKey32(POLICY());
|
347
349
|
}
|
@@ -4,14 +4,15 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
5
5
|
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
7
8
|
import {BundleManager} from "./BundleManager.sol";
|
8
9
|
import {ChainNft} from "../registry/ChainNft.sol";
|
9
10
|
import {NftId} from "../type/NftId.sol";
|
10
11
|
import {RoleId} from "../type/RoleId.sol";
|
11
12
|
import {SecondsLib} from "../type/Seconds.sol";
|
12
|
-
import {UFixedLib} from "../type/UFixed.sol";
|
13
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
13
14
|
import {ADMIN_ROLE, INSTANCE_OWNER_ROLE, DISTRIBUTION_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, INSTANCE_SERVICE_ROLE, DISTRIBUTION_SERVICE_ROLE, POOL_SERVICE_ROLE, PRODUCT_SERVICE_ROLE, APPLICATION_SERVICE_ROLE, POLICY_SERVICE_ROLE, CLAIM_SERVICE_ROLE, BUNDLE_SERVICE_ROLE, INSTANCE_ROLE} from "../type/RoleId.sol";
|
14
|
-
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
15
|
+
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
15
16
|
|
16
17
|
import {Service} from "../shared/Service.sol";
|
17
18
|
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
@@ -34,6 +35,9 @@ import {IInstanceService} from "./IInstanceService.sol";
|
|
34
35
|
import {InstanceReader} from "./InstanceReader.sol";
|
35
36
|
import {InstanceStore} from "./InstanceStore.sol";
|
36
37
|
import {InstanceAuthorizationsLib} from "./InstanceAuthorizationsLib.sol";
|
38
|
+
import {Seconds} from "../type/Seconds.sol";
|
39
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
40
|
+
|
37
41
|
|
38
42
|
contract InstanceService is
|
39
43
|
Service,
|
@@ -53,6 +57,28 @@ contract InstanceService is
|
|
53
57
|
address internal _masterInstanceBundleManager;
|
54
58
|
address internal _masterInstanceStore;
|
55
59
|
|
60
|
+
|
61
|
+
modifier onlyInstance() {
|
62
|
+
address instanceAddress = msg.sender;
|
63
|
+
NftId instanceNftId = getRegistry().getNftId(msg.sender);
|
64
|
+
if (instanceNftId.eqz()) {
|
65
|
+
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
66
|
+
}
|
67
|
+
|
68
|
+
ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
|
69
|
+
if (objectType != INSTANCE()) {
|
70
|
+
revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
|
71
|
+
}
|
72
|
+
|
73
|
+
VersionPart instanceVersion = IInstance(instanceAddress).getMajorVersion();
|
74
|
+
if (instanceVersion != getVersion().toMajorPart()) {
|
75
|
+
revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
|
76
|
+
}
|
77
|
+
|
78
|
+
_;
|
79
|
+
}
|
80
|
+
|
81
|
+
|
56
82
|
modifier onlyInstanceOwner(NftId instanceNftId) {
|
57
83
|
if(msg.sender != getRegistry().ownerOf(instanceNftId)) {
|
58
84
|
revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
|
@@ -142,6 +168,57 @@ contract InstanceService is
|
|
142
168
|
clonedInstanceNftId);
|
143
169
|
}
|
144
170
|
|
171
|
+
|
172
|
+
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
173
|
+
external
|
174
|
+
virtual
|
175
|
+
onlyInstance()
|
176
|
+
{
|
177
|
+
NftId instanceNftId = getRegistry().getNftId(msg.sender);
|
178
|
+
_stakingService.setInstanceLockingPeriod(
|
179
|
+
instanceNftId,
|
180
|
+
stakeLockingPeriod);
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
function setStakingRewardRate(UFixed rewardRate)
|
185
|
+
external
|
186
|
+
virtual
|
187
|
+
onlyInstance()
|
188
|
+
{
|
189
|
+
NftId instanceNftId = getRegistry().getNftId(msg.sender);
|
190
|
+
_stakingService.setInstanceRewardRate(
|
191
|
+
instanceNftId,
|
192
|
+
rewardRate);
|
193
|
+
}
|
194
|
+
|
195
|
+
|
196
|
+
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
|
197
|
+
external
|
198
|
+
virtual
|
199
|
+
onlyInstance()
|
200
|
+
{
|
201
|
+
NftId instanceNftId = getRegistry().getNftId(msg.sender);
|
202
|
+
_stakingService.refillInstanceRewardReserves(
|
203
|
+
instanceNftId,
|
204
|
+
rewardProvider,
|
205
|
+
dipAmount);
|
206
|
+
}
|
207
|
+
|
208
|
+
|
209
|
+
function withdrawStakingRewardReserves(Amount dipAmount)
|
210
|
+
external
|
211
|
+
virtual
|
212
|
+
onlyInstance()
|
213
|
+
returns (Amount newBalance)
|
214
|
+
{
|
215
|
+
NftId instanceNftId = getRegistry().getNftId(msg.sender);
|
216
|
+
_stakingService.withdrawInstanceRewardReserves(
|
217
|
+
instanceNftId,
|
218
|
+
dipAmount);
|
219
|
+
}
|
220
|
+
|
221
|
+
|
145
222
|
function setComponentLocked(bool locked)
|
146
223
|
external
|
147
224
|
virtual
|
@@ -172,11 +249,6 @@ contract InstanceService is
|
|
172
249
|
return _masterInstanceReader;
|
173
250
|
}
|
174
251
|
|
175
|
-
// From IService
|
176
|
-
function getDomain() public pure override returns(ObjectType) {
|
177
|
-
return INSTANCE();
|
178
|
-
}
|
179
|
-
|
180
252
|
function setAndRegisterMasterInstance(address instanceAddress)
|
181
253
|
external
|
182
254
|
onlyOwner
|
@@ -348,7 +420,7 @@ contract InstanceService is
|
|
348
420
|
IRegistry registry = getRegistry();
|
349
421
|
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
350
422
|
if(instanceInfo.objectType != INSTANCE()) {
|
351
|
-
revert
|
423
|
+
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
352
424
|
}
|
353
425
|
|
354
426
|
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
@@ -359,4 +431,9 @@ contract InstanceService is
|
|
359
431
|
instance = Instance(instanceInfo.objectAddress);
|
360
432
|
componentNftId = componentInfo.nftId;
|
361
433
|
}
|
434
|
+
|
435
|
+
// From IService
|
436
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
437
|
+
return INSTANCE();
|
438
|
+
}
|
362
439
|
}
|
@@ -4,16 +4,13 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
|
6
6
|
import {Amount} from "../type/Amount.sol";
|
7
|
-
import {Key32
|
7
|
+
import {Key32} from "../type/Key32.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
9
|
import {ClaimId} from "../type/ClaimId.sol";
|
10
|
-
import {ObjectType, BUNDLE,
|
10
|
+
import {ObjectType, BUNDLE, POLICY, POOL, PRODUCT, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../type/ObjectType.sol";
|
11
11
|
import {RequestId} from "../type/RequestId.sol";
|
12
|
-
import {RiskId
|
13
|
-
import {
|
14
|
-
import {StateId, ACTIVE} from "../type/StateId.sol";
|
15
|
-
import {TimestampLib} from "../type/Timestamp.sol";
|
16
|
-
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
12
|
+
import {RiskId} from "../type/RiskId.sol";
|
13
|
+
import {StateId} from "../type/StateId.sol";
|
17
14
|
import {ReferralId} from "../type/Referral.sol";
|
18
15
|
import {DistributorType} from "../type/DistributorType.sol";
|
19
16
|
import {PayoutId} from "../type/PayoutId.sol";
|
@@ -21,7 +18,6 @@ import {PayoutId} from "../type/PayoutId.sol";
|
|
21
18
|
import {BalanceStore} from "./base/BalanceStore.sol";
|
22
19
|
import {IInstance} from "./IInstance.sol";
|
23
20
|
import {KeyValueStore} from "../shared/KeyValueStore.sol";
|
24
|
-
import {IKeyValueStore} from "../shared/KeyValueStore.sol";
|
25
21
|
import {ObjectCounter} from "./base/ObjectCounter.sol";
|
26
22
|
|
27
23
|
import {IBundle} from "./module/IBundle.sol";
|
@@ -82,10 +78,6 @@ contract InstanceStore is
|
|
82
78
|
_update(_toNftKey32(productNftId, PRODUCT()), abi.encode(info), newState);
|
83
79
|
}
|
84
80
|
|
85
|
-
function updateProductSetupState(NftId productNftId, StateId newState) external restricted() {
|
86
|
-
_updateState(_toNftKey32(productNftId, PRODUCT()), newState);
|
87
|
-
}
|
88
|
-
|
89
81
|
//--- Pool --------------------------------------------------------------//
|
90
82
|
|
91
83
|
function createPool(
|
@@ -102,10 +94,6 @@ contract InstanceStore is
|
|
102
94
|
_update(_toNftKey32(poolNftId, POOL()), abi.encode(info), newState);
|
103
95
|
}
|
104
96
|
|
105
|
-
function updatePoolState(NftId poolNftId, StateId newState) external restricted() {
|
106
|
-
_updateState(_toNftKey32(poolNftId, POOL()), newState);
|
107
|
-
}
|
108
|
-
|
109
97
|
//--- DistributorType ---------------------------------------------------//
|
110
98
|
function createDistributorType(DistributorType distributorType, IDistribution.DistributorTypeInfo memory info) external restricted() {
|
111
99
|
_create(distributorType.toKey32(), abi.encode(info));
|
@@ -60,7 +60,7 @@ contract BalanceStore {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
_isRegistered[targetNftId] = true;
|
63
|
-
|
63
|
+
_setLastUpdatedIn(targetNftId);
|
64
64
|
|
65
65
|
emit LogBalanceStoreTargetRegistered(targetNftId);
|
66
66
|
}
|
@@ -71,7 +71,7 @@ contract BalanceStore {
|
|
71
71
|
_feeAmount[targetNftId] = newBalance;
|
72
72
|
|
73
73
|
emit LogBalanceStoreFeesIncreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
74
|
-
|
74
|
+
_setLastUpdatedIn(targetNftId);
|
75
75
|
}
|
76
76
|
|
77
77
|
function _decreaseFees(NftId targetNftId, Amount amount) internal onlyRegisteredTarget(targetNftId) returns (Amount newBalance) {
|
@@ -79,7 +79,7 @@ contract BalanceStore {
|
|
79
79
|
_feeAmount[targetNftId] = newBalance;
|
80
80
|
|
81
81
|
emit LogBalanceStoreFeesDecreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
82
|
-
|
82
|
+
_setLastUpdatedIn(targetNftId);
|
83
83
|
}
|
84
84
|
|
85
85
|
//--- locked management -------------------------------------------------//
|
@@ -88,7 +88,7 @@ contract BalanceStore {
|
|
88
88
|
_lockedAmount[targetNftId] = newBalance;
|
89
89
|
|
90
90
|
emit LogBalanceStoreLockedIncreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
91
|
-
|
91
|
+
_setLastUpdatedIn(targetNftId);
|
92
92
|
}
|
93
93
|
|
94
94
|
function _decreaseLocked(NftId targetNftId, Amount amount) internal onlyRegisteredTarget(targetNftId) returns (Amount newBalance) {
|
@@ -96,7 +96,7 @@ contract BalanceStore {
|
|
96
96
|
_lockedAmount[targetNftId] = newBalance;
|
97
97
|
|
98
98
|
emit LogBalanceStoreLockedDecreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
99
|
-
|
99
|
+
_setLastUpdatedIn(targetNftId);
|
100
100
|
}
|
101
101
|
|
102
102
|
//--- balance management ------------------------------------------------//
|
@@ -105,7 +105,7 @@ contract BalanceStore {
|
|
105
105
|
_balanceAmount[targetNftId] = newBalance;
|
106
106
|
|
107
107
|
emit LogBalanceStoreBalanceIncreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
108
|
-
|
108
|
+
_setLastUpdatedIn(targetNftId);
|
109
109
|
}
|
110
110
|
|
111
111
|
function _decreaseBalance(NftId targetNftId, Amount amount) internal onlyRegisteredTarget(targetNftId) returns (Amount newBalance) {
|
@@ -113,6 +113,11 @@ contract BalanceStore {
|
|
113
113
|
_balanceAmount[targetNftId] = newBalance;
|
114
114
|
|
115
115
|
emit LogBalanceStoreBalanceDecreased(targetNftId, amount, newBalance, _lastUpdatedIn[targetNftId]);
|
116
|
+
_setLastUpdatedIn(targetNftId);
|
117
|
+
}
|
118
|
+
|
119
|
+
//--- internal/private functions ----------------------------------------//
|
120
|
+
function _setLastUpdatedIn(NftId targetNftId) internal {
|
116
121
|
_lastUpdatedIn[targetNftId] = BlocknumberLib.currentBlocknumber();
|
117
122
|
}
|
118
123
|
}
|
@@ -2,47 +2,24 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
|
-
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
6
5
|
|
7
6
|
import {IRegistry} from "../../registry/IRegistry.sol";
|
8
7
|
|
9
8
|
abstract contract Cloneable is
|
10
9
|
AccessManagedUpgradeable
|
11
10
|
{
|
12
|
-
event CloneableInitialized(address authority, address registry);
|
13
|
-
|
14
|
-
error CloneableAuthorityZero();
|
15
|
-
error CloneableRegistryInvalid(address registry);
|
16
|
-
|
17
11
|
IRegistry internal _registry;
|
18
12
|
|
19
|
-
constructor() {
|
20
|
-
_registry = IRegistry(address(0));
|
21
|
-
}
|
22
|
-
|
23
13
|
/// @dev call to initialize MUST be made in the same transaction as cloning of the contract
|
24
|
-
function
|
14
|
+
function __Cloneable_init(
|
25
15
|
address authority,
|
26
16
|
address registry
|
27
17
|
)
|
28
|
-
|
18
|
+
internal
|
29
19
|
onlyInitializing
|
30
20
|
{
|
31
|
-
// check/handle access managed
|
32
|
-
if(authority == address(0)) {
|
33
|
-
revert CloneableAuthorityZero();
|
34
|
-
}
|
35
|
-
|
36
21
|
__AccessManaged_init(authority);
|
37
|
-
|
38
|
-
// check/handle registry
|
39
|
-
if (registry.code.length == 0) {
|
40
|
-
revert CloneableRegistryInvalid(registry);
|
41
|
-
}
|
42
|
-
|
43
22
|
_registry = IRegistry(registry);
|
44
|
-
|
45
|
-
emit CloneableInitialized(authority, registry);
|
46
23
|
}
|
47
24
|
|
48
25
|
function getRegistry() external view returns (IRegistry) {
|
@@ -17,7 +17,6 @@ contract ObjectManager is
|
|
17
17
|
event LogObjectManagerInitialized(address instance);
|
18
18
|
|
19
19
|
error ErrorObjectManagerNftIdInvalid(NftId instanceNftId);
|
20
|
-
error ErrorObjectManagerAlreadyAdded(NftId componentNftId, NftId objectNftId);
|
21
20
|
|
22
21
|
mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _activeObjects;
|
23
22
|
mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _allObjects;
|
@@ -29,8 +28,7 @@ contract ObjectManager is
|
|
29
28
|
external
|
30
29
|
{
|
31
30
|
IInstance instance = IInstance(instanceAddress);
|
32
|
-
|
33
|
-
|
31
|
+
__Cloneable_init(instance.authority(), address(instance.getRegistry()));
|
34
32
|
_instance = instance;
|
35
33
|
|
36
34
|
emit LogObjectManagerInitialized(instanceAddress);
|
@@ -37,10 +37,6 @@ contract OracleService is
|
|
37
37
|
registerInterface(type(IOracleService).interfaceId);
|
38
38
|
}
|
39
39
|
|
40
|
-
function getDomain() public pure override returns(ObjectType) {
|
41
|
-
return ORACLE();
|
42
|
-
}
|
43
|
-
|
44
40
|
function request(
|
45
41
|
NftId oracleNftId,
|
46
42
|
bytes calldata requestData,
|
@@ -274,4 +270,9 @@ contract OracleService is
|
|
274
270
|
address instanceAddress = getRegistry().getObjectInfo(instanceNftId).objectAddress;
|
275
271
|
return IInstance(instanceAddress);
|
276
272
|
}
|
273
|
+
|
274
|
+
|
275
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
276
|
+
return ORACLE();
|
277
|
+
}
|
277
278
|
}
|