@etherisc/gif-next 0.0.2-89c8f37-711 → 0.0.2-8a72793-100
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/README.md +34 -8
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +476 -86
- 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/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +273 -16
- 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 +371 -54
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +139 -15
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +165 -391
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +261 -27
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +103 -321
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +321 -369
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +129 -119
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +115 -143
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +196 -133
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1475 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2040 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +644 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1479 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1195 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1655 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2426 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +644 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +204 -38
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +127 -95
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +222 -125
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +784 -181
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +205 -90
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1002 -303
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +155 -280
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +96 -96
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +651 -514
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -0
- 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 +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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 +114 -340
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +243 -29
- 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 +102 -130
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +69 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +90 -308
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +153 -190
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +122 -88
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +119 -387
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +261 -27
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +275 -314
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +122 -108
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +172 -97
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +124 -219
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +464 -312
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +109 -394
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +653 -532
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +163 -97
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +134 -184
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +91 -93
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +243 -400
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +261 -27
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +415 -234
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +140 -114
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +94 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +308 -16
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +354 -106
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +136 -83
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +235 -202
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +57 -4
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +439 -302
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +141 -99
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +227 -314
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +120 -122
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +241 -398
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +637 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +724 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +334 -34
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +144 -41
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +540 -95
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +650 -193
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +109 -292
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +94 -80
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2099 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +443 -241
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +76 -265
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +461 -625
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +131 -131
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +57 -111
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +578 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +89 -88
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +431 -284
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +102 -130
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +148 -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 +55 -2
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -22
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +89 -307
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -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 +22 -57
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +122 -97
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +57 -111
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +585 -12
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +140 -113
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +77 -16
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +76 -106
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +210 -366
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +122 -95
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -11
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +122 -164
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +99 -85
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +149 -108
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +55 -24
- 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 +33 -9
- 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 +28 -4
- 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 +3 -3
- 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 +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- 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 +118 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +50 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +16 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- 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 +71 -70
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +389 -149
- package/contracts/authorization/AccessManagerCloneable.sol +147 -4
- package/contracts/authorization/Authorization.sol +351 -204
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +64 -29
- package/contracts/authorization/IAuthorization.sol +33 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +15 -12
- package/contracts/distribution/BasicDistributionAuthorization.sol +22 -9
- package/contracts/distribution/Distribution.sol +42 -48
- package/contracts/distribution/DistributionService.sol +125 -104
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +28 -24
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +90 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +438 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +57 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +106 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +377 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +60 -43
- package/contracts/instance/IInstanceService.sol +21 -30
- package/contracts/instance/Instance.sol +106 -71
- package/contracts/instance/InstanceAdmin.sol +287 -102
- package/contracts/instance/InstanceAuthorizationV3.sol +92 -61
- package/contracts/instance/InstanceReader.sol +275 -43
- package/contracts/instance/InstanceService.sol +196 -189
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +23 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +11 -4
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +14 -14
- package/contracts/instance/module/IDistribution.sol +2 -1
- package/contracts/instance/module/IPolicy.sol +26 -25
- package/contracts/instance/module/IRisk.sol +3 -0
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +7 -17
- package/contracts/oracle/OracleService.sol +113 -81
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +38 -27
- package/contracts/pool/BasicPoolAuthorization.sol +32 -11
- package/contracts/pool/BundleService.sol +179 -125
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +29 -34
- package/contracts/pool/IPoolComponent.sol +19 -15
- package/contracts/pool/IPoolService.sol +90 -75
- package/contracts/pool/Pool.sol +145 -128
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +540 -217
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +72 -43
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +11 -12
- package/contracts/product/BasicProductAuthorization.sol +24 -11
- package/contracts/product/ClaimService.sol +368 -153
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +6 -2
- package/contracts/product/IClaimService.sol +44 -8
- package/contracts/product/IPolicyService.sol +53 -38
- package/contracts/product/IPricingService.sol +10 -10
- package/contracts/product/IProductComponent.sol +27 -5
- package/contracts/product/{IProductService.sol → IRiskService.sol} +1 -1
- package/contracts/product/PolicyService.sol +446 -281
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +66 -62
- package/contracts/product/PricingServiceManager.sol +4 -4
- package/contracts/product/Product.sol +166 -89
- package/contracts/product/RiskService.sol +145 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +72 -40
- package/contracts/registry/IRegistry.sol +60 -28
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +357 -203
- package/contracts/registry/RegistryAdmin.sol +290 -182
- package/contracts/registry/RegistryAuthorization.sol +266 -0
- package/contracts/registry/RegistryService.sol +37 -48
- package/contracts/registry/RegistryServiceManager.sol +3 -3
- package/contracts/registry/ReleaseAdmin.sol +252 -0
- package/contracts/registry/ReleaseLifecycle.sol +8 -3
- package/contracts/registry/ReleaseRegistry.sol +264 -232
- package/contracts/registry/ServiceAuthorizationV3.sol +181 -52
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +73 -126
- package/contracts/shared/ComponentService.sol +424 -386
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +28 -17
- package/contracts/shared/ContractLib.sol +263 -0
- package/contracts/shared/IComponent.sol +8 -17
- package/contracts/shared/IComponentService.sol +40 -38
- package/contracts/shared/IInstanceLinkedComponent.sol +6 -32
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/IRegisterable.sol +23 -1
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +10 -2
- package/contracts/shared/InstanceLinkedComponent.sol +73 -48
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +29 -9
- package/contracts/shared/PolicyHolder.sol +15 -52
- package/contracts/shared/Registerable.sol +52 -21
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +15 -32
- package/contracts/shared/TokenHandler.sol +310 -26
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +11 -9
- package/contracts/staking/IStakingService.sol +8 -3
- package/contracts/staking/StakeManagerLib.sol +19 -26
- package/contracts/staking/Staking.sol +71 -61
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +13 -6
- package/contracts/staking/StakingService.sol +54 -35
- package/contracts/staking/StakingServiceManager.sol +6 -5
- package/contracts/staking/TargetManagerLib.sol +7 -3
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +7 -0
- package/contracts/type/ObjectType.sol +57 -34
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +35 -4
- package/contracts/type/RoleId.sol +23 -15
- package/contracts/type/Seconds.sol +21 -1
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +15 -1
- package/contracts/type/Timestamp.sol +4 -5
- package/contracts/type/UFixed.sol +13 -119
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +68 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +4 -3
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -708
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/product/ProductService.sol +0 -99
- package/contracts/product/ProductServiceManager.sol +0 -39
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -5,13 +5,23 @@ 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 {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
9
8
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
9
|
+
import {IAuthorization} from "./IAuthorization.sol";
|
10
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
+
|
12
|
+
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
13
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
14
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
10
16
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
11
17
|
import {Selector, SelectorLib, SelectorSetLib} from "../type/Selector.sol";
|
12
18
|
import {Str, StrLib} from "../type/String.sol";
|
13
|
-
import {
|
19
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
20
|
+
import {VersionPart} from "../type/Version.sol";
|
14
21
|
|
22
|
+
interface IAccessManagedChecker {
|
23
|
+
function authority() external view returns (address);
|
24
|
+
}
|
15
25
|
|
16
26
|
/**
|
17
27
|
* @dev A generic access amin contract that implements role based access control based on OpenZeppelin's AccessManager contract.
|
@@ -28,13 +38,23 @@ contract AccessAdmin is
|
|
28
38
|
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
29
39
|
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
30
40
|
|
31
|
-
/// @dev
|
41
|
+
/// @dev admin name used for logging only
|
42
|
+
string internal _adminName;
|
43
|
+
|
44
|
+
/// @dev the access manager driving the access admin contract
|
45
|
+
/// hold link to registry and release version
|
32
46
|
AccessManagerCloneable internal _authority;
|
33
47
|
|
48
|
+
/// @dev the authorization contract used for initial access control
|
49
|
+
IAuthorization internal _authorization;
|
50
|
+
|
34
51
|
/// @dev stores the deployer address and allows to create initializers
|
35
52
|
/// that are restricted to the deployer address.
|
36
53
|
address internal _deployer;
|
37
54
|
|
55
|
+
/// @dev the linked NFT ID
|
56
|
+
NftId internal _linkedNftId;
|
57
|
+
|
38
58
|
/// @dev store role info per role id
|
39
59
|
mapping(RoleId roleId => RoleInfo info) internal _roleInfo;
|
40
60
|
|
@@ -67,37 +87,42 @@ contract AccessAdmin is
|
|
67
87
|
|
68
88
|
modifier onlyDeployer() {
|
69
89
|
// special case for cloned AccessAdmin contracts
|
70
|
-
// IMPORTANT cloning and
|
90
|
+
// IMPORTANT cloning and initialize authority needs to be done in a single transaction
|
71
91
|
if (_deployer == address(0)) {
|
72
92
|
_deployer = msg.sender;
|
73
93
|
}
|
74
94
|
|
75
95
|
if (msg.sender != _deployer) {
|
76
|
-
revert
|
96
|
+
revert ErrorAccessAdminNotDeployer();
|
77
97
|
}
|
78
98
|
_;
|
79
99
|
}
|
80
100
|
|
81
101
|
modifier onlyRoleAdmin(RoleId roleId) {
|
82
|
-
|
83
|
-
revert ErrorRoleUnknown(roleId);
|
84
|
-
}
|
102
|
+
_checkRoleExists(roleId, false);
|
85
103
|
|
86
104
|
if (!hasAdminRole(msg.sender, roleId)) {
|
87
|
-
revert
|
105
|
+
revert ErrorAccessAdminNotAdminOfRole(_roleInfo[roleId].adminRoleId);
|
88
106
|
}
|
89
107
|
_;
|
90
108
|
}
|
91
109
|
|
92
110
|
modifier onlyRoleMember(RoleId roleId) {
|
93
111
|
if (!hasRole(msg.sender, roleId)) {
|
94
|
-
revert
|
112
|
+
revert ErrorAccessAdminNotRoleOwner(roleId);
|
95
113
|
}
|
96
114
|
_;
|
97
115
|
}
|
98
116
|
|
99
|
-
modifier onlyExistingRole(
|
100
|
-
|
117
|
+
modifier onlyExistingRole(
|
118
|
+
RoleId roleId,
|
119
|
+
bool onlyActiveRole,
|
120
|
+
bool allowLockedRoles
|
121
|
+
)
|
122
|
+
{
|
123
|
+
if (!allowLockedRoles) {
|
124
|
+
_checkRoleExists(roleId, onlyActiveRole);
|
125
|
+
}
|
101
126
|
_;
|
102
127
|
}
|
103
128
|
|
@@ -106,14 +131,212 @@ contract AccessAdmin is
|
|
106
131
|
_;
|
107
132
|
}
|
108
133
|
|
109
|
-
|
110
|
-
|
111
|
-
|
134
|
+
//-------------- initialization functions ------------------------------//
|
135
|
+
|
136
|
+
// event LogAccessAdminDebug(string message);
|
137
|
+
|
138
|
+
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
139
|
+
/// Internally initializes access manager with this admin and creates basic role setup.
|
140
|
+
function initialize(
|
141
|
+
address authority,
|
142
|
+
string memory adminName
|
143
|
+
)
|
144
|
+
public
|
145
|
+
initializer()
|
146
|
+
{
|
147
|
+
__AccessAdmin_init(authority, adminName);
|
148
|
+
}
|
149
|
+
|
150
|
+
|
151
|
+
function __AccessAdmin_init(
|
152
|
+
address authority,
|
153
|
+
string memory adminName
|
154
|
+
)
|
155
|
+
internal
|
156
|
+
onlyInitializing()
|
157
|
+
onlyDeployer()
|
158
|
+
{
|
159
|
+
// checks
|
160
|
+
// check authority is contract
|
161
|
+
if (!ContractLib.isContract(authority)) {
|
162
|
+
revert ErrorAccessAdminAuthorityNotContract(authority);
|
163
|
+
}
|
164
|
+
|
165
|
+
// check name not empty
|
166
|
+
if (bytes(adminName).length == 0) {
|
167
|
+
revert ErrorAccessAdminAccessManagerEmptyName();
|
168
|
+
}
|
169
|
+
|
170
|
+
_authority = AccessManagerCloneable(authority);
|
112
171
|
_authority.initialize(address(this));
|
113
172
|
|
114
|
-
|
115
|
-
|
116
|
-
|
173
|
+
// delayed additional check for authority after its initialization
|
174
|
+
if (!ContractLib.isAuthority(authority)) {
|
175
|
+
revert ErrorAccessAdminAccessManagerNotAccessManager(authority);
|
176
|
+
}
|
177
|
+
|
178
|
+
// effects
|
179
|
+
// set and initialize this access manager contract as
|
180
|
+
// the admin (ADMIN_ROLE) of the provided authority
|
181
|
+
__AccessManaged_init(authority);
|
182
|
+
|
183
|
+
// set name for logging
|
184
|
+
_adminName = adminName;
|
185
|
+
|
186
|
+
// set initial linked NFT ID to zero
|
187
|
+
_linkedNftId = NftIdLib.zero();
|
188
|
+
|
189
|
+
// create admin and public roles
|
190
|
+
_initializeAdminAndPublicRoles();
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
/// @dev check if target exists and reverts if it doesn't
|
195
|
+
function _checkTarget(
|
196
|
+
address target
|
197
|
+
)
|
198
|
+
internal
|
199
|
+
view
|
200
|
+
{
|
201
|
+
// check not yet created
|
202
|
+
if (!targetExists(target)) {
|
203
|
+
revert ErrorAccessAdminTargetNotCreated(target);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
function _checkIsRegistered(
|
208
|
+
address registry,
|
209
|
+
address target,
|
210
|
+
ObjectType expectedType
|
211
|
+
)
|
212
|
+
internal
|
213
|
+
view
|
214
|
+
{
|
215
|
+
ObjectType tagetType = IRegistry(registry).getObjectInfo(target).objectType;
|
216
|
+
if (tagetType.eqz()) {
|
217
|
+
revert ErrorAccessAdminNotRegistered(target);
|
218
|
+
}
|
219
|
+
|
220
|
+
if (tagetType != expectedType) {
|
221
|
+
revert ErrorAccessAdminTargetTypeMismatch(target, expectedType, tagetType);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
/// @dev check if target exists and and has expected type, reverts if it doesn't
|
226
|
+
function _checkTargetWithType(
|
227
|
+
address target,
|
228
|
+
ObjectType expectedType
|
229
|
+
)
|
230
|
+
internal
|
231
|
+
view
|
232
|
+
{
|
233
|
+
// check target exists
|
234
|
+
_checkTarget(target);
|
235
|
+
|
236
|
+
// check target type
|
237
|
+
ObjectType tagetType = _authority.getRegistry().getObjectInfo(target).objectType;
|
238
|
+
if (tagetType != expectedType) {
|
239
|
+
revert ErrorAccessAdminTargetTypeMismatch(target, expectedType, tagetType);
|
240
|
+
}
|
241
|
+
|
242
|
+
// target release is checked during component/instance registration
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
function _checkAuthorization(
|
247
|
+
address authorization,
|
248
|
+
ObjectType expectedDomain,
|
249
|
+
VersionPart expectedRelease,
|
250
|
+
bool checkAlreadyInitialized
|
251
|
+
)
|
252
|
+
internal
|
253
|
+
view
|
254
|
+
{
|
255
|
+
// checks
|
256
|
+
// check not yet initialized
|
257
|
+
if (checkAlreadyInitialized && address(_authorization) != address(0)) {
|
258
|
+
revert ErrorAccessAdminAlreadyInitialized(address(_authorization));
|
259
|
+
}
|
260
|
+
|
261
|
+
// check contract type matches
|
262
|
+
if (!ContractLib.supportsInterface(authorization, type(IAuthorization).interfaceId)) {
|
263
|
+
revert ErrorAccessAdminNotAuthorization(authorization);
|
264
|
+
}
|
265
|
+
|
266
|
+
// check domain matches
|
267
|
+
ObjectType domain = IAuthorization(authorization).getDomain();
|
268
|
+
if (domain != expectedDomain) {
|
269
|
+
revert ErrorAccessAdminDomainMismatch(authorization, expectedDomain, domain);
|
270
|
+
}
|
271
|
+
|
272
|
+
// check release matches
|
273
|
+
VersionPart authorizationRelease = IAuthorization(authorization).getRelease();
|
274
|
+
if (authorizationRelease != expectedRelease) {
|
275
|
+
revert ErrorAccessAdminReleaseMismatch(authorization, getRelease(), authorizationRelease);
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
|
280
|
+
function getRelease() public view virtual returns (VersionPart release) {
|
281
|
+
return _authority.getRelease();
|
282
|
+
}
|
283
|
+
|
284
|
+
|
285
|
+
function getRegistry() public view returns (IRegistry registry) {
|
286
|
+
return _authority.getRegistry();
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
function getLinkedNftId() external view returns (NftId linkedNftId) {
|
291
|
+
return _linkedNftId;
|
292
|
+
}
|
293
|
+
|
294
|
+
|
295
|
+
function getLinkedOwner() external view returns (address linkedOwner) {
|
296
|
+
return getRegistry().ownerOf(_linkedNftId);
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
function isLocked() public view returns (bool locked) {
|
302
|
+
return _authority.isLocked();
|
303
|
+
}
|
304
|
+
|
305
|
+
function _linkToNftOwnable(address registerable) internal {
|
306
|
+
if (!getRegistry().isRegistered(registerable)) {
|
307
|
+
revert ErrorAccessAdminNotRegistered(registerable);
|
308
|
+
}
|
309
|
+
|
310
|
+
_linkedNftId = getRegistry().getNftIdForAddress(registerable);
|
311
|
+
}
|
312
|
+
|
313
|
+
function _initializeAdminAndPublicRoles()
|
314
|
+
internal
|
315
|
+
virtual
|
316
|
+
onlyInitializing()
|
317
|
+
{
|
318
|
+
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
319
|
+
|
320
|
+
// setup admin role
|
321
|
+
_createRoleUnchecked(
|
322
|
+
ADMIN_ROLE(),
|
323
|
+
toRole({
|
324
|
+
adminRoleId: ADMIN_ROLE(),
|
325
|
+
roleType: RoleType.Contract,
|
326
|
+
maxMemberCount: 1,
|
327
|
+
name: ADMIN_ROLE_NAME}));
|
328
|
+
|
329
|
+
// add this contract as admin role member
|
330
|
+
_roleMembers[adminRoleId].add(address(this));
|
331
|
+
|
332
|
+
// setup public role
|
333
|
+
_createRoleUnchecked(
|
334
|
+
PUBLIC_ROLE(),
|
335
|
+
toRole({
|
336
|
+
adminRoleId: ADMIN_ROLE(),
|
337
|
+
roleType: RoleType.Gif,
|
338
|
+
maxMemberCount: type(uint32).max,
|
339
|
+
name: PUBLIC_ROLE_NAME}));
|
117
340
|
}
|
118
341
|
|
119
342
|
//--- view functions for roles ------------------------------------------//
|
@@ -154,6 +377,7 @@ contract AccessAdmin is
|
|
154
377
|
return _roleMembers[roleId].at(idx);
|
155
378
|
}
|
156
379
|
|
380
|
+
// TODO false because not role member or because role not exists?
|
157
381
|
function hasRole(address account, RoleId roleId) public view returns (bool) {
|
158
382
|
(bool isMember, ) = _authority.hasRole(
|
159
383
|
RoleId.unwrap(roleId),
|
@@ -219,18 +443,6 @@ contract AccessAdmin is
|
|
219
443
|
selector.toBytes4()));
|
220
444
|
}
|
221
445
|
|
222
|
-
function isAccessManaged(address target) public view returns (bool) {
|
223
|
-
if (!_isContract(target)) {
|
224
|
-
return false;
|
225
|
-
}
|
226
|
-
|
227
|
-
(bool success, ) = target.staticcall(
|
228
|
-
abi.encodeWithSelector(
|
229
|
-
AccessManagedUpgradeable.authority.selector));
|
230
|
-
|
231
|
-
return success;
|
232
|
-
}
|
233
|
-
|
234
446
|
function canCall(address caller, address target, Selector selector) external virtual view returns (bool can) {
|
235
447
|
(can, ) = _authority.canCall(caller, target, selector.toBytes4());
|
236
448
|
}
|
@@ -241,7 +453,8 @@ contract AccessAdmin is
|
|
241
453
|
adminRoleId: adminRoleId,
|
242
454
|
roleType: roleType,
|
243
455
|
maxMemberCount: maxMemberCount,
|
244
|
-
createdAt: TimestampLib.blockTimestamp()
|
456
|
+
createdAt: TimestampLib.blockTimestamp(),
|
457
|
+
pausedAt: TimestampLib.max()
|
245
458
|
});
|
246
459
|
}
|
247
460
|
|
@@ -258,6 +471,17 @@ contract AccessAdmin is
|
|
258
471
|
|
259
472
|
//--- internal/private functions -------------------------------------------------//
|
260
473
|
|
474
|
+
function _createTargetWithRole(
|
475
|
+
address target,
|
476
|
+
string memory targetName,
|
477
|
+
RoleId targetRoleId
|
478
|
+
)
|
479
|
+
internal
|
480
|
+
{
|
481
|
+
_createTarget(target, targetName, true, false);
|
482
|
+
_grantRoleToAccount(targetRoleId, target);
|
483
|
+
}
|
484
|
+
|
261
485
|
function _authorizeTargetFunctions(
|
262
486
|
address target,
|
263
487
|
RoleId roleId,
|
@@ -266,14 +490,21 @@ contract AccessAdmin is
|
|
266
490
|
internal
|
267
491
|
{
|
268
492
|
if (roleId == getAdminRole()) {
|
269
|
-
revert
|
493
|
+
revert ErrorAccessAdminAuthorizeForAdminRoleInvalid(target);
|
270
494
|
}
|
271
495
|
|
272
|
-
|
273
|
-
|
496
|
+
(
|
497
|
+
bytes4[] memory functionSelectors,
|
498
|
+
string[] memory functionNames
|
499
|
+
) = _processFunctionSelectors(target, functions, true);
|
274
500
|
|
275
501
|
// apply authz via access manager
|
276
|
-
_grantRoleAccessToFunctions(
|
502
|
+
_grantRoleAccessToFunctions(
|
503
|
+
target,
|
504
|
+
roleId,
|
505
|
+
functionSelectors,
|
506
|
+
functionNames,
|
507
|
+
false); // allow locked roles
|
277
508
|
}
|
278
509
|
|
279
510
|
function _unauthorizeTargetFunctions(
|
@@ -282,9 +513,17 @@ contract AccessAdmin is
|
|
282
513
|
)
|
283
514
|
internal
|
284
515
|
{
|
285
|
-
|
286
|
-
|
287
|
-
|
516
|
+
(
|
517
|
+
bytes4[] memory functionSelectors,
|
518
|
+
string[] memory functionNames
|
519
|
+
) = _processFunctionSelectors(target, functions, false);
|
520
|
+
|
521
|
+
_grantRoleAccessToFunctions(
|
522
|
+
target,
|
523
|
+
getAdminRole(),
|
524
|
+
functionSelectors,
|
525
|
+
functionNames,
|
526
|
+
true); // allowLockedRoles
|
288
527
|
}
|
289
528
|
|
290
529
|
function _processFunctionSelectors(
|
@@ -293,12 +532,15 @@ contract AccessAdmin is
|
|
293
532
|
bool addFunctions
|
294
533
|
)
|
295
534
|
internal
|
535
|
+
onlyExistingTarget(target)
|
296
536
|
returns (
|
297
|
-
bytes4[] memory functionSelectors
|
537
|
+
bytes4[] memory functionSelectors,
|
538
|
+
string[] memory functionNames
|
298
539
|
)
|
299
540
|
{
|
300
541
|
uint256 n = functions.length;
|
301
542
|
functionSelectors = new bytes4[](n);
|
543
|
+
functionNames = new string[](n);
|
302
544
|
FunctionInfo memory func;
|
303
545
|
Selector selector;
|
304
546
|
|
@@ -315,70 +557,7 @@ contract AccessAdmin is
|
|
315
557
|
|
316
558
|
// add bytes4 selector to function selector array
|
317
559
|
functionSelectors[i] = selector.toBytes4();
|
318
|
-
|
319
|
-
}
|
320
|
-
|
321
|
-
function _initializeAuthority(
|
322
|
-
address authorityAddress
|
323
|
-
)
|
324
|
-
internal
|
325
|
-
virtual
|
326
|
-
onlyInitializing()
|
327
|
-
onlyDeployer()
|
328
|
-
{
|
329
|
-
if (authority() != address(0)) {
|
330
|
-
revert ErrorAuthorityAlreadySet();
|
331
|
-
}
|
332
|
-
|
333
|
-
_authority = AccessManagerCloneable(authorityAddress);
|
334
|
-
__AccessManaged_init(address(_authority));
|
335
|
-
}
|
336
|
-
|
337
|
-
|
338
|
-
function _initializeAdminAndPublicRoles()
|
339
|
-
internal
|
340
|
-
virtual
|
341
|
-
onlyInitializing()
|
342
|
-
{
|
343
|
-
_createAdminAndPublicRoles();
|
344
|
-
}
|
345
|
-
|
346
|
-
|
347
|
-
/// @dev internal setup function that can be used in both constructor and initializer.
|
348
|
-
function _createAdminAndPublicRoles()
|
349
|
-
internal
|
350
|
-
{
|
351
|
-
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
352
|
-
FunctionInfo[] memory functions;
|
353
|
-
|
354
|
-
// setup admin role
|
355
|
-
_createRoleUnchecked(
|
356
|
-
ADMIN_ROLE(),
|
357
|
-
toRole({
|
358
|
-
adminRoleId: ADMIN_ROLE(),
|
359
|
-
roleType: RoleType.Contract,
|
360
|
-
maxMemberCount: 1,
|
361
|
-
name: ADMIN_ROLE_NAME}));
|
362
|
-
|
363
|
-
// add this contract as admin role member
|
364
|
-
_roleMembers[adminRoleId].add(address(this));
|
365
|
-
|
366
|
-
// setup public role
|
367
|
-
_createRoleUnchecked(
|
368
|
-
PUBLIC_ROLE(),
|
369
|
-
toRole({
|
370
|
-
adminRoleId: ADMIN_ROLE(),
|
371
|
-
roleType: RoleType.Gif,
|
372
|
-
maxMemberCount: type(uint32).max,
|
373
|
-
name: PUBLIC_ROLE_NAME}));
|
374
|
-
}
|
375
|
-
|
376
|
-
/// @dev check if target exists and reverts if it doesn't
|
377
|
-
function _checkTarget(address target)
|
378
|
-
internal
|
379
|
-
{
|
380
|
-
if (_targetInfo[target].createdAt.eqz()) {
|
381
|
-
revert ErrorTargetUnknown(target);
|
560
|
+
functionNames[i] = func.name.toString();
|
382
561
|
}
|
383
562
|
}
|
384
563
|
|
@@ -386,78 +565,82 @@ contract AccessAdmin is
|
|
386
565
|
function _grantRoleAccessToFunctions(
|
387
566
|
address target,
|
388
567
|
RoleId roleId,
|
389
|
-
bytes4[] memory functionSelectors
|
568
|
+
bytes4[] memory functionSelectors,
|
569
|
+
string[] memory functionNames,
|
570
|
+
bool allowLockedRoles // admin and public roles are locked
|
390
571
|
)
|
391
572
|
internal
|
573
|
+
onlyExistingTarget(target)
|
574
|
+
onlyExistingRole(roleId, true, allowLockedRoles)
|
392
575
|
{
|
576
|
+
|
393
577
|
_authority.setTargetFunctionRole(
|
394
578
|
target,
|
395
579
|
functionSelectors,
|
396
580
|
RoleId.unwrap(roleId));
|
397
581
|
|
398
|
-
//
|
582
|
+
// log function grantings
|
583
|
+
for (uint256 i = 0; i < functionSelectors.length; i++) {
|
584
|
+
emit LogAccessAdminFunctionGranted(
|
585
|
+
_adminName,
|
586
|
+
target,
|
587
|
+
string(abi.encodePacked(
|
588
|
+
functionNames[i],
|
589
|
+
"(): ",
|
590
|
+
_getRoleName(roleId))));
|
591
|
+
}
|
399
592
|
}
|
400
593
|
|
594
|
+
|
401
595
|
/// @dev grant the specified role to the provided account
|
402
596
|
function _grantRoleToAccount(RoleId roleId, address account)
|
403
597
|
internal
|
598
|
+
onlyExistingRole(roleId, true, false)
|
404
599
|
{
|
405
|
-
_checkRoleId(roleId);
|
406
|
-
|
407
600
|
// check max role members will not be exceeded
|
408
601
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
409
|
-
revert
|
602
|
+
revert ErrorAccessAdminRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
410
603
|
}
|
411
604
|
|
412
605
|
// check account is contract for contract role
|
413
|
-
|
414
|
-
|
606
|
+
if (
|
607
|
+
_roleInfo[roleId].roleType == RoleType.Contract &&
|
608
|
+
!ContractLib.isContract(account) // will fail in account's constructor
|
609
|
+
) {
|
610
|
+
revert ErrorAccessAdminRoleMemberNotContract(roleId, account);
|
415
611
|
}
|
416
612
|
|
613
|
+
// TODO check account already have roleId
|
417
614
|
_roleMembers[roleId].add(account);
|
418
615
|
_authority.grantRole(
|
419
616
|
RoleId.unwrap(roleId),
|
420
617
|
account,
|
421
618
|
0);
|
422
619
|
|
423
|
-
|
620
|
+
emit LogAccessAdminRoleGranted(_adminName, account, _getRoleName(roleId));
|
424
621
|
}
|
425
622
|
|
426
623
|
/// @dev revoke the specified role from the provided account
|
427
624
|
function _revokeRoleFromAccount(RoleId roleId, address account)
|
428
625
|
internal
|
626
|
+
onlyExistingRole(roleId, false, false)
|
429
627
|
{
|
430
|
-
_checkRoleId(roleId);
|
431
628
|
|
432
629
|
// check role removal is permitted
|
433
630
|
if (_roleInfo[roleId].roleType == RoleType.Contract) {
|
434
|
-
revert
|
631
|
+
revert ErrorAccessAdminRoleMemberRemovalDisabled(roleId, account);
|
435
632
|
}
|
436
633
|
|
634
|
+
// TODO check account have roleId?
|
437
635
|
_roleMembers[roleId].remove(account);
|
438
636
|
_authority.revokeRole(
|
439
637
|
RoleId.unwrap(roleId),
|
440
638
|
account);
|
441
639
|
|
442
|
-
|
640
|
+
emit LogAccessAdminRoleRevoked(_adminName, account, _roleInfo[roleId].name.toString());
|
443
641
|
}
|
444
642
|
|
445
643
|
|
446
|
-
function _checkRoleId(RoleId roleId)
|
447
|
-
internal
|
448
|
-
{
|
449
|
-
if (_roleInfo[roleId].createdAt.eqz()) {
|
450
|
-
revert ErrorRoleUnknown(roleId);
|
451
|
-
}
|
452
|
-
|
453
|
-
uint64 roleIdInt = RoleId.unwrap(roleId);
|
454
|
-
if (roleIdInt == _authority.ADMIN_ROLE()
|
455
|
-
|| roleIdInt == _authority.PUBLIC_ROLE())
|
456
|
-
{
|
457
|
-
revert ErrorRoleIsLocked(roleId);
|
458
|
-
}
|
459
|
-
}
|
460
|
-
|
461
644
|
/// @dev Creates a role based on the provided parameters.
|
462
645
|
/// Checks that the provided role and role id and role name not already used.
|
463
646
|
function _createRole(
|
@@ -468,24 +651,24 @@ contract AccessAdmin is
|
|
468
651
|
{
|
469
652
|
// check role does not yet exist
|
470
653
|
if(roleExists(roleId)) {
|
471
|
-
revert
|
654
|
+
revert ErrorAccessAdminRoleAlreadyCreated(
|
472
655
|
roleId,
|
473
656
|
_roleInfo[roleId].name.toString());
|
474
657
|
}
|
475
658
|
|
476
659
|
// check admin role exists
|
477
660
|
if(!roleExists(info.adminRoleId)) {
|
478
|
-
revert
|
661
|
+
revert ErrorAccessAdminRoleAdminNotExisting(info.adminRoleId);
|
479
662
|
}
|
480
663
|
|
481
664
|
// check role name is not empty
|
482
665
|
if(info.name.length() == 0) {
|
483
|
-
revert
|
666
|
+
revert ErrorAccessAdminRoleNameEmpty(roleId);
|
484
667
|
}
|
485
668
|
|
486
669
|
// check role name is not used for another role
|
487
670
|
if(_roleForName[info.name].exists) {
|
488
|
-
revert
|
671
|
+
revert ErrorAccessAdminRoleNameAlreadyExists(
|
489
672
|
roleId,
|
490
673
|
info.name.toString(),
|
491
674
|
_roleForName[info.name].roleId);
|
@@ -513,7 +696,7 @@ contract AccessAdmin is
|
|
513
696
|
// add role to list of roles
|
514
697
|
_roleIds.push(roleId);
|
515
698
|
|
516
|
-
emit
|
699
|
+
emit LogAccessAdminRoleCreated(_adminName, roleId, info.roleType, info.adminRoleId, info.name.toString());
|
517
700
|
}
|
518
701
|
|
519
702
|
|
@@ -524,11 +707,10 @@ contract AccessAdmin is
|
|
524
707
|
bool custom
|
525
708
|
)
|
526
709
|
internal
|
527
|
-
nonReentrant()
|
528
710
|
{
|
529
711
|
// check target does not yet exist
|
530
712
|
if(targetExists(target)) {
|
531
|
-
revert
|
713
|
+
revert ErrorAccessAdminTargetAlreadyCreated(
|
532
714
|
target,
|
533
715
|
_targetInfo[target].name.toString());
|
534
716
|
}
|
@@ -536,27 +718,27 @@ contract AccessAdmin is
|
|
536
718
|
// check target name is not empty
|
537
719
|
Str name = StrLib.toStr(targetName);
|
538
720
|
if(name.length() == 0) {
|
539
|
-
revert
|
721
|
+
revert ErrorAccessAdminTargetNameEmpty(target);
|
540
722
|
}
|
541
723
|
|
542
724
|
// check target name is not used for another target
|
543
725
|
if( _targetForName[name] != address(0)) {
|
544
|
-
revert
|
726
|
+
revert ErrorAccessAdminTargetNameAlreadyExists(
|
545
727
|
target,
|
546
728
|
targetName,
|
547
729
|
_targetForName[name]);
|
548
730
|
}
|
549
731
|
|
550
732
|
// check target is an access managed contract
|
551
|
-
if (!
|
552
|
-
revert
|
733
|
+
if (!_isAccessManaged(target)) {
|
734
|
+
revert ErrorAccessAdminTargetNotAccessManaged(target);
|
553
735
|
}
|
554
736
|
|
555
737
|
// check target shares authority with this contract
|
556
738
|
if (checkAuthority) {
|
557
739
|
address targetAuthority = AccessManagedUpgradeable(target).authority();
|
558
740
|
if (targetAuthority != authority()) {
|
559
|
-
revert
|
741
|
+
revert ErrorAccessAdminTargetAuthorityMismatch(authority(), targetAuthority);
|
560
742
|
}
|
561
743
|
}
|
562
744
|
|
@@ -573,19 +755,77 @@ contract AccessAdmin is
|
|
573
755
|
// add role to list of roles
|
574
756
|
_targets.push(target);
|
575
757
|
|
576
|
-
emit
|
758
|
+
emit LogAccessAdminTargetCreated(_adminName, target, targetName);
|
577
759
|
}
|
578
760
|
|
579
|
-
|
761
|
+
|
762
|
+
function _setTargetLocked(address target, bool locked)
|
580
763
|
internal
|
581
|
-
|
764
|
+
onlyExistingTarget(target)
|
765
|
+
{
|
766
|
+
_authority.setTargetClosed(target, locked);
|
767
|
+
}
|
768
|
+
|
769
|
+
|
770
|
+
function _isAccessManaged(address target)
|
771
|
+
internal
|
772
|
+
view
|
582
773
|
returns (bool)
|
583
774
|
{
|
584
|
-
|
585
|
-
|
586
|
-
|
775
|
+
if (!ContractLib.isContract(target)) {
|
776
|
+
return false;
|
777
|
+
}
|
778
|
+
|
779
|
+
(bool success, ) = target.staticcall(
|
780
|
+
abi.encodeWithSelector(
|
781
|
+
IAccessManagedChecker.authority.selector));
|
782
|
+
|
783
|
+
return success;
|
784
|
+
}
|
785
|
+
|
786
|
+
|
787
|
+
function _getAccountName(address account) internal view returns (string memory) {
|
788
|
+
if (targetExists(account)) {
|
789
|
+
return _targetInfo[account].name.toString();
|
790
|
+
}
|
791
|
+
return "<unknown-account>";
|
792
|
+
}
|
793
|
+
|
794
|
+
|
795
|
+
function _getRoleName(RoleId roleId) internal view returns (string memory) {
|
796
|
+
if (roleExists(roleId)) {
|
797
|
+
return _roleInfo[roleId].name.toString();
|
798
|
+
}
|
799
|
+
return "<unknown-role>";
|
800
|
+
}
|
801
|
+
|
802
|
+
|
803
|
+
function _checkRoleExists(
|
804
|
+
RoleId roleId,
|
805
|
+
bool onlyActiveRole
|
806
|
+
)
|
807
|
+
internal
|
808
|
+
view
|
809
|
+
{
|
810
|
+
if (!roleExists(roleId)) {
|
811
|
+
revert ErrorAccessAdminRoleUnknown(roleId);
|
812
|
+
}
|
813
|
+
|
814
|
+
uint64 roleIdInt = RoleId.unwrap(roleId);
|
815
|
+
if (roleIdInt == _authority.ADMIN_ROLE()) {
|
816
|
+
revert ErrorAccessAdminRoleIsLocked(roleId);
|
817
|
+
}
|
818
|
+
|
819
|
+
// check if role is disabled
|
820
|
+
if (onlyActiveRole && _roleInfo[roleId].pausedAt <= TimestampLib.blockTimestamp()) {
|
821
|
+
revert ErrorAccessAdminRoleIsPaused(roleId);
|
822
|
+
}
|
823
|
+
}
|
824
|
+
|
825
|
+
|
826
|
+
function _checkRegistry(address registry) internal view {
|
827
|
+
if (!ContractLib.isRegistry(registry)) {
|
828
|
+
revert ErrorAccessAdminNotRegistry(registry);
|
587
829
|
}
|
588
|
-
return size > 0;
|
589
830
|
}
|
590
|
-
|
591
831
|
}
|