@etherisc/gif-next 0.0.2-c00cf5d-513 → 0.0.2-c0457ac-280
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +198 -177
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +130 -335
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +67 -96
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +83 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +35 -48
- 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 +65 -66
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +163 -10
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +81 -93
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +56 -40
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +84 -44
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +458 -331
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +268 -46
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +74 -43
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1095 -344
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- 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 +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/{instance/module/ISetup.sol/ISetup.json → oracle/IOracle.sol/IOracle.json} +2 -2
- 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 +91 -264
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +56 -69
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +19 -51
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +145 -86
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +134 -133
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +242 -103
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +180 -376
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +42 -83
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +93 -167
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +56 -45
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +121 -211
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -61
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +20 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +20 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +94 -25
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +40 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +241 -107
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -55
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +180 -297
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +54 -99
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +163 -174
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +81 -54
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +337 -157
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +47 -230
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +34 -47
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +65 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +153 -1
- 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 +294 -15
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1712 -103
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +198 -28
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +45 -42
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +321 -161
- 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 +314 -136
- 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/Component.sol/Component.json +100 -96
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +916 -55
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +796 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +539 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/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/IComponent.sol/IComponent.json +76 -81
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +880 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +705 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +1 -11
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +7 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +21 -3
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +7 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +20 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +1036 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +571 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +194 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +33 -20
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +31 -13
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +19 -32
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +17 -22
- 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 +16 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +40 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +566 -54
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +460 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2005 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +761 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +657 -100
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +65 -46
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2261 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +68 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +53 -2
- 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/Fee.sol/FeeLib.json +34 -34
- 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 +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +96 -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/Seconds.sol/SecondsLib.json +76 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -2
- package/contracts/distribution/Distribution.sol +29 -53
- package/contracts/distribution/DistributionService.sol +61 -115
- package/contracts/distribution/IDistributionComponent.sol +5 -10
- package/contracts/distribution/IDistributionService.sol +2 -8
- package/contracts/instance/IInstance.sol +15 -7
- package/contracts/instance/IInstanceService.sol +35 -10
- package/contracts/instance/Instance.sol +63 -34
- package/contracts/instance/InstanceAdmin.sol +3 -2
- package/contracts/instance/InstanceAuthorizationsLib.sol +84 -27
- package/contracts/instance/InstanceReader.sol +64 -40
- package/contracts/instance/InstanceService.sol +185 -45
- package/contracts/instance/InstanceStore.sol +122 -64
- package/contracts/instance/base/BalanceStore.sol +123 -0
- 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/instance/module/IBundle.sol +1 -4
- package/contracts/instance/module/IComponents.sol +15 -4
- package/contracts/instance/module/IPolicy.sol +8 -2
- package/contracts/mock/Dip.sol +26 -0
- 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 +79 -167
- package/contracts/pool/IBundleService.sol +4 -16
- package/contracts/pool/IPoolComponent.sol +4 -6
- package/contracts/pool/IPoolService.sol +45 -9
- package/contracts/pool/Pool.sol +39 -42
- package/contracts/pool/PoolService.sol +190 -142
- package/contracts/product/ApplicationService.sol +109 -42
- package/contracts/product/ClaimService.sol +18 -19
- package/contracts/product/IApplicationService.sol +1 -1
- package/contracts/product/IClaimService.sol +7 -1
- package/contracts/product/IPolicyService.sol +6 -8
- package/contracts/product/IPricingService.sol +3 -1
- package/contracts/product/IProductComponent.sol +7 -6
- package/contracts/product/IProductService.sol +1 -8
- package/contracts/product/PolicyService.sol +225 -128
- package/contracts/product/PricingService.sol +72 -48
- package/contracts/product/Product.sol +47 -49
- package/contracts/product/ProductService.sol +26 -114
- package/contracts/registry/ChainNft.sol +8 -1
- package/contracts/registry/IRegistry.sol +15 -4
- package/contracts/registry/IRegistryService.sol +10 -0
- package/contracts/registry/IServiceAuthorization.sol +35 -0
- package/contracts/registry/Registry.sol +164 -47
- package/contracts/registry/RegistryAdmin.sol +264 -72
- package/contracts/registry/RegistryService.sol +48 -14
- package/contracts/registry/RegistryServiceManager.sol +2 -9
- package/contracts/registry/ReleaseManager.sol +242 -177
- package/contracts/registry/ServiceAuthorization.sol +86 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +261 -64
- package/contracts/shared/AccessAdmin.sol +759 -0
- package/contracts/shared/AccessManagerCustom.sol +6 -1
- package/contracts/shared/AccessManagerExtended.sol +19 -7
- package/contracts/shared/Component.sol +139 -129
- package/contracts/shared/ComponentService.sol +563 -88
- package/contracts/shared/ComponentServiceManager.sol +35 -0
- package/contracts/shared/ComponentVerifyingService.sol +117 -0
- package/contracts/shared/ERC165.sol +1 -1
- package/contracts/shared/IAccessAdmin.sol +168 -0
- package/contracts/shared/IComponent.sol +17 -37
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
- package/contracts/{instance/base → shared}/IKeyValueStore.sol +6 -6
- package/contracts/{instance/base → shared}/ILifecycle.sol +3 -3
- package/contracts/shared/INftOwnable.sol +1 -1
- package/contracts/shared/IPolicyHolder.sol +6 -1
- package/contracts/shared/IService.sol +8 -1
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +144 -0
- package/contracts/{instance/base → shared}/KeyValueStore.sol +30 -72
- package/contracts/{instance/base → shared}/Lifecycle.sol +12 -3
- package/contracts/shared/NftIdSetManager.sol +65 -0
- package/contracts/shared/NftOwnable.sol +3 -13
- package/contracts/shared/PolicyHolder.sol +21 -13
- package/contracts/shared/ProxyManager.sol +2 -3
- package/contracts/shared/Registerable.sol +2 -2
- package/contracts/shared/Service.sol +32 -21
- package/contracts/shared/TokenHandler.sol +24 -1
- package/contracts/staking/IStaking.sol +168 -0
- package/contracts/staking/IStakingService.sol +98 -47
- package/contracts/staking/StakeManagerLib.sol +231 -0
- package/contracts/staking/Staking.sol +513 -0
- package/contracts/staking/StakingManager.sol +54 -0
- package/contracts/staking/StakingReader.sol +187 -0
- package/contracts/staking/StakingService.sol +286 -44
- package/contracts/staking/StakingServiceManager.sol +7 -3
- package/contracts/staking/StakingStore.sol +613 -0
- package/contracts/staking/TargetManagerLib.sol +207 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +20 -1
- package/contracts/type/Blocknumber.sol +20 -3
- package/contracts/type/Fee.sol +17 -16
- package/contracts/type/NftId.sol +14 -16
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +142 -63
- package/contracts/type/Referral.sol +1 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +1 -1
- package/contracts/type/RoleId.sol +82 -20
- package/contracts/type/Seconds.sol +27 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +27 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +6 -2
- package/contracts/type/Version.sol +1 -1
- package/package.json +3 -3
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -581
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -194
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +0 -10
- package/contracts/instance/module/ISetup.sol +0 -33
- package/contracts/instance/module/ITreasury.sol +0 -23
@@ -3,30 +3,31 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.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 {Fee, FeeLib} from "../type/Fee.sol";
|
9
10
|
import {Key32} from "../type/Key32.sol";
|
10
11
|
import {NftId} from "../type/NftId.sol";
|
11
|
-
import {ObjectType, DISTRIBUTOR, DISTRIBUTION, INSTANCE, PRODUCT, POLICY, POOL,
|
12
|
+
import {ObjectType, COMPONENT, DISTRIBUTOR, DISTRIBUTION, INSTANCE, PRODUCT, POLICY, POOL, BUNDLE} from "../type/ObjectType.sol";
|
12
13
|
import {PayoutId} from "../type/PayoutId.sol";
|
13
14
|
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
14
|
-
import {
|
15
|
+
import {RequestId} from "../type/RequestId.sol";
|
15
16
|
import {RiskId} from "../type/RiskId.sol";
|
17
|
+
import {RoleId} from "../type/RoleId.sol";
|
18
|
+
import {StateId} from "../type/StateId.sol";
|
16
19
|
import {UFixed, MathLib, UFixedLib} from "../type/UFixed.sol";
|
17
20
|
import {Version} from "../type/Version.sol";
|
18
|
-
import {StateId} from "../type/StateId.sol";
|
19
21
|
|
20
22
|
import {IRegistry} from "../registry/IRegistry.sol";
|
21
23
|
import {IBundle} from "../instance/module/IBundle.sol";
|
22
24
|
import {IComponents} from "../instance/module/IComponents.sol";
|
23
25
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
24
26
|
import {IInstance} from "./IInstance.sol";
|
25
|
-
import {IKeyValueStore} from "../
|
27
|
+
import {IKeyValueStore} from "../shared/IKeyValueStore.sol";
|
28
|
+
import {IOracle} from "../oracle/IOracle.sol";
|
26
29
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
27
30
|
import {IRisk} from "../instance/module/IRisk.sol";
|
28
|
-
import {ISetup} from "../instance/module/ISetup.sol";
|
29
|
-
import {ITreasury} from "../instance/module/ITreasury.sol";
|
30
31
|
import {TimestampLib} from "../type/Timestamp.sol";
|
31
32
|
|
32
33
|
import {InstanceStore} from "./InstanceStore.sol";
|
@@ -40,7 +41,7 @@ contract InstanceReader {
|
|
40
41
|
bool private _initialized;
|
41
42
|
|
42
43
|
IInstance internal _instance;
|
43
|
-
|
44
|
+
InstanceStore internal _store;
|
44
45
|
|
45
46
|
function initialize(address instance) public {
|
46
47
|
if(_initialized) {
|
@@ -157,30 +158,19 @@ contract InstanceReader {
|
|
157
158
|
}
|
158
159
|
}
|
159
160
|
|
160
|
-
function getTokenHandler(NftId
|
161
|
+
function getTokenHandler(NftId componentNftId)
|
161
162
|
public
|
162
163
|
view
|
163
164
|
returns (address tokenHandler)
|
164
165
|
{
|
165
|
-
bytes memory data = _store.getData(
|
166
|
+
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
166
167
|
|
167
168
|
if (data.length > 0) {
|
168
|
-
|
169
|
+
IComponents.ComponentInfo memory info = abi.decode(data, (IComponents.ComponentInfo));
|
169
170
|
return address(info.tokenHandler);
|
170
171
|
}
|
171
172
|
}
|
172
173
|
|
173
|
-
function getTreasuryInfo(NftId productNftId)
|
174
|
-
public
|
175
|
-
view
|
176
|
-
returns (ITreasury.TreasuryInfo memory info)
|
177
|
-
{
|
178
|
-
bytes memory data = _store.getData(toTreasuryKey(productNftId));
|
179
|
-
if (data.length > 0) {
|
180
|
-
return abi.decode(data, (ITreasury.TreasuryInfo));
|
181
|
-
}
|
182
|
-
}
|
183
|
-
|
184
174
|
function getBundleInfo(NftId bundleNftId)
|
185
175
|
public
|
186
176
|
view
|
@@ -214,37 +204,48 @@ contract InstanceReader {
|
|
214
204
|
}
|
215
205
|
}
|
216
206
|
|
217
|
-
function
|
207
|
+
function getBalanceAmount(NftId targetNftId) external view returns (Amount) {
|
208
|
+
return _store.getBalanceAmount(targetNftId);
|
209
|
+
}
|
210
|
+
|
211
|
+
function getLockedAmount(NftId targetNftId) external view returns (Amount) {
|
212
|
+
return _store.getLockedAmount(targetNftId);
|
213
|
+
}
|
214
|
+
|
215
|
+
function getFeeAmount(NftId targetNftId) external view returns (Amount) {
|
216
|
+
return _store.getFeeAmount(targetNftId);
|
217
|
+
}
|
218
|
+
|
219
|
+
function getComponentInfo(NftId componentNftId)
|
218
220
|
public
|
219
221
|
view
|
220
|
-
returns (
|
222
|
+
returns (IComponents.ComponentInfo memory info)
|
221
223
|
{
|
222
|
-
bytes memory data = _store.getData(
|
224
|
+
bytes memory data = _store.getData(toComponentKey(componentNftId));
|
223
225
|
if (data.length > 0) {
|
224
|
-
return abi.decode(data, (
|
226
|
+
return abi.decode(data, (IComponents.ComponentInfo));
|
225
227
|
}
|
226
228
|
}
|
227
229
|
|
228
|
-
|
229
|
-
function getComponentInfo(NftId poolNftId)
|
230
|
+
function getProductInfo(NftId productNftId)
|
230
231
|
public
|
231
232
|
view
|
232
|
-
returns (IComponents.
|
233
|
+
returns (IComponents.ProductInfo memory info)
|
233
234
|
{
|
234
|
-
bytes memory data = _store.getData(
|
235
|
+
bytes memory data = _store.getData(toProductKey(productNftId));
|
235
236
|
if (data.length > 0) {
|
236
|
-
return abi.decode(data, (IComponents.
|
237
|
+
return abi.decode(data, (IComponents.ProductInfo));
|
237
238
|
}
|
238
239
|
}
|
239
240
|
|
240
|
-
function
|
241
|
+
function getPoolInfo(NftId poolNftId)
|
241
242
|
public
|
242
243
|
view
|
243
|
-
returns (
|
244
|
+
returns (IComponents.PoolInfo memory info)
|
244
245
|
{
|
245
|
-
bytes memory data = _store.getData(
|
246
|
+
bytes memory data = _store.getData(toPoolKey(poolNftId));
|
246
247
|
if (data.length > 0) {
|
247
|
-
return abi.decode(data, (
|
248
|
+
return abi.decode(data, (IComponents.PoolInfo));
|
248
249
|
}
|
249
250
|
}
|
250
251
|
|
@@ -259,6 +260,16 @@ contract InstanceReader {
|
|
259
260
|
}
|
260
261
|
}
|
261
262
|
|
263
|
+
function getRequestInfo(RequestId requestId)
|
264
|
+
public
|
265
|
+
view
|
266
|
+
returns (IOracle.RequestInfo memory requestInfo)
|
267
|
+
{
|
268
|
+
bytes memory data = _store.getData(requestId.toKey32());
|
269
|
+
if (data.length > 0) {
|
270
|
+
return abi.decode(data, (IOracle.RequestInfo));
|
271
|
+
}
|
272
|
+
}
|
262
273
|
|
263
274
|
function getMetadata(Key32 key)
|
264
275
|
public
|
@@ -268,6 +279,14 @@ contract InstanceReader {
|
|
268
279
|
return _store.getMetadata(key);
|
269
280
|
}
|
270
281
|
|
282
|
+
function getState(Key32 key)
|
283
|
+
public
|
284
|
+
view
|
285
|
+
returns (StateId state)
|
286
|
+
{
|
287
|
+
return _store.getMetadata(key).state;
|
288
|
+
}
|
289
|
+
|
271
290
|
|
272
291
|
function toReferralId(
|
273
292
|
NftId distributionNftId,
|
@@ -319,8 +338,9 @@ contract InstanceReader {
|
|
319
338
|
}
|
320
339
|
|
321
340
|
|
322
|
-
function
|
323
|
-
|
341
|
+
function hasRole(address account, RoleId roleId) public view returns (bool isMember) {
|
342
|
+
(isMember, ) = _instance.getInstanceAccessManager().hasRole(
|
343
|
+
roleId.toInt(), account);
|
324
344
|
}
|
325
345
|
|
326
346
|
|
@@ -333,14 +353,18 @@ contract InstanceReader {
|
|
333
353
|
return distributorNftId.toKey32(DISTRIBUTOR());
|
334
354
|
}
|
335
355
|
|
336
|
-
function toDistributionKey(NftId distributionNftId) public pure returns (Key32) {
|
337
|
-
return distributionNftId.toKey32(DISTRIBUTION());
|
338
|
-
}
|
339
|
-
|
340
356
|
function toBundleKey(NftId poolNftId) public pure returns (Key32) {
|
341
357
|
return poolNftId.toKey32(BUNDLE());
|
342
358
|
}
|
343
359
|
|
360
|
+
function toComponentKey(NftId componentNftId) public pure returns (Key32) {
|
361
|
+
return componentNftId.toKey32(COMPONENT());
|
362
|
+
}
|
363
|
+
|
364
|
+
function toDistributionKey(NftId distributionNftId) public pure returns (Key32) {
|
365
|
+
return distributionNftId.toKey32(DISTRIBUTION());
|
366
|
+
}
|
367
|
+
|
344
368
|
function toPoolKey(NftId poolNftId) public pure returns (Key32) {
|
345
369
|
return poolNftId.toKey32(POOL());
|
346
370
|
}
|
@@ -4,12 +4,18 @@ 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";
|
8
|
+
import {BundleManager} from "./BundleManager.sol";
|
9
|
+
import {ChainNft} from "../registry/ChainNft.sol";
|
7
10
|
import {NftId} from "../type/NftId.sol";
|
8
11
|
import {RoleId} from "../type/RoleId.sol";
|
12
|
+
import {SecondsLib} from "../type/Seconds.sol";
|
13
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
9
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";
|
10
|
-
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, POLICY,
|
15
|
+
import {ObjectType, INSTANCE, BUNDLE, APPLICATION, CLAIM, DISTRIBUTION, INSTANCE, POLICY, POOL, PRODUCT, REGISTRY, STAKING} from "../type/ObjectType.sol";
|
11
16
|
|
12
17
|
import {Service} from "../shared/Service.sol";
|
18
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
13
19
|
import {IService} from "../shared/IService.sol";
|
14
20
|
import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtendedInitializeable.sol";
|
15
21
|
|
@@ -19,16 +25,19 @@ import {IProductComponent} from "../product/IProductComponent.sol";
|
|
19
25
|
|
20
26
|
import {IRegistry} from "../registry/IRegistry.sol";
|
21
27
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
22
|
-
import {
|
28
|
+
import {IStakingService} from "../staking/IStakingService.sol";
|
29
|
+
import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
23
30
|
|
24
31
|
import {Instance} from "./Instance.sol";
|
25
32
|
import {IInstance} from "./IInstance.sol";
|
26
33
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
27
34
|
import {IInstanceService} from "./IInstanceService.sol";
|
28
35
|
import {InstanceReader} from "./InstanceReader.sol";
|
29
|
-
import {BundleManager} from "./BundleManager.sol";
|
30
36
|
import {InstanceStore} from "./InstanceStore.sol";
|
31
37
|
import {InstanceAuthorizationsLib} from "./InstanceAuthorizationsLib.sol";
|
38
|
+
import {Seconds} from "../type/Seconds.sol";
|
39
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
40
|
+
|
32
41
|
|
33
42
|
contract InstanceService is
|
34
43
|
Service,
|
@@ -39,6 +48,8 @@ contract InstanceService is
|
|
39
48
|
bytes32 public constant INSTANCE_CREATION_CODE_HASH = bytes32(0);
|
40
49
|
|
41
50
|
IRegistryService internal _registryService;
|
51
|
+
IStakingService internal _stakingService;
|
52
|
+
|
42
53
|
address internal _masterAccessManager;
|
43
54
|
address internal _masterInstanceAdmin;
|
44
55
|
address internal _masterInstance;
|
@@ -46,6 +57,28 @@ contract InstanceService is
|
|
46
57
|
address internal _masterInstanceBundleManager;
|
47
58
|
address internal _masterInstanceStore;
|
48
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
|
+
|
49
82
|
modifier onlyInstanceOwner(NftId instanceNftId) {
|
50
83
|
if(msg.sender != getRegistry().ownerOf(instanceNftId)) {
|
51
84
|
revert ErrorInstanceServiceRequestUnauhorized(msg.sender);
|
@@ -115,9 +148,16 @@ contract InstanceService is
|
|
115
148
|
|
116
149
|
clonedAccessManager.renounceRole(ADMIN_ROLE().toInt(), address(this));
|
117
150
|
|
151
|
+
// register new instance with registry
|
118
152
|
IRegistry.ObjectInfo memory info = _registryService.registerInstance(clonedInstance, instanceOwner);
|
119
153
|
clonedInstanceNftId = info.nftId;
|
120
154
|
|
155
|
+
// create corresponding staking target
|
156
|
+
_stakingService.createInstanceTarget(
|
157
|
+
clonedInstanceNftId,
|
158
|
+
TargetManagerLib.getDefaultLockingPeriod(),
|
159
|
+
TargetManagerLib.getDefaultRewardRate());
|
160
|
+
|
121
161
|
emit LogInstanceCloned(
|
122
162
|
address(clonedAccessManager),
|
123
163
|
address(clonedInstanceAdmin),
|
@@ -128,21 +168,102 @@ contract InstanceService is
|
|
128
168
|
clonedInstanceNftId);
|
129
169
|
}
|
130
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
|
+
|
222
|
+
function setComponentLocked(bool locked)
|
223
|
+
external
|
224
|
+
virtual
|
225
|
+
onlyComponent()
|
226
|
+
{
|
227
|
+
// checks
|
228
|
+
address componentAddress = msg.sender;
|
229
|
+
|
230
|
+
if (!IInstanceLinkedComponent(componentAddress).supportsInterface(type(IInstanceLinkedComponent).interfaceId)) {
|
231
|
+
revert ErrorInstanceServiceComponentNotInstanceLinked(componentAddress);
|
232
|
+
}
|
233
|
+
|
234
|
+
IRegistry registry = getRegistry();
|
235
|
+
NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
|
236
|
+
|
237
|
+
IInstance instance = IInstance(
|
238
|
+
registry.getObjectInfo(
|
239
|
+
instanceNftId).objectAddress);
|
240
|
+
|
241
|
+
// no revert in case already locked
|
242
|
+
instance.getInstanceAdmin().setTargetLockedByService(
|
243
|
+
componentAddress,
|
244
|
+
locked);
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
function getMasterInstanceReader() external view returns (address) {
|
249
|
+
return _masterInstanceReader;
|
250
|
+
}
|
251
|
+
|
131
252
|
function setAndRegisterMasterInstance(address instanceAddress)
|
132
253
|
external
|
133
254
|
onlyOwner
|
134
255
|
returns(NftId masterInstanceNftId)
|
135
256
|
{
|
136
257
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
137
|
-
if(_masterAccessManager != address(0)) { revert
|
258
|
+
if(_masterAccessManager != address(0)) { revert ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet(); }
|
138
259
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
139
260
|
if(_masterInstanceBundleManager != address(0)) { revert ErrorInstanceServiceMasterBundleManagerAlreadySet(); }
|
140
261
|
|
141
262
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
142
263
|
|
143
264
|
IInstance instance = IInstance(instanceAddress);
|
144
|
-
InstanceAdmin
|
145
|
-
address
|
265
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
266
|
+
address instanceAdminAddress = address(instanceAdmin);
|
146
267
|
InstanceReader instanceReader = instance.getInstanceReader();
|
147
268
|
address instanceReaderAddress = address(instanceReader);
|
148
269
|
BundleManager bundleManager = instance.getBundleManager();
|
@@ -150,19 +271,19 @@ contract InstanceService is
|
|
150
271
|
InstanceStore instanceStore = instance.getInstanceStore();
|
151
272
|
address instanceStoreAddress = address(instanceStore);
|
152
273
|
|
153
|
-
if(
|
274
|
+
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
154
275
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
155
276
|
if(bundleManagerAddress == address(0)) { revert ErrorInstanceServiceBundleManagerZero(); }
|
156
277
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
157
278
|
|
158
|
-
if(instance.authority() !=
|
159
|
-
if(bundleManager.authority() !=
|
160
|
-
if(instanceStore.authority() !=
|
279
|
+
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
280
|
+
if(bundleManager.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleManagerAuthorityMismatch(); }
|
281
|
+
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
161
282
|
if(bundleManager.getInstance() != instance) { revert ErrorInstanceServiceBundleMangerInstanceMismatch(); }
|
162
283
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
163
284
|
|
164
285
|
_masterAccessManager = instance.authority();
|
165
|
-
_masterInstanceAdmin =
|
286
|
+
_masterInstanceAdmin = instanceAdminAddress;
|
166
287
|
_masterInstance = instanceAddress;
|
167
288
|
_masterInstanceReader = instanceReaderAddress;
|
168
289
|
_masterInstanceBundleManager = bundleManagerAddress;
|
@@ -198,7 +319,6 @@ contract InstanceService is
|
|
198
319
|
}
|
199
320
|
|
200
321
|
|
201
|
-
// all gif targets MUST be childs of instanceNftId
|
202
322
|
function createGifTarget(
|
203
323
|
NftId instanceNftId,
|
204
324
|
address targetAddress,
|
@@ -207,7 +327,50 @@ contract InstanceService is
|
|
207
327
|
RoleId[] memory roles
|
208
328
|
)
|
209
329
|
external
|
210
|
-
|
330
|
+
virtual
|
331
|
+
restricted()
|
332
|
+
{
|
333
|
+
_createGifTarget(
|
334
|
+
instanceNftId,
|
335
|
+
targetAddress,
|
336
|
+
targetName,
|
337
|
+
roles,
|
338
|
+
selectors
|
339
|
+
);
|
340
|
+
}
|
341
|
+
|
342
|
+
|
343
|
+
function createComponentTarget(
|
344
|
+
NftId instanceNftId,
|
345
|
+
address targetAddress,
|
346
|
+
string memory targetName,
|
347
|
+
bytes4[][] memory selectors,
|
348
|
+
RoleId[] memory roles
|
349
|
+
)
|
350
|
+
external
|
351
|
+
virtual
|
352
|
+
restricted()
|
353
|
+
{
|
354
|
+
_createGifTarget(
|
355
|
+
instanceNftId,
|
356
|
+
targetAddress,
|
357
|
+
targetName,
|
358
|
+
roles,
|
359
|
+
selectors
|
360
|
+
);
|
361
|
+
}
|
362
|
+
|
363
|
+
|
364
|
+
/// all gif targets MUST be children of instanceNftId
|
365
|
+
function _createGifTarget(
|
366
|
+
NftId instanceNftId,
|
367
|
+
address targetAddress,
|
368
|
+
string memory targetName,
|
369
|
+
RoleId[] memory roles,
|
370
|
+
bytes4[][] memory selectors
|
371
|
+
)
|
372
|
+
internal
|
373
|
+
virtual
|
211
374
|
{
|
212
375
|
// TODO instanceAdmin will check target instance match anyway
|
213
376
|
(
|
@@ -220,36 +383,10 @@ contract InstanceService is
|
|
220
383
|
// set proposed target config
|
221
384
|
// TODO restriction: gif targets are set only once and only here?
|
222
385
|
// assume config is a mix of gif and custom roles and no further configuration by INSTANCE_OWNER_ROLE is ever needed?
|
223
|
-
for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++)
|
224
|
-
{
|
386
|
+
for(uint roleIdx = 0; roleIdx < roles.length; roleIdx++) {
|
225
387
|
instanceAdmin.setTargetFunctionRoleByService(targetName, selectors[roleIdx], roles[roleIdx]);
|
226
388
|
}
|
227
389
|
}
|
228
|
-
|
229
|
-
function setComponentLocked(bool locked) onlyComponent external {
|
230
|
-
|
231
|
-
address componentAddress = msg.sender;
|
232
|
-
IRegistry registry = getRegistry();
|
233
|
-
NftId instanceNftId = registry.getObjectInfo(componentAddress).parentNftId;
|
234
|
-
|
235
|
-
IInstance instance = IInstance(
|
236
|
-
registry.getObjectInfo(
|
237
|
-
instanceNftId).objectAddress);
|
238
|
-
|
239
|
-
instance.getInstanceAdmin().setTargetLockedByService(
|
240
|
-
componentAddress,
|
241
|
-
locked);
|
242
|
-
}
|
243
|
-
|
244
|
-
|
245
|
-
function getMasterInstanceReader() external view returns (address) {
|
246
|
-
return _masterInstanceReader;
|
247
|
-
}
|
248
|
-
|
249
|
-
// From IService
|
250
|
-
function getDomain() public pure override returns(ObjectType) {
|
251
|
-
return INSTANCE();
|
252
|
-
}
|
253
390
|
|
254
391
|
/// @dev top level initializer
|
255
392
|
function _initialize(
|
@@ -268,10 +405,8 @@ contract InstanceService is
|
|
268
405
|
|
269
406
|
initializeService(registryAddress, authority, owner);
|
270
407
|
|
271
|
-
_registryService = IRegistryService(
|
272
|
-
|
273
|
-
REGISTRY(),
|
274
|
-
getVersion().toMajorPart()));
|
408
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
409
|
+
_stakingService = IStakingService(_getServiceAddress(STAKING()));
|
275
410
|
|
276
411
|
registerInterface(type(IInstanceService).interfaceId);
|
277
412
|
}
|
@@ -285,7 +420,7 @@ contract InstanceService is
|
|
285
420
|
IRegistry registry = getRegistry();
|
286
421
|
IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
|
287
422
|
if(instanceInfo.objectType != INSTANCE()) {
|
288
|
-
revert
|
423
|
+
revert ErrorInstanceServiceNotInstanceNftId(instanceNftId);
|
289
424
|
}
|
290
425
|
|
291
426
|
IRegistry.ObjectInfo memory componentInfo = registry.getObjectInfo(componentAddress);
|
@@ -296,4 +431,9 @@ contract InstanceService is
|
|
296
431
|
instance = Instance(instanceInfo.objectAddress);
|
297
432
|
componentNftId = componentInfo.nftId;
|
298
433
|
}
|
434
|
+
|
435
|
+
// From IService
|
436
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
437
|
+
return INSTANCE();
|
438
|
+
}
|
299
439
|
}
|