@etherisc/gif-next 0.0.2-bb3faee-097 → 0.0.2-bb9ecaf-723
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -320
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +49 -29
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +201 -130
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +845 -126
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +73 -46
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +105 -77
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -2
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +12 -2
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +38 -32
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +8 -18
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +93 -54
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +0 -10
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +2 -2
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +79 -59
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -10
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +20 -30
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +93 -54
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +64 -74
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +93 -54
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +21 -31
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +93 -54
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +16 -26
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +24 -34
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +93 -54
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +25 -35
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +93 -54
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +50 -228
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +23 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +20 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +70 -35
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +335 -284
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +82 -112
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +55 -175
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +40 -20
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +45 -25
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1362 -2115
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +6 -16
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +87 -48
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -10
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -10
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +54 -34
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -10
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +93 -54
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +66 -46
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +0 -10
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +0 -10
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +2 -2
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +67 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +48 -28
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -10
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +93 -54
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +74 -74
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +71 -51
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +0 -10
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +64 -44
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +55 -35
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +0 -10
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -26
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +312 -217
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +126 -63
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +41 -21
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +330 -211
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +98 -86
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +62 -40
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +0 -10
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +28 -28
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +65 -45
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -10
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -10
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -10
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +0 -10
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +22 -48
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +50 -38
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +44 -24
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +198 -166
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +21 -2
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +22 -6
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +220 -321
- package/contracts/authorization/AccessAdminLib.sol +309 -27
- package/contracts/authorization/AccessManagerCloneable.sol +0 -18
- package/contracts/authorization/Authorization.sol +30 -9
- package/contracts/authorization/IAccess.sol +13 -14
- package/contracts/authorization/IAccessAdmin.sol +9 -11
- package/contracts/authorization/ServiceAuthorization.sol +10 -30
- package/contracts/distribution/BasicDistribution.sol +1 -2
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +2 -4
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +11 -0
- package/contracts/instance/IInstanceService.sol +2 -0
- package/contracts/instance/Instance.sol +18 -14
- package/contracts/instance/InstanceAdmin.sol +43 -119
- package/contracts/instance/InstanceAuthorizationV3.sol +49 -40
- package/contracts/instance/InstanceReader.sol +33 -59
- package/contracts/instance/InstanceService.sol +57 -43
- package/contracts/instance/InstanceStore.sol +153 -128
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/module/IComponents.sol +0 -2
- package/contracts/oracle/BasicOracle.sol +1 -2
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/Oracle.sol +2 -4
- package/contracts/pool/BasicPool.sol +1 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +2 -4
- package/contracts/product/ApplicationService.sol +2 -2
- package/contracts/product/BasicProduct.sol +1 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/ClaimService.sol +49 -53
- package/contracts/product/PolicyService.sol +9 -9
- package/contracts/product/Product.sol +2 -4
- package/contracts/product/RiskService.sol +3 -4
- package/contracts/registry/RegistryAdmin.sol +12 -30
- package/contracts/registry/RegistryAuthorization.sol +32 -31
- package/contracts/registry/ReleaseAdmin.sol +13 -9
- package/contracts/shared/Component.sol +2 -6
- package/contracts/shared/ComponentService.sol +22 -18
- package/contracts/shared/InstanceLinkedComponent.sol +2 -4
- package/contracts/staking/IStaking.sol +0 -1
- package/contracts/staking/Staking.sol +6 -6
- package/contracts/staking/StakingStore.sol +6 -0
- package/contracts/type/Blocknumber.sol +4 -9
- package/contracts/upgradeability/ProxyManager.sol +2 -2
- package/package.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -538
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/KeyValueStore.sol +0 -131
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IAccess} from "../authorization/IAccess.sol";
|
5
5
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
6
|
-
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
7
6
|
import {IRegistry} from "../registry/IRegistry.sol";
|
8
7
|
import {IInstance} from "./IInstance.sol";
|
9
8
|
|
@@ -14,17 +13,12 @@ import {ObjectType, INSTANCE} from "../type/ObjectType.sol";
|
|
14
13
|
import {RoleId, ADMIN_ROLE} from "../type/RoleId.sol";
|
15
14
|
import {Str} from "../type/String.sol";
|
16
15
|
import {VersionPart} from "../type/Version.sol";
|
16
|
+
import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
|
17
17
|
|
18
18
|
|
19
19
|
contract InstanceAdmin is
|
20
20
|
AccessAdmin
|
21
21
|
{
|
22
|
-
string public constant INSTANCE_TARGET_NAME = "Instance";
|
23
|
-
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
24
|
-
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
25
|
-
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
26
|
-
string public constant RISK_SET_TARGET_NAME = "RiskSet";
|
27
|
-
|
28
22
|
// onlyInstanceService
|
29
23
|
error ErrorInstanceAdminNotInstanceService(address caller);
|
30
24
|
|
@@ -33,13 +27,9 @@ contract InstanceAdmin is
|
|
33
27
|
|
34
28
|
IInstance internal _instance;
|
35
29
|
IRegistry internal _registry;
|
36
|
-
VersionPart internal _release;
|
37
30
|
|
38
31
|
uint64 internal _customRoleIdNext;
|
39
32
|
|
40
|
-
mapping(address target => RoleId roleId) internal _targetRoleId;
|
41
|
-
uint64 internal _components;
|
42
|
-
|
43
33
|
|
44
34
|
modifier onlyInstanceService() {
|
45
35
|
if (msg.sender != _registry.getServiceAddress(INSTANCE(), getRelease())) {
|
@@ -48,6 +38,7 @@ contract InstanceAdmin is
|
|
48
38
|
_;
|
49
39
|
}
|
50
40
|
|
41
|
+
|
51
42
|
/// @dev Only used for master instance admin.
|
52
43
|
constructor(address accessManager) {
|
53
44
|
initialize(
|
@@ -67,45 +58,46 @@ contract InstanceAdmin is
|
|
67
58
|
)
|
68
59
|
external
|
69
60
|
reinitializer(uint64(release.toInt()))
|
70
|
-
onlyDeployer()
|
71
61
|
{
|
72
62
|
// checks
|
73
63
|
AccessAdminLib.checkIsRegistered(registry, instance, INSTANCE());
|
74
64
|
|
65
|
+
// effects
|
75
66
|
AccessManagerCloneable(
|
76
67
|
authority()).completeSetup(
|
77
68
|
registry,
|
78
69
|
release);
|
79
70
|
|
80
|
-
|
71
|
+
AccessAdminLib.checkAuthorization(
|
72
|
+
address(_authorization),
|
73
|
+
authorization,
|
74
|
+
INSTANCE(), // expectedDomain
|
75
|
+
release, // expectedRelease
|
76
|
+
false, // expectServiceAuthorization
|
77
|
+
true); // checkAlreadyInitialized
|
81
78
|
|
82
|
-
// effects
|
83
79
|
_registry = IRegistry(registry);
|
84
|
-
_release = release;
|
85
|
-
|
86
80
|
_instance = IInstance(instance);
|
87
81
|
_authorization = IAuthorization(authorization);
|
88
|
-
_components = 0;
|
89
82
|
_customRoleIdNext = 0;
|
90
83
|
|
91
84
|
// link nft ownability to instance
|
92
85
|
_linkToNftOwnable(instance);
|
93
86
|
|
87
|
+
// setup roles and services
|
88
|
+
_createRoles(_authorization);
|
89
|
+
_setupServices(_authorization);
|
90
|
+
|
94
91
|
// setup instance targets
|
95
92
|
_createInstanceTargets(_authorization.getMainTargetName());
|
96
93
|
|
97
|
-
// setup non-contract roles
|
98
|
-
_setupServiceRoles(_authorization);
|
99
|
-
_createRoles(_authorization);
|
100
|
-
|
101
94
|
// authorize functions of instance contracts
|
102
95
|
_createTargetAuthorizations(_authorization);
|
103
96
|
}
|
104
97
|
|
105
|
-
|
106
98
|
/// @dev grants the service roles to the service addresses based on the authorization specification.
|
107
99
|
/// Service addresses used for the granting are determined by the registry and the release of this instance.
|
108
|
-
function
|
100
|
+
function _setupServices(IAuthorization authorization)
|
109
101
|
internal
|
110
102
|
{
|
111
103
|
ObjectType[] memory serviceDomains = authorization.getServiceDomains();
|
@@ -113,21 +105,8 @@ contract InstanceAdmin is
|
|
113
105
|
for(uint256 i = 0; i < serviceDomains.length; i++) {
|
114
106
|
ObjectType serviceDomain = serviceDomains[i];
|
115
107
|
RoleId serviceRoleId = authorization.getServiceRole(serviceDomain);
|
116
|
-
|
117
|
-
|
118
|
-
// create service role if missing
|
119
|
-
if (!roleExists(serviceRoleId)) {
|
120
|
-
_createRole(
|
121
|
-
serviceRoleId,
|
122
|
-
AccessAdminLib.toRole(
|
123
|
-
ADMIN_ROLE(),
|
124
|
-
IAccess.RoleType.Contract,
|
125
|
-
1,
|
126
|
-
serviceRoleName));
|
127
|
-
}
|
108
|
+
address service = _registry.getServiceAddress(serviceDomain, getRelease());
|
128
109
|
|
129
|
-
// grant service role to service
|
130
|
-
address service = _registry.getServiceAddress(serviceDomain, _release);
|
131
110
|
_grantRoleToAccount(
|
132
111
|
serviceRoleId,
|
133
112
|
service);
|
@@ -138,11 +117,17 @@ contract InstanceAdmin is
|
|
138
117
|
function _createInstanceTargets(string memory instanceTargetName)
|
139
118
|
internal
|
140
119
|
{
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
120
|
+
_createInstanceTarget(address(_instance), instanceTargetName);
|
121
|
+
_createInstanceTarget(address(this), INSTANCE_ADMIN_TARGET_NAME);
|
122
|
+
_createInstanceTarget(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME);
|
123
|
+
_createInstanceTarget(address(_instance.getProductStore()), PRODUCT_STORE_TARGET_NAME);
|
124
|
+
_createInstanceTarget(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME);
|
125
|
+
_createInstanceTarget(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME);
|
126
|
+
}
|
127
|
+
|
128
|
+
|
129
|
+
function _createInstanceTarget(address target, string memory name) internal {
|
130
|
+
_createTarget(target, name, TargetType.Instance, true);
|
146
131
|
}
|
147
132
|
|
148
133
|
|
@@ -155,29 +140,13 @@ contract InstanceAdmin is
|
|
155
140
|
external
|
156
141
|
restricted()
|
157
142
|
{
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
|
162
|
-
IAuthorization authorization = component.getAuthorization();
|
163
|
-
_checkAuthorization(address(authorization), expectedType, getRelease(), false, false);
|
143
|
+
IAuthorization authorization = AccessAdminLib.checkComponentInitialization(
|
144
|
+
this, _authorization, componentAddress, expectedType);
|
164
145
|
|
165
146
|
// effects
|
166
147
|
_createRoles(authorization);
|
167
|
-
|
148
|
+
_createTarget(componentAddress, authorization.getMainTargetName(), TargetType.Component, true);
|
168
149
|
_createTargetAuthorizations(authorization);
|
169
|
-
|
170
|
-
// increase component count
|
171
|
-
_components++;
|
172
|
-
}
|
173
|
-
|
174
|
-
function getRelease()
|
175
|
-
public
|
176
|
-
view
|
177
|
-
override
|
178
|
-
returns (VersionPart release)
|
179
|
-
{
|
180
|
-
return _release;
|
181
150
|
}
|
182
151
|
|
183
152
|
|
@@ -191,24 +160,18 @@ contract InstanceAdmin is
|
|
191
160
|
restricted()
|
192
161
|
returns (RoleId roleId)
|
193
162
|
{
|
194
|
-
// check role does not yet exist
|
195
|
-
if (roleExists(name)) {
|
196
|
-
revert ErrorAccessAdminRoleAlreadyCreated(
|
197
|
-
getRoleForName(name),
|
198
|
-
name);
|
199
|
-
}
|
200
|
-
|
201
163
|
// create roleId
|
202
164
|
roleId = AccessAdminLib.getCustomRoleId(_customRoleIdNext++);
|
203
165
|
|
204
166
|
// create role
|
205
167
|
_createRole(
|
206
168
|
roleId,
|
207
|
-
AccessAdminLib.
|
169
|
+
AccessAdminLib.roleInfo(
|
208
170
|
adminRoleId,
|
209
|
-
IAccess.
|
171
|
+
IAccess.TargetType.Custom,
|
210
172
|
maxMemberCount,
|
211
|
-
name)
|
173
|
+
name),
|
174
|
+
true); // revert on existing role
|
212
175
|
}
|
213
176
|
|
214
177
|
|
@@ -243,7 +206,7 @@ contract InstanceAdmin is
|
|
243
206
|
}
|
244
207
|
|
245
208
|
|
246
|
-
/// @dev Create a new
|
209
|
+
/// @dev Create a new contract target.
|
247
210
|
/// The target needs to be an access managed contract.
|
248
211
|
function createTarget(
|
249
212
|
address target,
|
@@ -253,10 +216,11 @@ contract InstanceAdmin is
|
|
253
216
|
restricted()
|
254
217
|
returns (RoleId contractRoleId)
|
255
218
|
{
|
256
|
-
return
|
219
|
+
return _createTarget(
|
257
220
|
target,
|
258
221
|
name,
|
259
|
-
TargetType.
|
222
|
+
TargetType.Contract,
|
223
|
+
true); // check authority matches
|
260
224
|
}
|
261
225
|
|
262
226
|
|
@@ -269,8 +233,7 @@ contract InstanceAdmin is
|
|
269
233
|
external
|
270
234
|
restricted()
|
271
235
|
{
|
272
|
-
|
273
|
-
_authorizeTargetFunctions(target, roleId, functions, true);
|
236
|
+
_authorizeTargetFunctions(target, roleId, functions, true, true);
|
274
237
|
}
|
275
238
|
|
276
239
|
|
@@ -282,8 +245,7 @@ contract InstanceAdmin is
|
|
282
245
|
external
|
283
246
|
restricted()
|
284
247
|
{
|
285
|
-
|
286
|
-
_authorizeTargetFunctions(target, ADMIN_ROLE(), functions, false);
|
248
|
+
_authorizeTargetFunctions(target, ADMIN_ROLE(), functions, true, false);
|
287
249
|
}
|
288
250
|
|
289
251
|
|
@@ -300,28 +262,20 @@ contract InstanceAdmin is
|
|
300
262
|
|
301
263
|
function setTargetLocked(address target, bool locked)
|
302
264
|
external
|
303
|
-
// not restricted():
|
265
|
+
// not restricted(): need to operate on locked instances to unlock instance
|
304
266
|
onlyInstanceService()
|
305
267
|
{
|
306
268
|
_setTargetLocked(target, locked);
|
307
269
|
}
|
308
270
|
|
309
271
|
|
310
|
-
function
|
272
|
+
function setContractLocked(address target, bool locked)
|
311
273
|
external
|
312
|
-
restricted()
|
274
|
+
restricted() // component service
|
313
275
|
{
|
314
276
|
_setTargetLocked(target, locked);
|
315
277
|
}
|
316
278
|
|
317
|
-
/// @dev Returns the number of components that have been registered with this instance.
|
318
|
-
function components()
|
319
|
-
external
|
320
|
-
view
|
321
|
-
returns (uint64)
|
322
|
-
{
|
323
|
-
return _components;
|
324
|
-
}
|
325
279
|
|
326
280
|
/// @dev Returns the instance authorization specification used to set up this instance admin.
|
327
281
|
function getInstanceAuthorization()
|
@@ -334,25 +288,6 @@ contract InstanceAdmin is
|
|
334
288
|
|
335
289
|
// ------------------- Internal functions ------------------- //
|
336
290
|
|
337
|
-
function _createRoles(IAuthorization authorization)
|
338
|
-
internal
|
339
|
-
{
|
340
|
-
RoleId[] memory roles = authorization.getRoles();
|
341
|
-
RoleId mainTargetRoleId = authorization.getTargetRole(
|
342
|
-
authorization.getMainTarget());
|
343
|
-
|
344
|
-
for(uint256 i = 0; i < roles.length; i++) {
|
345
|
-
RoleId roleId = roles[i];
|
346
|
-
|
347
|
-
// skip main target role, create role if not exists
|
348
|
-
if (roleId != mainTargetRoleId && !roleExists(roleId)) {
|
349
|
-
_createRole(
|
350
|
-
roleId,
|
351
|
-
authorization.getRoleInfo(roleId));
|
352
|
-
}
|
353
|
-
}
|
354
|
-
}
|
355
|
-
|
356
291
|
|
357
292
|
function _createTargetAuthorizations(IAuthorization authorization)
|
358
293
|
internal
|
@@ -369,15 +304,4 @@ contract InstanceAdmin is
|
|
369
304
|
}
|
370
305
|
}
|
371
306
|
}
|
372
|
-
|
373
|
-
|
374
|
-
function _checkComponentOrCustomTarget(address target)
|
375
|
-
internal
|
376
|
-
view
|
377
|
-
{
|
378
|
-
IAccess.TargetType targetType = getTargetInfo(target).targetType;
|
379
|
-
if (targetType != TargetType.Component && targetType != TargetType.Custom) {
|
380
|
-
revert ErrorInstanceAdminNotComponentOrCustomTarget(target);
|
381
|
-
}
|
382
|
-
}
|
383
307
|
}
|
@@ -10,6 +10,8 @@ import {ACCOUNTING, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION
|
|
10
10
|
import {BundleSet} from "../instance/BundleSet.sol";
|
11
11
|
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
12
12
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
13
|
+
import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
|
14
|
+
import {ProductStore} from "../instance/ProductStore.sol";
|
13
15
|
import {ADMIN_ROLE, INSTANCE_OWNER_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
14
16
|
import {RiskSet} from "../instance/RiskSet.sol";
|
15
17
|
|
@@ -21,19 +23,13 @@ contract InstanceAuthorizationV3
|
|
21
23
|
string public constant INSTANCE_ROLE_NAME = "InstanceRole";
|
22
24
|
string public constant INSTANCE_OWNER_ROLE_NAME = "InstanceOwnerRole";
|
23
25
|
|
24
|
-
string public constant INSTANCE_TARGET_NAME = "Instance";
|
25
|
-
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
26
|
-
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
27
|
-
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
28
|
-
string public constant RISK_SET_TARGET_NAME = "RiskSet";
|
29
|
-
|
30
26
|
constructor()
|
31
27
|
Authorization(
|
32
28
|
INSTANCE_TARGET_NAME,
|
33
29
|
INSTANCE(),
|
34
30
|
3,
|
35
31
|
COMMIT_HASH,
|
36
|
-
|
32
|
+
TargetType.Instance,
|
37
33
|
false)
|
38
34
|
{ }
|
39
35
|
|
@@ -58,9 +54,9 @@ contract InstanceAuthorizationV3
|
|
58
54
|
{
|
59
55
|
_addRole(
|
60
56
|
INSTANCE_OWNER_ROLE(),
|
61
|
-
AccessAdminLib.
|
57
|
+
AccessAdminLib.roleInfo(
|
62
58
|
ADMIN_ROLE(),
|
63
|
-
|
59
|
+
TargetType.Custom,
|
64
60
|
0, // max member count special case: instance nft owner is sole role owner
|
65
61
|
INSTANCE_OWNER_ROLE_NAME));
|
66
62
|
}
|
@@ -70,11 +66,11 @@ contract InstanceAuthorizationV3
|
|
70
66
|
override
|
71
67
|
{
|
72
68
|
// instance supporting targets
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
69
|
+
_addInstanceTarget(INSTANCE_ADMIN_TARGET_NAME);
|
70
|
+
_addInstanceTarget(INSTANCE_STORE_TARGET_NAME);
|
71
|
+
_addInstanceTarget(PRODUCT_STORE_TARGET_NAME);
|
72
|
+
_addInstanceTarget(BUNDLE_SET_TARGET_NAME);
|
73
|
+
_addInstanceTarget(RISK_SET_TARGET_NAME);
|
78
74
|
}
|
79
75
|
|
80
76
|
|
@@ -85,6 +81,7 @@ contract InstanceAuthorizationV3
|
|
85
81
|
_setupInstanceAuthorization();
|
86
82
|
_setupInstanceAdminAuthorization();
|
87
83
|
_setupInstanceStoreAuthorization();
|
84
|
+
_setupProductStoreAuthorization();
|
88
85
|
_setupBundleSetAuthorization();
|
89
86
|
_setUpRiskSetAuthorization();
|
90
87
|
}
|
@@ -178,7 +175,7 @@ contract InstanceAuthorizationV3
|
|
178
175
|
// authorize component service role
|
179
176
|
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(COMPONENT()));
|
180
177
|
_authorize(functions, InstanceAdmin.initializeComponentAuthorization.selector, "initializeComponentAuthoriz");
|
181
|
-
_authorize(functions, InstanceAdmin.
|
178
|
+
_authorize(functions, InstanceAdmin.setContractLocked.selector, "setContractLocked");
|
182
179
|
}
|
183
180
|
|
184
181
|
|
@@ -199,10 +196,6 @@ contract InstanceAuthorizationV3
|
|
199
196
|
_authorize(functions, InstanceStore.createComponent.selector, "createComponent");
|
200
197
|
_authorize(functions, InstanceStore.updateComponent.selector, "updateComponent");
|
201
198
|
_authorize(functions, InstanceStore.createPool.selector, "createPool");
|
202
|
-
_authorize(functions, InstanceStore.createProduct.selector, "createProduct");
|
203
|
-
_authorize(functions, InstanceStore.updateProduct.selector, "updateProduct");
|
204
|
-
_authorize(functions, InstanceStore.createFee.selector, "createFee");
|
205
|
-
_authorize(functions, InstanceStore.updateFee.selector, "updateFee");
|
206
199
|
|
207
200
|
// authorize distribution service role
|
208
201
|
functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(DISTRIBUTION()));
|
@@ -234,33 +227,49 @@ contract InstanceAuthorizationV3
|
|
234
227
|
_authorize(functions, InstanceStore.increaseLocked.selector, "increaseLocked");
|
235
228
|
_authorize(functions, InstanceStore.decreaseLocked.selector, "decreaseLocked");
|
236
229
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
230
|
+
}
|
231
|
+
|
232
|
+
function _setupProductStoreAuthorization()
|
233
|
+
internal
|
234
|
+
{
|
235
|
+
IAccess.FunctionInfo[] storage functions;
|
236
|
+
|
237
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(COMPONENT()));
|
238
|
+
_authorize(functions, ProductStore.createProduct.selector, "createProduct");
|
239
|
+
_authorize(functions, ProductStore.updateProduct.selector, "updateProduct");
|
240
|
+
_authorize(functions, ProductStore.createFee.selector, "createFee");
|
241
|
+
_authorize(functions, ProductStore.updateFee.selector, "updateFee");
|
242
242
|
|
243
243
|
// authorize application service role
|
244
|
-
functions = _authorizeForTarget(
|
245
|
-
_authorize(functions,
|
246
|
-
_authorize(functions,
|
247
|
-
_authorize(functions,
|
244
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(APPLICATION()));
|
245
|
+
_authorize(functions, ProductStore.createApplication.selector, "createApplication");
|
246
|
+
_authorize(functions, ProductStore.updateApplication.selector, "updateApplication");
|
247
|
+
_authorize(functions, ProductStore.updateApplicationState.selector, "updateApplicationState");
|
248
|
+
|
249
|
+
// authorize policy service role
|
250
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(POLICY()));
|
251
|
+
_authorize(functions, ProductStore.updatePolicy.selector, "updatePolicy");
|
252
|
+
_authorize(functions, ProductStore.updatePolicyState.selector, "updatePolicyState");
|
248
253
|
|
249
254
|
// authorize policy service role
|
250
|
-
functions = _authorizeForTarget(
|
251
|
-
_authorize(functions,
|
252
|
-
_authorize(functions,
|
253
|
-
|
254
|
-
|
255
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(POLICY()));
|
256
|
+
_authorize(functions, ProductStore.createPremium.selector, "createPremium");
|
257
|
+
_authorize(functions, ProductStore.updatePremiumState.selector, "updatePremiumState");
|
258
|
+
|
259
|
+
// authorize risk service role
|
260
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(RISK()));
|
261
|
+
_authorize(functions, ProductStore.createRisk.selector, "createRisk");
|
262
|
+
_authorize(functions, ProductStore.updateRisk.selector, "updateRisk");
|
263
|
+
_authorize(functions, ProductStore.updateRiskState.selector, "updateRiskState");
|
255
264
|
|
256
265
|
// authorize claim service role
|
257
|
-
functions = _authorizeForTarget(
|
258
|
-
_authorize(functions,
|
259
|
-
_authorize(functions,
|
260
|
-
_authorize(functions,
|
261
|
-
_authorize(functions,
|
262
|
-
_authorize(functions,
|
263
|
-
_authorize(functions,
|
266
|
+
functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(CLAIM()));
|
267
|
+
_authorize(functions, ProductStore.updatePolicyClaims.selector, "updatePolicyClaims");
|
268
|
+
_authorize(functions, ProductStore.createClaim.selector, "createClaim");
|
269
|
+
_authorize(functions, ProductStore.updateClaim.selector, "updateClaim");
|
270
|
+
_authorize(functions, ProductStore.createPayout.selector, "createPayout");
|
271
|
+
_authorize(functions, ProductStore.updatePayout.selector, "updatePayout");
|
272
|
+
_authorize(functions, ProductStore.updatePayoutState.selector, "updatePayoutState");
|
264
273
|
}
|
265
274
|
}
|
266
275
|
|