@etherisc/gif-next 0.0.2-9e6b423-414 → 0.0.2-9f51324-299
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -2
- 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 +97 -267
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +36 -652
- 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 +47 -222
- 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 +27 -175
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -85
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +16 -246
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +27 -420
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +3 -3
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +60 -221
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +114 -167
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +60 -72
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +0 -29
- 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 +2 -2
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2 -2
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +59 -220
- 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 +3 -3
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +59 -220
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +59 -220
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +32 -310
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +0 -182
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -322
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +292 -605
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +56 -242
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +290 -478
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +26 -208
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +14 -14
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +56 -234
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +59 -220
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +108 -92
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +55 -31
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +26 -92
- 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 +2 -2
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +36 -60
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +19 -15
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +59 -220
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +40 -40
- 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/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 +26 -82
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +2 -2
- 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 +249 -378
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +68 -243
- 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 +10 -10
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +186 -384
- 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 +76 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -437
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +54 -54
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +28 -28
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +45 -16
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +8 -8
- 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/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +5 -5
- 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 +2 -2
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +6 -6
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +218 -39
- 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/String.sol/StrLib.json +2 -50
- 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 +2 -2
- 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 +185 -261
- package/contracts/authorization/AccessAdminLib.sol +7 -220
- package/contracts/authorization/Authorization.sol +229 -38
- package/contracts/authorization/IAccess.sol +4 -14
- package/contracts/authorization/IAccessAdmin.sol +45 -19
- package/contracts/authorization/IAuthorization.sol +56 -3
- package/contracts/authorization/IServiceAuthorization.sol +17 -55
- package/contracts/authorization/ServiceAuthorization.sol +33 -247
- package/contracts/distribution/BasicDistributionAuthorization.sol +4 -11
- package/contracts/distribution/Distribution.sol +1 -2
- package/contracts/distribution/DistributionService.sol +33 -75
- package/contracts/distribution/IDistributionComponent.sol +1 -3
- package/contracts/distribution/IDistributionService.sol +4 -10
- package/contracts/instance/IInstance.sol +4 -43
- package/contracts/instance/IInstanceService.sol +3 -28
- package/contracts/instance/Instance.sol +39 -80
- package/contracts/instance/InstanceAdmin.sol +229 -162
- package/contracts/instance/InstanceAuthorizationV3.sol +28 -58
- package/contracts/instance/InstanceReader.sol +389 -371
- package/contracts/instance/InstanceService.sol +53 -105
- package/contracts/oracle/BasicOracleAuthorization.sol +2 -18
- package/contracts/pool/BasicPoolAuthorization.sol +3 -9
- package/contracts/pool/BundleService.sol +9 -8
- package/contracts/pool/PoolLib.sol +0 -44
- package/contracts/product/ApplicationService.sol +26 -4
- package/contracts/product/BasicProductAuthorization.sol +4 -9
- package/contracts/product/ClaimService.sol +20 -11
- package/contracts/product/PolicyService.sol +2 -2
- package/contracts/product/PolicyServiceLib.sol +0 -20
- package/contracts/registry/RegistryAdmin.sol +97 -27
- package/contracts/registry/RegistryAuthorization.sol +25 -35
- package/contracts/registry/ReleaseAdmin.sol +100 -42
- package/contracts/registry/ReleaseRegistry.sol +9 -12
- package/contracts/registry/ServiceAuthorizationV3.sol +20 -32
- package/contracts/registry/TokenRegistry.sol +4 -2
- package/contracts/shared/ComponentService.sol +5 -22
- package/contracts/shared/ContractLib.sol +45 -9
- package/contracts/shared/IRegisterable.sol +1 -0
- package/contracts/shared/Service.sol +4 -6
- package/contracts/staking/Staking.sol +5 -4
- package/contracts/staking/TargetManagerLib.sol +1 -1
- package/contracts/type/ObjectType.sol +3 -16
- package/contracts/type/RoleId.sol +59 -57
- package/contracts/type/String.sol +0 -12
- package/contracts/upgradeability/ProxyManager.sol +2 -2
- package/contracts/upgradeability/Versionable.sol +1 -4
- package/package.json +1 -1
@@ -1,314 +1,100 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
|
+
|
4
6
|
import {IAccess} from "../authorization/IAccess.sol";
|
7
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
5
8
|
import {IServiceAuthorization} from "./IServiceAuthorization.sol";
|
6
|
-
|
7
|
-
import {ADMIN_ROLE_NAME, PUBLIC_ROLE_NAME} from "./AccessAdmin.sol";
|
8
|
-
import {InitializableERC165} from "../shared/InitializableERC165.sol";
|
9
|
-
import {ObjectType, ObjectTypeLib, ALL} from "../type/ObjectType.sol";
|
10
|
-
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
11
9
|
import {SelectorLib} from "../type/Selector.sol";
|
12
|
-
import {
|
10
|
+
import {StrLib} from "../type/String.sol";
|
13
11
|
import {TimestampLib} from "../type/Timestamp.sol";
|
14
12
|
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
15
13
|
|
16
|
-
|
17
|
-
/// @dev Base contract for release specific service authorization contracts and for Authorization contracts.
|
14
|
+
/// @dev Base contract for release specific service authorization contracts.
|
18
15
|
contract ServiceAuthorization is
|
19
|
-
InitializableERC165,
|
20
16
|
IServiceAuthorization
|
21
17
|
{
|
22
|
-
|
23
|
-
string public constant COMMIT_HASH = "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a";
|
24
|
-
|
25
18
|
uint256 public constant COMMIT_HASH_LENGTH = 40;
|
26
19
|
uint256 public constant GIF_INITIAL_VERSION = 3;
|
27
20
|
|
28
|
-
|
29
|
-
string public
|
21
|
+
uint256 public immutable VERSION;
|
22
|
+
string public COMMIT_HASH;
|
30
23
|
|
31
|
-
ObjectType public immutable DOMAIN;
|
32
|
-
uint256 internal immutable _release;
|
33
|
-
string internal _commitHash;
|
34
|
-
|
35
|
-
string internal _mainTargetName;
|
36
|
-
Str internal _mainTarget;
|
37
|
-
|
38
|
-
// services
|
39
24
|
ObjectType[] internal _serviceDomains;
|
40
25
|
mapping(ObjectType domain => address service) internal _serviceAddress;
|
26
|
+
mapping(ObjectType domain => ObjectType[] authorizedDomains) internal _authorizedDomains;
|
27
|
+
mapping(ObjectType domain => mapping(ObjectType authorizedDomain => IAccess.FunctionInfo[] functions)) internal _authorizedFunctions;
|
41
28
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
// targets
|
47
|
-
Str[] internal _targets;
|
48
|
-
mapping(Str target => bool exists) internal _targetExists;
|
49
|
-
mapping(Str target => RoleId roleId) internal _targetRole;
|
50
|
-
mapping(Str target => RoleId[] authorizedRoles) internal _authorizedRoles;
|
51
|
-
mapping(Str target => mapping(RoleId authorizedRole => IAccess.FunctionInfo[] functions)) internal _authorizedFunctions;
|
52
|
-
|
53
|
-
|
54
|
-
constructor(
|
55
|
-
string memory mainTargetName,
|
56
|
-
ObjectType domain,
|
57
|
-
uint8 release,
|
58
|
-
string memory commitHash
|
59
|
-
)
|
60
|
-
{
|
61
|
-
// checks
|
62
|
-
if (bytes(mainTargetName).length == 0) {
|
63
|
-
revert ErrorAuthorizationMainTargetNameEmpty();
|
64
|
-
}
|
65
|
-
|
66
|
-
if (domain == ObjectTypeLib.zero()) {
|
67
|
-
revert ErrorAuthorizationTargetDomainZero();
|
68
|
-
}
|
69
|
-
|
70
|
-
if (release < VersionPartLib.releaseMin().toInt() || release >= VersionPartLib.releaseMax().toInt()) {
|
71
|
-
revert ErrorAuthorizationReleaseInvalid(release);
|
72
|
-
}
|
73
|
-
|
74
|
-
if (bytes(commitHash).length != COMMIT_HASH_LENGTH) {
|
75
|
-
revert ErrorAuthorizationCommitHashInvalid(commitHash);
|
76
|
-
}
|
77
|
-
|
78
|
-
// effects
|
79
|
-
_initializeERC165();
|
80
|
-
_registerInterfaceNotInitializing(type(IServiceAuthorization).interfaceId);
|
81
|
-
|
82
|
-
_mainTargetName = mainTargetName;
|
83
|
-
_mainTarget = StrLib.toStr(mainTargetName);
|
84
|
-
|
85
|
-
DOMAIN = domain;
|
86
|
-
_release = release;
|
87
|
-
_commitHash = commitHash;
|
29
|
+
constructor(string memory commitHash, uint256 version) {
|
30
|
+
assert(bytes(commitHash).length == COMMIT_HASH_LENGTH);
|
31
|
+
assert(version >= GIF_INITIAL_VERSION);
|
88
32
|
|
89
|
-
|
90
|
-
|
91
|
-
_addRole(PUBLIC_ROLE(), _toRoleInfo(ADMIN_ROLE(), RoleType.Core, 1, PUBLIC_ROLE_NAME()));
|
92
|
-
|
93
|
-
// defines service domains relevant for the authorization
|
33
|
+
COMMIT_HASH = commitHash;
|
34
|
+
VERSION = version;
|
94
35
|
_setupDomains();
|
95
36
|
_setupDomainAuthorizations();
|
96
37
|
}
|
97
38
|
|
98
|
-
/// @inheritdoc IServiceAuthorization
|
99
|
-
function getDomain() public view returns(ObjectType targetDomain) {
|
100
|
-
return DOMAIN;
|
101
|
-
}
|
102
|
-
|
103
|
-
/// @inheritdoc IServiceAuthorization
|
104
|
-
function getRelease() public view returns(VersionPart release) {
|
105
|
-
return VersionPartLib.toVersionPart(_release);
|
106
|
-
}
|
107
|
-
|
108
|
-
/// @inheritdoc IServiceAuthorization
|
109
39
|
function getCommitHash() external view returns(string memory commitHash) {
|
110
|
-
return
|
40
|
+
return COMMIT_HASH;
|
111
41
|
}
|
112
42
|
|
113
|
-
|
114
|
-
|
115
|
-
return _mainTargetName;
|
43
|
+
function getRelease() external view returns(VersionPart release) {
|
44
|
+
return VersionPartLib.toVersionPart(VERSION);
|
116
45
|
}
|
117
46
|
|
118
|
-
/// @inheritdoc IServiceAuthorization
|
119
|
-
function getMainTarget() external view returns(Str target) {
|
120
|
-
return _mainTarget;
|
121
|
-
}
|
122
|
-
|
123
|
-
/// @inheritdoc IServiceAuthorization
|
124
47
|
function getServiceDomains() external view returns(ObjectType[] memory serviceDomains) {
|
125
48
|
return _serviceDomains;
|
126
49
|
}
|
127
50
|
|
128
|
-
|
129
|
-
function getServiceDomain(uint256 idx) external view returns(ObjectType serviceDomain) {
|
51
|
+
function getServiceDomain(uint idx) external view returns(ObjectType serviceDomain) {
|
130
52
|
return _serviceDomains[idx];
|
131
53
|
}
|
132
54
|
|
133
|
-
/// @inheritdoc IServiceAuthorization
|
134
|
-
function getServiceTarget(ObjectType serviceDomain) public view returns(Str target) {
|
135
|
-
string memory serviceTargetName = ObjectTypeLib.toVersionedName(
|
136
|
-
ObjectTypeLib.toName(serviceDomain),
|
137
|
-
"Service",
|
138
|
-
getRelease());
|
139
|
-
|
140
|
-
return StrLib.toStr(serviceTargetName);
|
141
|
-
}
|
142
|
-
|
143
|
-
/// @inheritdoc IServiceAuthorization
|
144
|
-
function getServiceRole(ObjectType serviceDomain) public view returns(RoleId serviceRoleId) {
|
145
|
-
// special case domain ALL
|
146
|
-
if (serviceDomain == ALL()) {
|
147
|
-
return PUBLIC_ROLE();
|
148
|
-
}
|
149
|
-
|
150
|
-
Str target = getServiceTarget(serviceDomain);
|
151
|
-
return getTargetRole(target);
|
152
|
-
}
|
153
|
-
|
154
|
-
/// @inheritdoc IServiceAuthorization
|
155
55
|
function getServiceAddress(ObjectType serviceDomain) external view returns(address service) {
|
156
56
|
return _serviceAddress[serviceDomain];
|
157
57
|
}
|
158
58
|
|
159
|
-
|
160
|
-
|
161
|
-
return _targetRole[target];
|
162
|
-
}
|
163
|
-
|
164
|
-
/// @inheritdoc IServiceAuthorization
|
165
|
-
function roleExists(RoleId roleId) public view returns(bool exists) {
|
166
|
-
return _roleInfo[roleId].roleType != RoleType.Undefined;
|
167
|
-
}
|
168
|
-
|
169
|
-
/// @inheritdoc IServiceAuthorization
|
170
|
-
function getRoles() external view returns(RoleId[] memory roles) {
|
171
|
-
return _roles;
|
59
|
+
function getAuthorizedDomains(ObjectType serviceDomain) external view returns(ObjectType[] memory authorizatedDomains) {
|
60
|
+
return _authorizedDomains[serviceDomain];
|
172
61
|
}
|
173
62
|
|
174
|
-
|
175
|
-
|
176
|
-
return _roleInfo[roleId];
|
63
|
+
function getAuthorizedFunctions(ObjectType serviceDomain, ObjectType authorizedDomain) external view returns(IAccess.FunctionInfo[] memory authorizatedFunctions) {
|
64
|
+
return _authorizedFunctions[serviceDomain][authorizedDomain];
|
177
65
|
}
|
178
66
|
|
179
|
-
|
180
|
-
function
|
181
|
-
return
|
67
|
+
// ERC165
|
68
|
+
function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
|
69
|
+
return (
|
70
|
+
interfaceId == type(IServiceAuthorization).interfaceId ||
|
71
|
+
interfaceId == type(IERC165).interfaceId
|
72
|
+
);
|
182
73
|
}
|
183
74
|
|
184
|
-
/// @inheritdoc IServiceAuthorization
|
185
|
-
function getAuthorizedRoles(Str target) external view returns(RoleId[] memory roleIds) {
|
186
|
-
return _authorizedRoles[target];
|
187
|
-
}
|
188
|
-
|
189
|
-
/// @inheritdoc IServiceAuthorization
|
190
|
-
function getAuthorizedFunctions(Str target, RoleId roleId) external view returns(FunctionInfo[] memory authorizatedFunctions) {
|
191
|
-
return _authorizedFunctions[target][roleId];
|
192
|
-
}
|
193
75
|
|
194
|
-
/// @dev
|
195
|
-
/// When used for ReleaseAdmin the list defines the services to be registered for the release.
|
196
|
-
/// IMPORTANT: Both the list of the service domains as well as the ordering of the domains is important.
|
197
|
-
/// Trying to register services not in this list or register services in a different order will result in an error.
|
198
|
-
// solhint-disable-next-line no-empty-blocks
|
76
|
+
/// @dev Overwrite this function for a specific realease.
|
199
77
|
function _setupDomains() internal virtual {}
|
200
78
|
|
201
79
|
/// @dev Overwrite this function for a specific realease.
|
202
|
-
// solhint-disable-next-line no-empty-blocks
|
203
80
|
function _setupDomainAuthorizations() internal virtual {}
|
204
81
|
|
205
82
|
/// @dev Use this method to to add an authorized domain.
|
206
83
|
/// The services will need to be registered in the order they are added using this function.
|
207
|
-
function
|
84
|
+
function _authorizeDomain(ObjectType serviceDomain, address serviceAddress) internal {
|
208
85
|
_serviceDomains.push(serviceDomain);
|
209
86
|
_serviceAddress[serviceDomain] = serviceAddress;
|
210
|
-
|
211
|
-
string memory serviceName = ObjectTypeLib.toVersionedName(
|
212
|
-
ObjectTypeLib.toName(serviceDomain),
|
213
|
-
SERVICE_NAME_SUFFIX,
|
214
|
-
getRelease());
|
215
|
-
|
216
|
-
_addTargetWithRole(
|
217
|
-
serviceName,
|
218
|
-
RoleIdLib.toServiceRoleId(serviceDomain, getRelease()),
|
219
|
-
string(abi.encodePacked(serviceName, ROLE_NAME_SUFFIX)));
|
220
|
-
}
|
221
|
-
|
222
|
-
|
223
|
-
/// @dev Use this method to to add an authorized target together with its target role.
|
224
|
-
function _addTargetWithRole(
|
225
|
-
string memory targetName,
|
226
|
-
RoleId roleId,
|
227
|
-
string memory roleName
|
228
|
-
)
|
229
|
-
internal
|
230
|
-
{
|
231
|
-
// add target
|
232
|
-
Str target = StrLib.toStr(targetName);
|
233
|
-
_targets.push(target);
|
234
|
-
|
235
|
-
_targetExists[target] = true;
|
236
|
-
|
237
|
-
// link role to target if defined
|
238
|
-
if (roleId != RoleIdLib.zero()) {
|
239
|
-
// add role if new
|
240
|
-
if (!roleExists(roleId)) {
|
241
|
-
_addContractRole(roleId, roleName);
|
242
|
-
}
|
243
|
-
|
244
|
-
// link target to role
|
245
|
-
_targetRole[target] = roleId;
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
|
250
|
-
/// @dev Add a contract role for the provided role id and name.
|
251
|
-
function _addContractRole(RoleId roleId, string memory name) internal {
|
252
|
-
_addRole(
|
253
|
-
roleId,
|
254
|
-
_toRoleInfo(
|
255
|
-
ADMIN_ROLE(),
|
256
|
-
RoleType.Contract,
|
257
|
-
1,
|
258
|
-
name));
|
259
87
|
}
|
260
88
|
|
261
|
-
|
262
|
-
/// @dev Use this method to to add an authorized role.
|
263
|
-
function _addRole(RoleId roleId, RoleInfo memory info) internal {
|
264
|
-
_roles.push(roleId);
|
265
|
-
_roleInfo[roleId] = info;
|
266
|
-
}
|
267
|
-
|
268
|
-
|
269
|
-
/// @dev creates a role info object from the provided parameters
|
270
|
-
function _toRoleInfo(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) internal view returns (RoleInfo memory info) {
|
271
|
-
return RoleInfo({
|
272
|
-
name: StrLib.toStr(name),
|
273
|
-
adminRoleId: adminRoleId,
|
274
|
-
roleType: roleType,
|
275
|
-
maxMemberCount: maxMemberCount,
|
276
|
-
createdAt: TimestampLib.blockTimestamp(),
|
277
|
-
pausedAt: TimestampLib.max()});
|
278
|
-
}
|
279
|
-
|
280
|
-
|
281
89
|
/// @dev Use this method to authorize the specified domain to access the service domain.
|
282
|
-
function _authorizeForService(
|
283
|
-
ObjectType serviceDomain,
|
284
|
-
ObjectType authorizedDomain
|
285
|
-
)
|
90
|
+
function _authorizeForService(ObjectType serviceDomain, ObjectType authorizedDomain)
|
286
91
|
internal
|
287
92
|
returns (IAccess.FunctionInfo[] storage authorizatedFunctions)
|
288
93
|
{
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
return _authorizeForTarget(serviceTarget.toString(), authorizedRoleId);
|
94
|
+
_authorizedDomains[serviceDomain].push(authorizedDomain);
|
95
|
+
return _authorizedFunctions[serviceDomain][authorizedDomain];
|
293
96
|
}
|
294
97
|
|
295
|
-
|
296
|
-
/// @dev Use this method to authorize the specified role to access the target.
|
297
|
-
function _authorizeForTarget(string memory target, RoleId authorizedRoleId)
|
298
|
-
internal
|
299
|
-
returns (IAccess.FunctionInfo[] storage authorizatedFunctions)
|
300
|
-
{
|
301
|
-
Str targetStr = StrLib.toStr(target);
|
302
|
-
|
303
|
-
// add authorized role if not already added
|
304
|
-
if (_authorizedFunctions[targetStr][authorizedRoleId].length == 0) {
|
305
|
-
_authorizedRoles[targetStr].push(authorizedRoleId);
|
306
|
-
}
|
307
|
-
|
308
|
-
return _authorizedFunctions[targetStr][authorizedRoleId];
|
309
|
-
}
|
310
|
-
|
311
|
-
|
312
98
|
/// @dev Use this method to authorize a specific function authorization
|
313
99
|
function _authorize(IAccess.FunctionInfo[] storage functions, bytes4 selector, string memory name) internal {
|
314
100
|
functions.push(
|
@@ -8,7 +8,7 @@ import {Authorization} from "../authorization/Authorization.sol";
|
|
8
8
|
import {BasicDistribution} from "./BasicDistribution.sol";
|
9
9
|
import {Distribution} from "./Distribution.sol";
|
10
10
|
import {COMPONENT, DISTRIBUTION} from "../type/ObjectType.sol";
|
11
|
-
import {PUBLIC_ROLE} from "../type/RoleId.sol";
|
11
|
+
import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
|
12
12
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
13
13
|
|
14
14
|
|
@@ -16,22 +16,15 @@ contract BasicDistributionAuthorization
|
|
16
16
|
is Authorization
|
17
17
|
{
|
18
18
|
|
19
|
-
constructor(string memory
|
20
|
-
Authorization(
|
21
|
-
distributionName,
|
22
|
-
DISTRIBUTION(),
|
23
|
-
3,
|
24
|
-
COMMIT_HASH,
|
25
|
-
true,
|
26
|
-
true)
|
19
|
+
constructor(string memory distributionlName)
|
20
|
+
Authorization(distributionlName, DISTRIBUTION(), true, true)
|
27
21
|
{}
|
28
22
|
|
29
23
|
function _setupServiceTargets()
|
30
24
|
internal
|
31
25
|
virtual override
|
32
26
|
{
|
33
|
-
|
34
|
-
_authorizeServiceDomain(DISTRIBUTION(), address(11));
|
27
|
+
_addServiceTargetWithRole(COMPONENT());
|
35
28
|
}
|
36
29
|
|
37
30
|
function _setupTokenHandlerAuthorizations() internal virtual override {
|
@@ -37,7 +37,6 @@ abstract contract Distribution is
|
|
37
37
|
external
|
38
38
|
virtual
|
39
39
|
restricted()
|
40
|
-
// solhint-disable-next-line no-empty-blocks
|
41
40
|
{
|
42
41
|
// default is no action
|
43
42
|
}
|
@@ -82,7 +81,7 @@ abstract contract Distribution is
|
|
82
81
|
|
83
82
|
|
84
83
|
function calculateRenewalFeeAmount(
|
85
|
-
ReferralId
|
84
|
+
ReferralId referralId,
|
86
85
|
uint256 netPremiumAmount
|
87
86
|
)
|
88
87
|
external
|
@@ -13,19 +13,18 @@ import {IComponents} from "../instance/module/IComponents.sol";
|
|
13
13
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
14
14
|
|
15
15
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
16
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
17
|
+
import {Service} from "../shared/Service.sol";
|
16
18
|
import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
|
17
19
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
18
20
|
import {KEEP_STATE} from "../type/StateId.sol";
|
19
21
|
import {ObjectType, ACCOUNTING, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
|
20
22
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
21
23
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
22
|
-
|
23
|
-
import {PoolLib} from "../pool/PoolLib.sol";
|
24
|
-
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
24
|
+
import {ReferralId, ReferralLib} from "../type/Referral.sol";
|
25
25
|
import {Seconds} from "../type/Seconds.sol";
|
26
|
-
import {Service} from "../shared/Service.sol";
|
27
26
|
import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
|
28
|
-
import {UFixed
|
27
|
+
import {UFixed} from "../type/UFixed.sol";
|
29
28
|
|
30
29
|
|
31
30
|
contract DistributionService is
|
@@ -76,8 +75,7 @@ contract DistributionService is
|
|
76
75
|
restricted()
|
77
76
|
returns (DistributorType distributorType)
|
78
77
|
{
|
79
|
-
|
80
|
-
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution();
|
78
|
+
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution(getRegistry());
|
81
79
|
|
82
80
|
{
|
83
81
|
NftId productNftId = getRegistry().getParentNftId(distributionNftId);
|
@@ -91,7 +89,7 @@ contract DistributionService is
|
|
91
89
|
}
|
92
90
|
UFixed maxDiscountPercentageLimit = variableDistributionFees - variableFeesPartsTotal;
|
93
91
|
|
94
|
-
if (maxDiscountPercentage
|
92
|
+
if (maxDiscountPercentage.gt(maxDiscountPercentageLimit)) {
|
95
93
|
revert ErrorDistributionServiceMaxDiscountTooHigh(maxDiscountPercentage.toInt1000(), maxDiscountPercentageLimit.toInt1000());
|
96
94
|
}
|
97
95
|
}
|
@@ -123,7 +121,7 @@ contract DistributionService is
|
|
123
121
|
restricted()
|
124
122
|
returns (NftId distributorNftId)
|
125
123
|
{
|
126
|
-
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution();
|
124
|
+
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution(getRegistry());
|
127
125
|
_checkDistributionType(instance.getInstanceReader(), distributorType, distributionNftId);
|
128
126
|
|
129
127
|
distributorNftId = _registryService.registerDistributor(
|
@@ -156,7 +154,7 @@ contract DistributionService is
|
|
156
154
|
restricted()
|
157
155
|
{
|
158
156
|
_checkNftType(distributorNftId, DISTRIBUTOR());
|
159
|
-
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution();
|
157
|
+
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution(getRegistry());
|
160
158
|
_checkDistributionType(instance.getInstanceReader(), newDistributorType, distributionNftId);
|
161
159
|
|
162
160
|
IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
|
@@ -180,7 +178,7 @@ contract DistributionService is
|
|
180
178
|
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
181
179
|
returns (ReferralId referralId)
|
182
180
|
{
|
183
|
-
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution();
|
181
|
+
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution(getRegistry());
|
184
182
|
|
185
183
|
if (bytes(code).length == 0) {
|
186
184
|
revert ErrorDistributionServiceInvalidReferral(code);
|
@@ -241,7 +239,8 @@ contract DistributionService is
|
|
241
239
|
onlyNftOfType(distributionNftId, DISTRIBUTION())
|
242
240
|
{
|
243
241
|
if (referralIsValid(distributionNftId, referralId)) {
|
244
|
-
|
242
|
+
IRegistry registry = getRegistry();
|
243
|
+
IInstance instance = IInstance(ContractLib.getInstanceForComponent(getRegistry(), distributionNftId));
|
245
244
|
|
246
245
|
// update book keeping for referral info
|
247
246
|
IDistribution.ReferralInfo memory referralInfo = instance.getInstanceReader().getReferralInfo(referralId);
|
@@ -260,7 +259,8 @@ contract DistributionService is
|
|
260
259
|
restricted()
|
261
260
|
onlyNftOfType(distributionNftId, DISTRIBUTION())
|
262
261
|
{
|
263
|
-
|
262
|
+
IRegistry registry = getRegistry();
|
263
|
+
IInstance instance = IInstance(ContractLib.getInstanceForComponent(registry, distributionNftId));
|
264
264
|
InstanceReader reader = instance.getInstanceReader();
|
265
265
|
InstanceStore store = instance.getInstanceStore();
|
266
266
|
|
@@ -297,7 +297,7 @@ contract DistributionService is
|
|
297
297
|
onlyNftOfType(distributorNftId, DISTRIBUTOR())
|
298
298
|
returns (Amount withdrawnAmount)
|
299
299
|
{
|
300
|
-
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution();
|
300
|
+
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveDistribution(getRegistry());
|
301
301
|
InstanceReader reader = instance.getInstanceReader();
|
302
302
|
|
303
303
|
IComponents.ComponentInfo memory distributionInfo = reader.getComponentInfo(distributionNftId);
|
@@ -307,10 +307,10 @@ contract DistributionService is
|
|
307
307
|
|
308
308
|
// determine withdrawn amount
|
309
309
|
withdrawnAmount = amount;
|
310
|
-
if (withdrawnAmount
|
310
|
+
if (withdrawnAmount.gte(AmountLib.max())) {
|
311
311
|
withdrawnAmount = commissionAmount;
|
312
312
|
} else {
|
313
|
-
if (withdrawnAmount
|
313
|
+
if (withdrawnAmount.gt(commissionAmount)) {
|
314
314
|
revert ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(withdrawnAmount, commissionAmount);
|
315
315
|
}
|
316
316
|
}
|
@@ -342,7 +342,8 @@ contract DistributionService is
|
|
342
342
|
return false;
|
343
343
|
}
|
344
344
|
|
345
|
-
|
345
|
+
IRegistry registry = getRegistry();
|
346
|
+
IInstance instance = IInstance(ContractLib.getInstanceForComponent(registry, distributionNftId));
|
346
347
|
IDistribution.ReferralInfo memory info = instance.getInstanceReader().getReferralInfo(referralId);
|
347
348
|
|
348
349
|
if (info.distributorNftId.eqz()) {
|
@@ -358,48 +359,6 @@ contract DistributionService is
|
|
358
359
|
isValid = isValid && info.usedReferrals < info.maxReferrals;
|
359
360
|
}
|
360
361
|
|
361
|
-
|
362
|
-
function getDiscountPercentage(
|
363
|
-
InstanceReader instanceReader,
|
364
|
-
ReferralId referralId
|
365
|
-
)
|
366
|
-
external
|
367
|
-
virtual
|
368
|
-
view
|
369
|
-
returns (
|
370
|
-
UFixed discountPercentage,
|
371
|
-
ReferralStatus status
|
372
|
-
)
|
373
|
-
{
|
374
|
-
IDistribution.ReferralInfo memory info = instanceReader.getReferralInfo(
|
375
|
-
referralId);
|
376
|
-
|
377
|
-
if (info.expiryAt.eqz()) {
|
378
|
-
return (
|
379
|
-
UFixedLib.zero(),
|
380
|
-
REFERRAL_ERROR_UNKNOWN());
|
381
|
-
}
|
382
|
-
|
383
|
-
if (info.expiryAt < TimestampLib.blockTimestamp()) {
|
384
|
-
return (
|
385
|
-
UFixedLib.zero(),
|
386
|
-
REFERRAL_ERROR_EXPIRED());
|
387
|
-
}
|
388
|
-
|
389
|
-
if (info.usedReferrals >= info.maxReferrals) {
|
390
|
-
return (
|
391
|
-
UFixedLib.zero(),
|
392
|
-
REFERRAL_ERROR_EXHAUSTED());
|
393
|
-
}
|
394
|
-
|
395
|
-
return (
|
396
|
-
info.discountPercentage,
|
397
|
-
REFERRAL_OK()
|
398
|
-
);
|
399
|
-
|
400
|
-
}
|
401
|
-
|
402
|
-
|
403
362
|
function _checkDistributionType(InstanceReader instanceReader, DistributorType distributorType, NftId expectedDistributionNftId)
|
404
363
|
internal
|
405
364
|
view
|
@@ -412,30 +371,29 @@ contract DistributionService is
|
|
412
371
|
}
|
413
372
|
}
|
414
373
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
view
|
419
|
-
returns(IInstance instance)
|
420
|
-
{
|
421
|
-
// TODO refactor to ComponentLib or similar
|
422
|
-
return PoolLib.getInstanceForComponent(registry, distributionNftId);
|
423
|
-
}
|
424
|
-
|
425
|
-
|
426
|
-
function _getAndVerifyActiveDistribution()
|
374
|
+
function _getAndVerifyActiveDistribution(
|
375
|
+
IRegistry registry
|
376
|
+
)
|
427
377
|
internal
|
428
|
-
virtual
|
429
378
|
view
|
430
379
|
returns (
|
431
|
-
NftId
|
380
|
+
NftId didstributionNftId,
|
432
381
|
IInstance instance
|
433
382
|
)
|
434
383
|
{
|
435
|
-
|
384
|
+
(
|
385
|
+
IRegistry.ObjectInfo memory info,
|
386
|
+
address instanceAddress
|
387
|
+
) = ContractLib.getAndVerifyComponent(
|
388
|
+
registry,
|
389
|
+
msg.sender,
|
390
|
+
DISTRIBUTION(),
|
391
|
+
true); // only active pools
|
392
|
+
|
393
|
+
didstributionNftId = info.nftId;
|
394
|
+
instance = IInstance(instanceAddress);
|
436
395
|
}
|
437
396
|
|
438
|
-
|
439
397
|
function _getDomain() internal pure override returns(ObjectType) {
|
440
398
|
return DISTRIBUTION();
|
441
399
|
}
|
@@ -1,14 +1,12 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
5
|
-
|
6
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
7
6
|
import {NftId} from "../type/NftId.sol";
|
8
7
|
import {ReferralId, ReferralStatus} from "../type/Referral.sol";
|
9
8
|
import {UFixed} from "../type/UFixed.sol";
|
10
9
|
|
11
|
-
|
12
10
|
interface IDistributionComponent is IInstanceLinkedComponent {
|
13
11
|
|
14
12
|
event LogDistributorUpdated(address to, address operator);
|
@@ -1,17 +1,15 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {Amount} from "../type/Amount.sol";
|
5
|
+
import {NftId} from "../type/NftId.sol";
|
4
6
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
5
7
|
import {IService} from "../shared/IService.sol";
|
6
|
-
|
7
|
-
import {Amount} from "../type/Amount.sol";
|
8
|
+
import {UFixed} from "../type/UFixed.sol";
|
8
9
|
import {DistributorType} from "../type/DistributorType.sol";
|
9
|
-
import {
|
10
|
-
import {NftId} from "../type/NftId.sol";
|
11
|
-
import {ReferralId, ReferralStatus} from "../type/Referral.sol";
|
10
|
+
import {ReferralId} from "../type/Referral.sol";
|
12
11
|
import {Seconds} from "../type/Seconds.sol";
|
13
12
|
import {Timestamp} from "../type/Timestamp.sol";
|
14
|
-
import {UFixed} from "../type/UFixed.sol";
|
15
13
|
|
16
14
|
|
17
15
|
interface IDistributionService is IService {
|
@@ -102,8 +100,4 @@ interface IDistributionService is IService {
|
|
102
100
|
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
103
101
|
/// @return withdrawnAmount the effective withdrawn amount
|
104
102
|
function withdrawCommission(NftId distributorNftId, Amount amount) external returns (Amount withdrawnAmount);
|
105
|
-
|
106
|
-
/// @dev Returns the discount percentage for the provided referral code.
|
107
|
-
/// The function retuns both the percentage and the status of the referral code.
|
108
|
-
function getDiscountPercentage(InstanceReader instanceReader, ReferralId referralId) external view returns (UFixed discountPercentage, ReferralStatus status);
|
109
103
|
}
|