@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
@@ -5,26 +5,24 @@ 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";
|
9
8
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
10
9
|
import {IAuthorization} from "./IAuthorization.sol";
|
11
10
|
import {IRegistry} from "../registry/IRegistry.sol";
|
12
11
|
|
13
|
-
import {ADMIN_ROLE_NAME, PUBLIC_ROLE_NAME} from "./AccessAdmin.sol";
|
14
12
|
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
15
13
|
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
16
14
|
import {ContractLib} from "../shared/ContractLib.sol";
|
17
15
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
18
16
|
import {ObjectType} from "../type/ObjectType.sol";
|
19
17
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
20
|
-
import {Selector, SelectorSetLib} from "../type/Selector.sol";
|
18
|
+
import {Selector, SelectorLib, SelectorSetLib} from "../type/Selector.sol";
|
21
19
|
import {Str, StrLib} from "../type/String.sol";
|
22
20
|
import {TimestampLib} from "../type/Timestamp.sol";
|
23
21
|
import {VersionPart} from "../type/Version.sol";
|
24
22
|
|
25
|
-
|
26
|
-
function
|
27
|
-
|
23
|
+
interface IAccessManagedChecker {
|
24
|
+
function authority() external view returns (address);
|
25
|
+
}
|
28
26
|
|
29
27
|
/**
|
30
28
|
* @dev A generic access amin contract that implements role based access control based on OpenZeppelin's AccessManager contract.
|
@@ -38,6 +36,9 @@ contract AccessAdmin is
|
|
38
36
|
{
|
39
37
|
using EnumerableSet for EnumerableSet.AddressSet;
|
40
38
|
|
39
|
+
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
40
|
+
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
41
|
+
|
41
42
|
/// @dev admin name used for logging only
|
42
43
|
string internal _adminName;
|
43
44
|
|
@@ -85,9 +86,6 @@ contract AccessAdmin is
|
|
85
86
|
/// @dev temporary dynamic functions array
|
86
87
|
bytes4[] private _functions;
|
87
88
|
|
88
|
-
// @dev target type specific role id counters
|
89
|
-
mapping(TargetType => uint64) internal _nextRoleId;
|
90
|
-
|
91
89
|
modifier onlyDeployer() {
|
92
90
|
// special case for cloned AccessAdmin contracts
|
93
91
|
// IMPORTANT cloning and initialize authority needs to be done in a single transaction
|
@@ -101,9 +99,45 @@ contract AccessAdmin is
|
|
101
99
|
_;
|
102
100
|
}
|
103
101
|
|
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
|
+
}
|
104
136
|
|
105
137
|
//-------------- initialization functions ------------------------------//
|
106
138
|
|
139
|
+
// event LogAccessAdminDebug(string message);
|
140
|
+
|
107
141
|
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
108
142
|
/// Internally initializes access manager with this admin and creates basic role setup.
|
109
143
|
function initialize(
|
@@ -126,7 +160,7 @@ contract AccessAdmin is
|
|
126
160
|
onlyDeployer()
|
127
161
|
{
|
128
162
|
// checks
|
129
|
-
//
|
163
|
+
// check authority is contract
|
130
164
|
if (!ContractLib.isContract(authority)) {
|
131
165
|
revert ErrorAccessAdminAuthorityNotContract(authority);
|
132
166
|
}
|
@@ -159,7 +193,6 @@ contract AccessAdmin is
|
|
159
193
|
_initializeAdminAndPublicRoles();
|
160
194
|
}
|
161
195
|
|
162
|
-
//--- view functions for access amdin ---------------------------------------//
|
163
196
|
|
164
197
|
function getRelease() public view virtual returns (VersionPart release) {
|
165
198
|
return _authority.getRelease();
|
@@ -208,35 +241,18 @@ contract AccessAdmin is
|
|
208
241
|
return RoleId.wrap(_authority.PUBLIC_ROLE());
|
209
242
|
}
|
210
243
|
|
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
|
-
|
220
244
|
function roleExists(RoleId roleId) public view returns (bool exists) {
|
221
245
|
return _roleInfo[roleId].createdAt.gtz();
|
222
246
|
}
|
223
247
|
|
224
|
-
function getRoleForName(string memory name)
|
248
|
+
function getRoleForName(string memory name) external view returns (RoleId roleId) {
|
225
249
|
return _roleForName[StrLib.toStr(name)].roleId;
|
226
250
|
}
|
227
251
|
|
228
|
-
function getRoleInfo(RoleId roleId)
|
252
|
+
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory) {
|
229
253
|
return _roleInfo[roleId];
|
230
254
|
}
|
231
255
|
|
232
|
-
function isRoleActive(RoleId roleId) external view returns (bool isActive) {
|
233
|
-
return _roleInfo[roleId].pausedAt > TimestampLib.blockTimestamp();
|
234
|
-
}
|
235
|
-
|
236
|
-
function isRoleCustom(RoleId roleId) external view returns (bool isActive) {
|
237
|
-
return _roleInfo[roleId].roleType == RoleType.Custom;
|
238
|
-
}
|
239
|
-
|
240
256
|
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers) {
|
241
257
|
return _roleMembers[roleId].length();
|
242
258
|
}
|
@@ -245,15 +261,21 @@ contract AccessAdmin is
|
|
245
261
|
return _roleMembers[roleId].at(idx);
|
246
262
|
}
|
247
263
|
|
248
|
-
|
264
|
+
// TODO false because not role member or because role not exists?
|
265
|
+
function hasRole(address account, RoleId roleId) public view returns (bool) {
|
249
266
|
(bool isMember, ) = _authority.hasRole(
|
250
267
|
RoleId.unwrap(roleId),
|
251
268
|
account);
|
252
269
|
return isMember;
|
253
270
|
}
|
254
271
|
|
255
|
-
function
|
256
|
-
|
272
|
+
function hasAdminRole(address account, RoleId roleId)
|
273
|
+
public
|
274
|
+
virtual
|
275
|
+
view
|
276
|
+
returns (bool)
|
277
|
+
{
|
278
|
+
return hasRole(account, _roleInfo[roleId].adminRoleId);
|
257
279
|
}
|
258
280
|
|
259
281
|
//--- view functions for targets ----------------------------------------//
|
@@ -270,7 +292,7 @@ contract AccessAdmin is
|
|
270
292
|
return _targets[idx];
|
271
293
|
}
|
272
294
|
|
273
|
-
function getTargetInfo(address target)
|
295
|
+
function getTargetInfo(address target) external view returns (TargetInfo memory targetInfo) {
|
274
296
|
return _targetInfo[target];
|
275
297
|
}
|
276
298
|
|
@@ -279,7 +301,7 @@ contract AccessAdmin is
|
|
279
301
|
}
|
280
302
|
|
281
303
|
function isTargetLocked(address target) public view returns (bool locked) {
|
282
|
-
return _authority.
|
304
|
+
return _authority.isTargetClosed(target);
|
283
305
|
}
|
284
306
|
|
285
307
|
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions) {
|
@@ -319,12 +341,13 @@ contract AccessAdmin is
|
|
319
341
|
_linkedNftId = getRegistry().getNftIdForAddress(registerable);
|
320
342
|
}
|
321
343
|
|
322
|
-
|
323
344
|
function _initializeAdminAndPublicRoles()
|
324
345
|
internal
|
325
346
|
virtual
|
326
347
|
onlyInitializing()
|
327
348
|
{
|
349
|
+
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
350
|
+
|
328
351
|
// setup admin role
|
329
352
|
_createRoleUnchecked(
|
330
353
|
ADMIN_ROLE(),
|
@@ -332,147 +355,147 @@ contract AccessAdmin is
|
|
332
355
|
adminRoleId: ADMIN_ROLE(),
|
333
356
|
roleType: RoleType.Contract,
|
334
357
|
maxMemberCount: 1,
|
335
|
-
name: ADMIN_ROLE_NAME
|
358
|
+
name: ADMIN_ROLE_NAME}));
|
336
359
|
|
337
|
-
// add this contract as admin role member
|
338
|
-
|
339
|
-
// always be the only admin of the access manager.
|
340
|
-
_roleMembers[
|
341
|
-
RoleIdLib.toRoleId(_authority.ADMIN_ROLE())].add(address(this));
|
360
|
+
// add this contract as admin role member
|
361
|
+
_roleMembers[adminRoleId].add(address(this));
|
342
362
|
|
343
363
|
// setup public role
|
344
364
|
_createRoleUnchecked(
|
345
365
|
PUBLIC_ROLE(),
|
346
366
|
AccessAdminLib.toRole({
|
347
367
|
adminRoleId: ADMIN_ROLE(),
|
348
|
-
roleType: RoleType.
|
368
|
+
roleType: RoleType.Gif,
|
349
369
|
maxMemberCount: type(uint32).max,
|
350
|
-
name: PUBLIC_ROLE_NAME
|
370
|
+
name: PUBLIC_ROLE_NAME}));
|
351
371
|
}
|
352
372
|
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
_authorizeTargetFunctions(
|
359
|
-
getTargetForName(target),
|
360
|
-
_toAuthorizedRoleId(authorization, roleId),
|
361
|
-
authorization.getAuthorizedFunctions(
|
362
|
-
target,
|
363
|
-
roleId),
|
364
|
-
true);
|
365
|
-
}
|
366
|
-
|
367
|
-
|
368
|
-
function _toAuthorizedRoleId(IAuthorization authorization, RoleId roleId)
|
373
|
+
function _createTargetWithRole(
|
374
|
+
address target,
|
375
|
+
string memory targetName,
|
376
|
+
RoleId targetRoleId
|
377
|
+
)
|
369
378
|
internal
|
370
|
-
returns (RoleId authorizedRoleId)
|
371
379
|
{
|
372
|
-
|
373
|
-
|
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;
|
387
|
-
}
|
388
|
-
|
389
|
-
string memory roleName = authorization.getRoleInfo(roleId).name.toString();
|
390
|
-
return authorizedRoleId = getRoleForName(roleName);
|
380
|
+
_createTarget(target, targetName, true, false);
|
381
|
+
_grantRoleToAccount(targetRoleId, target);
|
391
382
|
}
|
392
383
|
|
393
|
-
|
394
384
|
function _authorizeTargetFunctions(
|
395
385
|
address target,
|
396
386
|
RoleId roleId,
|
397
|
-
FunctionInfo[] memory functions
|
398
|
-
bool addFunctions
|
387
|
+
FunctionInfo[] memory functions
|
399
388
|
)
|
400
389
|
internal
|
401
390
|
{
|
402
|
-
if (
|
391
|
+
if (roleId == getAdminRole()) {
|
403
392
|
revert ErrorAccessAdminAuthorizeForAdminRoleInvalid(target);
|
404
393
|
}
|
405
394
|
|
395
|
+
(
|
396
|
+
bytes4[] memory functionSelectors,
|
397
|
+
string[] memory functionNames
|
398
|
+
) = _processFunctionSelectors(target, functions, true);
|
399
|
+
|
406
400
|
// apply authz via access manager
|
407
401
|
_grantRoleAccessToFunctions(
|
408
402
|
target,
|
409
403
|
roleId,
|
410
|
-
|
411
|
-
|
404
|
+
functionSelectors,
|
405
|
+
functionNames,
|
406
|
+
false); // allow locked roles
|
412
407
|
}
|
413
408
|
|
409
|
+
function _unauthorizeTargetFunctions(
|
410
|
+
address target,
|
411
|
+
FunctionInfo[] memory functions
|
412
|
+
)
|
413
|
+
internal
|
414
|
+
{
|
415
|
+
(
|
416
|
+
bytes4[] memory functionSelectors,
|
417
|
+
string[] memory functionNames
|
418
|
+
) = _processFunctionSelectors(target, functions, false);
|
414
419
|
|
415
|
-
|
416
|
-
|
420
|
+
_grantRoleAccessToFunctions(
|
421
|
+
target,
|
422
|
+
getAdminRole(),
|
423
|
+
functionSelectors,
|
424
|
+
functionNames,
|
425
|
+
true); // allowLockedRoles
|
426
|
+
}
|
427
|
+
|
428
|
+
function _processFunctionSelectors(
|
417
429
|
address target,
|
418
|
-
RoleId roleId,
|
419
430
|
FunctionInfo[] memory functions,
|
420
431
|
bool addFunctions
|
421
432
|
)
|
422
433
|
internal
|
434
|
+
onlyExistingTarget(target)
|
435
|
+
returns (
|
436
|
+
bytes4[] memory functionSelectors,
|
437
|
+
string[] memory functionNames
|
438
|
+
)
|
423
439
|
{
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
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();
|
439
460
|
}
|
440
461
|
}
|
441
462
|
|
442
|
-
|
443
|
-
function
|
444
|
-
address target,
|
445
|
-
RoleId roleId,
|
446
|
-
|
447
|
-
|
463
|
+
/// @dev grant the specified role access to all functions in the provided selector list
|
464
|
+
function _grantRoleAccessToFunctions(
|
465
|
+
address target,
|
466
|
+
RoleId roleId,
|
467
|
+
bytes4[] memory functionSelectors,
|
468
|
+
string[] memory functionNames,
|
469
|
+
bool allowLockedRoles // admin and public roles are locked
|
448
470
|
)
|
449
471
|
internal
|
472
|
+
onlyExistingTarget(target)
|
473
|
+
onlyExistingRole(roleId, true, allowLockedRoles)
|
450
474
|
{
|
451
|
-
// update functions info
|
452
|
-
Selector selector = func.selector;
|
453
|
-
_functionInfo[target][selector] = func;
|
454
475
|
|
455
|
-
|
456
|
-
|
457
|
-
|
476
|
+
_authority.setTargetFunctionRole(
|
477
|
+
target,
|
478
|
+
functionSelectors,
|
479
|
+
RoleId.unwrap(roleId));
|
458
480
|
|
459
|
-
//
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
481
|
+
// log function grantings
|
482
|
+
for (uint256 i = 0; i < functionSelectors.length; i++) {
|
483
|
+
emit LogAccessAdminFunctionGranted(
|
484
|
+
_adminName,
|
485
|
+
target,
|
486
|
+
string(abi.encodePacked(
|
487
|
+
functionNames[i],
|
488
|
+
"(): ",
|
489
|
+
_getRoleName(roleId))));
|
490
|
+
}
|
467
491
|
}
|
468
492
|
|
469
493
|
|
470
494
|
/// @dev grant the specified role to the provided account
|
471
495
|
function _grantRoleToAccount(RoleId roleId, address account)
|
472
496
|
internal
|
497
|
+
onlyExistingRole(roleId, true, false)
|
473
498
|
{
|
474
|
-
_checkRoleExists(roleId, true, false);
|
475
|
-
|
476
499
|
// check max role members will not be exceeded
|
477
500
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
478
501
|
revert ErrorAccessAdminRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
@@ -486,7 +509,7 @@ contract AccessAdmin is
|
|
486
509
|
revert ErrorAccessAdminRoleMemberNotContract(roleId, account);
|
487
510
|
}
|
488
511
|
|
489
|
-
//
|
512
|
+
// TODO check account already have roleId
|
490
513
|
_roleMembers[roleId].add(account);
|
491
514
|
_authority.grantRole(
|
492
515
|
RoleId.unwrap(roleId),
|
@@ -496,19 +519,18 @@ contract AccessAdmin is
|
|
496
519
|
emit LogAccessAdminRoleGranted(_adminName, account, _getRoleName(roleId));
|
497
520
|
}
|
498
521
|
|
499
|
-
|
500
522
|
/// @dev revoke the specified role from the provided account
|
501
523
|
function _revokeRoleFromAccount(RoleId roleId, address account)
|
502
524
|
internal
|
525
|
+
onlyExistingRole(roleId, false, false)
|
503
526
|
{
|
504
|
-
_checkRoleExists(roleId, false, false);
|
505
527
|
|
506
|
-
// check
|
528
|
+
// check role removal is permitted
|
507
529
|
if (_roleInfo[roleId].roleType == RoleType.Contract) {
|
508
530
|
revert ErrorAccessAdminRoleMemberRemovalDisabled(roleId, account);
|
509
531
|
}
|
510
532
|
|
511
|
-
//
|
533
|
+
// TODO check account have roleId?
|
512
534
|
_roleMembers[roleId].remove(account);
|
513
535
|
_authority.revokeRole(
|
514
536
|
RoleId.unwrap(roleId),
|
@@ -526,84 +548,21 @@ contract AccessAdmin is
|
|
526
548
|
)
|
527
549
|
internal
|
528
550
|
{
|
529
|
-
// skip admin and public roles (they are created during initialization)
|
530
|
-
if (roleId == ADMIN_ROLE() || roleId == PUBLIC_ROLE()) {
|
531
|
-
return;
|
532
|
-
}
|
533
|
-
|
534
551
|
AccessAdminLib.checkRoleCreation(this, roleId, info);
|
535
552
|
_createRoleUnchecked(roleId, info);
|
536
553
|
}
|
537
554
|
|
538
555
|
|
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.blockTimestamp();
|
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(
|
565
|
-
address target,
|
566
|
-
string memory targetName,
|
567
|
-
TargetType targetType
|
568
|
-
)
|
569
|
-
internal
|
570
|
-
{
|
571
|
-
_createTarget(target, targetName, targetType, false);
|
572
|
-
}
|
573
|
-
|
574
|
-
|
575
556
|
function _createTarget(
|
576
557
|
address target,
|
577
558
|
string memory targetName,
|
578
|
-
|
579
|
-
bool
|
559
|
+
bool checkAuthority,
|
560
|
+
bool custom
|
580
561
|
)
|
581
|
-
|
582
|
-
returns (RoleId contractRoleId)
|
562
|
+
internal
|
583
563
|
{
|
584
|
-
// checks
|
585
564
|
AccessAdminLib.checkTargetCreation(this, target, targetName, checkAuthority);
|
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
|
-
}
|
565
|
+
_createTargetUnchecked(target, targetName, custom);
|
607
566
|
}
|
608
567
|
|
609
568
|
|
@@ -615,7 +574,6 @@ contract AccessAdmin is
|
|
615
574
|
{
|
616
575
|
// create role info
|
617
576
|
info.createdAt = TimestampLib.blockTimestamp();
|
618
|
-
info.pausedAt = TimestampLib.max();
|
619
577
|
_roleInfo[roleId] = info;
|
620
578
|
|
621
579
|
// create role name info
|
@@ -630,79 +588,35 @@ contract AccessAdmin is
|
|
630
588
|
}
|
631
589
|
|
632
590
|
|
633
|
-
/// @dev Creates a new target and a corresponding contract role.
|
634
|
-
/// The function assigns the role to the target and logs the creation.
|
635
591
|
function _createTargetUnchecked(
|
636
592
|
address target,
|
637
593
|
string memory targetName,
|
638
|
-
|
639
|
-
bool managed
|
594
|
+
bool custom
|
640
595
|
)
|
641
596
|
internal
|
642
|
-
returns (RoleId targetRoleId)
|
643
597
|
{
|
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
|
-
|
654
598
|
// create target info
|
655
599
|
Str name = StrLib.toStr(targetName);
|
656
600
|
_targetInfo[target] = TargetInfo({
|
657
601
|
name: name,
|
658
|
-
|
659
|
-
roleId: targetRoleId,
|
602
|
+
isCustom: custom,
|
660
603
|
createdAt: TimestampLib.blockTimestamp()
|
661
604
|
});
|
662
605
|
|
663
606
|
// create name to target mapping
|
664
607
|
_targetForName[name] = target;
|
665
608
|
|
666
|
-
// add
|
609
|
+
// add role to list of roles
|
667
610
|
_targets.push(target);
|
668
611
|
|
669
|
-
|
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);
|
612
|
+
emit LogAccessAdminTargetCreated(_adminName, target, targetName);
|
699
613
|
}
|
700
614
|
|
701
615
|
|
702
616
|
function _setTargetLocked(address target, bool locked)
|
703
617
|
internal
|
618
|
+
onlyExistingTarget(target)
|
704
619
|
{
|
705
|
-
_checkTargetExists(target);
|
706
620
|
_authority.setTargetClosed(target, locked);
|
707
621
|
}
|
708
622
|
|
@@ -719,7 +633,6 @@ contract AccessAdmin is
|
|
719
633
|
address authorization,
|
720
634
|
ObjectType expectedDomain,
|
721
635
|
VersionPart expectedRelease,
|
722
|
-
bool expectServiceAuthorization,
|
723
636
|
bool checkAlreadyInitialized
|
724
637
|
)
|
725
638
|
internal
|
@@ -730,15 +643,13 @@ contract AccessAdmin is
|
|
730
643
|
authorization,
|
731
644
|
expectedDomain,
|
732
645
|
expectedRelease,
|
733
|
-
expectServiceAuthorization,
|
734
646
|
checkAlreadyInitialized);
|
735
647
|
}
|
736
648
|
|
737
649
|
|
738
650
|
function _checkRoleExists(
|
739
651
|
RoleId roleId,
|
740
|
-
bool onlyActiveRole
|
741
|
-
bool allowAdminAndPublicRoles
|
652
|
+
bool onlyActiveRole
|
742
653
|
)
|
743
654
|
internal
|
744
655
|
view
|
@@ -747,15 +658,9 @@ contract AccessAdmin is
|
|
747
658
|
revert ErrorAccessAdminRoleUnknown(roleId);
|
748
659
|
}
|
749
660
|
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
}
|
754
|
-
|
755
|
-
// check role is not public role
|
756
|
-
if (roleId == PUBLIC_ROLE()) {
|
757
|
-
revert ErrorAccessAdminInvalidUserOfPublicRole();
|
758
|
-
}
|
661
|
+
uint64 roleIdInt = RoleId.unwrap(roleId);
|
662
|
+
if (roleIdInt == _authority.ADMIN_ROLE()) {
|
663
|
+
revert ErrorAccessAdminRoleIsLocked(roleId);
|
759
664
|
}
|
760
665
|
|
761
666
|
// check if role is disabled
|
@@ -765,6 +670,7 @@ contract AccessAdmin is
|
|
765
670
|
}
|
766
671
|
|
767
672
|
|
673
|
+
|
768
674
|
/// @dev check if target exists and reverts if it doesn't
|
769
675
|
function _checkTargetExists(
|
770
676
|
address target
|
@@ -777,4 +683,22 @@ contract AccessAdmin is
|
|
777
683
|
revert ErrorAccessAdminTargetNotCreated(target);
|
778
684
|
}
|
779
685
|
}
|
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
|
+
}
|
780
704
|
}
|