@etherisc/gif-next 0.0.2-ccfa4c7-304 → 0.0.2-cd48412-522
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +63 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +106 -38
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +91 -45
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +58 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +272 -102
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +662 -46
- 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 +227 -52
- 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 +180 -32
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +90 -17
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +246 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +420 -27
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +64 -152
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +226 -65
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +21 -98
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +378 -149
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +140 -78
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +20 -97
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +232 -19
- 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 +109 -110
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +225 -64
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +145 -134
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +225 -64
- 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 +83 -177
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +225 -64
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +37 -71
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +130 -148
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +225 -64
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +333 -190
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +225 -64
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +51 -229
- 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/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +368 -34
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +295 -5
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +419 -96
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +591 -343
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +194 -73
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +569 -513
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +321 -31
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +80 -42
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1316 -2015
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +101 -88
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- 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 +20 -20
- 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 +29 -41
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +239 -61
- 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/IOracleComponent.sol/IOracleComponent.json +19 -31
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +29 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +19 -31
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +83 -38
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +96 -50
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +59 -79
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +225 -64
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +300 -123
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +124 -58
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +186 -33
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +29 -41
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +238 -19
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +29 -41
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +100 -34
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +338 -79
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +121 -63
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +238 -52
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +96 -42
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +46 -58
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +225 -64
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +142 -102
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +113 -75
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +187 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +50 -10
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +55 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +50 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +40 -52
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +224 -18
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +157 -86
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +511 -21
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +118 -72
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +114 -112
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +99 -69
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +40 -52
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +258 -44
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +84 -42
- 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/IRegistry.sol/IRegistry.json +33 -22
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +29 -0
- 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 +71 -60
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +385 -243
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +266 -70
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +41 -12
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +76 -38
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +389 -191
- 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 +149 -97
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +437 -26
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +119 -59
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +19 -31
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +209 -190
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +113 -63
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +76 -41
- 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/ContractLib.sol/ITokenRegistryHelper.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +19 -31
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +118 -123
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -31
- 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/INftOwnable.sol/INftOwnable.json +19 -0
- 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/IRegisterable.sol/IRegisterable.json +19 -0
- 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 +29 -0
- 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/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +19 -31
- 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 +21 -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/Registerable.sol/Registerable.json +19 -0
- 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 +29 -0
- 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/IStaking.sol/IStaking.json +1385 -150
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +97 -117
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1471 -213
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +77 -76
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +123 -72
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +296 -152
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +131 -167
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +84 -54
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1615 -815
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +153 -91
- 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/Amount.sol/AmountLib.json +10 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +45 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +93 -37
- 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 +39 -218
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +45 -2
- 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 +50 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +3 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
- 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/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +65 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +15 -3
- package/contracts/accounting/IAccountingService.sol +4 -2
- package/contracts/authorization/AccessAdmin.sol +264 -188
- package/contracts/authorization/AccessAdminLib.sol +222 -9
- package/contracts/authorization/Authorization.sol +38 -234
- package/contracts/authorization/IAccess.sol +25 -7
- package/contracts/authorization/IAccessAdmin.sol +19 -45
- package/contracts/authorization/IAuthorization.sol +3 -57
- package/contracts/authorization/IServiceAuthorization.sol +55 -17
- package/contracts/authorization/ServiceAuthorization.sol +248 -34
- package/contracts/distribution/BasicDistribution.sol +7 -8
- package/contracts/distribution/BasicDistributionAuthorization.sol +11 -4
- package/contracts/distribution/Distribution.sol +12 -56
- package/contracts/distribution/DistributionService.sol +126 -63
- package/contracts/distribution/IDistributionComponent.sol +3 -10
- package/contracts/distribution/IDistributionService.sol +20 -8
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FireProduct.sol +6 -10
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +4 -8
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +83 -23
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +57 -6
- package/contracts/instance/IInstanceService.sol +42 -7
- package/contracts/instance/Instance.sol +112 -57
- package/contracts/instance/InstanceAdmin.sol +164 -235
- package/contracts/instance/InstanceAuthorizationV3.sol +101 -61
- package/contracts/instance/InstanceReader.sol +354 -392
- package/contracts/instance/InstanceService.sol +186 -134
- package/contracts/instance/InstanceStore.sol +153 -128
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +10 -2
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectLifecycle.sol +2 -6
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +15 -6
- package/contracts/instance/module/IDistribution.sol +17 -7
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracle.sol +3 -6
- package/contracts/oracle/BasicOracleAuthorization.sol +18 -2
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +4 -8
- package/contracts/oracle/OracleService.sol +8 -8
- package/contracts/pool/BasicPool.sol +4 -18
- package/contracts/pool/BasicPoolAuthorization.sol +10 -5
- package/contracts/pool/BundleService.sol +34 -43
- package/contracts/pool/IBundleService.sol +14 -13
- package/contracts/pool/IPoolService.sol +7 -2
- package/contracts/pool/Pool.sol +6 -20
- package/contracts/pool/PoolLib.sol +127 -2
- package/contracts/pool/PoolService.sol +41 -184
- package/contracts/product/ApplicationService.sol +69 -11
- package/contracts/product/BasicProduct.sol +2 -5
- package/contracts/product/BasicProductAuthorization.sol +11 -4
- package/contracts/product/ClaimService.sol +99 -105
- package/contracts/product/IApplicationService.sol +23 -2
- package/contracts/product/IClaimService.sol +5 -4
- package/contracts/product/IPolicyService.sol +9 -2
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +21 -3
- package/contracts/product/PolicyService.sol +40 -59
- package/contracts/product/PolicyServiceLib.sol +79 -5
- package/contracts/product/PricingService.sol +33 -31
- package/contracts/product/Product.sol +40 -18
- package/contracts/product/RiskService.sol +57 -12
- package/contracts/registry/IRegistry.sol +15 -9
- package/contracts/registry/IRelease.sol +6 -3
- package/contracts/registry/Registry.sol +15 -9
- package/contracts/registry/RegistryAdmin.sol +33 -100
- package/contracts/registry/RegistryAuthorization.sol +121 -52
- package/contracts/registry/RegistryService.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +42 -100
- package/contracts/registry/ReleaseRegistry.sol +20 -12
- package/contracts/registry/ServiceAuthorizationV3.sol +43 -32
- package/contracts/registry/TokenRegistry.sol +56 -52
- package/contracts/shared/Component.sol +16 -33
- package/contracts/shared/ComponentService.sol +249 -247
- package/contracts/shared/ContractLib.sol +106 -75
- package/contracts/shared/IComponent.sol +1 -4
- package/contracts/shared/IComponentService.sol +17 -16
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +0 -1
- package/contracts/shared/InstanceLinkedComponent.sol +6 -11
- package/contracts/shared/NftOwnable.sol +3 -1
- package/contracts/shared/PolicyHolder.sol +3 -2
- package/contracts/shared/Service.sol +6 -4
- package/contracts/staking/IStaking.sol +262 -70
- package/contracts/staking/IStakingService.sol +39 -84
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +470 -219
- package/contracts/staking/StakingLib.sol +38 -124
- package/contracts/staking/StakingManager.sol +4 -3
- package/contracts/staking/StakingReader.sol +62 -71
- package/contracts/staking/StakingService.sol +42 -185
- package/contracts/staking/StakingServiceManager.sol +1 -0
- package/contracts/staking/StakingStore.sol +1093 -331
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +69 -46
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +15 -15
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/NftId.sol +3 -3
- package/contracts/type/ObjectType.sol +16 -3
- package/contracts/type/RoleId.sol +57 -59
- package/contracts/type/Seconds.sol +19 -0
- package/contracts/type/String.sol +12 -0
- package/contracts/type/Timestamp.sol +4 -2
- package/contracts/type/UFixed.sol +28 -10
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +25 -11
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +0 -4
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +0 -24
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -485
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -538
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +0 -205
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/KeyValueStore.sol +0 -131
- package/contracts/staking/StakingLifecycle.sol +0 -23
@@ -5,24 +5,26 @@ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/acce
|
|
5
5
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
6
6
|
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
|
7
7
|
|
8
|
+
import {IAccess} from "./IAccess.sol";
|
8
9
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
9
10
|
import {IAuthorization} from "./IAuthorization.sol";
|
10
11
|
import {IRegistry} from "../registry/IRegistry.sol";
|
11
12
|
|
13
|
+
import {ADMIN_ROLE_NAME, PUBLIC_ROLE_NAME} from "./AccessAdmin.sol";
|
12
14
|
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
13
15
|
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
14
16
|
import {ContractLib} from "../shared/ContractLib.sol";
|
15
17
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
16
18
|
import {ObjectType} from "../type/ObjectType.sol";
|
17
19
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
18
|
-
import {Selector,
|
20
|
+
import {Selector, SelectorSetLib} from "../type/Selector.sol";
|
19
21
|
import {Str, StrLib} from "../type/String.sol";
|
20
22
|
import {TimestampLib} from "../type/Timestamp.sol";
|
21
23
|
import {VersionPart} from "../type/Version.sol";
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
25
|
+
function ADMIN_ROLE_NAME() pure returns (string memory) { return "AdminRole"; }
|
26
|
+
function PUBLIC_ROLE_NAME() pure returns (string memory) { return "PublicRole"; }
|
27
|
+
|
26
28
|
|
27
29
|
/**
|
28
30
|
* @dev A generic access amin contract that implements role based access control based on OpenZeppelin's AccessManager contract.
|
@@ -36,9 +38,6 @@ contract AccessAdmin is
|
|
36
38
|
{
|
37
39
|
using EnumerableSet for EnumerableSet.AddressSet;
|
38
40
|
|
39
|
-
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
40
|
-
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
41
|
-
|
42
41
|
/// @dev admin name used for logging only
|
43
42
|
string internal _adminName;
|
44
43
|
|
@@ -86,6 +85,9 @@ contract AccessAdmin is
|
|
86
85
|
/// @dev temporary dynamic functions array
|
87
86
|
bytes4[] private _functions;
|
88
87
|
|
88
|
+
// @dev target type specific role id counters
|
89
|
+
mapping(TargetType => uint64) internal _nextRoleId;
|
90
|
+
|
89
91
|
modifier onlyDeployer() {
|
90
92
|
// special case for cloned AccessAdmin contracts
|
91
93
|
// IMPORTANT cloning and initialize authority needs to be done in a single transaction
|
@@ -99,45 +101,9 @@ contract AccessAdmin is
|
|
99
101
|
_;
|
100
102
|
}
|
101
103
|
|
102
|
-
modifier onlyRoleMember(RoleId roleId, address account) {
|
103
|
-
_checkRoleExists(roleId, false);
|
104
|
-
|
105
|
-
if (!hasRole(account, roleId)) {
|
106
|
-
revert ErrorAccessAdminNotRoleOwner(roleId, account);
|
107
|
-
}
|
108
|
-
_;
|
109
|
-
}
|
110
|
-
|
111
|
-
modifier onlyRoleAdmin(RoleId roleId, address account) {
|
112
|
-
_checkRoleExists(roleId, false);
|
113
|
-
|
114
|
-
if (!hasAdminRole(account, roleId)) {
|
115
|
-
revert ErrorAccessAdminNotAdminOfRole(_roleInfo[roleId].adminRoleId, account);
|
116
|
-
}
|
117
|
-
_;
|
118
|
-
}
|
119
|
-
|
120
|
-
modifier onlyExistingRole(
|
121
|
-
RoleId roleId,
|
122
|
-
bool onlyActiveRole,
|
123
|
-
bool allowLockedRoles
|
124
|
-
)
|
125
|
-
{
|
126
|
-
if (!allowLockedRoles) {
|
127
|
-
_checkRoleExists(roleId, onlyActiveRole);
|
128
|
-
}
|
129
|
-
_;
|
130
|
-
}
|
131
|
-
|
132
|
-
modifier onlyExistingTarget(address target) {
|
133
|
-
_checkTargetExists(target);
|
134
|
-
_;
|
135
|
-
}
|
136
104
|
|
137
105
|
//-------------- initialization functions ------------------------------//
|
138
106
|
|
139
|
-
// event LogAccessAdminDebug(string message);
|
140
|
-
|
141
107
|
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
142
108
|
/// Internally initializes access manager with this admin and creates basic role setup.
|
143
109
|
function initialize(
|
@@ -160,7 +126,7 @@ contract AccessAdmin is
|
|
160
126
|
onlyDeployer()
|
161
127
|
{
|
162
128
|
// checks
|
163
|
-
// check authority
|
129
|
+
// only contract check (authority might not yet be initialized at this time)
|
164
130
|
if (!ContractLib.isContract(authority)) {
|
165
131
|
revert ErrorAccessAdminAuthorityNotContract(authority);
|
166
132
|
}
|
@@ -193,6 +159,7 @@ contract AccessAdmin is
|
|
193
159
|
_initializeAdminAndPublicRoles();
|
194
160
|
}
|
195
161
|
|
162
|
+
//--- view functions for access amdin ---------------------------------------//
|
196
163
|
|
197
164
|
function getRelease() public view virtual returns (VersionPart release) {
|
198
165
|
return _authority.getRelease();
|
@@ -241,18 +208,35 @@ contract AccessAdmin is
|
|
241
208
|
return RoleId.wrap(_authority.PUBLIC_ROLE());
|
242
209
|
}
|
243
210
|
|
211
|
+
function roleExists(string memory name) public view returns (bool exists) {
|
212
|
+
// special case for admin and public roles
|
213
|
+
if (StrLib.eq(name, ADMIN_ROLE_NAME()) || StrLib.eq(name, PUBLIC_ROLE_NAME())) {
|
214
|
+
return true;
|
215
|
+
}
|
216
|
+
|
217
|
+
return _roleForName[StrLib.toStr(name)].roleId.gtz();
|
218
|
+
}
|
219
|
+
|
244
220
|
function roleExists(RoleId roleId) public view returns (bool exists) {
|
245
221
|
return _roleInfo[roleId].createdAt.gtz();
|
246
222
|
}
|
247
223
|
|
248
|
-
function getRoleForName(string memory name)
|
224
|
+
function getRoleForName(string memory name) public view returns (RoleId roleId) {
|
249
225
|
return _roleForName[StrLib.toStr(name)].roleId;
|
250
226
|
}
|
251
227
|
|
252
|
-
function getRoleInfo(RoleId roleId)
|
228
|
+
function getRoleInfo(RoleId roleId) public view returns (RoleInfo memory) {
|
253
229
|
return _roleInfo[roleId];
|
254
230
|
}
|
255
231
|
|
232
|
+
function isRoleActive(RoleId roleId) external view returns (bool isActive) {
|
233
|
+
return _roleInfo[roleId].pausedAt > TimestampLib.current();
|
234
|
+
}
|
235
|
+
|
236
|
+
function isRoleCustom(RoleId roleId) external view returns (bool isActive) {
|
237
|
+
return _roleInfo[roleId].roleType == RoleType.Custom;
|
238
|
+
}
|
239
|
+
|
256
240
|
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers) {
|
257
241
|
return _roleMembers[roleId].length();
|
258
242
|
}
|
@@ -261,21 +245,15 @@ contract AccessAdmin is
|
|
261
245
|
return _roleMembers[roleId].at(idx);
|
262
246
|
}
|
263
247
|
|
264
|
-
|
265
|
-
function hasRole(address account, RoleId roleId) public view returns (bool) {
|
248
|
+
function isRoleMember(RoleId roleId, address account) public view returns (bool) {
|
266
249
|
(bool isMember, ) = _authority.hasRole(
|
267
250
|
RoleId.unwrap(roleId),
|
268
251
|
account);
|
269
252
|
return isMember;
|
270
253
|
}
|
271
254
|
|
272
|
-
function
|
273
|
-
|
274
|
-
virtual
|
275
|
-
view
|
276
|
-
returns (bool)
|
277
|
-
{
|
278
|
-
return hasRole(account, _roleInfo[roleId].adminRoleId);
|
255
|
+
function isRoleAdmin(RoleId roleId, address account) public virtual view returns (bool) {
|
256
|
+
return isRoleMember(_roleInfo[roleId].adminRoleId, account);
|
279
257
|
}
|
280
258
|
|
281
259
|
//--- view functions for targets ----------------------------------------//
|
@@ -292,7 +270,7 @@ contract AccessAdmin is
|
|
292
270
|
return _targets[idx];
|
293
271
|
}
|
294
272
|
|
295
|
-
function getTargetInfo(address target)
|
273
|
+
function getTargetInfo(address target) public view returns (TargetInfo memory targetInfo) {
|
296
274
|
return _targetInfo[target];
|
297
275
|
}
|
298
276
|
|
@@ -301,7 +279,7 @@ contract AccessAdmin is
|
|
301
279
|
}
|
302
280
|
|
303
281
|
function isTargetLocked(address target) public view returns (bool locked) {
|
304
|
-
return _authority.isTargetClosed(target);
|
282
|
+
return _authority.isLocked() || _authority.isTargetClosed(target);
|
305
283
|
}
|
306
284
|
|
307
285
|
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions) {
|
@@ -341,13 +319,12 @@ contract AccessAdmin is
|
|
341
319
|
_linkedNftId = getRegistry().getNftIdForAddress(registerable);
|
342
320
|
}
|
343
321
|
|
322
|
+
|
344
323
|
function _initializeAdminAndPublicRoles()
|
345
324
|
internal
|
346
325
|
virtual
|
347
326
|
onlyInitializing()
|
348
327
|
{
|
349
|
-
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
350
|
-
|
351
328
|
// setup admin role
|
352
329
|
_createRoleUnchecked(
|
353
330
|
ADMIN_ROLE(),
|
@@ -355,147 +332,147 @@ contract AccessAdmin is
|
|
355
332
|
adminRoleId: ADMIN_ROLE(),
|
356
333
|
roleType: RoleType.Contract,
|
357
334
|
maxMemberCount: 1,
|
358
|
-
name: ADMIN_ROLE_NAME}));
|
335
|
+
name: ADMIN_ROLE_NAME()}));
|
359
336
|
|
360
|
-
// add this contract as admin role member
|
361
|
-
|
337
|
+
// add this contract as admin role member, as contract roles cannot be revoked
|
338
|
+
// and max member count is 1 for admin role this access admin contract will
|
339
|
+
// always be the only admin of the access manager.
|
340
|
+
_roleMembers[
|
341
|
+
RoleIdLib.toRoleId(_authority.ADMIN_ROLE())].add(address(this));
|
362
342
|
|
363
343
|
// setup public role
|
364
344
|
_createRoleUnchecked(
|
365
345
|
PUBLIC_ROLE(),
|
366
346
|
AccessAdminLib.toRole({
|
367
347
|
adminRoleId: ADMIN_ROLE(),
|
368
|
-
roleType: RoleType.
|
348
|
+
roleType: RoleType.Core,
|
369
349
|
maxMemberCount: type(uint32).max,
|
370
|
-
name: PUBLIC_ROLE_NAME}));
|
350
|
+
name: PUBLIC_ROLE_NAME()}));
|
371
351
|
}
|
372
352
|
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
RoleId targetRoleId
|
377
|
-
)
|
353
|
+
|
354
|
+
/// @dev Authorize the functions of the target for the specified role.
|
355
|
+
function _authorizeFunctions(IAuthorization authorization, Str target, RoleId roleId)
|
378
356
|
internal
|
379
357
|
{
|
380
|
-
|
381
|
-
|
358
|
+
_authorizeTargetFunctions(
|
359
|
+
getTargetForName(target),
|
360
|
+
_toAuthorizedRoleId(authorization, roleId),
|
361
|
+
authorization.getAuthorizedFunctions(
|
362
|
+
target,
|
363
|
+
roleId),
|
364
|
+
true);
|
382
365
|
}
|
383
366
|
|
384
|
-
|
385
|
-
|
386
|
-
RoleId roleId,
|
387
|
-
FunctionInfo[] memory functions
|
388
|
-
)
|
367
|
+
|
368
|
+
function _toAuthorizedRoleId(IAuthorization authorization, RoleId roleId)
|
389
369
|
internal
|
370
|
+
returns (RoleId authorizedRoleId)
|
390
371
|
{
|
391
|
-
|
392
|
-
|
372
|
+
// special case for service roles (service roles have predefined role ids)
|
373
|
+
if (roleId.isServiceRole()) {
|
374
|
+
|
375
|
+
// create service role if missing
|
376
|
+
if (!roleExists(roleId)) {
|
377
|
+
_createRole(
|
378
|
+
roleId,
|
379
|
+
AccessAdminLib.toRole(
|
380
|
+
ADMIN_ROLE(),
|
381
|
+
RoleType.Contract,
|
382
|
+
1,
|
383
|
+
authorization.getRoleName(roleId)));
|
384
|
+
}
|
385
|
+
|
386
|
+
return roleId;
|
393
387
|
}
|
394
388
|
|
395
|
-
(
|
396
|
-
|
397
|
-
string[] memory functionNames
|
398
|
-
) = _processFunctionSelectors(target, functions, true);
|
399
|
-
|
400
|
-
// apply authz via access manager
|
401
|
-
_grantRoleAccessToFunctions(
|
402
|
-
target,
|
403
|
-
roleId,
|
404
|
-
functionSelectors,
|
405
|
-
functionNames,
|
406
|
-
false); // allow locked roles
|
389
|
+
string memory roleName = authorization.getRoleInfo(roleId).name.toString();
|
390
|
+
return authorizedRoleId = getRoleForName(roleName);
|
407
391
|
}
|
408
392
|
|
409
|
-
|
393
|
+
|
394
|
+
function _authorizeTargetFunctions(
|
410
395
|
address target,
|
411
|
-
|
396
|
+
RoleId roleId,
|
397
|
+
FunctionInfo[] memory functions,
|
398
|
+
bool addFunctions
|
412
399
|
)
|
413
400
|
internal
|
414
401
|
{
|
415
|
-
(
|
416
|
-
|
417
|
-
|
418
|
-
) = _processFunctionSelectors(target, functions, false);
|
402
|
+
if (addFunctions && roleId == getAdminRole()) {
|
403
|
+
revert ErrorAccessAdminAuthorizeForAdminRoleInvalid(target);
|
404
|
+
}
|
419
405
|
|
406
|
+
// apply authz via access manager
|
420
407
|
_grantRoleAccessToFunctions(
|
421
408
|
target,
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
true); // allowLockedRoles
|
409
|
+
roleId,
|
410
|
+
functions,
|
411
|
+
addFunctions); // add functions
|
426
412
|
}
|
427
413
|
|
428
|
-
function _processFunctionSelectors(
|
429
|
-
address target,
|
430
|
-
FunctionInfo[] memory functions,
|
431
|
-
bool addFunctions
|
432
|
-
)
|
433
|
-
internal
|
434
|
-
onlyExistingTarget(target)
|
435
|
-
returns (
|
436
|
-
bytes4[] memory functionSelectors,
|
437
|
-
string[] memory functionNames
|
438
|
-
)
|
439
|
-
{
|
440
|
-
uint256 n = functions.length;
|
441
|
-
functionSelectors = new bytes4[](n);
|
442
|
-
functionNames = new string[](n);
|
443
|
-
FunctionInfo memory func;
|
444
|
-
Selector selector;
|
445
|
-
|
446
|
-
for (uint256 i = 0; i < n; i++) {
|
447
|
-
func = functions[i];
|
448
|
-
selector = func.selector;
|
449
|
-
|
450
|
-
// add function selector to target selector set if not in set
|
451
|
-
if (addFunctions) { SelectorSetLib.add(_targetFunctions[target], selector); }
|
452
|
-
else { SelectorSetLib.remove(_targetFunctions[target], selector); }
|
453
|
-
|
454
|
-
// set function name
|
455
|
-
_functionInfo[target][selector] = func;
|
456
|
-
|
457
|
-
// add bytes4 selector to function selector array
|
458
|
-
functionSelectors[i] = selector.toBytes4();
|
459
|
-
functionNames[i] = func.name.toString();
|
460
|
-
}
|
461
|
-
}
|
462
414
|
|
463
415
|
/// @dev grant the specified role access to all functions in the provided selector list
|
464
416
|
function _grantRoleAccessToFunctions(
|
465
417
|
address target,
|
466
418
|
RoleId roleId,
|
467
|
-
|
468
|
-
|
469
|
-
bool allowLockedRoles // admin and public roles are locked
|
419
|
+
FunctionInfo[] memory functions,
|
420
|
+
bool addFunctions
|
470
421
|
)
|
471
422
|
internal
|
472
|
-
onlyExistingTarget(target)
|
473
|
-
onlyExistingRole(roleId, true, allowLockedRoles)
|
474
423
|
{
|
424
|
+
_checkTargetExists(target);
|
425
|
+
_checkRoleExists(roleId, true, true);
|
475
426
|
|
476
427
|
_authority.setTargetFunctionRole(
|
477
428
|
target,
|
478
|
-
|
429
|
+
AccessAdminLib.getSelectors(functions),
|
479
430
|
RoleId.unwrap(roleId));
|
480
431
|
|
481
|
-
// log function grantings
|
482
|
-
for (uint256 i = 0; i <
|
483
|
-
|
484
|
-
_adminName,
|
432
|
+
// update function set and log function grantings
|
433
|
+
for (uint256 i = 0; i < functions.length; i++) {
|
434
|
+
_updateFunctionAccess(
|
485
435
|
target,
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
_getRoleName(roleId))));
|
436
|
+
roleId,
|
437
|
+
functions[i],
|
438
|
+
addFunctions);
|
490
439
|
}
|
491
440
|
}
|
492
441
|
|
493
442
|
|
443
|
+
function _updateFunctionAccess(
|
444
|
+
address target,
|
445
|
+
RoleId roleId,
|
446
|
+
FunctionInfo memory func,
|
447
|
+
bool addFunction
|
448
|
+
)
|
449
|
+
internal
|
450
|
+
{
|
451
|
+
// update functions info
|
452
|
+
Selector selector = func.selector;
|
453
|
+
_functionInfo[target][selector] = func;
|
454
|
+
|
455
|
+
// update function sets
|
456
|
+
if (addFunction) { SelectorSetLib.add(_targetFunctions[target], selector); }
|
457
|
+
else { SelectorSetLib.remove(_targetFunctions[target], selector); }
|
458
|
+
|
459
|
+
// logging
|
460
|
+
emit LogAccessAdminFunctionGranted(
|
461
|
+
_adminName,
|
462
|
+
target,
|
463
|
+
string(abi.encodePacked(
|
464
|
+
func.name.toString(),
|
465
|
+
"(): ",
|
466
|
+
_getRoleName(roleId))));
|
467
|
+
}
|
468
|
+
|
469
|
+
|
494
470
|
/// @dev grant the specified role to the provided account
|
495
471
|
function _grantRoleToAccount(RoleId roleId, address account)
|
496
472
|
internal
|
497
|
-
onlyExistingRole(roleId, true, false)
|
498
473
|
{
|
474
|
+
_checkRoleExists(roleId, true, false);
|
475
|
+
|
499
476
|
// check max role members will not be exceeded
|
500
477
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
501
478
|
revert ErrorAccessAdminRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
@@ -509,7 +486,7 @@ contract AccessAdmin is
|
|
509
486
|
revert ErrorAccessAdminRoleMemberNotContract(roleId, account);
|
510
487
|
}
|
511
488
|
|
512
|
-
//
|
489
|
+
// effects
|
513
490
|
_roleMembers[roleId].add(account);
|
514
491
|
_authority.grantRole(
|
515
492
|
RoleId.unwrap(roleId),
|
@@ -519,18 +496,19 @@ contract AccessAdmin is
|
|
519
496
|
emit LogAccessAdminRoleGranted(_adminName, account, _getRoleName(roleId));
|
520
497
|
}
|
521
498
|
|
499
|
+
|
522
500
|
/// @dev revoke the specified role from the provided account
|
523
501
|
function _revokeRoleFromAccount(RoleId roleId, address account)
|
524
502
|
internal
|
525
|
-
onlyExistingRole(roleId, false, false)
|
526
503
|
{
|
504
|
+
_checkRoleExists(roleId, false, false);
|
527
505
|
|
528
|
-
// check
|
506
|
+
// check for attempt to revoke contract role
|
529
507
|
if (_roleInfo[roleId].roleType == RoleType.Contract) {
|
530
508
|
revert ErrorAccessAdminRoleMemberRemovalDisabled(roleId, account);
|
531
509
|
}
|
532
510
|
|
533
|
-
//
|
511
|
+
// effects
|
534
512
|
_roleMembers[roleId].remove(account);
|
535
513
|
_authority.revokeRole(
|
536
514
|
RoleId.unwrap(roleId),
|
@@ -548,21 +526,84 @@ contract AccessAdmin is
|
|
548
526
|
)
|
549
527
|
internal
|
550
528
|
{
|
529
|
+
// skip admin and public roles (they are created during initialization)
|
530
|
+
if (roleId == ADMIN_ROLE() || roleId == PUBLIC_ROLE()) {
|
531
|
+
return;
|
532
|
+
}
|
533
|
+
|
551
534
|
AccessAdminLib.checkRoleCreation(this, roleId, info);
|
552
535
|
_createRoleUnchecked(roleId, info);
|
553
536
|
}
|
554
537
|
|
555
538
|
|
556
|
-
|
539
|
+
/// @dev Activates or deactivates role.
|
540
|
+
/// The role activ property is indirectly controlled over the pausedAt timestamp.
|
541
|
+
function _setRoleActive(RoleId roleId, bool active)
|
542
|
+
internal
|
543
|
+
{
|
544
|
+
if (active) {
|
545
|
+
_roleInfo[roleId].pausedAt = TimestampLib.max();
|
546
|
+
} else {
|
547
|
+
_roleInfo[roleId].pausedAt = TimestampLib.current();
|
548
|
+
}
|
549
|
+
}
|
550
|
+
|
551
|
+
|
552
|
+
function _createManagedTarget(
|
553
|
+
address target,
|
554
|
+
string memory targetName,
|
555
|
+
TargetType targetType
|
556
|
+
)
|
557
|
+
internal
|
558
|
+
returns (RoleId contractRoleId)
|
559
|
+
{
|
560
|
+
return _createTarget(target, targetName, targetType, true);
|
561
|
+
}
|
562
|
+
|
563
|
+
|
564
|
+
function _createUncheckedTarget(
|
557
565
|
address target,
|
558
566
|
string memory targetName,
|
559
|
-
|
560
|
-
bool custom
|
567
|
+
TargetType targetType
|
561
568
|
)
|
562
569
|
internal
|
563
570
|
{
|
571
|
+
_createTarget(target, targetName, targetType, false);
|
572
|
+
}
|
573
|
+
|
574
|
+
|
575
|
+
function _createTarget(
|
576
|
+
address target,
|
577
|
+
string memory targetName,
|
578
|
+
TargetType targetType,
|
579
|
+
bool checkAuthority
|
580
|
+
)
|
581
|
+
private
|
582
|
+
returns (RoleId contractRoleId)
|
583
|
+
{
|
584
|
+
// checks
|
564
585
|
AccessAdminLib.checkTargetCreation(this, target, targetName, checkAuthority);
|
565
|
-
|
586
|
+
|
587
|
+
// effects
|
588
|
+
contractRoleId = _createTargetUnchecked(
|
589
|
+
target,
|
590
|
+
targetName,
|
591
|
+
targetType,
|
592
|
+
checkAuthority);
|
593
|
+
|
594
|
+
// deal with token handler, if applicable
|
595
|
+
(
|
596
|
+
address tokenHandler,
|
597
|
+
string memory tokenHandlerName
|
598
|
+
) = AccessAdminLib.getTokenHandler(target, targetName, targetType);
|
599
|
+
|
600
|
+
if (tokenHandler != address(0)) {
|
601
|
+
_createTargetUnchecked(
|
602
|
+
tokenHandler,
|
603
|
+
tokenHandlerName,
|
604
|
+
targetType,
|
605
|
+
checkAuthority);
|
606
|
+
}
|
566
607
|
}
|
567
608
|
|
568
609
|
|
@@ -573,7 +614,8 @@ contract AccessAdmin is
|
|
573
614
|
private
|
574
615
|
{
|
575
616
|
// create role info
|
576
|
-
info.createdAt = TimestampLib.
|
617
|
+
info.createdAt = TimestampLib.current();
|
618
|
+
info.pausedAt = TimestampLib.max();
|
577
619
|
_roleInfo[roleId] = info;
|
578
620
|
|
579
621
|
// create role name info
|
@@ -588,35 +630,79 @@ contract AccessAdmin is
|
|
588
630
|
}
|
589
631
|
|
590
632
|
|
633
|
+
/// @dev Creates a new target and a corresponding contract role.
|
634
|
+
/// The function assigns the role to the target and logs the creation.
|
591
635
|
function _createTargetUnchecked(
|
592
636
|
address target,
|
593
637
|
string memory targetName,
|
594
|
-
|
638
|
+
TargetType targetType,
|
639
|
+
bool managed
|
595
640
|
)
|
596
641
|
internal
|
642
|
+
returns (RoleId targetRoleId)
|
597
643
|
{
|
644
|
+
// create target role (if not existing)
|
645
|
+
string memory roleName;
|
646
|
+
(targetRoleId, roleName) = _getOrCreateTargetRoleIdAndName(target, targetName, targetType);
|
647
|
+
|
648
|
+
if (!roleExists(targetRoleId)) {
|
649
|
+
_createRole(
|
650
|
+
targetRoleId,
|
651
|
+
AccessAdminLib.toRole(ADMIN_ROLE(), IAccess.RoleType.Contract, 1, roleName));
|
652
|
+
}
|
653
|
+
|
598
654
|
// create target info
|
599
655
|
Str name = StrLib.toStr(targetName);
|
600
656
|
_targetInfo[target] = TargetInfo({
|
601
657
|
name: name,
|
602
|
-
|
603
|
-
|
658
|
+
targetType: targetType,
|
659
|
+
roleId: targetRoleId,
|
660
|
+
createdAt: TimestampLib.current()
|
604
661
|
});
|
605
662
|
|
606
663
|
// create name to target mapping
|
607
664
|
_targetForName[name] = target;
|
608
665
|
|
609
|
-
// add
|
666
|
+
// add target to list of targets
|
610
667
|
_targets.push(target);
|
611
668
|
|
612
|
-
|
669
|
+
// grant contract role to target
|
670
|
+
_grantRoleToAccount(targetRoleId, target);
|
671
|
+
|
672
|
+
emit LogAccessAdminTargetCreated(_adminName, targetName, managed, target, targetRoleId);
|
673
|
+
}
|
674
|
+
|
675
|
+
|
676
|
+
function _getOrCreateTargetRoleIdAndName(
|
677
|
+
address target,
|
678
|
+
string memory targetName,
|
679
|
+
TargetType targetType
|
680
|
+
)
|
681
|
+
internal
|
682
|
+
returns (
|
683
|
+
RoleId roleId,
|
684
|
+
string memory roleName
|
685
|
+
)
|
686
|
+
{
|
687
|
+
// get roleId
|
688
|
+
if (targetType == TargetType.Service || targetType == TargetType.GenericService) {
|
689
|
+
roleId = AccessAdminLib.getServiceRoleId(target, targetType);
|
690
|
+
} else {
|
691
|
+
roleId = AccessAdminLib.getTargetRoleId(target, targetType, _nextRoleId[targetType]);
|
692
|
+
|
693
|
+
// increment target type specific role id counter
|
694
|
+
_nextRoleId[targetType]++;
|
695
|
+
}
|
696
|
+
|
697
|
+
// create role name
|
698
|
+
roleName = AccessAdminLib.toRoleName(targetName);
|
613
699
|
}
|
614
700
|
|
615
701
|
|
616
702
|
function _setTargetLocked(address target, bool locked)
|
617
703
|
internal
|
618
|
-
onlyExistingTarget(target)
|
619
704
|
{
|
705
|
+
_checkTargetExists(target);
|
620
706
|
_authority.setTargetClosed(target, locked);
|
621
707
|
}
|
622
708
|
|
@@ -633,6 +719,7 @@ contract AccessAdmin is
|
|
633
719
|
address authorization,
|
634
720
|
ObjectType expectedDomain,
|
635
721
|
VersionPart expectedRelease,
|
722
|
+
bool expectServiceAuthorization,
|
636
723
|
bool checkAlreadyInitialized
|
637
724
|
)
|
638
725
|
internal
|
@@ -643,13 +730,15 @@ contract AccessAdmin is
|
|
643
730
|
authorization,
|
644
731
|
expectedDomain,
|
645
732
|
expectedRelease,
|
733
|
+
expectServiceAuthorization,
|
646
734
|
checkAlreadyInitialized);
|
647
735
|
}
|
648
736
|
|
649
737
|
|
650
738
|
function _checkRoleExists(
|
651
739
|
RoleId roleId,
|
652
|
-
bool onlyActiveRole
|
740
|
+
bool onlyActiveRole,
|
741
|
+
bool allowAdminAndPublicRoles
|
653
742
|
)
|
654
743
|
internal
|
655
744
|
view
|
@@ -658,19 +747,24 @@ contract AccessAdmin is
|
|
658
747
|
revert ErrorAccessAdminRoleUnknown(roleId);
|
659
748
|
}
|
660
749
|
|
661
|
-
|
662
|
-
|
663
|
-
|
750
|
+
if (!allowAdminAndPublicRoles) {
|
751
|
+
if (roleId == ADMIN_ROLE()) {
|
752
|
+
revert ErrorAccessAdminInvalidUserOfAdminRole();
|
753
|
+
}
|
754
|
+
|
755
|
+
// check role is not public role
|
756
|
+
if (roleId == PUBLIC_ROLE()) {
|
757
|
+
revert ErrorAccessAdminInvalidUserOfPublicRole();
|
758
|
+
}
|
664
759
|
}
|
665
760
|
|
666
761
|
// check if role is disabled
|
667
|
-
if (onlyActiveRole && _roleInfo[roleId].pausedAt <= TimestampLib.
|
762
|
+
if (onlyActiveRole && _roleInfo[roleId].pausedAt <= TimestampLib.current()) {
|
668
763
|
revert ErrorAccessAdminRoleIsPaused(roleId);
|
669
764
|
}
|
670
765
|
}
|
671
766
|
|
672
767
|
|
673
|
-
|
674
768
|
/// @dev check if target exists and reverts if it doesn't
|
675
769
|
function _checkTargetExists(
|
676
770
|
address target
|
@@ -683,22 +777,4 @@ contract AccessAdmin is
|
|
683
777
|
revert ErrorAccessAdminTargetNotCreated(target);
|
684
778
|
}
|
685
779
|
}
|
686
|
-
|
687
|
-
|
688
|
-
function _checkIsRegistered(
|
689
|
-
address registry,
|
690
|
-
address target,
|
691
|
-
ObjectType expectedType
|
692
|
-
)
|
693
|
-
internal
|
694
|
-
view
|
695
|
-
{
|
696
|
-
AccessAdminLib.checkIsRegistered(registry, target, expectedType);
|
697
|
-
}
|
698
|
-
|
699
|
-
function _checkRegistry(address registry) internal view {
|
700
|
-
if (!ContractLib.isRegistry(registry)) {
|
701
|
-
revert ErrorAccessAdminNotRegistry(registry);
|
702
|
-
}
|
703
|
-
}
|
704
780
|
}
|