@etherisc/gif-next 0.0.2-f15b559-661 → 0.0.2-f1b01e0-214
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +43 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +38 -38
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -26
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +6 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +366 -251
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +8 -39
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +101 -28
- 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 +283 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +37 -5
- 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 +32 -145
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +101 -46
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -87
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +160 -89
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +56 -52
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +1 -87
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +68 -5
- 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 +44 -74
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +94 -124
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +101 -46
- 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 +82 -173
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +20 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +69 -112
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +95 -138
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +101 -46
- 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 +104 -8
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +62 -13
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +119 -26
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +520 -413
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +101 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +225 -196
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +94 -65
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -36
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +356 -346
- 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 +20 -20
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -35
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +98 -35
- 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 -21
- 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 -21
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -42
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -31
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +22 -43
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +101 -46
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +64 -64
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -39
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +6 -6
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +10 -31
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +18 -18
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +10 -31
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +34 -34
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +80 -80
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +41 -41
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +90 -24
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -22
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +27 -48
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +101 -46
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -50
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +42 -0
- 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 +21 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +21 -42
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +21 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +62 -62
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +32 -32
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +41 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +63 -82
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -51
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +21 -42
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +55 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +27 -23
- 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 +445 -355
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +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 +481 -376
- 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 +128 -124
- 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/Component.sol/Component.json +0 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +114 -129
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +45 -49
- 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 +60 -4
- 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 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +44 -51
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -21
- 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/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -21
- 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 +83 -39
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +75 -4
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +133 -94
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- 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 +41 -37
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +109 -30
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +27 -23
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +10 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +93 -37
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- 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/UFixed.sol/UFixedLib.json +60 -36
- 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 +56 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +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/IAccountingService.sol +2 -2
- package/contracts/authorization/AccessAdmin.sol +201 -186
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +40 -31
- package/contracts/authorization/Authorization.sol +61 -33
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +63 -36
- package/contracts/authorization/IAuthorization.sol +6 -0
- package/contracts/distribution/BasicDistribution.sol +6 -6
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +3 -48
- package/contracts/distribution/DistributionService.sol +57 -30
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +4 -2
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FireProduct.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +0 -4
- package/contracts/instance/IInstance.sol +45 -9
- package/contracts/instance/IInstanceService.sol +19 -3
- package/contracts/instance/Instance.sol +73 -16
- package/contracts/instance/InstanceAdmin.sol +120 -107
- package/contracts/instance/InstanceAuthorizationV3.sol +43 -21
- package/contracts/instance/InstanceReader.sol +13 -0
- package/contracts/instance/InstanceService.sol +128 -73
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +16 -5
- package/contracts/instance/module/IDistribution.sol +19 -7
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +0 -2
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +0 -2
- package/contracts/pool/PoolService.sol +1 -3
- package/contracts/product/ApplicationService.sol +21 -6
- package/contracts/product/BasicProduct.sol +0 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +3 -0
- package/contracts/product/PolicyService.sol +0 -18
- package/contracts/product/PricingService.sol +11 -6
- package/contracts/product/Product.sol +0 -2
- package/contracts/product/RiskService.sol +10 -0
- package/contracts/registry/IRegistry.sol +4 -0
- package/contracts/registry/RegistryAdmin.sol +133 -229
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/ReleaseAdmin.sol +30 -22
- package/contracts/registry/ReleaseRegistry.sol +39 -33
- package/contracts/registry/ServiceAuthorizationV3.sol +87 -3
- package/contracts/shared/Component.sol +13 -30
- package/contracts/shared/ComponentService.sol +58 -42
- package/contracts/shared/ContractLib.sol +28 -0
- package/contracts/shared/IComponent.sol +0 -3
- package/contracts/shared/IComponentService.sol +9 -9
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +0 -2
- package/contracts/shared/NftOwnable.sol +1 -1
- package/contracts/shared/Registerable.sol +1 -4
- package/contracts/shared/TokenHandler.sol +5 -4
- package/contracts/staking/IStaking.sol +12 -2
- package/contracts/staking/IStakingService.sol +8 -1
- package/contracts/staking/Staking.sol +35 -15
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +79 -22
- package/contracts/staking/StakingReader.sol +5 -15
- package/contracts/staking/StakingService.sol +36 -2
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/ObjectType.sol +5 -14
- package/contracts/type/UFixed.sol +27 -10
- package/contracts/type/Version.sol +39 -0
- package/package.json +2 -2
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
@@ -5,10 +5,15 @@ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/acce
|
|
5
5
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
6
6
|
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
|
7
7
|
|
8
|
-
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
9
|
-
import {ContractLib} from "../shared/ContractLib.sol";
|
10
8
|
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
9
|
+
import {IAuthorization} from "./IAuthorization.sol";
|
11
10
|
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
+
|
12
|
+
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
13
|
+
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
14
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
15
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
16
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
12
17
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
13
18
|
import {Selector, SelectorLib, SelectorSetLib} from "../type/Selector.sol";
|
14
19
|
import {Str, StrLib} from "../type/String.sol";
|
@@ -34,13 +39,23 @@ contract AccessAdmin is
|
|
34
39
|
string public constant ADMIN_ROLE_NAME = "AdminRole";
|
35
40
|
string public constant PUBLIC_ROLE_NAME = "PublicRole";
|
36
41
|
|
37
|
-
/// @dev
|
42
|
+
/// @dev admin name used for logging only
|
43
|
+
string internal _adminName;
|
44
|
+
|
45
|
+
/// @dev the access manager driving the access admin contract
|
46
|
+
/// hold link to registry and release version
|
38
47
|
AccessManagerCloneable internal _authority;
|
39
48
|
|
49
|
+
/// @dev the authorization contract used for initial access control
|
50
|
+
IAuthorization internal _authorization;
|
51
|
+
|
40
52
|
/// @dev stores the deployer address and allows to create initializers
|
41
53
|
/// that are restricted to the deployer address.
|
42
54
|
address internal _deployer;
|
43
55
|
|
56
|
+
/// @dev the linked NFT ID
|
57
|
+
NftId internal _linkedNftId;
|
58
|
+
|
44
59
|
/// @dev store role info per role id
|
45
60
|
mapping(RoleId roleId => RoleInfo info) internal _roleInfo;
|
46
61
|
|
@@ -79,23 +94,25 @@ contract AccessAdmin is
|
|
79
94
|
}
|
80
95
|
|
81
96
|
if (msg.sender != _deployer) {
|
82
|
-
revert
|
97
|
+
revert ErrorAccessAdminNotDeployer();
|
83
98
|
}
|
84
99
|
_;
|
85
100
|
}
|
86
101
|
|
87
|
-
modifier
|
102
|
+
modifier onlyRoleMember(RoleId roleId, address account) {
|
88
103
|
_checkRoleExists(roleId, false);
|
89
104
|
|
90
|
-
if (!
|
91
|
-
revert
|
105
|
+
if (!hasRole(account, roleId)) {
|
106
|
+
revert ErrorAccessAdminNotRoleOwner(roleId, account);
|
92
107
|
}
|
93
108
|
_;
|
94
109
|
}
|
95
110
|
|
96
|
-
modifier
|
97
|
-
|
98
|
-
|
111
|
+
modifier onlyRoleAdmin(RoleId roleId, address account) {
|
112
|
+
_checkRoleExists(roleId, false);
|
113
|
+
|
114
|
+
if (!hasAdminRole(account, roleId)) {
|
115
|
+
revert ErrorAccessAdminNotAdminOfRole(_roleInfo[roleId].adminRoleId, account);
|
99
116
|
}
|
100
117
|
_;
|
101
118
|
}
|
@@ -113,7 +130,7 @@ contract AccessAdmin is
|
|
113
130
|
}
|
114
131
|
|
115
132
|
modifier onlyExistingTarget(address target) {
|
116
|
-
|
133
|
+
_checkTargetExists(target);
|
117
134
|
_;
|
118
135
|
}
|
119
136
|
|
@@ -124,34 +141,61 @@ contract AccessAdmin is
|
|
124
141
|
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
125
142
|
/// Internally initializes access manager with this admin and creates basic role setup.
|
126
143
|
function initialize(
|
127
|
-
|
144
|
+
address authority,
|
145
|
+
string memory adminName
|
128
146
|
)
|
129
147
|
public
|
130
148
|
initializer()
|
131
149
|
{
|
132
|
-
__AccessAdmin_init(authority);
|
150
|
+
__AccessAdmin_init(authority, adminName);
|
133
151
|
}
|
134
152
|
|
135
153
|
|
136
154
|
function __AccessAdmin_init(
|
137
|
-
|
155
|
+
address authority,
|
156
|
+
string memory adminName
|
138
157
|
)
|
139
158
|
internal
|
140
159
|
onlyInitializing()
|
141
|
-
onlyDeployer()
|
160
|
+
onlyDeployer()
|
142
161
|
{
|
143
|
-
|
162
|
+
// checks
|
163
|
+
// check authority is contract
|
164
|
+
if (!ContractLib.isContract(authority)) {
|
165
|
+
revert ErrorAccessAdminAuthorityNotContract(authority);
|
166
|
+
}
|
144
167
|
|
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
|
145
182
|
// set and initialize this access manager contract as
|
146
183
|
// the admin (ADMIN_ROLE) of the provided authority
|
147
|
-
__AccessManaged_init(
|
148
|
-
|
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();
|
149
191
|
|
150
192
|
// create admin and public roles
|
151
193
|
_initializeAdminAndPublicRoles();
|
194
|
+
}
|
152
195
|
|
153
|
-
|
154
|
-
|
196
|
+
|
197
|
+
function getRelease() public view virtual returns (VersionPart release) {
|
198
|
+
return _authority.getRelease();
|
155
199
|
}
|
156
200
|
|
157
201
|
|
@@ -160,46 +204,24 @@ contract AccessAdmin is
|
|
160
204
|
}
|
161
205
|
|
162
206
|
|
163
|
-
function
|
164
|
-
return
|
207
|
+
function getLinkedNftId() external view returns (NftId linkedNftId) {
|
208
|
+
return _linkedNftId;
|
165
209
|
}
|
166
210
|
|
167
211
|
|
168
|
-
function
|
169
|
-
|
170
|
-
|
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}));
|
212
|
+
function getLinkedOwner() external view returns (address linkedOwner) {
|
213
|
+
return getRegistry().ownerOf(_linkedNftId);
|
214
|
+
}
|
183
215
|
|
184
|
-
// add this contract as admin role member
|
185
|
-
_roleMembers[adminRoleId].add(address(this));
|
186
216
|
|
187
|
-
|
188
|
-
|
189
|
-
PUBLIC_ROLE(),
|
190
|
-
toRole({
|
191
|
-
adminRoleId: ADMIN_ROLE(),
|
192
|
-
roleType: RoleType.Gif,
|
193
|
-
maxMemberCount: type(uint32).max,
|
194
|
-
name: PUBLIC_ROLE_NAME}));
|
217
|
+
function getAuthorization() public view returns (IAuthorization authorization) {
|
218
|
+
return _authorization;
|
195
219
|
}
|
196
220
|
|
197
221
|
|
198
|
-
function
|
199
|
-
|
200
|
-
|
201
|
-
onlyInitializing()
|
202
|
-
{ }
|
222
|
+
function isLocked() public view returns (bool locked) {
|
223
|
+
return _authority.isLocked();
|
224
|
+
}
|
203
225
|
|
204
226
|
//--- view functions for roles ------------------------------------------//
|
205
227
|
|
@@ -223,12 +245,12 @@ contract AccessAdmin is
|
|
223
245
|
return _roleInfo[roleId].createdAt.gtz();
|
224
246
|
}
|
225
247
|
|
226
|
-
function
|
227
|
-
return
|
248
|
+
function getRoleForName(string memory name) external view returns (RoleId roleId) {
|
249
|
+
return _roleForName[StrLib.toStr(name)].roleId;
|
228
250
|
}
|
229
251
|
|
230
|
-
function
|
231
|
-
return
|
252
|
+
function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory) {
|
253
|
+
return _roleInfo[roleId];
|
232
254
|
}
|
233
255
|
|
234
256
|
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers) {
|
@@ -305,33 +327,59 @@ contract AccessAdmin is
|
|
305
327
|
selector.toBytes4()));
|
306
328
|
}
|
307
329
|
|
308
|
-
function
|
309
|
-
|
330
|
+
function deployer() public view returns (address) {
|
331
|
+
return _deployer;
|
310
332
|
}
|
311
333
|
|
312
|
-
|
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
|
-
});
|
321
|
-
}
|
334
|
+
//--- internal/private functions -------------------------------------------------//
|
322
335
|
|
323
|
-
function
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
336
|
+
function _linkToNftOwnable(address registerable) internal {
|
337
|
+
if (!getRegistry().isRegistered(registerable)) {
|
338
|
+
revert ErrorAccessAdminNotRegistered(registerable);
|
339
|
+
}
|
340
|
+
|
341
|
+
_linkedNftId = getRegistry().getNftIdForAddress(registerable);
|
328
342
|
}
|
329
343
|
|
330
|
-
function
|
331
|
-
|
344
|
+
function _initializeAdminAndPublicRoles()
|
345
|
+
internal
|
346
|
+
virtual
|
347
|
+
onlyInitializing()
|
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}));
|
332
371
|
}
|
333
372
|
|
334
|
-
|
373
|
+
function _createTargetWithRole(
|
374
|
+
address target,
|
375
|
+
string memory targetName,
|
376
|
+
RoleId targetRoleId
|
377
|
+
)
|
378
|
+
internal
|
379
|
+
{
|
380
|
+
_createTarget(target, targetName, true, false);
|
381
|
+
_grantRoleToAccount(targetRoleId, target);
|
382
|
+
}
|
335
383
|
|
336
384
|
function _authorizeTargetFunctions(
|
337
385
|
address target,
|
@@ -341,7 +389,7 @@ contract AccessAdmin is
|
|
341
389
|
internal
|
342
390
|
{
|
343
391
|
if (roleId == getAdminRole()) {
|
344
|
-
revert
|
392
|
+
revert ErrorAccessAdminAuthorizeForAdminRoleInvalid(target);
|
345
393
|
}
|
346
394
|
|
347
395
|
(
|
@@ -430,13 +478,15 @@ contract AccessAdmin is
|
|
430
478
|
functionSelectors,
|
431
479
|
RoleId.unwrap(roleId));
|
432
480
|
|
481
|
+
// log function grantings
|
433
482
|
for (uint256 i = 0; i < functionSelectors.length; i++) {
|
434
483
|
emit LogAccessAdminFunctionGranted(
|
484
|
+
_adminName,
|
435
485
|
target,
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
486
|
+
string(abi.encodePacked(
|
487
|
+
functionNames[i],
|
488
|
+
"(): ",
|
489
|
+
_getRoleName(roleId))));
|
440
490
|
}
|
441
491
|
}
|
442
492
|
|
@@ -448,7 +498,7 @@ contract AccessAdmin is
|
|
448
498
|
{
|
449
499
|
// check max role members will not be exceeded
|
450
500
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
451
|
-
revert
|
501
|
+
revert ErrorAccessAdminRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
452
502
|
}
|
453
503
|
|
454
504
|
// check account is contract for contract role
|
@@ -456,7 +506,7 @@ contract AccessAdmin is
|
|
456
506
|
_roleInfo[roleId].roleType == RoleType.Contract &&
|
457
507
|
!ContractLib.isContract(account) // will fail in account's constructor
|
458
508
|
) {
|
459
|
-
revert
|
509
|
+
revert ErrorAccessAdminRoleMemberNotContract(roleId, account);
|
460
510
|
}
|
461
511
|
|
462
512
|
// TODO check account already have roleId
|
@@ -466,7 +516,7 @@ contract AccessAdmin is
|
|
466
516
|
account,
|
467
517
|
0);
|
468
518
|
|
469
|
-
emit LogAccessAdminRoleGranted(account, _getRoleName(roleId));
|
519
|
+
emit LogAccessAdminRoleGranted(_adminName, account, _getRoleName(roleId));
|
470
520
|
}
|
471
521
|
|
472
522
|
/// @dev revoke the specified role from the provided account
|
@@ -477,7 +527,7 @@ contract AccessAdmin is
|
|
477
527
|
|
478
528
|
// check role removal is permitted
|
479
529
|
if (_roleInfo[roleId].roleType == RoleType.Contract) {
|
480
|
-
revert
|
530
|
+
revert ErrorAccessAdminRoleMemberRemovalDisabled(roleId, account);
|
481
531
|
}
|
482
532
|
|
483
533
|
// TODO check account have roleId?
|
@@ -486,7 +536,7 @@ contract AccessAdmin is
|
|
486
536
|
RoleId.unwrap(roleId),
|
487
537
|
account);
|
488
538
|
|
489
|
-
emit LogAccessAdminRoleRevoked(account, _roleInfo[roleId].name.toString());
|
539
|
+
emit LogAccessAdminRoleRevoked(_adminName, account, _roleInfo[roleId].name.toString());
|
490
540
|
}
|
491
541
|
|
492
542
|
|
@@ -498,32 +548,21 @@ contract AccessAdmin is
|
|
498
548
|
)
|
499
549
|
internal
|
500
550
|
{
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
roleId,
|
505
|
-
_roleInfo[roleId].name.toString());
|
506
|
-
}
|
507
|
-
|
508
|
-
// check admin role exists
|
509
|
-
if(!roleExists(info.adminRoleId)) {
|
510
|
-
revert ErrorRoleAdminNotExisting(info.adminRoleId);
|
511
|
-
}
|
512
|
-
|
513
|
-
// check role name is not empty
|
514
|
-
if(info.name.length() == 0) {
|
515
|
-
revert ErrorRoleNameEmpty(roleId);
|
516
|
-
}
|
551
|
+
AccessAdminLib.checkRoleCreation(this, roleId, info);
|
552
|
+
_createRoleUnchecked(roleId, info);
|
553
|
+
}
|
517
554
|
|
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
555
|
|
526
|
-
|
556
|
+
function _createTarget(
|
557
|
+
address target,
|
558
|
+
string memory targetName,
|
559
|
+
bool checkAuthority,
|
560
|
+
bool custom
|
561
|
+
)
|
562
|
+
internal
|
563
|
+
{
|
564
|
+
AccessAdminLib.checkTargetCreation(this, target, targetName, checkAuthority);
|
565
|
+
_createTargetUnchecked(target, targetName, custom);
|
527
566
|
}
|
528
567
|
|
529
568
|
|
@@ -545,53 +584,19 @@ contract AccessAdmin is
|
|
545
584
|
// add role to list of roles
|
546
585
|
_roleIds.push(roleId);
|
547
586
|
|
548
|
-
emit LogAccessAdminRoleCreated(roleId, info.roleType, info.adminRoleId, info.name.toString());
|
587
|
+
emit LogAccessAdminRoleCreated(_adminName, roleId, info.roleType, info.adminRoleId, info.name.toString());
|
549
588
|
}
|
550
589
|
|
551
590
|
|
552
|
-
function
|
591
|
+
function _createTargetUnchecked(
|
553
592
|
address target,
|
554
593
|
string memory targetName,
|
555
|
-
bool checkAuthority,
|
556
594
|
bool custom
|
557
595
|
)
|
558
596
|
internal
|
559
597
|
{
|
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
|
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
598
|
// create target info
|
599
|
+
Str name = StrLib.toStr(targetName);
|
595
600
|
_targetInfo[target] = TargetInfo({
|
596
601
|
name: name,
|
597
602
|
isCustom: custom,
|
@@ -604,47 +609,17 @@ contract AccessAdmin is
|
|
604
609
|
// add role to list of roles
|
605
610
|
_targets.push(target);
|
606
611
|
|
607
|
-
emit LogAccessAdminTargetCreated(target, targetName);
|
612
|
+
emit LogAccessAdminTargetCreated(_adminName, target, targetName);
|
608
613
|
}
|
609
614
|
|
610
615
|
|
611
|
-
function
|
612
|
-
internal
|
613
|
-
view
|
614
|
-
returns (bool)
|
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)
|
616
|
+
function _setTargetLocked(address target, bool locked)
|
629
617
|
internal
|
618
|
+
onlyExistingTarget(target)
|
630
619
|
{
|
631
|
-
_checkTarget(target);
|
632
|
-
|
633
|
-
// target locked/unlocked already
|
634
|
-
if(_authority.isTargetClosed(target) == locked) {
|
635
|
-
revert ErrorTargetAlreadyLocked(target, locked);
|
636
|
-
}
|
637
|
-
|
638
620
|
_authority.setTargetClosed(target, locked);
|
639
621
|
}
|
640
622
|
|
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
|
-
|
648
623
|
|
649
624
|
function _getRoleName(RoleId roleId) internal view returns (string memory) {
|
650
625
|
if (roleExists(roleId)) {
|
@@ -654,7 +629,25 @@ contract AccessAdmin is
|
|
654
629
|
}
|
655
630
|
|
656
631
|
|
657
|
-
function
|
632
|
+
function _checkAuthorization(
|
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(
|
658
651
|
RoleId roleId,
|
659
652
|
bool onlyActiveRole
|
660
653
|
)
|
@@ -662,28 +655,50 @@ contract AccessAdmin is
|
|
662
655
|
view
|
663
656
|
{
|
664
657
|
if (!roleExists(roleId)) {
|
665
|
-
revert
|
658
|
+
revert ErrorAccessAdminRoleUnknown(roleId);
|
666
659
|
}
|
667
660
|
|
668
661
|
uint64 roleIdInt = RoleId.unwrap(roleId);
|
669
662
|
if (roleIdInt == _authority.ADMIN_ROLE()) {
|
670
|
-
revert
|
663
|
+
revert ErrorAccessAdminRoleIsLocked(roleId);
|
671
664
|
}
|
672
665
|
|
673
666
|
// check if role is disabled
|
674
667
|
if (onlyActiveRole && _roleInfo[roleId].pausedAt <= TimestampLib.blockTimestamp()) {
|
675
|
-
revert
|
668
|
+
revert ErrorAccessAdminRoleIsPaused(roleId);
|
676
669
|
}
|
677
670
|
}
|
678
671
|
|
679
672
|
|
673
|
+
|
680
674
|
/// @dev check if target exists and reverts if it doesn't
|
681
|
-
function
|
675
|
+
function _checkTargetExists(
|
676
|
+
address target
|
677
|
+
)
|
682
678
|
internal
|
683
679
|
view
|
684
680
|
{
|
681
|
+
// check not yet created
|
685
682
|
if (!targetExists(target)) {
|
686
|
-
revert
|
683
|
+
revert ErrorAccessAdminTargetNotCreated(target);
|
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);
|
687
702
|
}
|
688
703
|
}
|
689
704
|
}
|