@etherisc/gif-next 0.0.2-8bdd2eb-413 → 0.0.2-8d9d4d6-542
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1502 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1168 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +110 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +129 -0
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +1639 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +134 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +171 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +108 -79
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +48 -40
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +13 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +32 -101
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +58 -65
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +120 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -79
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +22 -22
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +1676 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +289 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +70 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +192 -56
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +201 -34
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +41 -17
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +248 -108
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -71
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +10 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +78 -49
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +33 -25
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -41
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +25 -21
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -37
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +27 -19
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -69
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +47 -35
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +84 -47
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +36 -24
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +40 -32
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +54 -25
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +21 -13
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +19 -19
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1678 -153
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -14
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +20 -8
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +99 -154
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +195 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +52 -20
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +52 -20
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +107 -71
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +44 -36
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +20 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +13 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +8 -8
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +6 -6
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +13 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +49 -7
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +23 -39
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +33 -41
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +186 -114
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +18 -18
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +125 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +114 -4
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +749 -0
- package/contracts/authorization/IAccess.sol +43 -0
- package/contracts/authorization/IAccessAdmin.sol +130 -0
- package/contracts/authorization/IModuleAuthorization.sol +27 -0
- package/contracts/authorization/IServiceAuthorization.sol +35 -0
- package/contracts/authorization/InstanceAdmin.sol +108 -0
- package/contracts/authorization/ModuleAuthorization.sol +116 -0
- package/contracts/authorization/ServiceAuthorization.sol +86 -0
- package/contracts/distribution/DistributionService.sol +3 -4
- package/contracts/instance/IInstance.sol +14 -6
- package/contracts/instance/IInstanceService.sol +24 -8
- package/contracts/instance/Instance.sol +63 -39
- package/contracts/instance/InstanceAdminNew.sol +74 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +176 -0
- package/contracts/instance/InstanceAuthorizationsLib.sol +31 -3
- package/contracts/instance/InstanceReader.sol +29 -2
- package/contracts/instance/InstanceService.sol +85 -8
- package/contracts/instance/InstanceStore.sol +29 -20
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectManager.sol +1 -3
- package/contracts/oracle/IOracle.sol +20 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +145 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BundleService.sol +19 -19
- package/contracts/pool/PoolService.sol +6 -7
- package/contracts/product/ApplicationService.sol +5 -5
- package/contracts/product/ClaimService.sol +5 -5
- package/contracts/product/IClaimService.sol +6 -0
- package/contracts/product/PolicyService.sol +5 -5
- package/contracts/product/PricingService.sol +5 -6
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/IRegistry.sol +1 -1
- package/contracts/registry/Registry.sol +7 -1
- package/contracts/registry/RegistryAdmin.sol +236 -148
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/registry/RegistryServiceManager.sol +0 -5
- package/contracts/registry/ReleaseManager.sol +102 -172
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/shared/AccessManagerCustom.sol +6 -1
- package/contracts/shared/AccessManagerExtended.sol +12 -1
- package/contracts/shared/Component.sol +3 -0
- package/contracts/shared/ComponentService.sol +30 -9
- package/contracts/shared/ComponentVerifyingService.sol +13 -7
- package/contracts/shared/IComponentService.sol +11 -0
- package/contracts/shared/IService.sol +7 -0
- package/contracts/shared/Lifecycle.sol +11 -2
- package/contracts/shared/Service.sol +27 -21
- package/contracts/staking/IStakingService.sol +11 -7
- package/contracts/staking/StakeManagerLib.sol +52 -0
- package/contracts/staking/Staking.sol +58 -96
- package/contracts/staking/StakingService.sol +61 -56
- package/contracts/staking/StakingServiceManager.sol +0 -1
- package/contracts/staking/StakingStore.sol +79 -38
- package/contracts/type/ObjectType.sol +162 -67
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RoleId.sol +77 -19
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +12 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +6 -2
- package/package.json +3 -3
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
@@ -0,0 +1,43 @@
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {RoleId} from "../type/RoleId.sol";
|
5
|
+
import {Selector} from "../type/Selector.sol";
|
6
|
+
import {Str} from "../type/String.sol";
|
7
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
8
|
+
|
9
|
+
interface IAccess {
|
10
|
+
|
11
|
+
struct RoleInfo {
|
12
|
+
RoleId adminRoleId;
|
13
|
+
Str name;
|
14
|
+
bool isCustom;
|
15
|
+
uint256 maxMemberCount;
|
16
|
+
bool memberRemovalDisabled;
|
17
|
+
Timestamp createdAt;
|
18
|
+
Timestamp disabledAt;
|
19
|
+
}
|
20
|
+
|
21
|
+
struct RoleNameInfo {
|
22
|
+
RoleId roleId;
|
23
|
+
bool exists;
|
24
|
+
}
|
25
|
+
|
26
|
+
struct TargetInfo {
|
27
|
+
Str name;
|
28
|
+
bool isCustom;
|
29
|
+
Timestamp createdAt;
|
30
|
+
}
|
31
|
+
|
32
|
+
struct TargeNameInfo {
|
33
|
+
address target;
|
34
|
+
Timestamp createdAt;
|
35
|
+
}
|
36
|
+
|
37
|
+
struct FunctionInfo {
|
38
|
+
Selector selector; // function selector
|
39
|
+
Str name; // function name
|
40
|
+
Timestamp createdAt;
|
41
|
+
}
|
42
|
+
|
43
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
|
+
|
6
|
+
import {IAccess} from "./IAccess.sol";
|
7
|
+
import {RoleId} from "../type/RoleId.sol";
|
8
|
+
import {Selector} from "../type/Selector.sol";
|
9
|
+
import {Str} from "../type/String.sol";
|
10
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
11
|
+
|
12
|
+
interface IAccessAdmin is
|
13
|
+
IAccessManaged,
|
14
|
+
IAccess
|
15
|
+
{
|
16
|
+
|
17
|
+
// roles
|
18
|
+
event LogRoleCreated(RoleId roleId, RoleId roleAdminId, string name);
|
19
|
+
event LogRoleDisabled(RoleId roleId, bool disabled, Timestamp disabledAtOld);
|
20
|
+
event LogTargetCreated(address target, string name);
|
21
|
+
event LogFunctionCreated(address target, Selector selector, string name);
|
22
|
+
|
23
|
+
// only deployer modifier
|
24
|
+
error ErrorNotDeployer();
|
25
|
+
|
26
|
+
// only role admin modifier
|
27
|
+
error ErrorNotAdminOfRole(RoleId adminRoleId);
|
28
|
+
|
29
|
+
// only role owner modifier
|
30
|
+
error ErrorNotRoleOwner(RoleId roleId);
|
31
|
+
|
32
|
+
// initialize authority
|
33
|
+
error ErrorAuthorityAlreadySet();
|
34
|
+
error ErrorAdminRoleMissing();
|
35
|
+
|
36
|
+
// create role
|
37
|
+
error ErrorRoleAlreadyCreated(RoleId roleId, string name);
|
38
|
+
error ErrorRoleAdminNotExisting(RoleId adminRoleId);
|
39
|
+
error ErrorRoleNameEmpty(RoleId roleId);
|
40
|
+
error ErrorRoleNameAlreadyExists(RoleId roleId, string name, RoleId existingRoleId);
|
41
|
+
|
42
|
+
// grant/revoke/renounce role
|
43
|
+
error ErrorRoleUnknown(RoleId roleId);
|
44
|
+
error ErrorRoleIsLocked(RoleId roleId);
|
45
|
+
error ErrorRoleIsDisabled(RoleId roleId);
|
46
|
+
error ErrorRoleMembersLimitReached(RoleId roleId, uint256 memberCountLimit);
|
47
|
+
error ErrorRoleRemovalDisabled(RoleId roleId);
|
48
|
+
|
49
|
+
// create target
|
50
|
+
error ErrorTargetAlreadyCreated(address target, string name);
|
51
|
+
error ErrorTargetNameEmpty(address target);
|
52
|
+
error ErrorTargetNameAlreadyExists(address target, string name, address existingTarget);
|
53
|
+
error ErrorTargetNotAccessManaged(address target);
|
54
|
+
error ErrorTargetAuthorityMismatch(address expectedAuthority, address actualAuthority);
|
55
|
+
|
56
|
+
// lock target
|
57
|
+
error ErrorTagetNotLockable();
|
58
|
+
|
59
|
+
// authorize target functions
|
60
|
+
error ErrorAuthorizeForAdminRoleInvalid(address target);
|
61
|
+
|
62
|
+
// check target
|
63
|
+
error ErrorTargetUnknown(address target);
|
64
|
+
|
65
|
+
/// @dev Set the disabled status of the speicified role.
|
66
|
+
/// Role disabling only prevents the role from being granted to new accounts.
|
67
|
+
/// Existing role members may still execute functions that are authorized for that role.
|
68
|
+
/// Permissioned: the caller must have the manager role (getManagerRole).
|
69
|
+
function setRoleDisabled(RoleId roleId, bool disabled) external;
|
70
|
+
|
71
|
+
/// @dev Grant the specified account the provided role.
|
72
|
+
/// Permissioned: the caller must have the roles admin role.
|
73
|
+
function grantRole(address account, RoleId roleId) external;
|
74
|
+
|
75
|
+
/// @dev Revoke the provided role from the specified account.
|
76
|
+
/// Permissioned: the caller must have the roles admin role.
|
77
|
+
function revokeRole(address account, RoleId roleId) external;
|
78
|
+
|
79
|
+
/// @dev Removes the provided role from the caller
|
80
|
+
function renounceRole(RoleId roleId) external;
|
81
|
+
|
82
|
+
/// @dev Set the locked status of the speicified contract.
|
83
|
+
/// IMPORTANT: using this function the AccessManager might itself be put into locked state from which it cannot be unlocked again.
|
84
|
+
/// Overwrite this function if a different use case specific behaviour is required.
|
85
|
+
/// Alternatively, add specific function to just unlock this contract without a restricted() modifier.
|
86
|
+
/// Permissioned: the caller must have the manager role (getManagerRole).
|
87
|
+
function setTargetLocked(address target, bool locked) external;
|
88
|
+
|
89
|
+
/// @dev Specifies which functions of the target can be accessed by the provided role.
|
90
|
+
/// Previously existing authorizations will be overwritten.
|
91
|
+
/// Authorizing the admin role is not allowed, use function unauthorizedFunctions for this.
|
92
|
+
/// Permissioned: the caller must have the manager role (getManagerRole).
|
93
|
+
function authorizeFunctions(address target, RoleId roleId, FunctionInfo[] memory functions) external;
|
94
|
+
|
95
|
+
/// @dev Specifies for which functionss to remove any previous authorization
|
96
|
+
/// Permissioned: the caller must have the manager role (getManagerRole).
|
97
|
+
function unauthorizeFunctions(address target, FunctionInfo[] memory functions) external;
|
98
|
+
|
99
|
+
//--- view functions ----------------------------------------------------//
|
100
|
+
|
101
|
+
function roles() external view returns (uint256 numberOfRoles);
|
102
|
+
function getRoleId(uint256 idx) external view returns (RoleId roleId);
|
103
|
+
function getAdminRole() external view returns (RoleId roleId);
|
104
|
+
function getManagerRole() external view returns (RoleId roleId);
|
105
|
+
function getPublicRole() external view returns (RoleId roleId);
|
106
|
+
|
107
|
+
function roleExists(RoleId roleId) external view returns (bool exists);
|
108
|
+
function isRoleDisabled(RoleId roleId) external view returns (bool roleIsActive);
|
109
|
+
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory roleInfo);
|
110
|
+
function getRoleForName(Str name) external view returns (RoleNameInfo memory);
|
111
|
+
|
112
|
+
function hasRole(address account, RoleId roleId) external view returns (bool);
|
113
|
+
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers);
|
114
|
+
function getRoleMember(RoleId roleId, uint256 idx) external view returns (address account);
|
115
|
+
|
116
|
+
function targetExists(address target) external view returns (bool exists);
|
117
|
+
function isTargetLocked(address target) external view returns (bool locked);
|
118
|
+
function targets() external view returns (uint256 numberOfTargets);
|
119
|
+
function getTargetAddress(uint256 idx) external view returns (address target);
|
120
|
+
function getTargetInfo(address target) external view returns (TargetInfo memory targetInfo);
|
121
|
+
function getTargetForName(Str name) external view returns (address target);
|
122
|
+
|
123
|
+
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions);
|
124
|
+
function getAuthorizedFunction(address target, uint256 idx) external view returns (FunctionInfo memory func, RoleId roleId);
|
125
|
+
function canCall(address caller, address target, Selector selector) external view returns (bool can);
|
126
|
+
|
127
|
+
function toFunction(bytes4 selector, string memory name) external view returns (FunctionInfo memory);
|
128
|
+
function isAccessManaged(address target) external view returns (bool);
|
129
|
+
function deployer() external view returns (address);
|
130
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
5
|
+
import {RoleId} from "../type/RoleId.sol";
|
6
|
+
import {Str} from "../type/String.sol";
|
7
|
+
import {VersionPart} from "../type/Version.sol";
|
8
|
+
|
9
|
+
interface IModuleAuthorization {
|
10
|
+
|
11
|
+
/// @dev Returns the release (VersionPart) for which the instance authorizations are defined by this contract.
|
12
|
+
/// Matches with the release returned by the linked service authorization.
|
13
|
+
function getRelease() external view returns(VersionPart release);
|
14
|
+
|
15
|
+
/// @dev Returns the list of module targets.
|
16
|
+
function getTargets() external view returns(Str[] memory targets);
|
17
|
+
|
18
|
+
/// @dev Returns the list of involved roles.
|
19
|
+
function getRoles() external view returns(RoleId[] memory roles);
|
20
|
+
|
21
|
+
/// @dev For the given target the list of authorized role ids is returned
|
22
|
+
function getAuthorizedRoles(Str target) external view returns(RoleId[] memory roleIds);
|
23
|
+
|
24
|
+
/// @dev For the given target and role id the list of authorized functions is returned
|
25
|
+
function getAuthorizedFunctions(Str target, RoleId roleId) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions);
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
5
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
6
|
+
import {VersionPart} from "../type/Version.sol";
|
7
|
+
|
8
|
+
interface IServiceAuthorization {
|
9
|
+
|
10
|
+
/// @dev Returns the commit hash representing the deployed release
|
11
|
+
function getCommitHash()
|
12
|
+
external
|
13
|
+
view
|
14
|
+
returns(string memory commitHash);
|
15
|
+
|
16
|
+
/// @dev Returns the release (VersionPart) for which the service authorizations are defined by this contract.
|
17
|
+
function getRelease()
|
18
|
+
external
|
19
|
+
view
|
20
|
+
returns(VersionPart release);
|
21
|
+
|
22
|
+
/// @dev Returns the full list of service domains for this release.
|
23
|
+
/// Services need to be registered for the release in revers order of this list.
|
24
|
+
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains);
|
25
|
+
|
26
|
+
/// @dev Returns the expected service address for the provided domain.
|
27
|
+
function getServiceAddress(ObjectType serviceDomain) external view returns(address service);
|
28
|
+
|
29
|
+
/// @dev Given the service domain this function returns the list of other service domains that are authorized to access this service.
|
30
|
+
function getAuthorizedDomains(ObjectType serviceDomain) external view returns(ObjectType[] memory authorizatedDomains);
|
31
|
+
|
32
|
+
/// @dev For the given service domain and authorized domain the function returns the list of authorized functions
|
33
|
+
function getAuthorizedFunctions(ObjectType serviceDomain, ObjectType authorizedDomain) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions);
|
34
|
+
}
|
35
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
5
|
+
import {IInstance} from "../instance/IInstance.sol";
|
6
|
+
import {IModuleAuthorization} from "./IModuleAuthorization.sol";
|
7
|
+
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
8
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
+
import {NftId} from "../type/NftId.sol";
|
10
|
+
import {ObjectType, INSTANCE} from "../type/ObjectType.sol";
|
11
|
+
import {RegistryLinked} from "../shared/RegistryLinked.sol";
|
12
|
+
import {ReleaseManager} from "../registry/ReleaseManager.sol";
|
13
|
+
import {RoleId} from "../type/RoleId.sol";
|
14
|
+
import {VersionPart} from "../type/Version.sol";
|
15
|
+
|
16
|
+
contract InstanceAdmin is
|
17
|
+
AccessAdmin,
|
18
|
+
RegistryLinked
|
19
|
+
{
|
20
|
+
|
21
|
+
// initialize
|
22
|
+
error ErrorInstanceAdminNotInstance(address instance);
|
23
|
+
error ErrorInstanceAdminNotRegisteredInstance(address instance);
|
24
|
+
error ErrorInstanceAdminServiceVersionMismatch();
|
25
|
+
|
26
|
+
IInstance private _instance;
|
27
|
+
IModuleAuthorization private _instanceAuthz;
|
28
|
+
IServiceAuthorization private _serviceAuthz;
|
29
|
+
|
30
|
+
function initialize(
|
31
|
+
address registry,
|
32
|
+
address instance,
|
33
|
+
IModuleAuthorization instanceAuthz
|
34
|
+
)
|
35
|
+
external
|
36
|
+
initializer()
|
37
|
+
{
|
38
|
+
initializeRegistryLinked(registry);
|
39
|
+
_initializeInstance(instance);
|
40
|
+
_initializeAuthorization(instanceAuthz);
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
//--- view functions ----------------------------------------------------//
|
45
|
+
|
46
|
+
function getInstance() external view returns(IInstance instance) {
|
47
|
+
return _instance;
|
48
|
+
}
|
49
|
+
|
50
|
+
function getInstanceAuthorization() external view returns(IModuleAuthorization serviceAuthz) {
|
51
|
+
return _instanceAuthz;
|
52
|
+
}
|
53
|
+
|
54
|
+
function getServiceAuthorization() external view returns(IServiceAuthorization serviceAuthz) {
|
55
|
+
return _serviceAuthz;
|
56
|
+
}
|
57
|
+
|
58
|
+
//--- private functions -------------------------------------------------//
|
59
|
+
|
60
|
+
function _initializeInstance(address instance)
|
61
|
+
private
|
62
|
+
onlyInitializing()
|
63
|
+
{
|
64
|
+
IRegistry registry = getRegistry();
|
65
|
+
IRegistry.ObjectInfo memory info = registry.getObjectInfo(instance);
|
66
|
+
|
67
|
+
if (info.objectType != INSTANCE()) {
|
68
|
+
revert ErrorInstanceAdminNotInstance(instance);
|
69
|
+
}
|
70
|
+
|
71
|
+
if (info.nftId.eqz()) {
|
72
|
+
revert ErrorInstanceAdminNotRegisteredInstance(instance);
|
73
|
+
}
|
74
|
+
|
75
|
+
_instance = IInstance(instance);
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
function _initializeAuthorization(
|
80
|
+
IModuleAuthorization instanceAuthz
|
81
|
+
)
|
82
|
+
private
|
83
|
+
onlyInitializing()
|
84
|
+
{
|
85
|
+
// check instance version matches with authz relase
|
86
|
+
VersionPart release = instanceAuthz.getRelease();
|
87
|
+
if(release != _instance.getMajorVersion()) {
|
88
|
+
revert ErrorInstanceAdminServiceVersionMismatch();
|
89
|
+
}
|
90
|
+
|
91
|
+
_instanceAuthz = instanceAuthz;
|
92
|
+
_serviceAuthz = _getServiceAuthorization(release);
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
function _getServiceAuthorization(VersionPart release)
|
97
|
+
private
|
98
|
+
view
|
99
|
+
returns (IServiceAuthorization serviceAuthz)
|
100
|
+
{
|
101
|
+
ReleaseManager releaseManager = ReleaseManager(
|
102
|
+
getRegistry().getReleaseManagerAddress());
|
103
|
+
|
104
|
+
return releaseManager.getServiceAuthorization(release);
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
|
@@ -0,0 +1,116 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
5
|
+
import {IModuleAuthorization} from "./IModuleAuthorization.sol";
|
6
|
+
import {ObjectType, ObjectTypeLib} from "../type/ObjectType.sol";
|
7
|
+
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
8
|
+
import {SelectorLib} from "../type/Selector.sol";
|
9
|
+
import {Str, StrLib} from "../type/String.sol";
|
10
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
11
|
+
import {VersionPart} from "../type/Version.sol";
|
12
|
+
|
13
|
+
contract ModuleAuthorization
|
14
|
+
is IModuleAuthorization
|
15
|
+
{
|
16
|
+
|
17
|
+
Str[] internal _targets;
|
18
|
+
RoleId[] internal _roles;
|
19
|
+
mapping(RoleId role => Str name) internal _roleName;
|
20
|
+
|
21
|
+
mapping(Str target => RoleId[] authorizedRoles) internal _authorizedRoles;
|
22
|
+
mapping(Str target => mapping(RoleId authorizedRole => IAccess.FunctionInfo[] functions)) internal _authorizedFunctions;
|
23
|
+
|
24
|
+
constructor() {
|
25
|
+
_setupTargets();
|
26
|
+
_setupRoles();
|
27
|
+
_setupTargetAuthorizations();
|
28
|
+
}
|
29
|
+
|
30
|
+
function getRelease() public virtual view returns(VersionPart release) { }
|
31
|
+
|
32
|
+
function getTargets() external view returns(Str[] memory targets) {
|
33
|
+
return _targets;
|
34
|
+
}
|
35
|
+
|
36
|
+
function getRoles() external view returns(RoleId[] memory roles) {
|
37
|
+
return _roles;
|
38
|
+
}
|
39
|
+
|
40
|
+
function getRoleName(RoleId roleId) external view returns (Str name) {
|
41
|
+
return _roleName[roleId];
|
42
|
+
}
|
43
|
+
|
44
|
+
function getAuthorizedRoles(Str target) external view returns(RoleId[] memory roleIds) {
|
45
|
+
return _authorizedRoles[target];
|
46
|
+
}
|
47
|
+
|
48
|
+
function getAuthorizedFunctions(Str target, RoleId roleId) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions) {
|
49
|
+
return _authorizedFunctions[target][roleId];
|
50
|
+
}
|
51
|
+
|
52
|
+
/// @dev Overwrite this function for a specific realease.
|
53
|
+
function _setupTargets() internal virtual {}
|
54
|
+
|
55
|
+
/// @dev Overwrite this function for a specific realease.
|
56
|
+
function _setupRoles() internal virtual {}
|
57
|
+
|
58
|
+
/// @dev Overwrite this function for a specific realease.
|
59
|
+
function _setupTargetAuthorizations() internal virtual {}
|
60
|
+
|
61
|
+
/// @dev Use this method to to add an authorized target.
|
62
|
+
function _addTarget(string memory name) internal {
|
63
|
+
_targets.push(StrLib.toStr(name));
|
64
|
+
}
|
65
|
+
|
66
|
+
function _addServiceRole(ObjectType serviceDomain) internal {
|
67
|
+
_addRole(
|
68
|
+
_getServiceRoleId(serviceDomain),
|
69
|
+
ObjectTypeLib.toVersionedName(
|
70
|
+
ObjectTypeLib.toName(serviceDomain),
|
71
|
+
"ServiceRole",
|
72
|
+
getRelease().toInt()));
|
73
|
+
}
|
74
|
+
|
75
|
+
/// @dev Use this method to to add an authorized role.
|
76
|
+
function _addRole(RoleId roleId, string memory name) internal {
|
77
|
+
_roles.push(roleId);
|
78
|
+
_roleName[roleId] = StrLib.toStr(name);
|
79
|
+
}
|
80
|
+
|
81
|
+
/// @dev Use this method to authorize the specified role to access the target.
|
82
|
+
function _authorizeForTarget(string memory target, RoleId authorizedRoleId)
|
83
|
+
internal
|
84
|
+
returns (IAccess.FunctionInfo[] storage authorizatedFunctions)
|
85
|
+
{
|
86
|
+
Str targetStr = StrLib.toStr(target);
|
87
|
+
_authorizedRoles[targetStr].push(authorizedRoleId);
|
88
|
+
return _authorizedFunctions[targetStr][authorizedRoleId];
|
89
|
+
}
|
90
|
+
|
91
|
+
/// @dev Use this method to authorize a specific function authorization
|
92
|
+
function _authorize(IAccess.FunctionInfo[] storage functions, bytes4 selector, string memory name) internal {
|
93
|
+
functions.push(
|
94
|
+
IAccess.FunctionInfo({
|
95
|
+
selector: SelectorLib.toSelector(selector),
|
96
|
+
name: StrLib.toStr(name),
|
97
|
+
createdAt: TimestampLib.blockTimestamp()}));
|
98
|
+
}
|
99
|
+
|
100
|
+
/// @dev role id for targets registry, staking and instance
|
101
|
+
function _getTargetRoleId(ObjectType targetDomain)
|
102
|
+
internal
|
103
|
+
returns (RoleId targetRoleId)
|
104
|
+
{
|
105
|
+
return RoleIdLib.roleForType(targetDomain);
|
106
|
+
}
|
107
|
+
|
108
|
+
function _getServiceRoleId(ObjectType serviceDomain)
|
109
|
+
internal
|
110
|
+
returns (RoleId serviceRoleId)
|
111
|
+
{
|
112
|
+
return RoleIdLib.roleForTypeAndVersion(
|
113
|
+
serviceDomain, getRelease());
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
@@ -0,0 +1,86 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
5
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
6
|
+
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
7
|
+
import {SelectorLib} from "../type/Selector.sol";
|
8
|
+
import {StrLib} from "../type/String.sol";
|
9
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
10
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
11
|
+
|
12
|
+
/// @dev Base contract for release specific service authorization contracts.
|
13
|
+
contract ServiceAuthorization
|
14
|
+
is IServiceAuthorization
|
15
|
+
{
|
16
|
+
uint256 public constant GIF_VERSION_3 = 3;
|
17
|
+
|
18
|
+
string private _commitHash;
|
19
|
+
|
20
|
+
ObjectType[] internal _serviceDomains;
|
21
|
+
mapping(ObjectType domain => address service) internal _serviceAddress;
|
22
|
+
mapping(ObjectType domain => ObjectType[] authorizedDomains) internal _authorizedDomains;
|
23
|
+
mapping(ObjectType domain => mapping(ObjectType authorizedDomain => IAccess.FunctionInfo[] functions)) internal _authorizedFunctions;
|
24
|
+
|
25
|
+
constructor(string memory commitHash) {
|
26
|
+
_commitHash = commitHash;
|
27
|
+
_setupDomains();
|
28
|
+
_setupDomainAuthorizations();
|
29
|
+
}
|
30
|
+
|
31
|
+
function getCommitHash() external view returns(string memory commitHash) {
|
32
|
+
return _commitHash;
|
33
|
+
}
|
34
|
+
|
35
|
+
function getRelease() external view returns(VersionPart release) {
|
36
|
+
return VersionPartLib.toVersionPart(GIF_VERSION_3);
|
37
|
+
}
|
38
|
+
|
39
|
+
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains) {
|
40
|
+
return _serviceDomains;
|
41
|
+
}
|
42
|
+
|
43
|
+
function getServiceAddress(ObjectType serviceDomain) external view returns(address service) {
|
44
|
+
return _serviceAddress[serviceDomain];
|
45
|
+
}
|
46
|
+
|
47
|
+
function getAuthorizedDomains(ObjectType serviceDomain) external view returns(ObjectType[] memory authorizatedDomains) {
|
48
|
+
return _authorizedDomains[serviceDomain];
|
49
|
+
}
|
50
|
+
|
51
|
+
function getAuthorizedFunctions(ObjectType serviceDomain, ObjectType authorizedDomain) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions) {
|
52
|
+
return _authorizedFunctions[serviceDomain][authorizedDomain];
|
53
|
+
}
|
54
|
+
|
55
|
+
/// @dev Overwrite this function for a specific realease.
|
56
|
+
function _setupDomains() internal virtual {}
|
57
|
+
|
58
|
+
/// @dev Overwrite this function for a specific realease.
|
59
|
+
function _setupDomainAuthorizations() internal virtual {}
|
60
|
+
|
61
|
+
/// @dev Use this method to to add an authorized domain.
|
62
|
+
/// The services will need to be registered in the order they are added using this function.
|
63
|
+
function _authorizeDomain(ObjectType serviceDomain, address serviceAddress) internal {
|
64
|
+
_serviceDomains.push(serviceDomain);
|
65
|
+
_serviceAddress[serviceDomain] = serviceAddress;
|
66
|
+
}
|
67
|
+
|
68
|
+
/// @dev Use this method to authorize the specified domain to access the service domain.
|
69
|
+
function _authorizeForService(ObjectType serviceDomain, ObjectType authorizedDomain)
|
70
|
+
internal
|
71
|
+
returns (IAccess.FunctionInfo[] storage authorizatedFunctions)
|
72
|
+
{
|
73
|
+
_authorizedDomains[serviceDomain].push(authorizedDomain);
|
74
|
+
return _authorizedFunctions[serviceDomain][authorizedDomain];
|
75
|
+
}
|
76
|
+
|
77
|
+
/// @dev Use this method to authorize a specific function authorization
|
78
|
+
function _authorize(IAccess.FunctionInfo[] storage functions, bytes4 selector, string memory name) internal {
|
79
|
+
functions.push(
|
80
|
+
IAccess.FunctionInfo({
|
81
|
+
selector: SelectorLib.toSelector(selector),
|
82
|
+
name: StrLib.toStr(name),
|
83
|
+
createdAt: TimestampLib.blockTimestamp()}));
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
@@ -77,10 +77,6 @@ contract DistributionService is
|
|
77
77
|
registerInterface(type(IDistributionService).interfaceId);
|
78
78
|
}
|
79
79
|
|
80
|
-
function getDomain() public pure override returns(ObjectType) {
|
81
|
-
return DISTRIBUTION();
|
82
|
-
}
|
83
|
-
|
84
80
|
|
85
81
|
function createDistributorType(
|
86
82
|
string memory name,
|
@@ -295,4 +291,7 @@ contract DistributionService is
|
|
295
291
|
return IInstance(instanceAddress);
|
296
292
|
}
|
297
293
|
|
294
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
295
|
+
return DISTRIBUTION();
|
296
|
+
}
|
298
297
|
}
|
@@ -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";
|
@@ -37,7 +40,6 @@ import {IPolicyService} from "../product/IPolicyService.sol";
|
|
37
40
|
import {IBundleService} from "../pool/IBundleService.sol";
|
38
41
|
|
39
42
|
|
40
|
-
|
41
43
|
interface IInstance is
|
42
44
|
IRegisterable,
|
43
45
|
ITransferInterceptor,
|
@@ -56,6 +58,10 @@ interface IInstance is
|
|
56
58
|
error ErrorInstanceInstanceStoreAlreadySet(address instanceStore);
|
57
59
|
error ErrorInstanceInstanceStoreAuthorityMismatch(address instanceAuthority);
|
58
60
|
|
61
|
+
struct InstanceInfo {
|
62
|
+
uint64 requestsCount;
|
63
|
+
}
|
64
|
+
|
59
65
|
function createRole(string memory roleName, string memory adminName) external returns (RoleId roleId, RoleId admin);
|
60
66
|
function grantRole(RoleId roleId, address account) external;
|
61
67
|
function revokeRole(RoleId roleId, address account) external;
|
@@ -64,11 +70,13 @@ interface IInstance is
|
|
64
70
|
function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
|
65
71
|
function setTargetLocked(address target, bool locked) external;
|
66
72
|
|
67
|
-
function
|
68
|
-
function
|
69
|
-
function
|
70
|
-
|
71
|
-
|
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);
|
72
80
|
|
73
81
|
function getMajorVersion() external pure returns (VersionPart majorVersion);
|
74
82
|
function getInstanceReader() external view returns (InstanceReader);
|