@etherisc/gif-next 0.0.2-bb3faee-097 → 0.0.2-bb9ecaf-723
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -320
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +49 -29
- 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 +201 -130
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +845 -126
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +73 -46
- 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 +105 -77
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -2
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +12 -2
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +38 -32
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +8 -18
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +93 -54
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +0 -10
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +2 -2
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +79 -59
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -10
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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 +20 -30
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +93 -54
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +64 -74
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +93 -54
- 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 +21 -31
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +93 -54
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +16 -26
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +24 -34
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +93 -54
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +25 -35
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +93 -54
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +50 -228
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +23 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +20 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +70 -35
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +335 -284
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +82 -112
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +55 -175
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +40 -20
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +45 -25
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1362 -2115
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +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/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 +6 -16
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +87 -48
- 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 +0 -10
- 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/Oracle.sol/Oracle.json +0 -10
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +54 -34
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -10
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +93 -54
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +66 -46
- 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/IPoolComponent.sol/IPoolComponent.json +0 -10
- 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/Pool.sol/Pool.json +0 -10
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +2 -2
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +67 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +48 -28
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -10
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +93 -54
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +74 -74
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +71 -51
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +0 -10
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +64 -44
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +55 -35
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +0 -10
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -26
- 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 +312 -217
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +126 -63
- 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 +41 -21
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +330 -211
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +98 -86
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +62 -40
- 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/Component.sol/Component.json +0 -10
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +28 -28
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +65 -45
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- 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/IComponent.sol/IComponent.json +0 -10
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -10
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -10
- 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/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 +0 -10
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +22 -48
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +50 -38
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +44 -24
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +198 -166
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- 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/Blocknumber.sol/BlocknumberLib.json +21 -2
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- 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/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- 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/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +22 -6
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +220 -321
- package/contracts/authorization/AccessAdminLib.sol +309 -27
- package/contracts/authorization/AccessManagerCloneable.sol +0 -18
- package/contracts/authorization/Authorization.sol +30 -9
- package/contracts/authorization/IAccess.sol +13 -14
- package/contracts/authorization/IAccessAdmin.sol +9 -11
- package/contracts/authorization/ServiceAuthorization.sol +10 -30
- package/contracts/distribution/BasicDistribution.sol +1 -2
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +2 -4
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +11 -0
- package/contracts/instance/IInstanceService.sol +2 -0
- package/contracts/instance/Instance.sol +18 -14
- package/contracts/instance/InstanceAdmin.sol +43 -119
- package/contracts/instance/InstanceAuthorizationV3.sol +49 -40
- package/contracts/instance/InstanceReader.sol +33 -59
- package/contracts/instance/InstanceService.sol +57 -43
- package/contracts/instance/InstanceStore.sol +153 -128
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/module/IComponents.sol +0 -2
- package/contracts/oracle/BasicOracle.sol +1 -2
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/Oracle.sol +2 -4
- package/contracts/pool/BasicPool.sol +1 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +2 -4
- package/contracts/product/ApplicationService.sol +2 -2
- package/contracts/product/BasicProduct.sol +1 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/ClaimService.sol +49 -53
- package/contracts/product/PolicyService.sol +9 -9
- package/contracts/product/Product.sol +2 -4
- package/contracts/product/RiskService.sol +3 -4
- package/contracts/registry/RegistryAdmin.sol +12 -30
- package/contracts/registry/RegistryAuthorization.sol +32 -31
- package/contracts/registry/ReleaseAdmin.sol +13 -9
- package/contracts/shared/Component.sol +2 -6
- package/contracts/shared/ComponentService.sol +22 -18
- package/contracts/shared/InstanceLinkedComponent.sol +2 -4
- package/contracts/staking/IStaking.sol +0 -1
- package/contracts/staking/Staking.sol +6 -6
- package/contracts/staking/StakingStore.sol +6 -0
- package/contracts/type/Blocknumber.sol +4 -9
- package/contracts/upgradeability/ProxyManager.sol +2 -2
- package/package.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -538
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/KeyValueStore.sol +0 -131
@@ -7,13 +7,15 @@ import {IAccess} from "./IAccess.sol";
|
|
7
7
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
8
8
|
import {IAuthorization} from "./IAuthorization.sol";
|
9
9
|
import {IComponent} from "../shared/IComponent.sol";
|
10
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
10
11
|
import {IRegistry} from "../registry/IRegistry.sol";
|
11
12
|
import {IService} from "../shared/IService.sol";
|
12
13
|
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
13
14
|
|
15
|
+
import {BlocknumberLib} from "../type/Blocknumber.sol";
|
14
16
|
import {ContractLib} from "../shared/ContractLib.sol";
|
15
17
|
import {ObjectType} from "../type/ObjectType.sol";
|
16
|
-
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
18
|
+
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
17
19
|
import {SelectorLib} from "../type/Selector.sol";
|
18
20
|
import {Str, StrLib} from "../type/String.sol";
|
19
21
|
import {TimestampLib} from "../type/Timestamp.sol";
|
@@ -40,6 +42,126 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
40
42
|
uint64 public constant CUSTOM_ROLE_MIN = 1000000;
|
41
43
|
|
42
44
|
|
45
|
+
function ADMIN_ROLE_NAME() public pure returns (string memory) {
|
46
|
+
return "AdminRole";
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
function isAdminRoleName(string memory name) public pure returns (bool) {
|
51
|
+
return StrLib.eq(name, ADMIN_ROLE_NAME());
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
function PUBLIC_ROLE_NAME() public pure returns (string memory) {
|
56
|
+
return "PublicRole";
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
function getAdminRole() public pure returns (RoleId adminRoleId) {
|
61
|
+
// see oz AccessManagerUpgradeable
|
62
|
+
return RoleId.wrap(type(uint64).min);
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
function getPublicRole() public pure returns (RoleId publicRoleId) {
|
67
|
+
// see oz AccessManagerUpgradeable
|
68
|
+
return RoleId.wrap(type(uint64).max);
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
function isAdminOrPublicRole(string memory name)
|
73
|
+
public
|
74
|
+
view
|
75
|
+
returns (bool)
|
76
|
+
{
|
77
|
+
return StrLib.eq(name, ADMIN_ROLE_NAME())
|
78
|
+
|| StrLib.eq(name, PUBLIC_ROLE_NAME());
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
function isDynamicRoleId(RoleId roleId)
|
83
|
+
public
|
84
|
+
pure
|
85
|
+
returns (bool)
|
86
|
+
{
|
87
|
+
return roleId.toInt() >= COMPONENT_ROLE_MIN;
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
function adminRoleInfo()
|
92
|
+
public
|
93
|
+
view
|
94
|
+
returns (IAccess.RoleInfo memory)
|
95
|
+
{
|
96
|
+
return roleInfo(
|
97
|
+
getAdminRole(),
|
98
|
+
IAccess.TargetType.Core,
|
99
|
+
1,
|
100
|
+
ADMIN_ROLE_NAME());
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
function publicRoleInfo()
|
105
|
+
public
|
106
|
+
view
|
107
|
+
returns (IAccess.RoleInfo memory)
|
108
|
+
{
|
109
|
+
return roleInfo(
|
110
|
+
getAdminRole(),
|
111
|
+
IAccess.TargetType.Custom,
|
112
|
+
type(uint32).max,
|
113
|
+
PUBLIC_ROLE_NAME());
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
function coreRoleInfo(string memory name)
|
118
|
+
public
|
119
|
+
view
|
120
|
+
returns (IAccess.RoleInfo memory)
|
121
|
+
{
|
122
|
+
return roleInfo(
|
123
|
+
getAdminRole(),
|
124
|
+
IAccess.TargetType.Core,
|
125
|
+
1,
|
126
|
+
name);
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
function serviceRoleInfo(string memory serviceName)
|
131
|
+
public
|
132
|
+
view
|
133
|
+
returns (IAccess.RoleInfo memory)
|
134
|
+
{
|
135
|
+
return roleInfo(
|
136
|
+
getAdminRole(),
|
137
|
+
IAccess.TargetType.Service,
|
138
|
+
1,
|
139
|
+
serviceName);
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
/// @dev Creates a role info object from the provided parameters
|
144
|
+
function roleInfo(
|
145
|
+
RoleId adminRoleId,
|
146
|
+
IAccess.TargetType targetType,
|
147
|
+
uint32 maxMemberCount,
|
148
|
+
string memory roleName
|
149
|
+
)
|
150
|
+
public
|
151
|
+
view
|
152
|
+
returns (IAccess.RoleInfo memory info)
|
153
|
+
{
|
154
|
+
return IAccess.RoleInfo({
|
155
|
+
name: StrLib.toStr(roleName),
|
156
|
+
adminRoleId: adminRoleId,
|
157
|
+
targetType: targetType,
|
158
|
+
maxMemberCount: maxMemberCount,
|
159
|
+
createdAt: TimestampLib.current(),
|
160
|
+
pausedAt: TimestampLib.max(),
|
161
|
+
lastUpdateIn: BlocknumberLib.current()});
|
162
|
+
}
|
163
|
+
|
164
|
+
|
43
165
|
function getSelectors(
|
44
166
|
IAccess.FunctionInfo[] memory functions
|
45
167
|
)
|
@@ -57,16 +179,42 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
57
179
|
}
|
58
180
|
|
59
181
|
|
182
|
+
function checkInitParameters(
|
183
|
+
address authority,
|
184
|
+
string memory adminName
|
185
|
+
)
|
186
|
+
public
|
187
|
+
view
|
188
|
+
{
|
189
|
+
// only contract check (authority might not yet be initialized at this time)
|
190
|
+
if (!ContractLib.isContract(authority)) {
|
191
|
+
revert IAccessAdmin.ErrorAccessAdminAuthorityNotContract(authority);
|
192
|
+
}
|
193
|
+
|
194
|
+
// check name not empty
|
195
|
+
if (bytes(adminName).length == 0) {
|
196
|
+
revert IAccessAdmin.ErrorAccessAdminAccessManagerEmptyName();
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
|
60
201
|
function checkRoleCreation(
|
61
202
|
IAccessAdmin accessAdmin,
|
62
203
|
RoleId roleId,
|
63
|
-
IAccess.RoleInfo memory info
|
204
|
+
IAccess.RoleInfo memory info,
|
205
|
+
bool revertOnExistingRole
|
64
206
|
)
|
65
207
|
public
|
66
208
|
view
|
209
|
+
returns (bool isAdminOrPublicRole)
|
67
210
|
{
|
68
|
-
// check
|
69
|
-
if(
|
211
|
+
// check
|
212
|
+
if (roleId == ADMIN_ROLE() || roleId == PUBLIC_ROLE()) {
|
213
|
+
return true;
|
214
|
+
}
|
215
|
+
|
216
|
+
// check role does not yet exist
|
217
|
+
if(revertOnExistingRole && accessAdmin.roleExists(roleId)) {
|
70
218
|
revert IAccessAdmin.ErrorAccessAdminRoleAlreadyCreated(
|
71
219
|
roleId,
|
72
220
|
accessAdmin.getRoleInfo(roleId).name.toString());
|
@@ -83,16 +231,54 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
83
231
|
}
|
84
232
|
|
85
233
|
// check role name is not used for another role
|
86
|
-
RoleId roleIdForName = accessAdmin.getRoleForName(StrLib.toString(info.name));
|
87
|
-
if(
|
234
|
+
(RoleId roleIdForName, bool exists) = accessAdmin.getRoleForName(StrLib.toString(info.name));
|
235
|
+
if(revertOnExistingRole && exists) {
|
88
236
|
revert IAccessAdmin.ErrorAccessAdminRoleNameAlreadyExists(
|
89
237
|
roleId,
|
90
238
|
info.name.toString(),
|
91
239
|
roleIdForName);
|
92
240
|
}
|
241
|
+
|
242
|
+
return false;
|
93
243
|
}
|
94
244
|
|
95
245
|
|
246
|
+
function checkRoleExists(
|
247
|
+
IAccessAdmin accessAdmin,
|
248
|
+
RoleId roleId,
|
249
|
+
bool onlyActiveRole,
|
250
|
+
bool allowAdminAndPublicRoles
|
251
|
+
)
|
252
|
+
internal
|
253
|
+
view
|
254
|
+
{
|
255
|
+
// check role exists
|
256
|
+
if (!accessAdmin.roleExists(roleId)) {
|
257
|
+
revert IAccessAdmin.ErrorAccessAdminRoleUnknown(roleId);
|
258
|
+
}
|
259
|
+
|
260
|
+
// if onlyActiveRoles: check if role is disabled
|
261
|
+
if (onlyActiveRole && accessAdmin.getRoleInfo(roleId).pausedAt <= TimestampLib.current()) {
|
262
|
+
revert IAccessAdmin.ErrorAccessAdminRoleIsPaused(roleId);
|
263
|
+
}
|
264
|
+
|
265
|
+
// if not allowAdminAndPublicRoles, check if role is admin or public role
|
266
|
+
if (!allowAdminAndPublicRoles) {
|
267
|
+
checkNotAdminOrPublicRole(roleId);
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
|
272
|
+
function checkNotAdminOrPublicRole(RoleId roleId) public pure {
|
273
|
+
if (roleId == ADMIN_ROLE()) {
|
274
|
+
revert IAccessAdmin.ErrorAccessAdminInvalidUseOfAdminRole();
|
275
|
+
}
|
276
|
+
|
277
|
+
if (roleId == PUBLIC_ROLE()) {
|
278
|
+
revert IAccessAdmin.ErrorAccessAdminInvalidUseOfPublicRole();
|
279
|
+
}
|
280
|
+
}
|
281
|
+
|
96
282
|
function checkTargetCreation(
|
97
283
|
IAccessAdmin accessAdmin,
|
98
284
|
address target,
|
@@ -139,6 +325,73 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
139
325
|
}
|
140
326
|
|
141
327
|
|
328
|
+
function checkComponentInitialization(
|
329
|
+
IAccessAdmin accessAdmin,
|
330
|
+
IAuthorization instanceAuthorization,
|
331
|
+
address componentAddress,
|
332
|
+
ObjectType expectedType
|
333
|
+
)
|
334
|
+
public
|
335
|
+
view
|
336
|
+
returns (IAuthorization componentAuthorization)
|
337
|
+
{
|
338
|
+
checkIsRegistered(address(accessAdmin.getRegistry()), componentAddress, expectedType);
|
339
|
+
|
340
|
+
VersionPart expecteRelease = accessAdmin.getRelease();
|
341
|
+
IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
|
342
|
+
componentAuthorization = component.getAuthorization();
|
343
|
+
|
344
|
+
checkAuthorization(
|
345
|
+
address(instanceAuthorization),
|
346
|
+
address(componentAuthorization),
|
347
|
+
expectedType,
|
348
|
+
expecteRelease,
|
349
|
+
false, // expectServiceAuthorization,
|
350
|
+
false); // checkAlreadyInitialized
|
351
|
+
}
|
352
|
+
|
353
|
+
|
354
|
+
function checkTargetAndRoleForFunctions(
|
355
|
+
IAccessAdmin accessAdmin,
|
356
|
+
address target,
|
357
|
+
RoleId roleId,
|
358
|
+
bool onlyComponentOrContractTargets
|
359
|
+
)
|
360
|
+
public
|
361
|
+
view
|
362
|
+
{
|
363
|
+
// check target exists
|
364
|
+
IAccess.TargetType targetType = accessAdmin.getTargetInfo(target).targetType;
|
365
|
+
if (targetType == IAccess.TargetType.Undefined) {
|
366
|
+
revert IAccessAdmin.ErrorAccessAdminTargetNotCreated(target);
|
367
|
+
}
|
368
|
+
|
369
|
+
// check target type
|
370
|
+
if (onlyComponentOrContractTargets) {
|
371
|
+
if (targetType != IAccess.TargetType.Component && targetType != IAccess.TargetType.Contract) {
|
372
|
+
revert IAccessAdmin.ErrorAccessAdminNotComponentOrCustomTarget(target);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
|
376
|
+
// check role exist
|
377
|
+
checkRoleExists(accessAdmin, roleId, true, true);
|
378
|
+
}
|
379
|
+
|
380
|
+
|
381
|
+
function checkTargetExists(
|
382
|
+
IAccessAdmin accessAdmin,
|
383
|
+
address target
|
384
|
+
)
|
385
|
+
public
|
386
|
+
view
|
387
|
+
{
|
388
|
+
// check not yet created
|
389
|
+
if (!accessAdmin.targetExists(target)) {
|
390
|
+
revert IAccessAdmin.ErrorAccessAdminTargetNotCreated(target);
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
|
142
395
|
function checkAuthorization(
|
143
396
|
address authorizationOld,
|
144
397
|
address authorization,
|
@@ -214,6 +467,20 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
214
467
|
}
|
215
468
|
|
216
469
|
|
470
|
+
function getAuthorizedRole(
|
471
|
+
IAccessAdmin accessAdmin,
|
472
|
+
IAuthorization authorization,
|
473
|
+
RoleId roleId
|
474
|
+
)
|
475
|
+
public
|
476
|
+
view
|
477
|
+
returns (RoleId authorizedRoleId)
|
478
|
+
{
|
479
|
+
string memory roleName = authorization.getRoleInfo(roleId).name.toString();
|
480
|
+
(authorizedRoleId, ) = accessAdmin.getRoleForName(roleName);
|
481
|
+
}
|
482
|
+
|
483
|
+
|
217
484
|
function getServiceRoleId(
|
218
485
|
address serviceAddress,
|
219
486
|
IAccess.TargetType serviceTargetType
|
@@ -302,7 +569,9 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
302
569
|
return RoleIdLib.toRoleId(COMPONENT_ROLE_MIN + index);
|
303
570
|
}
|
304
571
|
|
305
|
-
if (targetType == IAccess.TargetType.Custom
|
572
|
+
if (targetType == IAccess.TargetType.Custom
|
573
|
+
|| targetType == IAccess.TargetType.Contract)
|
574
|
+
{
|
306
575
|
return RoleIdLib.toRoleId(CUSTOM_ROLE_MIN + index);
|
307
576
|
}
|
308
577
|
|
@@ -342,32 +611,44 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
342
611
|
}
|
343
612
|
|
344
613
|
|
345
|
-
function
|
614
|
+
function toFunctionGrantingString(
|
615
|
+
IAccessAdmin accessAdmin,
|
616
|
+
Str functionName,
|
617
|
+
RoleId roleId
|
618
|
+
)
|
619
|
+
public
|
620
|
+
view
|
621
|
+
returns (string memory)
|
622
|
+
{
|
346
623
|
return string(
|
347
624
|
abi.encodePacked(
|
348
|
-
|
349
|
-
|
625
|
+
functionName.toString(),
|
626
|
+
"(): ",
|
627
|
+
getRoleName(accessAdmin, roleId)));
|
350
628
|
}
|
351
629
|
|
352
630
|
|
353
|
-
function
|
354
|
-
|
355
|
-
|
356
|
-
uint32 maxMemberCount,
|
357
|
-
string memory name
|
631
|
+
function getRoleName(
|
632
|
+
IAccessAdmin accessAdmin,
|
633
|
+
RoleId roleId
|
358
634
|
)
|
359
|
-
public
|
635
|
+
public
|
360
636
|
view
|
361
|
-
returns (
|
362
|
-
{
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
637
|
+
returns (string memory)
|
638
|
+
{
|
639
|
+
if (accessAdmin.roleExists(roleId)) {
|
640
|
+
return accessAdmin.getRoleInfo(roleId).name.toString();
|
641
|
+
}
|
642
|
+
|
643
|
+
return "<unknown-role>";
|
644
|
+
}
|
645
|
+
|
646
|
+
|
647
|
+
function toRoleName(string memory name) public pure returns (string memory) {
|
648
|
+
return string(
|
649
|
+
abi.encodePacked(
|
650
|
+
name,
|
651
|
+
ROLE_SUFFIX));
|
371
652
|
}
|
372
653
|
|
373
654
|
|
@@ -390,7 +671,8 @@ library AccessAdminLib { // ACCESS_ADMIN_LIB
|
|
390
671
|
return IAccess.FunctionInfo({
|
391
672
|
name: StrLib.toStr(name),
|
392
673
|
selector: SelectorLib.toSelector(selector),
|
393
|
-
createdAt: TimestampLib.current()
|
674
|
+
createdAt: TimestampLib.current(),
|
675
|
+
lastUpdateIn: BlocknumberLib.current()});
|
394
676
|
}
|
395
677
|
|
396
678
|
}
|
@@ -62,24 +62,6 @@ contract AccessManagerCloneable is
|
|
62
62
|
_checkAndSetRelease(release);
|
63
63
|
}
|
64
64
|
|
65
|
-
// /// @dev Completes the setup of the access manager.
|
66
|
-
// /// Links the access manager to the registry and sets the release version.
|
67
|
-
// function completeSetup(
|
68
|
-
// address registry,
|
69
|
-
// VersionPart release,
|
70
|
-
// bool verifyRelease
|
71
|
-
// )
|
72
|
-
// public
|
73
|
-
// onlyAdminRole
|
74
|
-
// reinitializer(uint64(release.toInt()))
|
75
|
-
// {
|
76
|
-
// _checkAndSetRegistry(registry);
|
77
|
-
|
78
|
-
// if (verifyRelease) {
|
79
|
-
// _checkAndSetRelease(release);
|
80
|
-
// }
|
81
|
-
// }
|
82
|
-
|
83
65
|
/// @dev Returns true if the caller is authorized to call the target with the given selector and the manager lock is not set to locked.
|
84
66
|
/// Feturn values as in OpenZeppelin AccessManager.
|
85
67
|
/// For a locked manager the function reverts with ErrorAccessManagerTargetAdminLocked.
|
@@ -1,8 +1,10 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IAccess} from "./IAccess.sol";
|
4
5
|
import {IAuthorization} from "./IAuthorization.sol";
|
5
6
|
|
7
|
+
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
6
8
|
import {ObjectType} from "../type/ObjectType.sol";
|
7
9
|
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
8
10
|
import {ServiceAuthorization} from "../authorization/ServiceAuthorization.sol";
|
@@ -16,8 +18,10 @@ contract Authorization is
|
|
16
18
|
|
17
19
|
// MUST match with AccessAdminLib.COMPONENT_ROLE_MIN
|
18
20
|
uint64 public constant COMPONENT_ROLE_MIN = 110000;
|
21
|
+
uint64 public constant INSTANCE_ROLE_MIN = 100000;
|
19
22
|
|
20
23
|
uint64 internal _nextGifContractRoleId;
|
24
|
+
uint64 internal _nextInstanceContractRoleId;
|
21
25
|
|
22
26
|
string internal _tokenHandlerName = "ComponentTh";
|
23
27
|
Str internal _tokenHandlerTarget;
|
@@ -28,28 +32,35 @@ contract Authorization is
|
|
28
32
|
ObjectType domain,
|
29
33
|
uint8 release,
|
30
34
|
string memory commitHash,
|
31
|
-
|
35
|
+
IAccess.TargetType targetType,
|
32
36
|
bool includeTokenHandler
|
33
37
|
)
|
34
38
|
ServiceAuthorization(mainTargetName, domain, release, commitHash)
|
35
39
|
{
|
36
|
-
|
40
|
+
// IMPORTANT must match with AccessAdminLib.CORE_ROLE_MIN
|
41
|
+
_nextGifContractRoleId = 100;
|
42
|
+
_nextInstanceContractRoleId = INSTANCE_ROLE_MIN;
|
37
43
|
|
38
44
|
// setup main target
|
39
|
-
|
45
|
+
// special case: core targets
|
46
|
+
if (targetType == IAccess.TargetType.Core) {
|
47
|
+
_addGifTarget(_mainTargetName);
|
48
|
+
// special case instances
|
49
|
+
} else if (targetType == IAccess.TargetType.Instance) {
|
50
|
+
_addInstanceTarget(_mainTargetName);
|
51
|
+
// all other target types
|
52
|
+
} else {
|
40
53
|
if (domain.eqz()) {
|
41
54
|
revert ErrorAuthorizationTargetDomainZero();
|
42
55
|
}
|
43
56
|
|
44
57
|
RoleId mainRoleId = RoleIdLib.toRoleId(COMPONENT_ROLE_MIN);
|
45
|
-
string memory
|
58
|
+
string memory mainRoleName = _toTargetRoleName(_mainTargetName);
|
46
59
|
|
47
60
|
_addTargetWithRole(
|
48
61
|
_mainTargetName,
|
49
62
|
mainRoleId,
|
50
|
-
|
51
|
-
} else {
|
52
|
-
_addGifTarget(_mainTargetName);
|
63
|
+
mainRoleName);
|
53
64
|
}
|
54
65
|
|
55
66
|
// setup use case specific parts
|
@@ -120,9 +131,9 @@ contract Authorization is
|
|
120
131
|
function _addCustomRole(RoleId roleId, RoleId adminRoleId, uint32 maxMemberCount, string memory name) internal {
|
121
132
|
_addRole(
|
122
133
|
roleId,
|
123
|
-
|
134
|
+
AccessAdminLib.roleInfo(
|
124
135
|
adminRoleId,
|
125
|
-
|
136
|
+
TargetType.Custom,
|
126
137
|
maxMemberCount,
|
127
138
|
name));
|
128
139
|
}
|
@@ -141,6 +152,16 @@ contract Authorization is
|
|
141
152
|
contractRoleName);
|
142
153
|
}
|
143
154
|
|
155
|
+
/// @dev Add an instance target with its corresponding contract role
|
156
|
+
function _addInstanceTarget(string memory contractName) internal {
|
157
|
+
RoleId contractRoleId = RoleIdLib.toRoleId(_nextInstanceContractRoleId++);
|
158
|
+
string memory contractRoleName = _toTargetRoleName(contractName);
|
159
|
+
|
160
|
+
_addTargetWithRole(
|
161
|
+
contractName,
|
162
|
+
contractRoleId,
|
163
|
+
contractRoleName);
|
164
|
+
}
|
144
165
|
|
145
166
|
/// @dev Use this method to to add an authorized target.
|
146
167
|
function _addTarget(string memory name) internal {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: UNLICENSED
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Blocknumber} from "../type/Blocknumber.sol";
|
4
5
|
import {RoleId} from "../type/RoleId.sol";
|
5
6
|
import {Selector} from "../type/Selector.sol";
|
6
7
|
import {Str} from "../type/String.sol";
|
@@ -8,13 +9,6 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
8
9
|
|
9
10
|
interface IAccess {
|
10
11
|
|
11
|
-
enum RoleType {
|
12
|
-
Undefined, // no role must have this type
|
13
|
-
Core, // GIF core roles
|
14
|
-
Contract, // roles assigned to contracts, cannot be revoked
|
15
|
-
Custom // use case specific rules for components
|
16
|
-
}
|
17
|
-
|
18
12
|
enum TargetType {
|
19
13
|
Undefined, // no target must have this type
|
20
14
|
Core, // GIF core contracts
|
@@ -22,26 +16,30 @@ interface IAccess {
|
|
22
16
|
Service, // service contracts
|
23
17
|
Instance, // instance contracts
|
24
18
|
Component, // instance contracts
|
25
|
-
|
19
|
+
Contract, // normal contracts
|
20
|
+
Custom // use case specific rules for contracts or normal accounts
|
26
21
|
}
|
27
22
|
|
28
23
|
struct RoleInfo {
|
29
24
|
// slot 0
|
30
|
-
RoleId adminRoleId;
|
31
|
-
|
32
|
-
uint32 maxMemberCount;
|
33
|
-
Timestamp createdAt;
|
34
|
-
Timestamp pausedAt;
|
25
|
+
RoleId adminRoleId; // 64
|
26
|
+
TargetType targetType; // ?
|
27
|
+
uint32 maxMemberCount; // 32
|
28
|
+
Timestamp createdAt; // 40
|
29
|
+
Timestamp pausedAt; // 40
|
30
|
+
Blocknumber lastUpdateIn; // 40
|
35
31
|
// slot 1
|
36
|
-
Str name;
|
32
|
+
Str name; // 256
|
37
33
|
}
|
38
34
|
|
35
|
+
|
39
36
|
// TODO recalc slot allocation
|
40
37
|
struct TargetInfo {
|
41
38
|
Str name;
|
42
39
|
TargetType targetType;
|
43
40
|
RoleId roleId;
|
44
41
|
Timestamp createdAt;
|
42
|
+
Blocknumber lastUpdateIn;
|
45
43
|
}
|
46
44
|
|
47
45
|
struct FunctionInfo {
|
@@ -50,6 +48,7 @@ interface IAccess {
|
|
50
48
|
// slot 1
|
51
49
|
Selector selector; // function selector
|
52
50
|
Timestamp createdAt;
|
51
|
+
Blocknumber lastUpdateIn;
|
53
52
|
}
|
54
53
|
|
55
54
|
struct RoleNameInfo {
|
@@ -8,6 +8,7 @@ import {IAuthorization} from "./IAuthorization.sol";
|
|
8
8
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
9
9
|
import {IRelease} from "../registry/IRelease.sol";
|
10
10
|
|
11
|
+
import {Blocknumber} from "../type/Blocknumber.sol";
|
11
12
|
import {NftId} from "../type/NftId.sol";
|
12
13
|
import {ObjectType} from "../type/ObjectType.sol";
|
13
14
|
import {RoleId} from "../type/RoleId.sol";
|
@@ -23,12 +24,14 @@ interface IAccessAdmin is
|
|
23
24
|
{
|
24
25
|
|
25
26
|
// roles, targets and functions
|
26
|
-
event LogAccessAdminRoleCreated(string admin, RoleId roleId,
|
27
|
+
event LogAccessAdminRoleCreated(string admin, RoleId roleId, TargetType targetType, RoleId roleAdminId, string name);
|
27
28
|
event LogAccessAdminTargetCreated(string admin, string name, bool managed, address target, RoleId roleId);
|
28
29
|
|
30
|
+
event LogAccessAdminRoleActivatedSet(string admin, RoleId roleId, bool active, Blocknumber lastUpdateIn);
|
29
31
|
event LogAccessAdminRoleGranted(string admin, address account, string roleName);
|
30
32
|
event LogAccessAdminRoleRevoked(string admin, address account, string roleName);
|
31
|
-
event
|
33
|
+
event LogAccessAdminTargetLockedSet(string admin, address target, bool locked, Blocknumber lastUpdateIn);
|
34
|
+
event LogAccessAdminFunctionGranted(string admin, address target, string func, Blocknumber lastUpdateIn);
|
32
35
|
|
33
36
|
// only deployer modifier
|
34
37
|
error ErrorAccessAdminNotDeployer();
|
@@ -40,8 +43,8 @@ interface IAccessAdmin is
|
|
40
43
|
error ErrorAccessAdminNotRoleOwner(RoleId roleId, address account);
|
41
44
|
|
42
45
|
// role management
|
43
|
-
error
|
44
|
-
error
|
46
|
+
error ErrorAccessAdminInvalidUseOfAdminRole();
|
47
|
+
error ErrorAccessAdminInvalidUseOfPublicRole();
|
45
48
|
error ErrorAccessAdminRoleNotCustom(RoleId roleId);
|
46
49
|
|
47
50
|
// initialization
|
@@ -96,6 +99,7 @@ interface IAccessAdmin is
|
|
96
99
|
error ErrorAccessAdminTargetAlreadyLocked(address target, bool isLocked);
|
97
100
|
|
98
101
|
// authorize target functions
|
102
|
+
error ErrorAccessAdminNotComponentOrCustomTarget(address target);
|
99
103
|
error ErrorAccessAdminAuthorizeForAdminRoleInvalid(address target);
|
100
104
|
|
101
105
|
// toFunction
|
@@ -109,18 +113,14 @@ interface IAccessAdmin is
|
|
109
113
|
|
110
114
|
function getAuthorization() external view returns (IAuthorization authorization);
|
111
115
|
function getLinkedNftId() external view returns (NftId linkedNftId);
|
112
|
-
function getLinkedOwner() external view returns (address linkedOwner);
|
113
116
|
|
114
117
|
function isLocked() external view returns (bool locked);
|
115
118
|
|
116
119
|
function roles() external view returns (uint256 numberOfRoles);
|
117
120
|
function getRoleId(uint256 idx) external view returns (RoleId roleId);
|
118
|
-
function getAdminRole() external view returns (RoleId roleId);
|
119
|
-
function getPublicRole() external view returns (RoleId roleId);
|
120
121
|
|
121
122
|
function roleExists(RoleId roleId) external view returns (bool exists);
|
122
|
-
function
|
123
|
-
function getRoleForName(string memory name) external view returns (RoleId roleId);
|
123
|
+
function getRoleForName(string memory name) external view returns (RoleId roleId, bool exists);
|
124
124
|
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory roleInfo);
|
125
125
|
function isRoleActive(RoleId roleId) external view returns (bool isActive);
|
126
126
|
function isRoleCustom(RoleId roleId) external view returns (bool isCustom);
|
@@ -139,6 +139,4 @@ interface IAccessAdmin is
|
|
139
139
|
|
140
140
|
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions);
|
141
141
|
function getAuthorizedFunction(address target, uint256 idx) external view returns (FunctionInfo memory func, RoleId roleId);
|
142
|
-
|
143
|
-
function deployer() external view returns (address);
|
144
142
|
}
|