@etherisc/gif-next 0.0.2-9e6b423-414 → 0.0.2-9f51324-299
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/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +2 -2
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +97 -267
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +36 -652
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +47 -222
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +27 -175
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -85
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +16 -246
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +27 -420
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +3 -3
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +60 -221
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +114 -167
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +60 -72
- 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 +0 -29
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +2 -2
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2 -2
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +59 -220
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +3 -3
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +59 -220
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +32 -310
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +0 -182
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -322
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +292 -605
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +56 -242
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +290 -478
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +26 -208
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +14 -14
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- 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/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- 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/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +56 -234
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +59 -220
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -92
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +55 -31
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- 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/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +26 -92
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +2 -2
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +36 -60
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +19 -15
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +59 -220
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +40 -40
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +26 -82
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +2 -2
- 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/IRelease.sol/IRelease.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +249 -378
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +68 -243
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +10 -10
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +186 -384
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +76 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -437
- 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/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 +54 -54
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +28 -28
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +45 -16
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.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/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/InitializableERC165.sol/InitializableERC165.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/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.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/Registerable.sol/Registerable.dbg.json +1 -1
- 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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- 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/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +8 -8
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +5 -5
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +2 -2
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
- 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/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.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 +6 -6
- 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 +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +218 -39
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +2 -50
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.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/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +185 -261
- package/contracts/authorization/AccessAdminLib.sol +7 -220
- package/contracts/authorization/Authorization.sol +229 -38
- package/contracts/authorization/IAccess.sol +4 -14
- package/contracts/authorization/IAccessAdmin.sol +45 -19
- package/contracts/authorization/IAuthorization.sol +56 -3
- package/contracts/authorization/IServiceAuthorization.sol +17 -55
- package/contracts/authorization/ServiceAuthorization.sol +33 -247
- package/contracts/distribution/BasicDistributionAuthorization.sol +4 -11
- package/contracts/distribution/Distribution.sol +1 -2
- package/contracts/distribution/DistributionService.sol +33 -75
- package/contracts/distribution/IDistributionComponent.sol +1 -3
- package/contracts/distribution/IDistributionService.sol +4 -10
- package/contracts/instance/IInstance.sol +4 -43
- package/contracts/instance/IInstanceService.sol +3 -28
- package/contracts/instance/Instance.sol +39 -80
- package/contracts/instance/InstanceAdmin.sol +229 -162
- package/contracts/instance/InstanceAuthorizationV3.sol +28 -58
- package/contracts/instance/InstanceReader.sol +389 -371
- package/contracts/instance/InstanceService.sol +53 -105
- package/contracts/oracle/BasicOracleAuthorization.sol +2 -18
- package/contracts/pool/BasicPoolAuthorization.sol +3 -9
- package/contracts/pool/BundleService.sol +9 -8
- package/contracts/pool/PoolLib.sol +0 -44
- package/contracts/product/ApplicationService.sol +26 -4
- package/contracts/product/BasicProductAuthorization.sol +4 -9
- package/contracts/product/ClaimService.sol +20 -11
- package/contracts/product/PolicyService.sol +2 -2
- package/contracts/product/PolicyServiceLib.sol +0 -20
- package/contracts/registry/RegistryAdmin.sol +97 -27
- package/contracts/registry/RegistryAuthorization.sol +25 -35
- package/contracts/registry/ReleaseAdmin.sol +100 -42
- package/contracts/registry/ReleaseRegistry.sol +9 -12
- package/contracts/registry/ServiceAuthorizationV3.sol +20 -32
- package/contracts/registry/TokenRegistry.sol +4 -2
- package/contracts/shared/ComponentService.sol +5 -22
- package/contracts/shared/ContractLib.sol +45 -9
- package/contracts/shared/IRegisterable.sol +1 -0
- package/contracts/shared/Service.sol +4 -6
- package/contracts/staking/Staking.sol +5 -4
- package/contracts/staking/TargetManagerLib.sol +1 -1
- package/contracts/type/ObjectType.sol +3 -16
- package/contracts/type/RoleId.sol +59 -57
- package/contracts/type/String.sol +0 -12
- package/contracts/upgradeability/ProxyManager.sol +2 -2
- package/contracts/upgradeability/Versionable.sol +1 -4
- package/package.json +1 -1
@@ -6,57 +6,19 @@ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/acce
|
|
6
6
|
import {IAccess} from "./IAccess.sol";
|
7
7
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
8
8
|
import {IAuthorization} from "./IAuthorization.sol";
|
9
|
-
import {IComponent} from "../shared/IComponent.sol";
|
10
9
|
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
-
import {IService} from "../shared/IService.sol";
|
12
|
-
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
13
10
|
|
14
11
|
import {ContractLib} from "../shared/ContractLib.sol";
|
15
12
|
import {ObjectType} from "../type/ObjectType.sol";
|
16
|
-
import {RoleId
|
13
|
+
import {RoleId} from "../type/RoleId.sol";
|
17
14
|
import {SelectorLib} from "../type/Selector.sol";
|
18
15
|
import {Str, StrLib} from "../type/String.sol";
|
19
16
|
import {TimestampLib} from "../type/Timestamp.sol";
|
20
|
-
import {VersionPart
|
17
|
+
import {VersionPart} from "../type/Version.sol";
|
21
18
|
|
22
19
|
|
23
20
|
library AccessAdminLib { // ACCESS_ADMIN_LIB
|
24
21
|
|
25
|
-
string public constant TOKEN_HANDLER_SUFFIX = "Th";
|
26
|
-
string public constant ROLE_SUFFIX = "_Role";
|
27
|
-
|
28
|
-
uint64 public constant SERVICE_DOMAIN_ROLE_FACTOR = 100;
|
29
|
-
uint64 public constant COMPONENT_ROLE_FACTOR = 1000;
|
30
|
-
uint64 public constant COMPONENT_ROLE_MAX = 19000;
|
31
|
-
|
32
|
-
uint64 public constant CORE_ROLE_MIN = 100;
|
33
|
-
uint64 public constant SERVICE_ROLE_MIN = 1000; // + service domain * SERVICE_ROLE_FACTOR + release
|
34
|
-
uint64 public constant SERVICE_ROLE_FACTOR = 1000;
|
35
|
-
uint64 public constant INSTANCE_ROLE_MIN = 100000;
|
36
|
-
|
37
|
-
// MUST match with Authorization.COMPONENT_ROLE_MIN
|
38
|
-
uint64 public constant COMPONENT_ROLE_MIN = 110000;
|
39
|
-
|
40
|
-
uint64 public constant CUSTOM_ROLE_MIN = 1000000;
|
41
|
-
|
42
|
-
|
43
|
-
function getSelectors(
|
44
|
-
IAccess.FunctionInfo[] memory functions
|
45
|
-
)
|
46
|
-
public
|
47
|
-
pure
|
48
|
-
returns (
|
49
|
-
bytes4[] memory selectors
|
50
|
-
)
|
51
|
-
{
|
52
|
-
uint256 n = functions.length;
|
53
|
-
selectors = new bytes4[](n);
|
54
|
-
for (uint256 i = 0; i < n; i++) {
|
55
|
-
selectors[i] = functions[i].selector.toBytes4();
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
22
|
function checkRoleCreation(
|
61
23
|
IAccessAdmin accessAdmin,
|
62
24
|
RoleId roleId,
|
@@ -92,7 +54,6 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
92
54
|
}
|
93
55
|
}
|
94
56
|
|
95
|
-
|
96
57
|
function checkTargetCreation(
|
97
58
|
IAccessAdmin accessAdmin,
|
98
59
|
address target,
|
@@ -136,6 +97,7 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
136
97
|
revert IAccessAdmin.ErrorAccessAdminTargetAuthorityMismatch(accessAdmin.authority(), targetAuthority);
|
137
98
|
}
|
138
99
|
}
|
100
|
+
|
139
101
|
}
|
140
102
|
|
141
103
|
|
@@ -144,7 +106,6 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
144
106
|
address authorization,
|
145
107
|
ObjectType expectedDomain,
|
146
108
|
VersionPart expectedRelease,
|
147
|
-
bool expectServiceAuthorization,
|
148
109
|
bool checkAlreadyInitialized
|
149
110
|
)
|
150
111
|
public
|
@@ -157,14 +118,8 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
157
118
|
}
|
158
119
|
|
159
120
|
// check contract type matches
|
160
|
-
if (
|
161
|
-
|
162
|
-
revert IAccessAdmin.ErrorAccessAdminNotServiceAuthorization(authorization);
|
163
|
-
}
|
164
|
-
} else {
|
165
|
-
if (!ContractLib.supportsInterface(authorization, type(IAuthorization).interfaceId)) {
|
166
|
-
revert IAccessAdmin.ErrorAccessAdminNotAuthorization(authorization);
|
167
|
-
}
|
121
|
+
if (!ContractLib.supportsInterface(authorization, type(IAuthorization).interfaceId)) {
|
122
|
+
revert IAccessAdmin.ErrorAccessAdminNotAuthorization(authorization);
|
168
123
|
}
|
169
124
|
|
170
125
|
// check domain matches
|
@@ -189,8 +144,6 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
189
144
|
public
|
190
145
|
view
|
191
146
|
{
|
192
|
-
checkRegistry(registry);
|
193
|
-
|
194
147
|
ObjectType tagetType = IRegistry(registry).getObjectInfo(target).objectType;
|
195
148
|
if (tagetType.eqz()) {
|
196
149
|
revert IAccessAdmin.ErrorAccessAdminNotRegistered(target);
|
@@ -201,161 +154,7 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
201
154
|
}
|
202
155
|
}
|
203
156
|
|
204
|
-
|
205
|
-
function checkRegistry(
|
206
|
-
address registry
|
207
|
-
)
|
208
|
-
public
|
209
|
-
view
|
210
|
-
{
|
211
|
-
if (!ContractLib.isRegistry(registry)) {
|
212
|
-
revert IAccessAdmin.ErrorAccessAdminNotRegistry(registry);
|
213
|
-
}
|
214
|
-
}
|
215
|
-
|
216
|
-
|
217
|
-
function getServiceRoleId(
|
218
|
-
address serviceAddress,
|
219
|
-
IAccess.TargetType serviceTargetType
|
220
|
-
)
|
221
|
-
public
|
222
|
-
view
|
223
|
-
returns (RoleId serviceRoleId)
|
224
|
-
{
|
225
|
-
IService service = IService(serviceAddress);
|
226
|
-
|
227
|
-
if (serviceTargetType == IAccess.TargetType.Service) {
|
228
|
-
return RoleIdLib.toServiceRoleId(service.getDomain(), service.getRelease());
|
229
|
-
} else if (serviceTargetType == IAccess.TargetType.GenericService) {
|
230
|
-
return RoleIdLib.toGenericServiceRoleId(service.getDomain());
|
231
|
-
}
|
232
|
-
|
233
|
-
revert IAccessAdmin.ErrorAccessAdminInvalidServiceType(serviceAddress, serviceTargetType);
|
234
|
-
}
|
235
|
-
|
236
|
-
|
237
|
-
function getVersionedServiceRoleId(
|
238
|
-
ObjectType serviceDomain,
|
239
|
-
VersionPart release
|
240
|
-
)
|
241
|
-
public
|
242
|
-
pure
|
243
|
-
returns (RoleId serviceRoleId)
|
244
|
-
{
|
245
|
-
return RoleIdLib.toRoleId(
|
246
|
-
SERVICE_ROLE_MIN + SERVICE_ROLE_FACTOR * serviceDomain.toInt() + release.toInt());
|
247
|
-
}
|
248
|
-
|
249
|
-
|
250
|
-
function getGenericServiceRoleId(
|
251
|
-
ObjectType serviceDomain
|
252
|
-
)
|
253
|
-
public
|
254
|
-
pure
|
255
|
-
returns (RoleId serviceRoleId)
|
256
|
-
{
|
257
|
-
return RoleIdLib.toRoleId(
|
258
|
-
SERVICE_ROLE_MIN + SERVICE_ROLE_FACTOR * serviceDomain.toInt() + VersionPartLib.releaseMax().toInt());
|
259
|
-
}
|
260
|
-
|
261
|
-
|
262
|
-
function getCustomRoleId(uint64 index)
|
263
|
-
public
|
264
|
-
pure
|
265
|
-
returns (RoleId customRoleId)
|
266
|
-
{
|
267
|
-
return RoleIdLib.toRoleId(CUSTOM_ROLE_MIN + index);
|
268
|
-
}
|
269
|
-
|
270
|
-
|
271
|
-
function isCustomRole(RoleId roleId)
|
272
|
-
public
|
273
|
-
pure
|
274
|
-
returns (bool)
|
275
|
-
{
|
276
|
-
return roleId.toInt() >= CUSTOM_ROLE_MIN;
|
277
|
-
}
|
278
|
-
|
279
|
-
|
280
|
-
function getTargetRoleId(
|
281
|
-
address target,
|
282
|
-
IAccess.TargetType targetType,
|
283
|
-
uint64 index
|
284
|
-
)
|
285
|
-
public
|
286
|
-
view
|
287
|
-
returns (RoleId targetRoleId)
|
288
|
-
{
|
289
|
-
if (targetType == IAccess.TargetType.Core) {
|
290
|
-
return RoleIdLib.toRoleId(CORE_ROLE_MIN + index);
|
291
|
-
}
|
292
|
-
|
293
|
-
if (targetType == IAccess.TargetType.Service || targetType == IAccess.TargetType.GenericService ) {
|
294
|
-
return getServiceRoleId(target, targetType);
|
295
|
-
}
|
296
|
-
|
297
|
-
if (targetType == IAccess.TargetType.Instance) {
|
298
|
-
return RoleIdLib.toRoleId(INSTANCE_ROLE_MIN + index);
|
299
|
-
}
|
300
|
-
|
301
|
-
if (targetType == IAccess.TargetType.Component) {
|
302
|
-
return RoleIdLib.toRoleId(COMPONENT_ROLE_MIN + index);
|
303
|
-
}
|
304
|
-
|
305
|
-
if (targetType == IAccess.TargetType.Custom) {
|
306
|
-
return RoleIdLib.toRoleId(CUSTOM_ROLE_MIN + index);
|
307
|
-
}
|
308
|
-
|
309
|
-
revert IAccessAdmin.ErrorAccessAdminInvalidTargetType(target, targetType);
|
310
|
-
}
|
311
|
-
|
312
|
-
|
313
|
-
function getTokenHandler(
|
314
|
-
address target,
|
315
|
-
string memory targetName,
|
316
|
-
IAccess.TargetType targetType
|
317
|
-
)
|
318
|
-
public
|
319
|
-
view
|
320
|
-
returns (
|
321
|
-
address tokenHandler,
|
322
|
-
string memory tokenHandlerName
|
323
|
-
)
|
324
|
-
{
|
325
|
-
// not component or core (we need to check core because of staking)
|
326
|
-
if (targetType != IAccess.TargetType.Component && targetType != IAccess.TargetType.Core) {
|
327
|
-
return (address(0), "");
|
328
|
-
}
|
329
|
-
|
330
|
-
// not contract
|
331
|
-
if (!ContractLib.isContract(target)) {
|
332
|
-
return (address(0), "");
|
333
|
-
}
|
334
|
-
|
335
|
-
// not component
|
336
|
-
if (!ContractLib.supportsInterface(target, type(IComponent).interfaceId)) {
|
337
|
-
return (address(0), "");
|
338
|
-
}
|
339
|
-
|
340
|
-
tokenHandler = address(IComponent(target).getTokenHandler());
|
341
|
-
tokenHandlerName = string(abi.encodePacked(targetName, TOKEN_HANDLER_SUFFIX));
|
342
|
-
}
|
343
|
-
|
344
|
-
|
345
|
-
function toRoleName(string memory name) public pure returns (string memory) {
|
346
|
-
return string(
|
347
|
-
abi.encodePacked(
|
348
|
-
name,
|
349
|
-
ROLE_SUFFIX));
|
350
|
-
}
|
351
|
-
|
352
|
-
|
353
|
-
function toRole(
|
354
|
-
RoleId adminRoleId,
|
355
|
-
IAccessAdmin.RoleType roleType,
|
356
|
-
uint32 maxMemberCount,
|
357
|
-
string memory name
|
358
|
-
)
|
157
|
+
function toRole(RoleId adminRoleId, IAccessAdmin.RoleType roleType, uint32 maxMemberCount, string memory name)
|
359
158
|
public
|
360
159
|
view
|
361
160
|
returns (IAccess.RoleInfo memory)
|
@@ -370,23 +169,11 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
370
169
|
});
|
371
170
|
}
|
372
171
|
|
373
|
-
|
374
|
-
function toFunction(
|
375
|
-
bytes4 selector,
|
376
|
-
string memory name
|
377
|
-
)
|
172
|
+
function toFunction(bytes4 selector, string memory name)
|
378
173
|
public
|
379
174
|
view
|
380
175
|
returns (IAccess.FunctionInfo memory)
|
381
176
|
{
|
382
|
-
if(selector == bytes4(0)) {
|
383
|
-
revert IAccessAdmin.ErrorAccessAdminSelectorZero();
|
384
|
-
}
|
385
|
-
|
386
|
-
if(bytes(name).length == 0) {
|
387
|
-
revert IAccessAdmin.ErrorAccessAdminFunctionNameEmpty();
|
388
|
-
}
|
389
|
-
|
390
177
|
return IAccess.FunctionInfo({
|
391
178
|
name: StrLib.toStr(name),
|
392
179
|
selector: SelectorLib.toSelector(selector),
|
@@ -4,49 +4,75 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccess} from "./IAccess.sol";
|
5
5
|
import {IAuthorization} from "./IAuthorization.sol";
|
6
6
|
|
7
|
-
import {
|
7
|
+
import {InitializableERC165} from "../shared/InitializableERC165.sol";
|
8
8
|
import {ObjectType, ObjectTypeLib} from "../type/ObjectType.sol";
|
9
|
-
import {RoleId, RoleIdLib, ADMIN_ROLE
|
9
|
+
import {RoleId, RoleIdLib, ADMIN_ROLE} from "../type/RoleId.sol";
|
10
10
|
import {SelectorLib} from "../type/Selector.sol";
|
11
|
-
import {ServiceAuthorization} from "../authorization/ServiceAuthorization.sol";
|
12
11
|
import {Str, StrLib} from "../type/String.sol";
|
13
12
|
import {TimestampLib} from "../type/Timestamp.sol";
|
14
13
|
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
15
14
|
|
16
|
-
|
17
15
|
contract Authorization is
|
18
|
-
|
16
|
+
InitializableERC165,
|
19
17
|
IAuthorization
|
20
18
|
{
|
19
|
+
uint256 public constant GIF_RELEASE = 3;
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
string public constant ROLE_NAME_SUFFIX = "Role";
|
22
|
+
string public constant SERVICE_ROLE_NAME_SUFFIX = "ServiceRole";
|
24
23
|
|
25
24
|
uint64 internal _nextGifContractRoleId;
|
25
|
+
ObjectType[] internal _serviceDomains;
|
26
|
+
mapping(ObjectType domain => Str target) internal _serviceTarget;
|
27
|
+
|
28
|
+
string internal _mainTargetName = "Component";
|
29
|
+
string internal _tokenHandlerName = "ComponentTH";
|
26
30
|
|
27
|
-
|
31
|
+
ObjectType internal _domain;
|
32
|
+
Str internal _mainTarget;
|
28
33
|
Str internal _tokenHandlerTarget;
|
34
|
+
Str[] internal _targets;
|
35
|
+
|
36
|
+
mapping(Str target => RoleId roleid) internal _targetRole;
|
37
|
+
mapping(Str target => bool exists) internal _targetExists;
|
38
|
+
|
39
|
+
RoleId[] internal _roles;
|
40
|
+
mapping(RoleId role => RoleInfo info) internal _roleInfo;
|
41
|
+
|
42
|
+
mapping(Str target => RoleId[] authorizedRoles) internal _authorizedRoles;
|
43
|
+
mapping(Str target => mapping(RoleId authorizedRole => IAccess.FunctionInfo[] functions)) internal _authorizedFunctions;
|
29
44
|
|
30
45
|
|
31
46
|
constructor(
|
32
47
|
string memory mainTargetName,
|
33
|
-
ObjectType
|
34
|
-
uint8 release,
|
35
|
-
string memory commitHash,
|
48
|
+
ObjectType targetDomain,
|
36
49
|
bool isComponent,
|
37
50
|
bool includeTokenHandler
|
38
51
|
)
|
39
|
-
ServiceAuthorization(mainTargetName, domain, release, commitHash)
|
40
52
|
{
|
53
|
+
// checks
|
54
|
+
if (bytes(mainTargetName).length == 0) {
|
55
|
+
revert ErrorAuthorizationMainTargetNameEmpty();
|
56
|
+
}
|
57
|
+
|
58
|
+
if (targetDomain == ObjectTypeLib.zero()) {
|
59
|
+
revert ErrorAuthorizationTargetDomainZero();
|
60
|
+
}
|
61
|
+
|
62
|
+
// effects
|
63
|
+
_initializeERC165();
|
64
|
+
|
65
|
+
_domain = targetDomain;
|
66
|
+
_mainTargetName = mainTargetName;
|
67
|
+
_mainTarget = StrLib.toStr(mainTargetName);
|
41
68
|
_nextGifContractRoleId = 10;
|
42
69
|
|
43
|
-
// setup main target
|
44
70
|
if (isComponent) {
|
45
|
-
if (
|
71
|
+
if (targetDomain.eqz()) {
|
46
72
|
revert ErrorAuthorizationTargetDomainZero();
|
47
73
|
}
|
48
74
|
|
49
|
-
RoleId mainRoleId = RoleIdLib.
|
75
|
+
RoleId mainRoleId = RoleIdLib.toComponentRoleId(targetDomain, 0);
|
50
76
|
string memory mainRolName = _toTargetRoleName(_mainTargetName);
|
51
77
|
|
52
78
|
_addTargetWithRole(
|
@@ -54,9 +80,8 @@ contract Authorization is
|
|
54
80
|
mainRoleId,
|
55
81
|
mainRolName);
|
56
82
|
} else {
|
57
|
-
|
83
|
+
_addGifContractTarget(_mainTargetName);
|
58
84
|
}
|
59
|
-
|
60
85
|
// setup use case specific parts
|
61
86
|
_setupServiceTargets();
|
62
87
|
_setupRoles(); // not including main target role
|
@@ -65,7 +90,7 @@ contract Authorization is
|
|
65
90
|
|
66
91
|
// setup component token handler
|
67
92
|
if (includeTokenHandler) {
|
68
|
-
_tokenHandlerName = string(abi.encodePacked(mainTargetName, "
|
93
|
+
_tokenHandlerName = string(abi.encodePacked(mainTargetName, "TH"));
|
69
94
|
_tokenHandlerTarget = StrLib.toStr(_tokenHandlerName);
|
70
95
|
_addTarget(_tokenHandlerName);
|
71
96
|
_setupTokenHandlerAuthorizations();
|
@@ -74,6 +99,47 @@ contract Authorization is
|
|
74
99
|
_registerInterfaceNotInitializing(type(IAuthorization).interfaceId);
|
75
100
|
}
|
76
101
|
|
102
|
+
function getDomain() external view returns(ObjectType targetDomain) {
|
103
|
+
return _domain;
|
104
|
+
}
|
105
|
+
|
106
|
+
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains) {
|
107
|
+
return _serviceDomains;
|
108
|
+
}
|
109
|
+
|
110
|
+
function getComponentRole(ObjectType componentDomain) public view returns(RoleId roleId) {
|
111
|
+
return RoleIdLib.toComponentRoleId(componentDomain, 0);
|
112
|
+
}
|
113
|
+
|
114
|
+
function getServiceRole(ObjectType serviceDomain) public virtual pure returns (RoleId serviceRoleId) {
|
115
|
+
return RoleIdLib.roleForTypeAndVersion(
|
116
|
+
serviceDomain,
|
117
|
+
getRelease());
|
118
|
+
}
|
119
|
+
|
120
|
+
function getServiceTarget(ObjectType serviceDomain) external view returns(Str serviceTarget) {
|
121
|
+
return _serviceTarget[serviceDomain];
|
122
|
+
}
|
123
|
+
|
124
|
+
function getRoles() external view returns(RoleId[] memory roles) {
|
125
|
+
return _roles;
|
126
|
+
}
|
127
|
+
|
128
|
+
function roleExists(RoleId roleId) public view returns(bool exists) {
|
129
|
+
return _roleInfo[roleId].roleType != RoleType.Undefined;
|
130
|
+
}
|
131
|
+
|
132
|
+
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory info) {
|
133
|
+
return _roleInfo[roleId];
|
134
|
+
}
|
135
|
+
|
136
|
+
function getMainTargetName() public virtual view returns (string memory name) {
|
137
|
+
return _mainTargetName;
|
138
|
+
}
|
139
|
+
|
140
|
+
function getMainTarget() public view returns(Str) {
|
141
|
+
return _mainTarget;
|
142
|
+
}
|
77
143
|
|
78
144
|
function getTokenHandlerName() public view returns(string memory) {
|
79
145
|
return _tokenHandlerName;
|
@@ -83,7 +149,7 @@ contract Authorization is
|
|
83
149
|
return _tokenHandlerTarget;
|
84
150
|
}
|
85
151
|
|
86
|
-
function getTarget(string memory targetName) public
|
152
|
+
function getTarget(string memory targetName) public view returns(Str target) {
|
87
153
|
return StrLib.toStr(targetName);
|
88
154
|
}
|
89
155
|
|
@@ -95,31 +161,111 @@ contract Authorization is
|
|
95
161
|
return target == _mainTarget || _targetExists[target];
|
96
162
|
}
|
97
163
|
|
164
|
+
function getTargetRole(Str target) public view returns(RoleId roleId) {
|
165
|
+
return _targetRole[target];
|
166
|
+
}
|
167
|
+
|
168
|
+
function getAuthorizedRoles(Str target) external view returns(RoleId[] memory roleIds) {
|
169
|
+
return _authorizedRoles[target];
|
170
|
+
}
|
171
|
+
|
172
|
+
function getAuthorizedFunctions(Str target, RoleId roleId) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions) {
|
173
|
+
return _authorizedFunctions[target][roleId];
|
174
|
+
}
|
175
|
+
|
176
|
+
function getRelease() public virtual pure returns(VersionPart release) {
|
177
|
+
return VersionPartLib.toVersionPart(GIF_RELEASE);
|
178
|
+
}
|
179
|
+
|
98
180
|
/// @dev Sets up the relevant service targets for the component.
|
99
181
|
/// Overwrite this function for use case specific authorizations.
|
100
|
-
// solhint-disable-next-line no-empty-blocks
|
101
182
|
function _setupServiceTargets() internal virtual { }
|
102
183
|
|
103
184
|
/// @dev Sets up the relevant (non-service) targets for the component.
|
104
185
|
/// Overwrite this function for use case specific authorizations.
|
105
|
-
// solhint-disable-next-line no-empty-blocks
|
106
186
|
function _setupTargets() internal virtual { }
|
107
187
|
|
108
188
|
/// @dev Sets up the relevant roles for the component.
|
109
189
|
/// Overwrite this function for use case specific authorizations.
|
110
|
-
// solhint-disable-next-line no-empty-blocks
|
111
190
|
function _setupRoles() internal virtual {}
|
112
191
|
|
113
192
|
/// @dev Sets up the relevant component's token handler authorizations.
|
114
193
|
/// Overwrite this function for use case specific authorizations.
|
115
|
-
// solhint-disable-next-line no-empty-blocks
|
116
194
|
function _setupTokenHandlerAuthorizations() internal virtual {}
|
117
195
|
|
118
196
|
/// @dev Sets up the relevant target authorizations for the component.
|
119
197
|
/// Overwrite this function for use case specific authorizations.
|
120
|
-
// solhint-disable-next-line no-empty-blocks
|
121
198
|
function _setupTargetAuthorizations() internal virtual {}
|
122
199
|
|
200
|
+
function _addGifContractTarget(string memory contractName) internal {
|
201
|
+
|
202
|
+
RoleId contractRoleId = RoleIdLib.toRoleId(_nextGifContractRoleId++);
|
203
|
+
string memory contractRoleName = string(
|
204
|
+
abi.encodePacked(
|
205
|
+
contractName,
|
206
|
+
ROLE_NAME_SUFFIX));
|
207
|
+
|
208
|
+
_addTargetWithRole(
|
209
|
+
contractName,
|
210
|
+
contractRoleId,
|
211
|
+
contractRoleName);
|
212
|
+
}
|
213
|
+
|
214
|
+
/// @dev Add the service target role for the specified service domain
|
215
|
+
function _addServiceTargetWithRole(ObjectType serviceDomain) internal {
|
216
|
+
// add service domain
|
217
|
+
_serviceDomains.push(serviceDomain);
|
218
|
+
|
219
|
+
// get versioned target name
|
220
|
+
string memory serviceTargetName = ObjectTypeLib.toVersionedName(
|
221
|
+
ObjectTypeLib.toName(serviceDomain),
|
222
|
+
"Service",
|
223
|
+
getRelease());
|
224
|
+
|
225
|
+
_serviceTarget[serviceDomain] = StrLib.toStr(serviceTargetName);
|
226
|
+
|
227
|
+
RoleId serviceRoleId = getServiceRole(serviceDomain);
|
228
|
+
string memory serviceRoleName = ObjectTypeLib.toVersionedName(
|
229
|
+
ObjectTypeLib.toName(serviceDomain),
|
230
|
+
"ServiceRole",
|
231
|
+
getRelease());
|
232
|
+
|
233
|
+
_addTargetWithRole(
|
234
|
+
serviceTargetName,
|
235
|
+
serviceRoleId,
|
236
|
+
serviceRoleName);
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
/// @dev Use this method to to add an authorized role.
|
241
|
+
function _addRole(RoleId roleId, RoleInfo memory info) internal {
|
242
|
+
_roles.push(roleId);
|
243
|
+
_roleInfo[roleId] = info;
|
244
|
+
}
|
245
|
+
|
246
|
+
|
247
|
+
/// @dev Add a contract role for the provided role id and name.
|
248
|
+
function _addContractRole(RoleId roleId, string memory name) internal {
|
249
|
+
_addRole(
|
250
|
+
roleId,
|
251
|
+
_toRoleInfo(
|
252
|
+
ADMIN_ROLE(),
|
253
|
+
RoleType.Contract,
|
254
|
+
1,
|
255
|
+
name));
|
256
|
+
}
|
257
|
+
|
258
|
+
|
259
|
+
/// @dev Add the versioned service role for the specified service domain
|
260
|
+
function _addServiceRole(ObjectType serviceDomain) internal {
|
261
|
+
_addContractRole(
|
262
|
+
getServiceRole(serviceDomain),
|
263
|
+
ObjectTypeLib.toVersionedName(
|
264
|
+
ObjectTypeLib.toName(serviceDomain),
|
265
|
+
SERVICE_ROLE_NAME_SUFFIX,
|
266
|
+
getRelease()));
|
267
|
+
}
|
268
|
+
|
123
269
|
|
124
270
|
/// @dev Add a contract role for the provided role id and name.
|
125
271
|
function _addCustomRole(RoleId roleId, RoleId adminRoleId, uint32 maxMemberCount, string memory name) internal {
|
@@ -132,18 +278,31 @@ contract Authorization is
|
|
132
278
|
name));
|
133
279
|
}
|
134
280
|
|
135
|
-
/// @dev Add a gif target with its corresponding contract role
|
136
|
-
function _addGifTarget(string memory contractName) internal {
|
137
|
-
RoleId contractRoleId = RoleIdLib.toRoleId(_nextGifContractRoleId++);
|
138
|
-
string memory contractRoleName = string(
|
139
|
-
abi.encodePacked(
|
140
|
-
contractName,
|
141
|
-
ROLE_NAME_SUFFIX));
|
142
281
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
282
|
+
/// @dev Use this method to to add an authorized target together with its target role.
|
283
|
+
function _addTargetWithRole(
|
284
|
+
string memory targetName,
|
285
|
+
RoleId roleId,
|
286
|
+
string memory roleName
|
287
|
+
)
|
288
|
+
internal
|
289
|
+
{
|
290
|
+
// add target
|
291
|
+
Str target = StrLib.toStr(targetName);
|
292
|
+
_targets.push(target);
|
293
|
+
|
294
|
+
_targetExists[target] = true;
|
295
|
+
|
296
|
+
// link role to target if defined
|
297
|
+
if (roleId != RoleIdLib.zero()) {
|
298
|
+
// add role if new
|
299
|
+
if (!roleExists(roleId)) {
|
300
|
+
_addContractRole(roleId, roleName);
|
301
|
+
}
|
302
|
+
|
303
|
+
// link target to role
|
304
|
+
_targetRole[target] = roleId;
|
305
|
+
}
|
147
306
|
}
|
148
307
|
|
149
308
|
|
@@ -153,22 +312,54 @@ contract Authorization is
|
|
153
312
|
}
|
154
313
|
|
155
314
|
|
156
|
-
/// @dev
|
315
|
+
/// @dev Use this method to authorize the specified role to access the target.
|
316
|
+
function _authorizeForTarget(string memory target, RoleId authorizedRoleId)
|
317
|
+
internal
|
318
|
+
returns (IAccess.FunctionInfo[] storage authorizatedFunctions)
|
319
|
+
{
|
320
|
+
Str targetStr = StrLib.toStr(target);
|
321
|
+
_authorizedRoles[targetStr].push(authorizedRoleId);
|
322
|
+
return _authorizedFunctions[targetStr][authorizedRoleId];
|
323
|
+
}
|
324
|
+
|
325
|
+
|
326
|
+
/// @dev Use this method to authorize a specific function authorization
|
327
|
+
function _authorize(IAccess.FunctionInfo[] storage functions, bytes4 selector, string memory name) internal {
|
328
|
+
functions.push(
|
329
|
+
IAccess.FunctionInfo({
|
330
|
+
selector: SelectorLib.toSelector(selector),
|
331
|
+
name: StrLib.toStr(name),
|
332
|
+
createdAt: TimestampLib.blockTimestamp()}));
|
333
|
+
}
|
334
|
+
|
335
|
+
|
336
|
+
/// @dev role id for targets registry, staking and instance
|
157
337
|
function _toTargetRoleId(ObjectType targetDomain)
|
158
338
|
internal
|
159
339
|
pure
|
160
340
|
returns (RoleId targetRoleId)
|
161
341
|
{
|
162
|
-
return RoleIdLib.
|
342
|
+
return RoleIdLib.roleForType(targetDomain);
|
163
343
|
}
|
164
344
|
|
165
345
|
|
166
|
-
/// @dev Returns the role name for the specified target name
|
167
346
|
function _toTargetRoleName(string memory targetName) internal pure returns (string memory) {
|
168
347
|
return string(
|
169
348
|
abi.encodePacked(
|
170
349
|
targetName,
|
171
350
|
ROLE_NAME_SUFFIX));
|
172
351
|
}
|
352
|
+
|
353
|
+
|
354
|
+
/// @dev creates a role info object from the provided parameters
|
355
|
+
function _toRoleInfo(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) internal view returns (RoleInfo memory info) {
|
356
|
+
return RoleInfo({
|
357
|
+
name: StrLib.toStr(name),
|
358
|
+
adminRoleId: adminRoleId,
|
359
|
+
roleType: roleType,
|
360
|
+
maxMemberCount: maxMemberCount,
|
361
|
+
createdAt: TimestampLib.blockTimestamp(),
|
362
|
+
pausedAt: TimestampLib.max()});
|
363
|
+
}
|
173
364
|
}
|
174
365
|
|