@etherisc/gif-next 0.0.2-7c8d286-020 → 0.0.2-7d488b3-675
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 +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -48
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -34
- 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 +246 -361
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +39 -8
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +23 -96
- 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 +184 -278
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +0 -32
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +109 -33
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +41 -96
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +65 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +106 -142
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +53 -61
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +20 -40
- 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 +17 -33
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +59 -75
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +41 -96
- 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 +118 -42
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +23 -23
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +27 -43
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +29 -45
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +41 -96
- 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 +7 -85
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +11 -54
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -95
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +405 -512
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +41 -96
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +63 -86
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +36 -26
- 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 +14 -14
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +30 -93
- 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 +42 -58
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -39
- 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 +41 -96
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -74
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -47
- 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 +22 -38
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +74 -106
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -63
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +26 -71
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +23 -35
- 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 +41 -96
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -96
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +0 -21
- 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/IPricingService.sol/IPricingService.json +0 -21
- 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/IRiskService.sol/IRiskService.json +0 -21
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +86 -94
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +18 -452
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -57
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +52 -89
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -44
- 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 +26 -55
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +23 -27
- 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 +350 -440
- 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 +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +368 -473
- 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 +124 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- 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 +102 -63
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -41
- 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 +4 -60
- 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/IComponentService.sol/IComponentService.json +24 -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/InitializableERC165.sol/InitializableERC165.json +2 -2
- 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/IStaking.sol/IStaking.json +9 -74
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +3 -74
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +57 -141
- 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 +34 -50
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +57 -30
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +29 -124
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +23 -35
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -142
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +14 -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/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 +31 -33
- 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 +2 -2
- 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/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/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -56
- 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 +4 -4
- 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 +3 -2
- package/contracts/authorization/AccessAdmin.sol +186 -201
- package/contracts/authorization/AccessManagerCloneable.sol +31 -40
- package/contracts/authorization/Authorization.sol +33 -61
- package/contracts/authorization/IAccessAdmin.sol +36 -63
- package/contracts/authorization/IAuthorization.sol +0 -6
- package/contracts/distribution/BasicDistribution.sol +3 -5
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +47 -4
- package/contracts/distribution/DistributionService.sol +6 -10
- package/contracts/distribution/IDistributionComponent.sol +9 -0
- package/contracts/distribution/IDistributionService.sol +5 -3
- package/contracts/instance/IInstance.sol +8 -43
- package/contracts/instance/IInstanceService.sol +2 -14
- package/contracts/instance/Instance.sol +13 -62
- package/contracts/instance/InstanceAdmin.sol +107 -120
- package/contracts/instance/InstanceAuthorizationV3.sol +21 -43
- package/contracts/instance/InstanceReader.sol +1 -1
- package/contracts/instance/InstanceService.sol +60 -118
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/OracleService.sol +4 -4
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/PoolLib.sol +1 -94
- package/contracts/pool/PoolService.sol +89 -91
- package/contracts/product/ApplicationService.sol +1 -10
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/ClaimService.sol +0 -8
- package/contracts/product/IApplicationService.sol +0 -2
- package/contracts/product/IPricingService.sol +0 -1
- package/contracts/product/IRiskService.sol +0 -3
- package/contracts/product/PolicyService.sol +53 -35
- package/contracts/product/PolicyServiceLib.sol +1 -55
- package/contracts/product/PricingService.sol +0 -5
- package/contracts/product/RiskService.sol +0 -10
- package/contracts/registry/RegistryAdmin.sol +229 -133
- package/contracts/registry/ReleaseAdmin.sol +22 -30
- package/contracts/registry/ReleaseRegistry.sol +33 -39
- package/contracts/registry/ServiceAuthorizationV3.sol +3 -88
- package/contracts/shared/Component.sol +6 -6
- package/contracts/shared/ComponentService.sol +29 -33
- package/contracts/shared/ContractLib.sol +0 -28
- package/contracts/shared/IComponentService.sol +6 -4
- package/contracts/shared/InitializableERC165.sol +1 -9
- package/contracts/shared/NftOwnable.sol +1 -2
- package/contracts/shared/Registerable.sol +4 -1
- package/contracts/shared/TokenHandler.sol +4 -5
- package/contracts/staking/IStaking.sol +2 -12
- package/contracts/staking/IStakingService.sol +1 -11
- package/contracts/staking/{StakingLib.sol → StakeManagerLib.sol} +22 -79
- package/contracts/staking/Staking.sol +13 -33
- package/contracts/staking/StakingReader.sol +15 -5
- package/contracts/staking/StakingService.sol +2 -39
- package/contracts/staking/StakingStore.sol +1 -2
- package/contracts/type/ObjectType.sol +14 -5
- package/contracts/type/Version.sol +0 -39
- package/package.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +0 -4
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +0 -673
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +0 -878
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +0 -469
- package/contracts/authorization/AccessAdminLib.sol +0 -183
- package/contracts/registry/RegistryAuthorization.sol +0 -267
@@ -151,8 +151,9 @@ contract AccountingService is
|
|
151
151
|
Amount feeAmount
|
152
152
|
)
|
153
153
|
public
|
154
|
-
virtual
|
155
|
-
|
154
|
+
virtual
|
155
|
+
// TODO re-enable once role granting is stable and fixed
|
156
|
+
// restricted()
|
156
157
|
{
|
157
158
|
_checkNftType(poolNftId, POOL());
|
158
159
|
_changeTargetBalance(DECREASE, instanceStore, poolNftId, amount, feeAmount);
|
@@ -5,15 +5,10 @@ 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 {IAccessAdmin} from "./IAccessAdmin.sol";
|
9
|
-
import {IAuthorization} from "./IAuthorization.sol";
|
10
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
-
|
12
|
-
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
13
8
|
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
14
9
|
import {ContractLib} from "../shared/ContractLib.sol";
|
15
|
-
import {
|
16
|
-
import {
|
10
|
+
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
11
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
17
12
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
18
13
|
import {Selector, SelectorLib, SelectorSetLib} from "../type/Selector.sol";
|
19
14
|
import {Str, StrLib} from "../type/String.sol";
|
@@ -39,23 +34,13 @@ contract AccessAdmin is
|
|
39
34
|
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
40
35
|
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
41
36
|
|
42
|
-
/// @dev
|
43
|
-
string internal _adminName;
|
44
|
-
|
45
|
-
/// @dev the access manager driving the access admin contract
|
46
|
-
/// hold link to registry and release version
|
37
|
+
/// @dev the OpenZeppelin access manager driving the access admin contract
|
47
38
|
AccessManagerCloneable internal _authority;
|
48
39
|
|
49
|
-
/// @dev the authorization contract used for initial access control
|
50
|
-
IAuthorization internal _authorization;
|
51
|
-
|
52
40
|
/// @dev stores the deployer address and allows to create initializers
|
53
41
|
/// that are restricted to the deployer address.
|
54
42
|
address internal _deployer;
|
55
43
|
|
56
|
-
/// @dev the linked NFT ID
|
57
|
-
NftId internal _linkedNftId;
|
58
|
-
|
59
44
|
/// @dev store role info per role id
|
60
45
|
mapping(RoleId roleId => RoleInfo info) internal _roleInfo;
|
61
46
|
|
@@ -94,25 +79,23 @@ contract AccessAdmin is
|
|
94
79
|
}
|
95
80
|
|
96
81
|
if (msg.sender != _deployer) {
|
97
|
-
revert
|
82
|
+
revert ErrorNotDeployer();
|
98
83
|
}
|
99
84
|
_;
|
100
85
|
}
|
101
86
|
|
102
|
-
modifier
|
87
|
+
modifier onlyRoleAdmin(RoleId roleId) {
|
103
88
|
_checkRoleExists(roleId, false);
|
104
89
|
|
105
|
-
if (!
|
106
|
-
revert
|
90
|
+
if (!hasAdminRole(msg.sender, roleId)) {
|
91
|
+
revert ErrorNotAdminOfRole(_roleInfo[roleId].adminRoleId);
|
107
92
|
}
|
108
93
|
_;
|
109
94
|
}
|
110
95
|
|
111
|
-
modifier
|
112
|
-
|
113
|
-
|
114
|
-
if (!hasAdminRole(account, roleId)) {
|
115
|
-
revert ErrorAccessAdminNotAdminOfRole(_roleInfo[roleId].adminRoleId, account);
|
96
|
+
modifier onlyRoleMember(RoleId roleId) {
|
97
|
+
if (!hasRole(msg.sender, roleId)) {
|
98
|
+
revert ErrorNotRoleOwner(roleId);
|
116
99
|
}
|
117
100
|
_;
|
118
101
|
}
|
@@ -130,7 +113,7 @@ contract AccessAdmin is
|
|
130
113
|
}
|
131
114
|
|
132
115
|
modifier onlyExistingTarget(address target) {
|
133
|
-
|
116
|
+
_checkTarget(target);
|
134
117
|
_;
|
135
118
|
}
|
136
119
|
|
@@ -141,61 +124,34 @@ contract AccessAdmin is
|
|
141
124
|
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
142
125
|
/// Internally initializes access manager with this admin and creates basic role setup.
|
143
126
|
function initialize(
|
144
|
-
|
145
|
-
string memory adminName
|
127
|
+
AccessManagerCloneable authority
|
146
128
|
)
|
147
129
|
public
|
148
130
|
initializer()
|
149
131
|
{
|
150
|
-
__AccessAdmin_init(authority
|
132
|
+
__AccessAdmin_init(authority);
|
151
133
|
}
|
152
134
|
|
153
135
|
|
154
136
|
function __AccessAdmin_init(
|
155
|
-
|
156
|
-
string memory adminName
|
137
|
+
AccessManagerCloneable authority
|
157
138
|
)
|
158
139
|
internal
|
159
140
|
onlyInitializing()
|
160
|
-
onlyDeployer()
|
141
|
+
onlyDeployer() // initializes deployer if not initialized yet
|
161
142
|
{
|
162
|
-
|
163
|
-
// check authority is contract
|
164
|
-
if (!ContractLib.isContract(authority)) {
|
165
|
-
revert ErrorAccessAdminAuthorityNotContract(authority);
|
166
|
-
}
|
143
|
+
authority.initialize(address(this));
|
167
144
|
|
168
|
-
// check name not empty
|
169
|
-
if (bytes(adminName).length == 0) {
|
170
|
-
revert ErrorAccessAdminAccessManagerEmptyName();
|
171
|
-
}
|
172
|
-
|
173
|
-
_authority = AccessManagerCloneable(authority);
|
174
|
-
_authority.initialize(address(this));
|
175
|
-
|
176
|
-
// delayed additional check for authority after its initialization
|
177
|
-
if (!ContractLib.isAuthority(authority)) {
|
178
|
-
revert ErrorAccessAdminAccessManagerNotAccessManager(authority);
|
179
|
-
}
|
180
|
-
|
181
|
-
// effects
|
182
145
|
// set and initialize this access manager contract as
|
183
146
|
// the admin (ADMIN_ROLE) of the provided authority
|
184
|
-
__AccessManaged_init(authority);
|
185
|
-
|
186
|
-
// set name for logging
|
187
|
-
_adminName = adminName;
|
188
|
-
|
189
|
-
// set initial linked NFT ID to zero
|
190
|
-
_linkedNftId = NftIdLib.zero();
|
147
|
+
__AccessManaged_init(address(authority));
|
148
|
+
_authority = authority;
|
191
149
|
|
192
150
|
// create admin and public roles
|
193
151
|
_initializeAdminAndPublicRoles();
|
194
|
-
}
|
195
152
|
|
196
|
-
|
197
|
-
|
198
|
-
return _authority.getRelease();
|
153
|
+
// additional use case specific initialization
|
154
|
+
_initializeCustom();
|
199
155
|
}
|
200
156
|
|
201
157
|
|
@@ -204,24 +160,46 @@ contract AccessAdmin is
|
|
204
160
|
}
|
205
161
|
|
206
162
|
|
207
|
-
function
|
208
|
-
return
|
163
|
+
function getRelease() public view returns (VersionPart release) {
|
164
|
+
return _authority.getRelease();
|
209
165
|
}
|
210
166
|
|
211
167
|
|
212
|
-
function
|
213
|
-
|
214
|
-
|
168
|
+
function _initializeAdminAndPublicRoles()
|
169
|
+
internal
|
170
|
+
virtual
|
171
|
+
onlyInitializing()
|
172
|
+
{
|
173
|
+
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
174
|
+
|
175
|
+
// setup admin role
|
176
|
+
_createRoleUnchecked(
|
177
|
+
ADMIN_ROLE(),
|
178
|
+
toRole({
|
179
|
+
adminRoleId: ADMIN_ROLE(),
|
180
|
+
roleType: RoleType.Contract,
|
181
|
+
maxMemberCount: 1,
|
182
|
+
name: ADMIN_ROLE_NAME}));
|
215
183
|
|
184
|
+
// add this contract as admin role member
|
185
|
+
_roleMembers[adminRoleId].add(address(this));
|
216
186
|
|
217
|
-
|
218
|
-
|
187
|
+
// setup public role
|
188
|
+
_createRoleUnchecked(
|
189
|
+
PUBLIC_ROLE(),
|
190
|
+
toRole({
|
191
|
+
adminRoleId: ADMIN_ROLE(),
|
192
|
+
roleType: RoleType.Gif,
|
193
|
+
maxMemberCount: type(uint32).max,
|
194
|
+
name: PUBLIC_ROLE_NAME}));
|
219
195
|
}
|
220
196
|
|
221
197
|
|
222
|
-
function
|
223
|
-
|
224
|
-
|
198
|
+
function _initializeCustom()
|
199
|
+
internal
|
200
|
+
virtual
|
201
|
+
onlyInitializing()
|
202
|
+
{ }
|
225
203
|
|
226
204
|
//--- view functions for roles ------------------------------------------//
|
227
205
|
|
@@ -245,14 +223,14 @@ contract AccessAdmin is
|
|
245
223
|
return _roleInfo[roleId].createdAt.gtz();
|
246
224
|
}
|
247
225
|
|
248
|
-
function getRoleForName(string memory name) external view returns (RoleId roleId) {
|
249
|
-
return _roleForName[StrLib.toStr(name)].roleId;
|
250
|
-
}
|
251
|
-
|
252
226
|
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory) {
|
253
227
|
return _roleInfo[roleId];
|
254
228
|
}
|
255
229
|
|
230
|
+
function getRoleForName(Str name) external view returns (RoleNameInfo memory) {
|
231
|
+
return _roleForName[name];
|
232
|
+
}
|
233
|
+
|
256
234
|
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers) {
|
257
235
|
return _roleMembers[roleId].length();
|
258
236
|
}
|
@@ -327,60 +305,34 @@ contract AccessAdmin is
|
|
327
305
|
selector.toBytes4()));
|
328
306
|
}
|
329
307
|
|
330
|
-
function
|
331
|
-
|
308
|
+
function canCall(address caller, address target, Selector selector) external virtual view returns (bool can) {
|
309
|
+
(can, ) = _authority.canCall(caller, target, selector.toBytes4());
|
332
310
|
}
|
333
311
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
312
|
+
function toRole(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) public view returns (RoleInfo memory) {
|
313
|
+
return RoleInfo({
|
314
|
+
name: StrLib.toStr(name),
|
315
|
+
adminRoleId: adminRoleId,
|
316
|
+
roleType: roleType,
|
317
|
+
maxMemberCount: maxMemberCount,
|
318
|
+
createdAt: TimestampLib.blockTimestamp(),
|
319
|
+
pausedAt: TimestampLib.max()
|
320
|
+
});
|
342
321
|
}
|
343
322
|
|
344
|
-
function
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
RoleId adminRoleId = RoleIdLib.toRoleId(_authority.ADMIN_ROLE());
|
350
|
-
|
351
|
-
// setup admin role
|
352
|
-
_createRoleUnchecked(
|
353
|
-
ADMIN_ROLE(),
|
354
|
-
AccessAdminLib.toRole({
|
355
|
-
adminRoleId: ADMIN_ROLE(),
|
356
|
-
roleType: RoleType.Contract,
|
357
|
-
maxMemberCount: 1,
|
358
|
-
name: ADMIN_ROLE_NAME}));
|
359
|
-
|
360
|
-
// add this contract as admin role member
|
361
|
-
_roleMembers[adminRoleId].add(address(this));
|
362
|
-
|
363
|
-
// setup public role
|
364
|
-
_createRoleUnchecked(
|
365
|
-
PUBLIC_ROLE(),
|
366
|
-
AccessAdminLib.toRole({
|
367
|
-
adminRoleId: ADMIN_ROLE(),
|
368
|
-
roleType: RoleType.Gif,
|
369
|
-
maxMemberCount: type(uint32).max,
|
370
|
-
name: PUBLIC_ROLE_NAME}));
|
323
|
+
function toFunction(bytes4 selector, string memory name) public view returns (FunctionInfo memory) {
|
324
|
+
return FunctionInfo({
|
325
|
+
name: StrLib.toStr(name),
|
326
|
+
selector: SelectorLib.toSelector(selector),
|
327
|
+
createdAt: TimestampLib.blockTimestamp()});
|
371
328
|
}
|
372
329
|
|
373
|
-
function
|
374
|
-
|
375
|
-
string memory targetName,
|
376
|
-
RoleId targetRoleId
|
377
|
-
)
|
378
|
-
internal
|
379
|
-
{
|
380
|
-
_createTarget(target, targetName, true, false);
|
381
|
-
_grantRoleToAccount(targetRoleId, target);
|
330
|
+
function deployer() public view returns (address) {
|
331
|
+
return _deployer;
|
382
332
|
}
|
383
333
|
|
334
|
+
//--- internal/private functions -------------------------------------------------//
|
335
|
+
|
384
336
|
function _authorizeTargetFunctions(
|
385
337
|
address target,
|
386
338
|
RoleId roleId,
|
@@ -389,7 +341,7 @@ contract AccessAdmin is
|
|
389
341
|
internal
|
390
342
|
{
|
391
343
|
if (roleId == getAdminRole()) {
|
392
|
-
revert
|
344
|
+
revert ErrorAuthorizeForAdminRoleInvalid(target);
|
393
345
|
}
|
394
346
|
|
395
347
|
(
|
@@ -478,15 +430,13 @@ contract AccessAdmin is
|
|
478
430
|
functionSelectors,
|
479
431
|
RoleId.unwrap(roleId));
|
480
432
|
|
481
|
-
// log function grantings
|
482
433
|
for (uint256 i = 0; i < functionSelectors.length; i++) {
|
483
434
|
emit LogAccessAdminFunctionGranted(
|
484
|
-
_adminName,
|
485
435
|
target,
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
436
|
+
// _getAccountName(target),
|
437
|
+
// string(abi.encodePacked("", functionSelectors[i])),
|
438
|
+
functionNames[i],
|
439
|
+
_getRoleName(roleId));
|
490
440
|
}
|
491
441
|
}
|
492
442
|
|
@@ -498,7 +448,7 @@ contract AccessAdmin is
|
|
498
448
|
{
|
499
449
|
// check max role members will not be exceeded
|
500
450
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
501
|
-
revert
|
451
|
+
revert ErrorRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
502
452
|
}
|
503
453
|
|
504
454
|
// check account is contract for contract role
|
@@ -506,7 +456,7 @@ contract AccessAdmin is
|
|
506
456
|
_roleInfo[roleId].roleType == RoleType.Contract &&
|
507
457
|
!ContractLib.isContract(account) // will fail in account's constructor
|
508
458
|
) {
|
509
|
-
revert
|
459
|
+
revert ErrorRoleMemberNotContract(roleId, account);
|
510
460
|
}
|
511
461
|
|
512
462
|
// TODO check account already have roleId
|
@@ -516,7 +466,7 @@ contract AccessAdmin is
|
|
516
466
|
account,
|
517
467
|
0);
|
518
468
|
|
519
|
-
emit LogAccessAdminRoleGranted(
|
469
|
+
emit LogAccessAdminRoleGranted(account, _getRoleName(roleId));
|
520
470
|
}
|
521
471
|
|
522
472
|
/// @dev revoke the specified role from the provided account
|
@@ -527,7 +477,7 @@ contract AccessAdmin is
|
|
527
477
|
|
528
478
|
// check role removal is permitted
|
529
479
|
if (_roleInfo[roleId].roleType == RoleType.Contract) {
|
530
|
-
revert
|
480
|
+
revert ErrorRoleMemberRemovalDisabled(roleId, account);
|
531
481
|
}
|
532
482
|
|
533
483
|
// TODO check account have roleId?
|
@@ -536,7 +486,7 @@ contract AccessAdmin is
|
|
536
486
|
RoleId.unwrap(roleId),
|
537
487
|
account);
|
538
488
|
|
539
|
-
emit LogAccessAdminRoleRevoked(
|
489
|
+
emit LogAccessAdminRoleRevoked(account, _roleInfo[roleId].name.toString());
|
540
490
|
}
|
541
491
|
|
542
492
|
|
@@ -548,21 +498,32 @@ contract AccessAdmin is
|
|
548
498
|
)
|
549
499
|
internal
|
550
500
|
{
|
551
|
-
|
552
|
-
|
553
|
-
|
501
|
+
// check role does not yet exist
|
502
|
+
if(roleExists(roleId)) {
|
503
|
+
revert ErrorRoleAlreadyCreated(
|
504
|
+
roleId,
|
505
|
+
_roleInfo[roleId].name.toString());
|
506
|
+
}
|
554
507
|
|
508
|
+
// check admin role exists
|
509
|
+
if(!roleExists(info.adminRoleId)) {
|
510
|
+
revert ErrorRoleAdminNotExisting(info.adminRoleId);
|
511
|
+
}
|
555
512
|
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
513
|
+
// check role name is not empty
|
514
|
+
if(info.name.length() == 0) {
|
515
|
+
revert ErrorRoleNameEmpty(roleId);
|
516
|
+
}
|
517
|
+
|
518
|
+
// check role name is not used for another role
|
519
|
+
if(_roleForName[info.name].exists) {
|
520
|
+
revert ErrorRoleNameAlreadyExists(
|
521
|
+
roleId,
|
522
|
+
info.name.toString(),
|
523
|
+
_roleForName[info.name].roleId);
|
524
|
+
}
|
525
|
+
|
526
|
+
_createRoleUnchecked(roleId, info);
|
566
527
|
}
|
567
528
|
|
568
529
|
|
@@ -584,19 +545,53 @@ contract AccessAdmin is
|
|
584
545
|
// add role to list of roles
|
585
546
|
_roleIds.push(roleId);
|
586
547
|
|
587
|
-
emit LogAccessAdminRoleCreated(
|
548
|
+
emit LogAccessAdminRoleCreated(roleId, info.roleType, info.adminRoleId, info.name.toString());
|
588
549
|
}
|
589
550
|
|
590
551
|
|
591
|
-
function
|
552
|
+
function _createTarget(
|
592
553
|
address target,
|
593
554
|
string memory targetName,
|
555
|
+
bool checkAuthority,
|
594
556
|
bool custom
|
595
557
|
)
|
596
558
|
internal
|
597
559
|
{
|
598
|
-
//
|
560
|
+
// check target does not yet exist
|
561
|
+
if(targetExists(target)) {
|
562
|
+
revert ErrorTargetAlreadyCreated(
|
563
|
+
target,
|
564
|
+
_targetInfo[target].name.toString());
|
565
|
+
}
|
566
|
+
|
567
|
+
// check target name is not empty
|
599
568
|
Str name = StrLib.toStr(targetName);
|
569
|
+
if(name.length() == 0) {
|
570
|
+
revert ErrorTargetNameEmpty(target);
|
571
|
+
}
|
572
|
+
|
573
|
+
// check target name is not used for another target
|
574
|
+
if( _targetForName[name] != address(0)) {
|
575
|
+
revert ErrorTargetNameAlreadyExists(
|
576
|
+
target,
|
577
|
+
targetName,
|
578
|
+
_targetForName[name]);
|
579
|
+
}
|
580
|
+
|
581
|
+
// check target is an access managed contract
|
582
|
+
if (!_isAccessManaged(target)) {
|
583
|
+
revert ErrorTargetNotAccessManaged(target);
|
584
|
+
}
|
585
|
+
|
586
|
+
// check target shares authority with this contract
|
587
|
+
if (checkAuthority) {
|
588
|
+
address targetAuthority = AccessManagedUpgradeable(target).authority();
|
589
|
+
if (targetAuthority != authority()) {
|
590
|
+
revert ErrorTargetAuthorityMismatch(authority(), targetAuthority);
|
591
|
+
}
|
592
|
+
}
|
593
|
+
|
594
|
+
// create target info
|
600
595
|
_targetInfo[target] = TargetInfo({
|
601
596
|
name: name,
|
602
597
|
isCustom: custom,
|
@@ -609,17 +604,47 @@ contract AccessAdmin is
|
|
609
604
|
// add role to list of roles
|
610
605
|
_targets.push(target);
|
611
606
|
|
612
|
-
emit LogAccessAdminTargetCreated(
|
607
|
+
emit LogAccessAdminTargetCreated(target, targetName);
|
613
608
|
}
|
614
609
|
|
615
610
|
|
616
|
-
function
|
611
|
+
function _isAccessManaged(address target)
|
617
612
|
internal
|
618
|
-
|
613
|
+
view
|
614
|
+
returns (bool)
|
619
615
|
{
|
616
|
+
if (!ContractLib.isContract(target)) {
|
617
|
+
return false;
|
618
|
+
}
|
619
|
+
|
620
|
+
(bool success, ) = target.staticcall(
|
621
|
+
abi.encodeWithSelector(
|
622
|
+
IAccessManagedChecker.authority.selector));
|
623
|
+
|
624
|
+
return success;
|
625
|
+
}
|
626
|
+
|
627
|
+
|
628
|
+
function _setTargetClosed(address target, bool locked)
|
629
|
+
internal
|
630
|
+
{
|
631
|
+
_checkTarget(target);
|
632
|
+
|
633
|
+
// target locked/unlocked already
|
634
|
+
if(_authority.isTargetClosed(target) == locked) {
|
635
|
+
revert ErrorTargetAlreadyLocked(target, locked);
|
636
|
+
}
|
637
|
+
|
620
638
|
_authority.setTargetClosed(target, locked);
|
621
639
|
}
|
622
640
|
|
641
|
+
function _getAccountName(address account) internal view returns (string memory) {
|
642
|
+
if (targetExists(account)) {
|
643
|
+
return _targetInfo[account].name.toString();
|
644
|
+
}
|
645
|
+
return "<unknown-account>";
|
646
|
+
}
|
647
|
+
|
623
648
|
|
624
649
|
function _getRoleName(RoleId roleId) internal view returns (string memory) {
|
625
650
|
if (roleExists(roleId)) {
|
@@ -629,25 +654,7 @@ contract AccessAdmin is
|
|
629
654
|
}
|
630
655
|
|
631
656
|
|
632
|
-
function
|
633
|
-
address authorization,
|
634
|
-
ObjectType expectedDomain,
|
635
|
-
VersionPart expectedRelease,
|
636
|
-
bool checkAlreadyInitialized
|
637
|
-
)
|
638
|
-
internal
|
639
|
-
view
|
640
|
-
{
|
641
|
-
AccessAdminLib.checkAuthorization(
|
642
|
-
address(_authorization),
|
643
|
-
authorization,
|
644
|
-
expectedDomain,
|
645
|
-
expectedRelease,
|
646
|
-
checkAlreadyInitialized);
|
647
|
-
}
|
648
|
-
|
649
|
-
|
650
|
-
function _checkRoleExists(
|
657
|
+
function _checkRoleExists(
|
651
658
|
RoleId roleId,
|
652
659
|
bool onlyActiveRole
|
653
660
|
)
|
@@ -655,50 +662,28 @@ contract AccessAdmin is
|
|
655
662
|
view
|
656
663
|
{
|
657
664
|
if (!roleExists(roleId)) {
|
658
|
-
revert
|
665
|
+
revert ErrorRoleUnknown(roleId);
|
659
666
|
}
|
660
667
|
|
661
668
|
uint64 roleIdInt = RoleId.unwrap(roleId);
|
662
669
|
if (roleIdInt == _authority.ADMIN_ROLE()) {
|
663
|
-
revert
|
670
|
+
revert ErrorRoleIsLocked(roleId);
|
664
671
|
}
|
665
672
|
|
666
673
|
// check if role is disabled
|
667
674
|
if (onlyActiveRole && _roleInfo[roleId].pausedAt <= TimestampLib.blockTimestamp()) {
|
668
|
-
revert
|
675
|
+
revert ErrorRoleIsPaused(roleId);
|
669
676
|
}
|
670
677
|
}
|
671
678
|
|
672
679
|
|
673
|
-
|
674
680
|
/// @dev check if target exists and reverts if it doesn't
|
675
|
-
function
|
676
|
-
address target
|
677
|
-
)
|
681
|
+
function _checkTarget(address target)
|
678
682
|
internal
|
679
683
|
view
|
680
684
|
{
|
681
|
-
// check not yet created
|
682
685
|
if (!targetExists(target)) {
|
683
|
-
revert
|
684
|
-
}
|
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);
|
686
|
+
revert ErrorTargetUnknown(target);
|
702
687
|
}
|
703
688
|
}
|
704
689
|
}
|