@etherisc/gif-next 0.0.2-f12cf4d-104 → 0.0.2-f13d67f-541
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +86 -312
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1075 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +810 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +843 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +729 -287
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +2008 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +438 -35
- 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 +560 -220
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +191 -21
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +256 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +426 -27
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +128 -218
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +427 -53
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +58 -137
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +555 -217
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +170 -82
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +37 -116
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +401 -78
- 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 +183 -138
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +401 -59
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +324 -260
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +426 -52
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/flight/FlightLib.sol/FlightLib.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightLib.sol/FlightLib.json +408 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.json +1198 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.json +849 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.json +1466 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.json +844 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.json +2185 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.json +844 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.json +376 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.json +901 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +214 -215
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +844 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +94 -110
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +196 -165
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +844 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +600 -306
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +844 -0
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +51 -229
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/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 +551 -50
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +415 -15
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +606 -112
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1121 -374
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +379 -68
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1136 -561
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +419 -82
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +100 -54
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1283 -1912
- 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 +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +866 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- 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 +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +77 -91
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +425 -54
- 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 +41 -55
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +56 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +61 -75
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +141 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +134 -50
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +102 -124
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +401 -59
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +298 -329
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +133 -97
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +200 -131
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +59 -73
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +333 -169
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +72 -86
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +565 -367
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +169 -69
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +313 -64
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +123 -47
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +193 -192
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +426 -52
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +292 -195
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +142 -94
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +268 -10
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +181 -19
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +160 -55
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +77 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +168 -167
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +258 -22
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +283 -195
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +153 -81
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +135 -126
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +118 -70
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +187 -186
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +326 -91
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +123 -47
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +54 -19
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +56 -3
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +92 -57
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +845 -489
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1137 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +71 -35
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +99 -43
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2271 -0
- 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 +398 -64
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +459 -26
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +120 -60
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +60 -60
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +269 -561
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +134 -86
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +525 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +41 -41
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +155 -382
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +41 -55
- 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/INftOwnable.sol/INftOwnable.json +19 -0
- 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/IRegisterable.sol/IRegisterable.json +139 -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/IService.sol/IService.json +56 -3
- 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 +60 -74
- 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 +21 -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/Registerable.sol/Registerable.json +137 -62
- 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/Service.sol/Service.json +51 -11
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1457 -145
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +214 -110
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1634 -275
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +149 -62
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +294 -177
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +253 -174
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +102 -50
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1632 -818
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +160 -88
- 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 +11 -11
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +64 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- 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 +94 -38
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +49 -50
- 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 +23 -4
- 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/RequestIdSet.sol/LibRequestIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/RequestIdSet.sol/LibRequestIdSet.json +33 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +42 -157
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +64 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +69 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +37 -5
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +61 -37
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +81 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +274 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +47 -0
- package/contracts/authorization/AccessAdmin.sol +389 -306
- package/contracts/authorization/AccessAdminLib.sol +678 -0
- package/contracts/authorization/AccessManagerCloneable.sol +128 -4
- package/contracts/authorization/Authorization.sol +161 -260
- package/contracts/authorization/IAccess.sol +29 -12
- package/contracts/authorization/IAccessAdmin.sol +89 -84
- package/contracts/authorization/IAuthorization.sol +9 -43
- package/contracts/authorization/IServiceAuthorization.sol +55 -17
- package/contracts/authorization/ServiceAuthorization.sol +228 -34
- package/contracts/distribution/BasicDistribution.sol +19 -18
- package/contracts/distribution/BasicDistributionAuthorization.sol +30 -10
- package/contracts/distribution/Distribution.sol +45 -85
- package/contracts/distribution/DistributionService.sol +192 -99
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +3 -10
- package/contracts/distribution/IDistributionService.sol +38 -24
- package/contracts/examples/fire/FirePool.sol +6 -6
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +15 -13
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/flight/FlightLib.sol +279 -0
- package/contracts/examples/flight/FlightOracle.sol +168 -0
- package/contracts/examples/flight/FlightOracleAuthorization.sol +34 -0
- package/contracts/examples/flight/FlightPool.sol +89 -0
- package/contracts/examples/flight/FlightPoolAuthorization.sol +37 -0
- package/contracts/examples/flight/FlightProduct.sol +470 -0
- package/contracts/examples/flight/FlightProductAuthorization.sol +44 -0
- package/contracts/examples/flight/FlightUSD.sol +26 -0
- package/contracts/examples/flight/originalV1.sol +396 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +34 -11
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -13
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +119 -27
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +109 -19
- package/contracts/instance/IInstanceService.sol +59 -11
- package/contracts/instance/Instance.sol +184 -65
- package/contracts/instance/InstanceAdmin.sol +221 -191
- package/contracts/instance/InstanceAuthorizationV3.sol +153 -72
- package/contracts/instance/InstanceReader.sol +447 -314
- package/contracts/instance/InstanceService.sol +305 -205
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +152 -116
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +126 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +6 -8
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +18 -8
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/oracle/BasicOracle.sol +3 -6
- package/contracts/oracle/BasicOracleAuthorization.sol +15 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/IOracleService.sol +12 -12
- package/contracts/oracle/Oracle.sol +5 -9
- package/contracts/oracle/OracleService.sol +98 -80
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +4 -18
- package/contracts/pool/BasicPoolAuthorization.sol +29 -16
- package/contracts/pool/BundleService.sol +66 -165
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +27 -51
- package/contracts/pool/IPoolService.sol +56 -58
- package/contracts/pool/Pool.sol +15 -29
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +221 -227
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +93 -25
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +4 -5
- package/contracts/product/BasicProductAuthorization.sol +33 -11
- package/contracts/product/ClaimService.sol +221 -209
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +28 -3
- package/contracts/product/IClaimService.sol +18 -5
- package/contracts/product/IPolicyService.sol +31 -11
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +25 -10
- package/contracts/product/PolicyService.sol +252 -302
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +52 -46
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +95 -36
- package/contracts/product/RiskService.sol +130 -37
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +23 -24
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +22 -11
- package/contracts/registry/RegistryAdmin.sol +94 -383
- package/contracts/registry/RegistryAuthorization.sol +337 -0
- package/contracts/registry/RegistryService.sol +4 -4
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +199 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +157 -117
- package/contracts/registry/ServiceAuthorizationV3.sol +193 -54
- package/contracts/registry/TokenRegistry.sol +61 -59
- package/contracts/shared/Component.sol +36 -55
- package/contracts/shared/ComponentService.sol +350 -438
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +260 -2
- package/contracts/shared/IComponent.sol +1 -10
- package/contracts/shared/IComponentService.sol +22 -41
- package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +15 -5
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +62 -35
- package/contracts/shared/NftOwnable.sol +8 -6
- package/contracts/shared/PolicyHolder.sol +4 -3
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +13 -30
- package/contracts/shared/TokenHandler.sol +45 -100
- package/contracts/staking/IStaking.sol +265 -72
- package/contracts/staking/IStakingService.sol +45 -75
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +502 -210
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +55 -84
- package/contracts/staking/StakingManager.sol +4 -3
- package/contracts/staking/StakingReader.sol +58 -77
- package/contracts/staking/StakingService.sol +62 -194
- package/contracts/staking/StakingServiceManager.sol +6 -4
- package/contracts/staking/StakingStore.sol +1093 -330
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +69 -46
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +17 -22
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +70 -68
- package/contracts/type/Referral.sol +6 -0
- package/contracts/type/RequestIdSet.sol +62 -0
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +63 -45
- package/contracts/type/Seconds.sol +23 -0
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/String.sol +42 -0
- package/contracts/type/Timestamp.sol +14 -8
- package/contracts/type/UFixed.sol +35 -127
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +27 -13
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +2 -2
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -474
- 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/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +0 -205
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/KeyValueStore.sol +0 -131
- package/contracts/staking/StakingLifecycle.sol +0 -23
@@ -3,15 +3,24 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
6
|
-
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
|
7
6
|
|
7
|
+
import {IAccess} from "./IAccess.sol";
|
8
|
+
import {IAccessAdmin} from "./IAccessAdmin.sol";
|
9
|
+
import {IAuthorization} from "./IAuthorization.sol";
|
10
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
11
|
+
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
12
|
+
|
13
|
+
import {AccessAdminLib} from "./AccessAdminLib.sol";
|
8
14
|
import {AccessManagerCloneable} from "./AccessManagerCloneable.sol";
|
15
|
+
import {Blocknumber, BlocknumberLib} from "../type/Blocknumber.sol";
|
9
16
|
import {ContractLib} from "../shared/ContractLib.sol";
|
10
|
-
import {
|
17
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
18
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
11
19
|
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
12
|
-
import {Selector,
|
20
|
+
import {Selector, SelectorSetLib} from "../type/Selector.sol";
|
13
21
|
import {Str, StrLib} from "../type/String.sol";
|
14
22
|
import {TimestampLib} from "../type/Timestamp.sol";
|
23
|
+
import {VersionPart} from "../type/Version.sol";
|
15
24
|
|
16
25
|
|
17
26
|
/**
|
@@ -21,20 +30,26 @@ import {TimestampLib} from "../type/Timestamp.sol";
|
|
21
30
|
*/
|
22
31
|
contract AccessAdmin is
|
23
32
|
AccessManagedUpgradeable,
|
24
|
-
ReentrancyGuardUpgradeable,
|
25
33
|
IAccessAdmin
|
26
34
|
{
|
27
35
|
using EnumerableSet for EnumerableSet.AddressSet;
|
28
36
|
|
29
|
-
|
30
|
-
string
|
37
|
+
/// @dev admin name used for logging only
|
38
|
+
string internal _adminName;
|
31
39
|
|
32
|
-
/// @dev the
|
40
|
+
/// @dev the access manager driving the access admin contract
|
41
|
+
/// hold link to registry and release version
|
33
42
|
AccessManagerCloneable internal _authority;
|
34
43
|
|
35
|
-
/// @dev
|
36
|
-
|
37
|
-
|
44
|
+
/// @dev the authorization contract used for initial access control
|
45
|
+
IAuthorization internal _authorization;
|
46
|
+
|
47
|
+
// /// @dev stores the deployer address and allows to create initializers
|
48
|
+
// /// that are restricted to the deployer address.
|
49
|
+
// address internal _deployer;
|
50
|
+
|
51
|
+
/// @dev the linked NFT ID
|
52
|
+
NftId internal _linkedNftId;
|
38
53
|
|
39
54
|
/// @dev store role info per role id
|
40
55
|
mapping(RoleId roleId => RoleInfo info) internal _roleInfo;
|
@@ -45,6 +60,9 @@ contract AccessAdmin is
|
|
45
60
|
/// @dev store array with all created roles
|
46
61
|
RoleId [] internal _roleIds;
|
47
62
|
|
63
|
+
// @dev target type specific role id counters
|
64
|
+
mapping(TargetType => uint64) internal _nextRoleId;
|
65
|
+
|
48
66
|
/// @dev store set of current role members for given role
|
49
67
|
mapping(RoleId roleId => EnumerableSet.AddressSet roleMembers) internal _roleMembers;
|
50
68
|
|
@@ -66,52 +84,92 @@ contract AccessAdmin is
|
|
66
84
|
/// @dev temporary dynamic functions array
|
67
85
|
bytes4[] private _functions;
|
68
86
|
|
69
|
-
modifier onlyDeployer() {
|
70
|
-
// special case for cloned AccessAdmin contracts
|
71
|
-
// IMPORTANT cloning and _initializeAuthority needs to be done in a single transaction
|
72
|
-
if (_deployer == address(0)) {
|
73
|
-
_deployer = msg.sender;
|
74
|
-
}
|
75
87
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
88
|
+
//-------------- initialization functions ------------------------------//
|
89
|
+
|
90
|
+
/// @dev Initializes this admin with the provided accessManager (and authorization specification).
|
91
|
+
/// Internally initializes access manager with this admin and creates basic role setup.
|
92
|
+
function initialize(
|
93
|
+
address authority,
|
94
|
+
string memory adminName
|
95
|
+
)
|
96
|
+
public
|
97
|
+
initializer()
|
98
|
+
{
|
99
|
+
__AccessAdmin_init(authority, adminName);
|
80
100
|
}
|
81
101
|
|
82
|
-
modifier onlyRoleAdmin(RoleId roleId) {
|
83
|
-
_checkRoleExists(roleId, false);
|
84
102
|
|
85
|
-
|
86
|
-
|
103
|
+
/// @dev Initializes this admin with the provided accessManager and name.
|
104
|
+
/// IMPORTANT
|
105
|
+
/// - cloning of an access admin and initialization MUST be done in the same tx.
|
106
|
+
/// - this function as well as any completeSetup functions MUST be called in the same tx.
|
107
|
+
function __AccessAdmin_init(
|
108
|
+
address authority,
|
109
|
+
string memory adminName
|
110
|
+
)
|
111
|
+
internal
|
112
|
+
onlyInitializing()
|
113
|
+
{
|
114
|
+
AccessAdminLib.checkInitParameters(authority, adminName);
|
115
|
+
_authority = AccessManagerCloneable(authority);
|
116
|
+
_authority.initialize(address(this));
|
117
|
+
|
118
|
+
// delayed additional check for authority after its initialization
|
119
|
+
if (!ContractLib.isAuthority(authority)) {
|
120
|
+
revert ErrorAccessAdminAccessManagerNotAccessManager(authority);
|
87
121
|
}
|
88
|
-
|
122
|
+
|
123
|
+
// effects
|
124
|
+
// set and initialize this access manager contract as
|
125
|
+
// the admin (ADMIN_ROLE) of the provided authority
|
126
|
+
__AccessManaged_init(authority);
|
127
|
+
|
128
|
+
// set name for logging
|
129
|
+
_adminName = adminName;
|
130
|
+
|
131
|
+
// set initial linked NFT ID to zero
|
132
|
+
_linkedNftId = NftIdLib.zero();
|
133
|
+
|
134
|
+
// setup admin role
|
135
|
+
_createRoleUnchecked(
|
136
|
+
ADMIN_ROLE(), AccessAdminLib.adminRoleInfo());
|
137
|
+
|
138
|
+
// add this contract as admin role member, as contract roles cannot be revoked
|
139
|
+
// and max member count is 1 for admin role this access admin contract will
|
140
|
+
// always be the only admin of the access manager.
|
141
|
+
_roleMembers[
|
142
|
+
RoleIdLib.toRoleId(_authority.ADMIN_ROLE())].add(address(this));
|
143
|
+
|
144
|
+
// setup public role
|
145
|
+
_createRoleUnchecked(
|
146
|
+
PUBLIC_ROLE(), AccessAdminLib.publicRoleInfo());
|
89
147
|
}
|
90
148
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
_;
|
149
|
+
//--- view functions for access admin ---------------------------------------//
|
150
|
+
|
151
|
+
function getRelease() public view virtual returns (VersionPart release) {
|
152
|
+
return _authority.getRelease();
|
96
153
|
}
|
97
154
|
|
98
|
-
|
99
|
-
|
100
|
-
|
155
|
+
|
156
|
+
function getRegistry() public view returns (IRegistry registry) {
|
157
|
+
return _authority.getRegistry();
|
101
158
|
}
|
102
159
|
|
103
|
-
|
104
|
-
|
105
|
-
|
160
|
+
|
161
|
+
function getLinkedNftId() external view returns (NftId linkedNftId) {
|
162
|
+
return _linkedNftId;
|
106
163
|
}
|
107
164
|
|
108
|
-
constructor() {
|
109
|
-
_deployer = msg.sender;
|
110
|
-
_authority = new AccessManagerCloneable();
|
111
|
-
_authority.initialize(address(this));
|
112
165
|
|
113
|
-
|
114
|
-
|
166
|
+
function getAuthorization() public view returns (IAuthorization authorization) {
|
167
|
+
return _authorization;
|
168
|
+
}
|
169
|
+
|
170
|
+
|
171
|
+
function isLocked() public view returns (bool locked) {
|
172
|
+
return _authority.isLocked();
|
115
173
|
}
|
116
174
|
|
117
175
|
//--- view functions for roles ------------------------------------------//
|
@@ -133,15 +191,28 @@ contract AccessAdmin is
|
|
133
191
|
}
|
134
192
|
|
135
193
|
function roleExists(RoleId roleId) public view returns (bool exists) {
|
136
|
-
return _roleInfo[roleId].
|
194
|
+
return _roleInfo[roleId].targetType != TargetType.Undefined;
|
137
195
|
}
|
138
196
|
|
139
|
-
function
|
197
|
+
function getRoleForName(string memory name) public view returns (RoleId roleId, bool exists) {
|
198
|
+
roleId = _roleForName[StrLib.toStr(name)].roleId;
|
199
|
+
exists = false;
|
200
|
+
|
201
|
+
if (roleId.gtz() || AccessAdminLib.isAdminRoleName(name)) {
|
202
|
+
exists = true;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
function getRoleInfo(RoleId roleId) public view returns (RoleInfo memory) {
|
140
207
|
return _roleInfo[roleId];
|
141
208
|
}
|
142
209
|
|
143
|
-
function
|
144
|
-
return
|
210
|
+
function isRoleActive(RoleId roleId) external view returns (bool isActive) {
|
211
|
+
return _roleInfo[roleId].pausedAt > TimestampLib.current();
|
212
|
+
}
|
213
|
+
|
214
|
+
function isRoleCustom(RoleId roleId) external view returns (bool isActive) {
|
215
|
+
return _roleInfo[roleId].targetType == TargetType.Custom;
|
145
216
|
}
|
146
217
|
|
147
218
|
function roleMembers(RoleId roleId) external view returns (uint256 numberOfMembers) {
|
@@ -152,20 +223,15 @@ contract AccessAdmin is
|
|
152
223
|
return _roleMembers[roleId].at(idx);
|
153
224
|
}
|
154
225
|
|
155
|
-
function
|
226
|
+
function isRoleMember(RoleId roleId, address account) public view returns (bool) {
|
156
227
|
(bool isMember, ) = _authority.hasRole(
|
157
228
|
RoleId.unwrap(roleId),
|
158
229
|
account);
|
159
230
|
return isMember;
|
160
231
|
}
|
161
232
|
|
162
|
-
function
|
163
|
-
|
164
|
-
virtual
|
165
|
-
view
|
166
|
-
returns (bool)
|
167
|
-
{
|
168
|
-
return hasRole(account, _roleInfo[roleId].adminRoleId);
|
233
|
+
function isRoleAdmin(RoleId roleId, address account) public virtual view returns (bool) {
|
234
|
+
return isRoleMember(_roleInfo[roleId].adminRoleId, account);
|
169
235
|
}
|
170
236
|
|
171
237
|
//--- view functions for targets ----------------------------------------//
|
@@ -182,7 +248,7 @@ contract AccessAdmin is
|
|
182
248
|
return _targets[idx];
|
183
249
|
}
|
184
250
|
|
185
|
-
function getTargetInfo(address target)
|
251
|
+
function getTargetInfo(address target) public view returns (TargetInfo memory targetInfo) {
|
186
252
|
return _targetInfo[target];
|
187
253
|
}
|
188
254
|
|
@@ -191,9 +257,11 @@ contract AccessAdmin is
|
|
191
257
|
}
|
192
258
|
|
193
259
|
function isTargetLocked(address target) public view returns (bool locked) {
|
194
|
-
return _authority.isTargetClosed(target);
|
260
|
+
return _authority.isLocked() || _authority.isTargetClosed(target);
|
195
261
|
}
|
196
262
|
|
263
|
+
//--- view functions for target functions -------------------------------//
|
264
|
+
|
197
265
|
function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions) {
|
198
266
|
return SelectorSetLib.size(_targetFunctions[target]);
|
199
267
|
}
|
@@ -217,380 +285,395 @@ contract AccessAdmin is
|
|
217
285
|
selector.toBytes4()));
|
218
286
|
}
|
219
287
|
|
220
|
-
function canCall(address caller, address target, Selector selector) external virtual view returns (bool can) {
|
221
|
-
(can, ) = _authority.canCall(caller, target, selector.toBytes4());
|
222
|
-
}
|
223
|
-
|
224
|
-
function toRole(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) public view returns (RoleInfo memory) {
|
225
|
-
return RoleInfo({
|
226
|
-
name: StrLib.toStr(name),
|
227
|
-
adminRoleId: adminRoleId,
|
228
|
-
roleType: roleType,
|
229
|
-
maxMemberCount: maxMemberCount,
|
230
|
-
createdAt: TimestampLib.blockTimestamp(),
|
231
|
-
pausedAt: TimestampLib.max()
|
232
|
-
});
|
233
|
-
}
|
234
288
|
|
235
|
-
function
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
function deployer() public view returns (address) {
|
243
|
-
return _deployer;
|
289
|
+
function getFunctionInfo(address target, Selector selector)
|
290
|
+
external
|
291
|
+
view
|
292
|
+
returns (FunctionInfo memory functionInfo)
|
293
|
+
{
|
294
|
+
return _functionInfo[target][selector];
|
244
295
|
}
|
245
296
|
|
246
297
|
//--- internal/private functions -------------------------------------------------//
|
247
298
|
|
248
|
-
function
|
249
|
-
|
250
|
-
|
251
|
-
FunctionInfo[] memory functions
|
252
|
-
)
|
253
|
-
internal
|
254
|
-
{
|
255
|
-
if (roleId == getAdminRole()) {
|
256
|
-
revert ErrorAuthorizeForAdminRoleInvalid(target);
|
299
|
+
function _linkToNftOwnable(address registerable) internal {
|
300
|
+
if (!getRegistry().isRegistered(registerable)) {
|
301
|
+
revert ErrorAccessAdminNotRegistered(registerable);
|
257
302
|
}
|
258
303
|
|
259
|
-
|
260
|
-
bytes4[] memory functionSelectors = _processFunctionSelectors(target, functions, addFunctions);
|
261
|
-
|
262
|
-
// apply authz via access manager
|
263
|
-
_grantRoleAccessToFunctions(target, roleId, functionSelectors);
|
304
|
+
_linkedNftId = getRegistry().getNftIdForAddress(registerable);
|
264
305
|
}
|
265
306
|
|
266
|
-
function _unauthorizeTargetFunctions(
|
267
|
-
address target,
|
268
|
-
FunctionInfo[] memory functions
|
269
|
-
)
|
270
|
-
internal
|
271
|
-
{
|
272
|
-
bool addFunctions = false;
|
273
|
-
bytes4[] memory functionSelectors = _processFunctionSelectors(target, functions, addFunctions);
|
274
|
-
_grantRoleAccessToFunctions(target, getAdminRole(), functionSelectors);
|
275
|
-
}
|
276
307
|
|
277
|
-
function
|
278
|
-
|
279
|
-
FunctionInfo[] memory functions,
|
280
|
-
bool addFunctions
|
308
|
+
function _createRoles(
|
309
|
+
IServiceAuthorization authorization
|
281
310
|
)
|
282
311
|
internal
|
283
|
-
returns (
|
284
|
-
bytes4[] memory functionSelectors
|
285
|
-
)
|
286
312
|
{
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
functionSelectors[i] = selector.toBytes4();
|
313
|
+
RoleId[] memory roles = authorization.getRoles();
|
314
|
+
|
315
|
+
for(uint256 i = 0; i < roles.length; i++) {
|
316
|
+
RoleId authzRoleId = roles[i];
|
317
|
+
IAccess.RoleInfo memory roleInfo = authorization.getRoleInfo(authzRoleId);
|
318
|
+
(RoleId roleId, bool exists) = getRoleForName(roleInfo.name.toString());
|
319
|
+
|
320
|
+
if (!exists) {
|
321
|
+
if (!AccessAdminLib.isDynamicRoleId(authzRoleId)) {
|
322
|
+
roleId = authzRoleId;
|
323
|
+
}
|
324
|
+
|
325
|
+
_createRole(
|
326
|
+
roleId,
|
327
|
+
roleInfo,
|
328
|
+
true);
|
329
|
+
}
|
305
330
|
}
|
306
331
|
}
|
307
332
|
|
308
|
-
|
309
|
-
|
333
|
+
|
334
|
+
/// @dev Creates a role based on the provided parameters.
|
335
|
+
/// Checks that the provided role and role id and role name not already used.
|
336
|
+
function _createRole(
|
337
|
+
RoleId roleId,
|
338
|
+
RoleInfo memory info,
|
339
|
+
bool revertOnExistingRole
|
310
340
|
)
|
311
341
|
internal
|
312
|
-
virtual
|
313
|
-
onlyInitializing()
|
314
|
-
onlyDeployer()
|
315
342
|
{
|
316
|
-
|
317
|
-
|
343
|
+
bool isAdminOrPublicRole = AccessAdminLib.checkRoleCreation(this, roleId, info, revertOnExistingRole);
|
344
|
+
if (!isAdminOrPublicRole) {
|
345
|
+
_createRoleUnchecked(roleId, info);
|
318
346
|
}
|
319
|
-
|
320
|
-
_authority = AccessManagerCloneable(authorityAddress);
|
321
|
-
__AccessManaged_init(address(_authority));
|
322
|
-
}
|
323
|
-
|
324
|
-
|
325
|
-
function _initializeAdminAndPublicRoles()
|
326
|
-
internal
|
327
|
-
virtual
|
328
|
-
onlyInitializing()
|
329
|
-
{
|
330
|
-
_createAdminAndPublicRoles();
|
331
347
|
}
|
332
348
|
|
333
349
|
|
334
|
-
|
335
|
-
|
336
|
-
|
350
|
+
function _createRoleUnchecked(
|
351
|
+
RoleId roleId,
|
352
|
+
RoleInfo memory info
|
353
|
+
)
|
354
|
+
private
|
337
355
|
{
|
338
|
-
|
356
|
+
// create role info
|
357
|
+
info.createdAt = TimestampLib.current();
|
358
|
+
info.pausedAt = TimestampLib.max();
|
359
|
+
_roleInfo[roleId] = info;
|
339
360
|
|
340
|
-
//
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
adminRoleId: ADMIN_ROLE(),
|
345
|
-
roleType: RoleType.Contract,
|
346
|
-
maxMemberCount: 1,
|
347
|
-
name: ADMIN_ROLE_NAME}));
|
361
|
+
// create role name info
|
362
|
+
_roleForName[info.name] = RoleNameInfo({
|
363
|
+
roleId: roleId,
|
364
|
+
exists: true});
|
348
365
|
|
349
|
-
// add
|
350
|
-
|
366
|
+
// add role to list of roles
|
367
|
+
_roleIds.push(roleId);
|
351
368
|
|
352
|
-
|
353
|
-
_createRoleUnchecked(
|
354
|
-
PUBLIC_ROLE(),
|
355
|
-
toRole({
|
356
|
-
adminRoleId: ADMIN_ROLE(),
|
357
|
-
roleType: RoleType.Gif,
|
358
|
-
maxMemberCount: type(uint32).max,
|
359
|
-
name: PUBLIC_ROLE_NAME}));
|
369
|
+
emit LogAccessAdminRoleCreated(_adminName, roleId, info.targetType, info.adminRoleId, info.name.toString());
|
360
370
|
}
|
361
371
|
|
362
372
|
|
363
|
-
/// @dev
|
364
|
-
|
365
|
-
|
366
|
-
RoleId roleId,
|
367
|
-
bytes4[] memory functionSelectors
|
368
|
-
)
|
373
|
+
/// @dev Activates or deactivates role.
|
374
|
+
/// The role activ property is indirectly controlled over the pausedAt timestamp.
|
375
|
+
function _setRoleActive(RoleId roleId, bool active)
|
369
376
|
internal
|
370
377
|
{
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
378
|
+
AccessAdminLib.checkRoleExists(this, roleId, false, false);
|
379
|
+
|
380
|
+
if (active) {
|
381
|
+
_roleInfo[roleId].pausedAt = TimestampLib.max();
|
382
|
+
} else {
|
383
|
+
_roleInfo[roleId].pausedAt = TimestampLib.current();
|
384
|
+
}
|
375
385
|
|
376
|
-
|
386
|
+
Blocknumber lastUpdateIn = _roleInfo[roleId].lastUpdateIn;
|
387
|
+
_roleInfo[roleId].lastUpdateIn = BlocknumberLib.current();
|
388
|
+
|
389
|
+
emit LogAccessAdminRoleActivatedSet(_adminName, roleId, active, lastUpdateIn);
|
377
390
|
}
|
378
391
|
|
379
392
|
|
380
393
|
/// @dev grant the specified role to the provided account
|
381
394
|
function _grantRoleToAccount(RoleId roleId, address account)
|
382
395
|
internal
|
383
|
-
onlyExistingRole(roleId, true)
|
384
396
|
{
|
397
|
+
AccessAdminLib.checkRoleExists(this, roleId, true, false);
|
398
|
+
|
385
399
|
// check max role members will not be exceeded
|
386
400
|
if (_roleMembers[roleId].length() >= _roleInfo[roleId].maxMemberCount) {
|
387
|
-
revert
|
401
|
+
revert ErrorAccessAdminRoleMembersLimitReached(roleId, _roleInfo[roleId].maxMemberCount);
|
388
402
|
}
|
389
403
|
|
390
404
|
// check account is contract for contract role
|
391
405
|
if (
|
392
|
-
_roleInfo[roleId].
|
406
|
+
_roleInfo[roleId].targetType != TargetType.Custom &&
|
393
407
|
!ContractLib.isContract(account) // will fail in account's constructor
|
394
408
|
) {
|
395
|
-
revert
|
409
|
+
revert ErrorAccessAdminRoleMemberNotContract(roleId, account);
|
396
410
|
}
|
397
411
|
|
398
|
-
//
|
412
|
+
// effects
|
399
413
|
_roleMembers[roleId].add(account);
|
400
414
|
_authority.grantRole(
|
401
415
|
RoleId.unwrap(roleId),
|
402
416
|
account,
|
403
417
|
0);
|
404
418
|
|
405
|
-
|
419
|
+
emit LogAccessAdminRoleGranted(
|
420
|
+
_adminName,
|
421
|
+
account,
|
422
|
+
AccessAdminLib.getRoleName(this, roleId));
|
406
423
|
}
|
407
424
|
|
425
|
+
|
408
426
|
/// @dev revoke the specified role from the provided account
|
409
427
|
function _revokeRoleFromAccount(RoleId roleId, address account)
|
410
428
|
internal
|
411
|
-
onlyExistingRole(roleId, false)
|
412
429
|
{
|
430
|
+
AccessAdminLib.checkRoleExists(this, roleId, false, false);
|
413
431
|
|
414
|
-
// check
|
415
|
-
if (_roleInfo[roleId].
|
416
|
-
revert
|
432
|
+
// check for attempt to revoke contract role
|
433
|
+
if (_roleInfo[roleId].targetType != TargetType.Custom) {
|
434
|
+
revert ErrorAccessAdminRoleMemberRemovalDisabled(roleId, account);
|
417
435
|
}
|
418
436
|
|
419
|
-
//
|
437
|
+
// effects
|
420
438
|
_roleMembers[roleId].remove(account);
|
421
439
|
_authority.revokeRole(
|
422
440
|
RoleId.unwrap(roleId),
|
423
441
|
account);
|
424
442
|
|
425
|
-
|
443
|
+
emit LogAccessAdminRoleRevoked(_adminName, account, _roleInfo[roleId].name.toString());
|
426
444
|
}
|
427
445
|
|
428
446
|
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
RoleInfo memory info
|
447
|
+
function _getOrCreateTargetRoleIdAndName(
|
448
|
+
address target,
|
449
|
+
string memory targetName,
|
450
|
+
TargetType targetType
|
434
451
|
)
|
435
452
|
internal
|
453
|
+
returns (
|
454
|
+
RoleId roleId,
|
455
|
+
string memory roleName,
|
456
|
+
bool exists
|
457
|
+
)
|
436
458
|
{
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
459
|
+
roleName = AccessAdminLib.toRoleName(targetName);
|
460
|
+
(roleId, exists) = getRoleForName(roleName);
|
461
|
+
|
462
|
+
if (exists) {
|
463
|
+
return (roleId, roleName, true);
|
464
|
+
}
|
465
|
+
|
466
|
+
// get roleId
|
467
|
+
if (targetType == TargetType.Service || targetType == TargetType.GenericService) {
|
468
|
+
roleId = AccessAdminLib.getServiceRoleId(target, targetType);
|
469
|
+
} else {
|
470
|
+
uint64 nextRoleId = _nextRoleId[targetType];
|
471
|
+
roleId = AccessAdminLib.getTargetRoleId(target, targetType, nextRoleId);
|
472
|
+
|
473
|
+
// increment target type specific role id counter
|
474
|
+
_nextRoleId[targetType]++;
|
442
475
|
}
|
443
|
-
|
444
|
-
// check admin role exists
|
445
|
-
if(!roleExists(info.adminRoleId)) {
|
446
|
-
revert ErrorRoleAdminNotExisting(info.adminRoleId);
|
447
|
-
}
|
448
|
-
|
449
|
-
// check role name is not empty
|
450
|
-
if(info.name.length() == 0) {
|
451
|
-
revert ErrorRoleNameEmpty(roleId);
|
452
|
-
}
|
453
|
-
|
454
|
-
// check role name is not used for another role
|
455
|
-
if(_roleForName[info.name].exists) {
|
456
|
-
revert ErrorRoleNameAlreadyExists(
|
457
|
-
roleId,
|
458
|
-
info.name.toString(),
|
459
|
-
_roleForName[info.name].roleId);
|
460
|
-
}
|
461
|
-
|
462
|
-
_createRoleUnchecked(roleId, info);
|
463
476
|
}
|
464
477
|
|
465
478
|
|
466
|
-
function
|
467
|
-
|
468
|
-
|
479
|
+
function _createTarget(
|
480
|
+
address target,
|
481
|
+
string memory targetName,
|
482
|
+
TargetType targetType,
|
483
|
+
bool checkAuthority
|
469
484
|
)
|
470
|
-
|
485
|
+
internal
|
486
|
+
returns (RoleId contractRoleId)
|
471
487
|
{
|
472
|
-
//
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
488
|
+
// checks
|
489
|
+
AccessAdminLib.checkTargetCreation(this, target, targetName, checkAuthority);
|
490
|
+
|
491
|
+
// effects
|
492
|
+
contractRoleId = _createTargetUnchecked(
|
493
|
+
target,
|
494
|
+
targetName,
|
495
|
+
targetType,
|
496
|
+
checkAuthority);
|
497
|
+
|
498
|
+
// deal with token handler, if applicable
|
499
|
+
(
|
500
|
+
address tokenHandler,
|
501
|
+
string memory tokenHandlerName
|
502
|
+
) = AccessAdminLib.getTokenHandler(target, targetName, targetType);
|
503
|
+
|
504
|
+
if (tokenHandler != address(0)) {
|
505
|
+
_createTargetUnchecked(
|
506
|
+
tokenHandler,
|
507
|
+
tokenHandlerName,
|
508
|
+
targetType,
|
509
|
+
checkAuthority);
|
510
|
+
}
|
485
511
|
}
|
486
512
|
|
487
513
|
|
488
|
-
|
514
|
+
/// @dev Creates a new target and a corresponding contract role.
|
515
|
+
/// The function assigns the role to the target and logs the creation.
|
516
|
+
function _createTargetUnchecked(
|
489
517
|
address target,
|
490
518
|
string memory targetName,
|
491
|
-
|
492
|
-
bool
|
519
|
+
TargetType targetType,
|
520
|
+
bool managed
|
493
521
|
)
|
494
522
|
internal
|
495
|
-
|
523
|
+
returns (RoleId targetRoleId)
|
496
524
|
{
|
497
|
-
//
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
if( _targetForName[name] != address(0)) {
|
512
|
-
revert ErrorTargetNameAlreadyExists(
|
513
|
-
target,
|
514
|
-
targetName,
|
515
|
-
_targetForName[name]);
|
516
|
-
}
|
517
|
-
|
518
|
-
// check target is an access managed contract
|
519
|
-
if (!ContractLib.isAccessManaged(target)) {
|
520
|
-
revert ErrorTargetNotAccessManaged(target);
|
521
|
-
}
|
522
|
-
|
523
|
-
// check target shares authority with this contract
|
524
|
-
if (checkAuthority) {
|
525
|
-
address targetAuthority = AccessManagedUpgradeable(target).authority();
|
526
|
-
if (targetAuthority != authority()) {
|
527
|
-
revert ErrorTargetAuthorityMismatch(authority(), targetAuthority);
|
528
|
-
}
|
525
|
+
// create target role (if not existing)
|
526
|
+
string memory roleName;
|
527
|
+
bool roleExists;
|
528
|
+
(targetRoleId, roleName, roleExists) = _getOrCreateTargetRoleIdAndName(target, targetName, targetType);
|
529
|
+
|
530
|
+
if (!roleExists) {
|
531
|
+
_createRole(
|
532
|
+
targetRoleId,
|
533
|
+
AccessAdminLib.roleInfo(
|
534
|
+
ADMIN_ROLE(),
|
535
|
+
targetType,
|
536
|
+
1,
|
537
|
+
roleName),
|
538
|
+
true); // revert on existing role
|
529
539
|
}
|
530
540
|
|
531
541
|
// create target info
|
542
|
+
Str name = StrLib.toStr(targetName);
|
532
543
|
_targetInfo[target] = TargetInfo({
|
533
544
|
name: name,
|
534
|
-
|
535
|
-
|
536
|
-
|
545
|
+
targetType: targetType,
|
546
|
+
roleId: targetRoleId,
|
547
|
+
createdAt: TimestampLib.current(),
|
548
|
+
lastUpdateIn: BlocknumberLib.current()});
|
537
549
|
|
538
550
|
// create name to target mapping
|
539
551
|
_targetForName[name] = target;
|
540
552
|
|
541
|
-
// add
|
553
|
+
// add target to list of targets
|
542
554
|
_targets.push(target);
|
543
555
|
|
544
|
-
|
556
|
+
// grant contract role to target
|
557
|
+
_grantRoleToAccount(targetRoleId, target);
|
558
|
+
|
559
|
+
emit LogAccessAdminTargetCreated(_adminName, targetName, managed, target, targetRoleId);
|
545
560
|
}
|
546
561
|
|
547
562
|
|
548
|
-
function
|
563
|
+
function _setTargetLocked(address target, bool locked)
|
549
564
|
internal
|
550
565
|
{
|
551
|
-
|
566
|
+
AccessAdminLib.checkTargetExists(this, target);
|
567
|
+
_authority.setTargetClosed(target, locked);
|
552
568
|
|
553
|
-
//
|
554
|
-
|
555
|
-
|
556
|
-
}
|
569
|
+
// logging
|
570
|
+
Blocknumber lastUpdateIn = _targetInfo[target].lastUpdateIn;
|
571
|
+
_targetInfo[target].lastUpdateIn = BlocknumberLib.current();
|
557
572
|
|
558
|
-
|
573
|
+
emit LogAccessAdminTargetLockedSet(_adminName, target, locked, lastUpdateIn);
|
559
574
|
}
|
560
575
|
|
561
576
|
|
562
|
-
|
577
|
+
/// @dev Authorize the functions of the target for the specified role.
|
578
|
+
function _authorizeFunctions(IAuthorization authorization, Str target, RoleId roleId)
|
579
|
+
internal
|
580
|
+
{
|
581
|
+
_authorizeTargetFunctions(
|
582
|
+
getTargetForName(target),
|
583
|
+
AccessAdminLib.getAuthorizedRole(
|
584
|
+
this,
|
585
|
+
authorization,
|
586
|
+
roleId),
|
587
|
+
authorization.getAuthorizedFunctions(
|
588
|
+
target,
|
589
|
+
roleId),
|
590
|
+
false,
|
591
|
+
true);
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
/// @dev Authorize the functions of the target for the specified role.
|
596
|
+
/// Flag addFunctions determines if functions are added or removed.
|
597
|
+
function _authorizeTargetFunctions(
|
598
|
+
address target,
|
563
599
|
RoleId roleId,
|
564
|
-
|
600
|
+
FunctionInfo[] memory functions,
|
601
|
+
bool onlyComponentOrContractTargets,
|
602
|
+
bool addFunctions
|
565
603
|
)
|
566
604
|
internal
|
567
|
-
view
|
568
605
|
{
|
569
|
-
|
570
|
-
|
606
|
+
// checks
|
607
|
+
AccessAdminLib.checkTargetAndRoleForFunctions(
|
608
|
+
this,
|
609
|
+
target,
|
610
|
+
roleId,
|
611
|
+
onlyComponentOrContractTargets);
|
612
|
+
|
613
|
+
if (addFunctions && roleId == getAdminRole()) {
|
614
|
+
revert ErrorAccessAdminAuthorizeForAdminRoleInvalid(target);
|
571
615
|
}
|
572
616
|
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
revert ErrorRoleIsLocked(roleId);
|
578
|
-
}
|
617
|
+
_authority.setTargetFunctionRole(
|
618
|
+
target,
|
619
|
+
AccessAdminLib.getSelectors(functions),
|
620
|
+
RoleId.unwrap(roleId));
|
579
621
|
|
580
|
-
//
|
581
|
-
|
582
|
-
|
622
|
+
// update function set and log function grantings
|
623
|
+
for (uint256 i = 0; i < functions.length; i++) {
|
624
|
+
_updateFunctionAccess(
|
625
|
+
target,
|
626
|
+
roleId,
|
627
|
+
functions[i],
|
628
|
+
addFunctions);
|
583
629
|
}
|
584
630
|
}
|
585
631
|
|
586
632
|
|
587
|
-
|
588
|
-
|
633
|
+
function _updateFunctionAccess(
|
634
|
+
address target,
|
635
|
+
RoleId roleId,
|
636
|
+
FunctionInfo memory func,
|
637
|
+
bool addFunction
|
638
|
+
)
|
639
|
+
internal
|
640
|
+
{
|
641
|
+
// update functions info
|
642
|
+
Selector selector = func.selector;
|
643
|
+
Blocknumber lastUpdateIn = _functionInfo[target][selector].lastUpdateIn;
|
644
|
+
|
645
|
+
// update function sets
|
646
|
+
if (addFunction) { SelectorSetLib.add(_targetFunctions[target], selector); }
|
647
|
+
else { SelectorSetLib.remove(_targetFunctions[target], selector); }
|
648
|
+
|
649
|
+
_functionInfo[target][selector] = func;
|
650
|
+
_functionInfo[target][selector].lastUpdateIn = BlocknumberLib.current();
|
651
|
+
|
652
|
+
// logging
|
653
|
+
emit LogAccessAdminFunctionGranted(
|
654
|
+
_adminName,
|
655
|
+
target,
|
656
|
+
AccessAdminLib.toFunctionGrantingString(this, func.name, roleId),
|
657
|
+
lastUpdateIn);
|
658
|
+
}
|
659
|
+
|
660
|
+
|
661
|
+
function _checkAuthorization(
|
662
|
+
address authorization,
|
663
|
+
ObjectType expectedDomain,
|
664
|
+
VersionPart expectedRelease,
|
665
|
+
bool expectServiceAuthorization,
|
666
|
+
bool checkAlreadyInitialized
|
667
|
+
)
|
589
668
|
internal
|
590
669
|
view
|
591
670
|
{
|
592
|
-
|
593
|
-
|
594
|
-
|
671
|
+
AccessAdminLib.checkAuthorization(
|
672
|
+
address(_authorization),
|
673
|
+
authorization,
|
674
|
+
expectedDomain,
|
675
|
+
expectedRelease,
|
676
|
+
expectServiceAuthorization,
|
677
|
+
checkAlreadyInitialized);
|
595
678
|
}
|
596
679
|
}
|