@etherisc/gif-next 0.0.2-f15b559-661 → 0.0.2-f1b01e0-214
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/README.md +43 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +38 -38
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -26
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +6 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +366 -251
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +8 -39
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +101 -28
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +283 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +37 -5
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +32 -145
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +101 -46
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -87
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +160 -89
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +56 -52
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +1 -87
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +68 -5
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +44 -74
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +94 -124
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +101 -46
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +82 -173
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +20 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +69 -112
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +95 -138
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +101 -46
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +104 -8
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +62 -13
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +119 -26
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +520 -413
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +101 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +225 -196
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +94 -65
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -36
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +356 -346
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +20 -20
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -35
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +98 -35
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -21
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -21
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -42
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -31
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +22 -43
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +101 -46
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +64 -64
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -39
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +6 -6
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +10 -31
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +18 -18
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +10 -31
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +34 -34
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +80 -80
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +41 -41
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +90 -24
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -22
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +27 -48
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +101 -46
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -50
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +42 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +21 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +21 -42
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +21 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +62 -62
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +32 -32
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +41 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +63 -82
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -51
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +21 -42
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +55 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +27 -23
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +445 -355
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +481 -376
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +128 -124
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +0 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +114 -129
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +45 -49
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +60 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +44 -51
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -21
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -21
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +83 -39
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +75 -4
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +133 -94
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +41 -37
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +109 -30
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +27 -23
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +10 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +93 -37
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +56 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/IAccountingService.sol +2 -2
- package/contracts/authorization/AccessAdmin.sol +201 -186
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +40 -31
- package/contracts/authorization/Authorization.sol +61 -33
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +63 -36
- package/contracts/authorization/IAuthorization.sol +6 -0
- package/contracts/distribution/BasicDistribution.sol +6 -6
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +3 -48
- package/contracts/distribution/DistributionService.sol +57 -30
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +4 -2
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FireProduct.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +0 -4
- package/contracts/instance/IInstance.sol +45 -9
- package/contracts/instance/IInstanceService.sol +19 -3
- package/contracts/instance/Instance.sol +73 -16
- package/contracts/instance/InstanceAdmin.sol +120 -107
- package/contracts/instance/InstanceAuthorizationV3.sol +43 -21
- package/contracts/instance/InstanceReader.sol +13 -0
- package/contracts/instance/InstanceService.sol +128 -73
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +16 -5
- package/contracts/instance/module/IDistribution.sol +19 -7
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +0 -2
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +0 -2
- package/contracts/pool/PoolService.sol +1 -3
- package/contracts/product/ApplicationService.sol +21 -6
- package/contracts/product/BasicProduct.sol +0 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +3 -0
- package/contracts/product/PolicyService.sol +0 -18
- package/contracts/product/PricingService.sol +11 -6
- package/contracts/product/Product.sol +0 -2
- package/contracts/product/RiskService.sol +10 -0
- package/contracts/registry/IRegistry.sol +4 -0
- package/contracts/registry/RegistryAdmin.sol +133 -229
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/ReleaseAdmin.sol +30 -22
- package/contracts/registry/ReleaseRegistry.sol +39 -33
- package/contracts/registry/ServiceAuthorizationV3.sol +87 -3
- package/contracts/shared/Component.sol +13 -30
- package/contracts/shared/ComponentService.sol +58 -42
- package/contracts/shared/ContractLib.sol +28 -0
- package/contracts/shared/IComponent.sol +0 -3
- package/contracts/shared/IComponentService.sol +9 -9
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +0 -2
- package/contracts/shared/NftOwnable.sol +1 -1
- package/contracts/shared/Registerable.sol +1 -4
- package/contracts/shared/TokenHandler.sol +5 -4
- package/contracts/staking/IStaking.sol +12 -2
- package/contracts/staking/IStakingService.sol +8 -1
- package/contracts/staking/Staking.sol +35 -15
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +79 -22
- package/contracts/staking/StakingReader.sol +5 -15
- package/contracts/staking/StakingService.sol +36 -2
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/ObjectType.sol +5 -14
- package/contracts/type/UFixed.sol +27 -10
- package/contracts/type/Version.sol +39 -0
- package/package.json +2 -2
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
| @@ -4,7 +4,12 @@ pragma solidity ^0.8.20; | |
| 4 4 | 
             
            import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
         | 
| 5 5 |  | 
| 6 6 | 
             
            import {IAccess} from "./IAccess.sol";
         | 
| 7 | 
            +
            import {IAuthorization} from "./IAuthorization.sol";
         | 
| 7 8 | 
             
            import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
         | 
| 9 | 
            +
            import {IRelease} from "../registry/IRelease.sol";
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            import {NftId} from "../type/NftId.sol";
         | 
| 12 | 
            +
            import {ObjectType} from "../type/ObjectType.sol";
         | 
| 8 13 | 
             
            import {RoleId} from "../type/RoleId.sol";
         | 
| 9 14 | 
             
            import {Selector} from "../type/Selector.sol";
         | 
| 10 15 | 
             
            import {Str} from "../type/String.sol";
         | 
| @@ -13,59 +18,80 @@ import {VersionPart} from "../type/Version.sol"; | |
| 13 18 | 
             
            interface IAccessAdmin is 
         | 
| 14 19 | 
             
                IAccessManaged,
         | 
| 15 20 | 
             
                IAccess,
         | 
| 16 | 
            -
                IRegistryLinked
         | 
| 21 | 
            +
                IRegistryLinked,
         | 
| 22 | 
            +
                IRelease
         | 
| 17 23 | 
             
            {
         | 
| 18 24 |  | 
| 19 25 | 
             
                // roles, targets and functions
         | 
| 20 | 
            -
                event LogAccessAdminRoleCreated(RoleId roleId, RoleType roleType, RoleId roleAdminId, string name);
         | 
| 21 | 
            -
                event LogAccessAdminTargetCreated(address target, string name);
         | 
| 26 | 
            +
                event LogAccessAdminRoleCreated(string admin, RoleId roleId, RoleType roleType, RoleId roleAdminId, string name);
         | 
| 27 | 
            +
                event LogAccessAdminTargetCreated(string admin, address target, string name);
         | 
| 22 28 |  | 
| 23 | 
            -
                event LogAccessAdminRoleGranted(address account, string roleName);
         | 
| 24 | 
            -
                event LogAccessAdminRoleRevoked(address account, string roleName);
         | 
| 25 | 
            -
                event LogAccessAdminFunctionGranted( | 
| 29 | 
            +
                event LogAccessAdminRoleGranted(string admin, address account, string roleName);
         | 
| 30 | 
            +
                event LogAccessAdminRoleRevoked(string admin, address account, string roleName);
         | 
| 31 | 
            +
                event LogAccessAdminFunctionGranted(string admin, address target, string func);
         | 
| 26 32 |  | 
| 27 33 | 
             
                // only deployer modifier
         | 
| 28 | 
            -
                error  | 
| 34 | 
            +
                error ErrorAccessAdminNotDeployer();
         | 
| 29 35 |  | 
| 30 36 | 
             
                // only role admin modifier
         | 
| 31 | 
            -
                error  | 
| 37 | 
            +
                error ErrorAccessAdminNotAdminOfRole(RoleId adminRoleId, address account);
         | 
| 32 38 |  | 
| 33 39 | 
             
                // only role owner modifier
         | 
| 34 | 
            -
                error  | 
| 40 | 
            +
                error ErrorAccessAdminNotRoleOwner(RoleId roleId, address account);
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                // initialization
         | 
| 43 | 
            +
                error ErrorAccessAdminNotRegistry(address registry);
         | 
| 44 | 
            +
                error ErrorAccessAdminAuthorityNotContract(address authority);
         | 
| 45 | 
            +
                error ErrorAccessAdminAccessManagerNotAccessManager(address authority);
         | 
| 46 | 
            +
                error ErrorAccessAdminAccessManagerEmptyName();
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                // check target
         | 
| 49 | 
            +
                error ErrorAccessAdminTargetNotCreated(address target);
         | 
| 50 | 
            +
                error ErrorAccessAdminTargetNotRegistered(address target);
         | 
| 51 | 
            +
                error ErrorAccessAdminTargetTypeMismatch(address target, ObjectType expectedType, ObjectType actualType);
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                // check authorization
         | 
| 54 | 
            +
                error ErrorAccessAdminAlreadyInitialized(address authorization);
         | 
| 55 | 
            +
                error ErrorAccessAdminNotAuthorization(address authorization);
         | 
| 56 | 
            +
                error ErrorAccessAdminDomainMismatch(address authorization, ObjectType expectedDomain, ObjectType actualDomain);
         | 
| 57 | 
            +
                error ErrorAccessAdminReleaseMismatch(address authorization, VersionPart expectedRelease, VersionPart actualRelease);
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                // link to nft
         | 
| 60 | 
            +
                error ErrorAccessAdminNotRegistered(address registerable);
         | 
| 35 61 |  | 
| 36 62 | 
             
                // initialize authority
         | 
| 37 | 
            -
                error  | 
| 63 | 
            +
                error ErrorAccessAdminAdminRoleMissing();
         | 
| 38 64 |  | 
| 39 65 | 
             
                // create role
         | 
| 40 | 
            -
                error  | 
| 41 | 
            -
                error  | 
| 42 | 
            -
                error  | 
| 43 | 
            -
                error  | 
| 66 | 
            +
                error ErrorAccessAdminRoleAlreadyCreated(RoleId roleId, string name);
         | 
| 67 | 
            +
                error ErrorAccessAdminRoleAdminNotExisting(RoleId adminRoleId);
         | 
| 68 | 
            +
                error ErrorAccessAdminRoleNameEmpty(RoleId roleId);
         | 
| 69 | 
            +
                error ErrorAccessAdminRoleNameAlreadyExists(RoleId roleId, string name, RoleId existingRoleId);
         | 
| 44 70 |  | 
| 45 71 | 
             
                // grant/revoke/renounce role
         | 
| 46 | 
            -
                error  | 
| 47 | 
            -
                error  | 
| 48 | 
            -
                error  | 
| 49 | 
            -
                error  | 
| 50 | 
            -
                error  | 
| 51 | 
            -
                error  | 
| 72 | 
            +
                error ErrorAccessAdminRoleUnknown(RoleId roleId);
         | 
| 73 | 
            +
                error ErrorAccessAdminRoleIsLocked(RoleId roleId);
         | 
| 74 | 
            +
                error ErrorAccessAdminRoleIsPaused(RoleId roleId);
         | 
| 75 | 
            +
                error ErrorAccessAdminRoleMembersLimitReached(RoleId roleId, uint256 memberCountLimit);
         | 
| 76 | 
            +
                error ErrorAccessAdminRoleMemberNotContract(RoleId roleId, address notContract);
         | 
| 77 | 
            +
                error ErrorAccessAdminRoleMemberRemovalDisabled(RoleId roleId, address expectedMember);
         | 
| 52 78 |  | 
| 53 79 | 
             
                // create target
         | 
| 54 | 
            -
                error  | 
| 55 | 
            -
                error  | 
| 56 | 
            -
                error  | 
| 57 | 
            -
                error  | 
| 58 | 
            -
                error  | 
| 80 | 
            +
                error ErrorAccessAdminTargetAlreadyCreated(address target, string name);
         | 
| 81 | 
            +
                error ErrorAccessAdminTargetNameEmpty(address target);
         | 
| 82 | 
            +
                error ErrorAccessAdminTargetNameAlreadyExists(address target, string name, address existingTarget);
         | 
| 83 | 
            +
                error ErrorAccessAdminTargetNotAccessManaged(address target);
         | 
| 84 | 
            +
                error ErrorAccessAdminTargetAuthorityMismatch(address expectedAuthority, address actualAuthority);
         | 
| 59 85 |  | 
| 60 86 | 
             
                // lock target
         | 
| 61 | 
            -
                error  | 
| 62 | 
            -
                error  | 
| 87 | 
            +
                error ErrorAccessAdminTagetNotLockable();
         | 
| 88 | 
            +
                error ErrorAccessAdminTargetAlreadyLocked(address target, bool isLocked);
         | 
| 63 89 |  | 
| 64 90 | 
             
                // authorize target functions
         | 
| 65 | 
            -
                error  | 
| 91 | 
            +
                error ErrorAccessAdminAuthorizeForAdminRoleInvalid(address target);
         | 
| 66 92 |  | 
| 67 93 | 
             
                // check target
         | 
| 68 | 
            -
                error  | 
| 94 | 
            +
                error ErrorAccessAdminTargetUnknown(address target);
         | 
| 69 95 |  | 
| 70 96 | 
             
                /// @dev Set the disabled status of the speicified role.
         | 
| 71 97 | 
             
                /// Role disabling only prevents the role from being granted to new accounts.
         | 
| @@ -110,7 +136,11 @@ interface IAccessAdmin is | |
| 110 136 |  | 
| 111 137 | 
             
                //--- view functions ----------------------------------------------------//
         | 
| 112 138 |  | 
| 113 | 
            -
                function  | 
| 139 | 
            +
                function getAuthorization() external view returns (IAuthorization authorization);
         | 
| 140 | 
            +
                function getLinkedNftId() external view returns (NftId linkedNftId);
         | 
| 141 | 
            +
                function getLinkedOwner() external view returns (address linkedOwner);
         | 
| 142 | 
            +
             | 
| 143 | 
            +
                function isLocked() external view returns (bool locked);
         | 
| 114 144 |  | 
| 115 145 | 
             
                function roles() external view returns (uint256 numberOfRoles);
         | 
| 116 146 | 
             
                function getRoleId(uint256 idx) external view returns (RoleId roleId);
         | 
| @@ -118,8 +148,8 @@ interface IAccessAdmin is | |
| 118 148 | 
             
                function getPublicRole() external view returns (RoleId roleId);
         | 
| 119 149 |  | 
| 120 150 | 
             
                function roleExists(RoleId roleId) external view returns (bool exists); 
         | 
| 151 | 
            +
                function getRoleForName(string memory name) external view returns (RoleId roleId);
         | 
| 121 152 | 
             
                function getRoleInfo(RoleId roleId) external view returns (RoleInfo memory roleInfo);
         | 
| 122 | 
            -
                function getRoleForName(Str name) external view returns (RoleNameInfo memory);
         | 
| 123 153 |  | 
| 124 154 | 
             
                function hasRole(address account, RoleId roleId) external view returns (bool);
         | 
| 125 155 | 
             
                function hasAdminRole(address account, RoleId roleId) external view returns (bool);
         | 
| @@ -127,17 +157,14 @@ interface IAccessAdmin is | |
| 127 157 | 
             
                function getRoleMember(RoleId roleId, uint256 idx) external view returns (address account);
         | 
| 128 158 |  | 
| 129 159 | 
             
                function targetExists(address target) external view returns (bool exists);
         | 
| 130 | 
            -
                function  | 
| 160 | 
            +
                function getTargetForName(Str name) external view returns (address target);
         | 
| 131 161 | 
             
                function targets() external view returns (uint256 numberOfTargets);
         | 
| 132 162 | 
             
                function getTargetAddress(uint256 idx) external view returns (address target);
         | 
| 133 163 | 
             
                function getTargetInfo(address target) external view returns (TargetInfo memory targetInfo);
         | 
| 134 | 
            -
                function  | 
| 164 | 
            +
                function isTargetLocked(address target) external view returns (bool locked);
         | 
| 135 165 |  | 
| 136 166 | 
             
                function authorizedFunctions(address target) external view returns (uint256 numberOfFunctions);
         | 
| 137 167 | 
             
                function getAuthorizedFunction(address target, uint256 idx) external view returns (FunctionInfo memory func, RoleId roleId);
         | 
| 138 | 
            -
                function canCall(address caller, address target, Selector selector) external view returns (bool can);
         | 
| 139 168 |  | 
| 140 | 
            -
                function toRole(RoleId adminRoleId, RoleType roleType, uint32 maxMemberCount, string memory name) external view returns (RoleInfo memory);
         | 
| 141 | 
            -
                function toFunction(bytes4 selector, string memory name) external view returns (FunctionInfo memory);
         | 
| 142 169 | 
             
                function deployer() external view returns (address);
         | 
| 143 170 | 
             
            }
         | 
| @@ -1,6 +1,8 @@ | |
| 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";
         | 
| 5 7 | 
             
            import {ObjectType} from "../type/ObjectType.sol";
         | 
| 6 8 | 
             
            import {RoleId} from "../type/RoleId.sol";
         | 
| @@ -8,12 +10,16 @@ import {Str} from "../type/String.sol"; | |
| 8 10 | 
             
            import {VersionPart} from "../type/Version.sol";
         | 
| 9 11 |  | 
| 10 12 | 
             
            interface IAuthorization is 
         | 
| 13 | 
            +
                 IERC165,
         | 
| 11 14 | 
             
                 IAccess 
         | 
| 12 15 | 
             
            {
         | 
| 13 16 |  | 
| 14 17 | 
             
                 error ErrorAuthorizationMainTargetNameEmpty();
         | 
| 15 18 | 
             
                 error ErrorAuthorizationTargetDomainZero();
         | 
| 16 19 |  | 
| 20 | 
            +
                 /// @dev Returns the main domain of the authorization.
         | 
| 21 | 
            +
                 function getDomain() external view returns(ObjectType targetDomain);
         | 
| 22 | 
            +
             | 
| 17 23 | 
             
                 /// @dev Returns the list of service targets.
         | 
| 18 24 | 
             
                 function getServiceDomains() external view returns(ObjectType[] memory serviceDomains);
         | 
| 19 25 |  | 
| @@ -7,7 +7,7 @@ import {Distribution} from "./Distribution.sol"; | |
| 7 7 | 
             
            import {DistributorType} from "../type/DistributorType.sol";
         | 
| 8 8 | 
             
            import {DISTRIBUTOR} from "../type/ObjectType.sol";
         | 
| 9 9 | 
             
            import {Fee} from "../type/Fee.sol";
         | 
| 10 | 
            -
            import {NftId} from "../type/NftId.sol";
         | 
| 10 | 
            +
            import {NftId, NftIdLib} from "../type/NftId.sol";
         | 
| 11 11 | 
             
            import {ReferralId} from "../type/Referral.sol";
         | 
| 12 12 | 
             
            import {Seconds} from "../type/Seconds.sol";
         | 
| 13 13 | 
             
            import {Timestamp} from "../type/Timestamp.sol";
         | 
| @@ -95,6 +95,7 @@ contract BasicDistribution is | |
| 95 95 | 
             
                 * referral codes need to be unique
         | 
| 96 96 | 
             
                 */
         | 
| 97 97 | 
             
                function createReferral(
         | 
| 98 | 
            +
                    NftId distributorNftId,
         | 
| 98 99 | 
             
                    string memory code,
         | 
| 99 100 | 
             
                    UFixed discountPercentage,
         | 
| 100 101 | 
             
                    uint32 maxReferrals,
         | 
| @@ -104,10 +105,10 @@ contract BasicDistribution is | |
| 104 105 | 
             
                    external
         | 
| 105 106 | 
             
                    virtual
         | 
| 106 107 | 
             
                    restricted()
         | 
| 107 | 
            -
                     | 
| 108 | 
            +
                    onlyNftOwner(distributorNftId)
         | 
| 108 109 | 
             
                    returns (ReferralId referralId)
         | 
| 109 110 | 
             
                {
         | 
| 110 | 
            -
                     | 
| 111 | 
            +
                    _checkNftType(distributorNftId, DISTRIBUTOR());
         | 
| 111 112 | 
             
                    return _createReferral(
         | 
| 112 113 | 
             
                        distributorNftId,
         | 
| 113 114 | 
             
                        code,
         | 
| @@ -122,8 +123,7 @@ contract BasicDistribution is | |
| 122 123 | 
             
                    NftId instanceNftId,
         | 
| 123 124 | 
             
                    IAuthorization authorization, 
         | 
| 124 125 | 
             
                    address initialOwner,
         | 
| 125 | 
            -
                    string memory name | 
| 126 | 
            -
                    address token
         | 
| 126 | 
            +
                    string memory name
         | 
| 127 127 | 
             
                )
         | 
| 128 128 | 
             
                    internal
         | 
| 129 129 | 
             
                    virtual
         | 
| @@ -133,9 +133,9 @@ contract BasicDistribution is | |
| 133 133 | 
             
                        registry, 
         | 
| 134 134 | 
             
                        instanceNftId, 
         | 
| 135 135 | 
             
                        authorization,
         | 
| 136 | 
            +
                        false,
         | 
| 136 137 | 
             
                        initialOwner, 
         | 
| 137 138 | 
             
                        name, 
         | 
| 138 | 
            -
                        token, 
         | 
| 139 139 | 
             
                        ""); // component specifc data
         | 
| 140 140 | 
             
                }
         | 
| 141 141 | 
             
            }
         | 
| @@ -10,7 +10,7 @@ import {Amount} from "../type/Amount.sol"; | |
| 10 10 | 
             
            import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
         | 
| 11 11 | 
             
            import {DistributorType} from "../type/DistributorType.sol";
         | 
| 12 12 | 
             
            import {Fee} from "../type/Fee.sol";
         | 
| 13 | 
            -
            import {NftId | 
| 13 | 
            +
            import {NftId} from "../type/NftId.sol";
         | 
| 14 14 | 
             
            import {ReferralId, ReferralStatus, ReferralLib} from "../type/Referral.sol";
         | 
| 15 15 | 
             
            import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
         | 
| 16 16 | 
             
            import {Seconds} from "../type/Seconds.sol";
         | 
| @@ -28,17 +28,8 @@ abstract contract Distribution is | |
| 28 28 | 
             
                struct DistributionStorage {
         | 
| 29 29 | 
             
                    IComponentService _componentService;
         | 
| 30 30 | 
             
                    IDistributionService _distributionService;
         | 
| 31 | 
            -
                    mapping(address distributor => NftId distributorNftId) _distributorNftId;
         | 
| 32 31 | 
             
                }
         | 
| 33 32 |  | 
| 34 | 
            -
                modifier onlyDistributor() {
         | 
| 35 | 
            -
                    if (!isDistributor(msg.sender)) {
         | 
| 36 | 
            -
                        revert ErrorDistributionNotDistributor(msg.sender);
         | 
| 37 | 
            -
                    }
         | 
| 38 | 
            -
                    _;
         | 
| 39 | 
            -
                }
         | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 33 | 
             
                function processRenewal(
         | 
| 43 34 | 
             
                    ReferralId referralId,
         | 
| 44 35 | 
             
                    uint256 feeAmount
         | 
| @@ -56,7 +47,6 @@ abstract contract Distribution is | |
| 56 47 | 
             
                    external 
         | 
| 57 48 | 
             
                    virtual
         | 
| 58 49 | 
             
                    restricted()
         | 
| 59 | 
            -
                    onlyDistributor()
         | 
| 60 50 | 
             
                    onlyNftOfType(distributorNftId, DISTRIBUTOR())
         | 
| 61 51 | 
             
                    onlyNftOwner(distributorNftId)
         | 
| 62 52 | 
             
                    returns (Amount withdrawnAmount) 
         | 
| @@ -64,27 +54,6 @@ abstract contract Distribution is | |
| 64 54 | 
             
                    return _withdrawCommission(distributorNftId, amount);
         | 
| 65 55 | 
             
                }
         | 
| 66 56 |  | 
| 67 | 
            -
             | 
| 68 | 
            -
                function isDistributor(address candidate)
         | 
| 69 | 
            -
                    public
         | 
| 70 | 
            -
                    view
         | 
| 71 | 
            -
                    returns (bool)
         | 
| 72 | 
            -
                {
         | 
| 73 | 
            -
                    DistributionStorage storage $ = _getDistributionStorage();
         | 
| 74 | 
            -
                    return $._distributorNftId[candidate].gtz();
         | 
| 75 | 
            -
                }
         | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
                function getDistributorNftId(address distributor)
         | 
| 79 | 
            -
                    public
         | 
| 80 | 
            -
                    view
         | 
| 81 | 
            -
                    returns (NftId distributorNftId)
         | 
| 82 | 
            -
                {
         | 
| 83 | 
            -
                    DistributionStorage storage $ = _getDistributionStorage();
         | 
| 84 | 
            -
                    return $._distributorNftId[distributor];
         | 
| 85 | 
            -
                }
         | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 57 | 
             
                function getDiscountPercentage(string memory referralCode)
         | 
| 89 58 | 
             
                    external
         | 
| 90 59 | 
             
                    view
         | 
| @@ -135,9 +104,9 @@ abstract contract Distribution is | |
| 135 104 | 
             
                    address registry,
         | 
| 136 105 | 
             
                    NftId productNftId,
         | 
| 137 106 | 
             
                    IAuthorization authorization, 
         | 
| 107 | 
            +
                    bool isInterceptor,
         | 
| 138 108 | 
             
                    address initialOwner,
         | 
| 139 109 | 
             
                    string memory name,
         | 
| 140 | 
            -
                    address token,
         | 
| 141 110 | 
             
                    bytes memory componentData // component specifidc data 
         | 
| 142 111 | 
             
                )
         | 
| 143 112 | 
             
                    internal
         | 
| @@ -148,10 +117,9 @@ abstract contract Distribution is | |
| 148 117 | 
             
                        registry, 
         | 
| 149 118 | 
             
                        productNftId, 
         | 
| 150 119 | 
             
                        name, 
         | 
| 151 | 
            -
                        token, 
         | 
| 152 120 | 
             
                        DISTRIBUTION(), 
         | 
| 153 121 | 
             
                        authorization,
         | 
| 154 | 
            -
                         | 
| 122 | 
            +
                        isInterceptor,
         | 
| 155 123 | 
             
                        initialOwner, 
         | 
| 156 124 | 
             
                        componentData);
         | 
| 157 125 |  | 
| @@ -215,16 +183,11 @@ abstract contract Distribution is | |
| 215 183 | 
             
                    returns(NftId distributorNftId)
         | 
| 216 184 | 
             
                {
         | 
| 217 185 | 
             
                    DistributionStorage storage $ = _getDistributionStorage();
         | 
| 218 | 
            -
                    if($._distributorNftId[distributor].gtz()) {
         | 
| 219 | 
            -
                        revert ErrorDistributionAlreadyDistributor(distributor, $._distributorNftId[distributor]);
         | 
| 220 | 
            -
                    }
         | 
| 221 186 |  | 
| 222 187 | 
             
                    distributorNftId = $._distributionService.createDistributor(
         | 
| 223 188 | 
             
                        distributor,
         | 
| 224 189 | 
             
                        distributorType,
         | 
| 225 190 | 
             
                        data);
         | 
| 226 | 
            -
             | 
| 227 | 
            -
                    $._distributorNftId[distributor] = distributorNftId;
         | 
| 228 191 | 
             
                }
         | 
| 229 192 |  | 
| 230 193 | 
             
                /// @dev Uptates the distributor type for the specified distributor.
         | 
| @@ -273,14 +236,6 @@ abstract contract Distribution is | |
| 273 236 | 
             
                    return _getDistributionStorage()._distributionService.withdrawCommission(distributorNftId, amount);
         | 
| 274 237 | 
             
                }
         | 
| 275 238 |  | 
| 276 | 
            -
                function _nftTransferFrom(address from, address to, uint256 tokenId, address operator) internal virtual override {
         | 
| 277 | 
            -
                    // keep track of distributor nft owner
         | 
| 278 | 
            -
                    emit LogDistributorUpdated(to, operator);
         | 
| 279 | 
            -
                    DistributionStorage storage $ = _getDistributionStorage();
         | 
| 280 | 
            -
                    $._distributorNftId[from] = NftIdLib.zero();
         | 
| 281 | 
            -
                    $._distributorNftId[to] = NftIdLib.toNftId(tokenId);
         | 
| 282 | 
            -
                }
         | 
| 283 | 
            -
             | 
| 284 239 | 
             
                function _getDistributionStorage() private pure returns (DistributionStorage storage $) {
         | 
| 285 240 | 
             
                    assembly {
         | 
| 286 241 | 
             
                        $.slot := DISTRIBUTION_STORAGE_LOCATION_V1
         | 
| @@ -74,7 +74,6 @@ contract DistributionService is | |
| 74 74 | 
             
                    returns (DistributorType distributorType)
         | 
| 75 75 | 
             
                {
         | 
| 76 76 | 
             
                    (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
         | 
| 77 | 
            -
                    // InstanceReader instanceReader = instance.getInstanceReader();
         | 
| 78 77 |  | 
| 79 78 | 
             
                    {
         | 
| 80 79 | 
             
                        NftId productNftId = _getProductNftId(distributionNftId);
         | 
| @@ -94,16 +93,17 @@ contract DistributionService is | |
| 94 93 | 
             
                    }
         | 
| 95 94 |  | 
| 96 95 | 
             
                    distributorType = DistributorTypeLib.toDistributorType(distributionNftId, name);
         | 
| 97 | 
            -
                    IDistribution.DistributorTypeInfo memory info = IDistribution.DistributorTypeInfo(
         | 
| 98 | 
            -
                        name,
         | 
| 99 | 
            -
                         | 
| 100 | 
            -
                         | 
| 101 | 
            -
                         | 
| 102 | 
            -
                         | 
| 103 | 
            -
                         | 
| 104 | 
            -
                         | 
| 105 | 
            -
                         | 
| 106 | 
            -
                         | 
| 96 | 
            +
                    IDistribution.DistributorTypeInfo memory info = IDistribution.DistributorTypeInfo({
         | 
| 97 | 
            +
                        name: name,
         | 
| 98 | 
            +
                        distributionNftId: distributionNftId,
         | 
| 99 | 
            +
                        minDiscountPercentage: minDiscountPercentage,
         | 
| 100 | 
            +
                        maxDiscountPercentage: maxDiscountPercentage,
         | 
| 101 | 
            +
                        commissionPercentage: commissionPercentage,
         | 
| 102 | 
            +
                        maxReferralCount: maxReferralCount,
         | 
| 103 | 
            +
                        maxReferralLifetime: maxReferralLifetime,
         | 
| 104 | 
            +
                        allowSelfReferrals: allowSelfReferrals,
         | 
| 105 | 
            +
                        allowRenewals: allowRenewals,
         | 
| 106 | 
            +
                        data: data});
         | 
| 107 107 |  | 
| 108 108 | 
             
                    instance.getInstanceStore().createDistributorType(distributorType, info);
         | 
| 109 109 | 
             
                }
         | 
| @@ -119,6 +119,7 @@ contract DistributionService is | |
| 119 119 | 
             
                    returns (NftId distributorNftId)
         | 
| 120 120 | 
             
                {
         | 
| 121 121 | 
             
                    (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
         | 
| 122 | 
            +
                    _checkDistributionType(instance.getInstanceReader(), distributorType, distributionNftId);
         | 
| 122 123 |  | 
| 123 124 | 
             
                    distributorNftId = _registryService.registerDistributor(
         | 
| 124 125 | 
             
                        IRegistry.ObjectInfo(
         | 
| @@ -131,26 +132,29 @@ contract DistributionService is | |
| 131 132 | 
             
                            ""
         | 
| 132 133 | 
             
                        ));
         | 
| 133 134 |  | 
| 134 | 
            -
                    IDistribution.DistributorInfo memory info = IDistribution.DistributorInfo(
         | 
| 135 | 
            -
                        distributorType,
         | 
| 136 | 
            -
                        true,  | 
| 137 | 
            -
                         | 
| 138 | 
            -
                         | 
| 135 | 
            +
                    IDistribution.DistributorInfo memory info = IDistribution.DistributorInfo({
         | 
| 136 | 
            +
                        distributorType: distributorType,
         | 
| 137 | 
            +
                        active: true, 
         | 
| 138 | 
            +
                        numPoliciesSold: 0,
         | 
| 139 | 
            +
                        data: data});
         | 
| 139 140 |  | 
| 140 141 | 
             
                    instance.getInstanceStore().createDistributor(distributorNftId, info);
         | 
| 141 142 | 
             
                }
         | 
| 142 143 |  | 
| 143 144 | 
             
                function changeDistributorType(
         | 
| 144 145 | 
             
                    NftId distributorNftId,
         | 
| 145 | 
            -
                    DistributorType  | 
| 146 | 
            +
                    DistributorType newDistributorType,
         | 
| 146 147 | 
             
                    bytes memory data
         | 
| 147 148 | 
             
                )
         | 
| 148 149 | 
             
                    external
         | 
| 149 150 | 
             
                    virtual
         | 
| 150 151 | 
             
                {
         | 
| 151 | 
            -
                    ( | 
| 152 | 
            +
                    _checkNftType(distributorNftId, DISTRIBUTOR());
         | 
| 153 | 
            +
                    (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
         | 
| 154 | 
            +
                    _checkDistributionType(instance.getInstanceReader(), newDistributorType, distributionNftId);
         | 
| 155 | 
            +
                    
         | 
| 152 156 | 
             
                    IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
         | 
| 153 | 
            -
                    distributorInfo.distributorType =  | 
| 157 | 
            +
                    distributorInfo.distributorType = newDistributorType;
         | 
| 154 158 | 
             
                    distributorInfo.data = data;
         | 
| 155 159 | 
             
                    instance.getInstanceStore().updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
         | 
| 156 160 | 
             
                }
         | 
| @@ -178,6 +182,11 @@ contract DistributionService is | |
| 178 182 | 
             
                        revert ErrorDistributionServiceExpirationInvalid(expiryAt);
         | 
| 179 183 | 
             
                    }
         | 
| 180 184 |  | 
| 185 | 
            +
                    NftId distributorDistributionNftId = getRegistry().getParentNftId(distributorNftId);
         | 
| 186 | 
            +
                    if (distributorDistributionNftId != distributionNftId) {
         | 
| 187 | 
            +
                        revert ErrorDistributionServiceDistributorDistributionMismatch(distributorNftId, distributorDistributionNftId, distributionNftId);
         | 
| 188 | 
            +
                    }
         | 
| 189 | 
            +
             | 
| 181 190 | 
             
                    {
         | 
| 182 191 | 
             
                        InstanceReader instanceReader = instance.getInstanceReader();
         | 
| 183 192 | 
             
                        DistributorType distributorType = instanceReader.getDistributorInfo(distributorNftId).distributorType;
         | 
| @@ -199,15 +208,16 @@ contract DistributionService is | |
| 199 208 |  | 
| 200 209 | 
             
                    {
         | 
| 201 210 | 
             
                        referralId = ReferralLib.toReferralId(distributionNftId, code);
         | 
| 202 | 
            -
                        IDistribution.ReferralInfo memory info = IDistribution.ReferralInfo(
         | 
| 203 | 
            -
                             | 
| 204 | 
            -
                             | 
| 205 | 
            -
                             | 
| 206 | 
            -
                             | 
| 207 | 
            -
                             | 
| 208 | 
            -
                             | 
| 209 | 
            -
                             | 
| 210 | 
            -
             | 
| 211 | 
            +
                        IDistribution.ReferralInfo memory info = IDistribution.ReferralInfo({
         | 
| 212 | 
            +
                            distributionNftId: distributionNftId,
         | 
| 213 | 
            +
                            distributorNftId: distributorNftId,
         | 
| 214 | 
            +
                            referralCode: code,
         | 
| 215 | 
            +
                            discountPercentage: discountPercentage,
         | 
| 216 | 
            +
                            maxReferrals: maxReferrals,
         | 
| 217 | 
            +
                            usedReferrals: 0, 
         | 
| 218 | 
            +
                            expiryAt: expiryAt,
         | 
| 219 | 
            +
                            data: data
         | 
| 220 | 
            +
                        });
         | 
| 211 221 |  | 
| 212 222 | 
             
                        instance.getInstanceStore().createReferral(referralId, info);
         | 
| 213 223 | 
             
                    }
         | 
| @@ -288,7 +298,7 @@ contract DistributionService is | |
| 288 298 | 
             
                    InstanceReader reader = instance.getInstanceReader();
         | 
| 289 299 |  | 
| 290 300 | 
             
                    IComponents.ComponentInfo memory distributionInfo = reader.getComponentInfo(distributionNftId);
         | 
| 291 | 
            -
                    address distributionWallet = distributionInfo.tokenHandler.getWallet();
         | 
| 301 | 
            +
                    // address distributionWallet = distributionInfo.tokenHandler.getWallet();
         | 
| 292 302 |  | 
| 293 303 | 
             
                    Amount commissionAmount = reader.getFeeAmount(distributorNftId);
         | 
| 294 304 |  | 
| @@ -314,7 +324,7 @@ contract DistributionService is | |
| 314 324 | 
             
                    // transfer amount to distributor
         | 
| 315 325 | 
             
                    {
         | 
| 316 326 | 
             
                        address distributor = getRegistry().ownerOf(distributorNftId);
         | 
| 317 | 
            -
                        emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(distributionInfo. | 
| 327 | 
            +
                        emit LogDistributionServiceCommissionWithdrawn(distributorNftId, distributor, address(distributionInfo.tokenHandler.TOKEN()), withdrawnAmount);
         | 
| 318 328 | 
             
                        distributionInfo.tokenHandler.pushToken(distributor, withdrawnAmount);
         | 
| 319 329 | 
             
                    }
         | 
| 320 330 | 
             
                }
         | 
| @@ -338,10 +348,27 @@ contract DistributionService is | |
| 338 348 | 
             
                        return false;
         | 
| 339 349 | 
             
                    }
         | 
| 340 350 |  | 
| 351 | 
            +
                    // ensure the referral was created on the same distribution
         | 
| 352 | 
            +
                    if(info.distributionNftId != distributionNftId) {
         | 
| 353 | 
            +
                        revert ErrorDistributionServiceReferralDistributionMismatch(referralId, info.distributionNftId, distributionNftId);
         | 
| 354 | 
            +
                    }
         | 
| 355 | 
            +
             | 
| 341 356 | 
             
                    isValid = info.expiryAt.eqz() || (info.expiryAt.gtz() && TimestampLib.blockTimestamp() <= info.expiryAt);
         | 
| 342 357 | 
             
                    isValid = isValid && info.usedReferrals < info.maxReferrals;
         | 
| 343 358 | 
             
                }
         | 
| 344 359 |  | 
| 360 | 
            +
                function _checkDistributionType(InstanceReader instanceReader, DistributorType distributorType, NftId expectedDistributionNftId) 
         | 
| 361 | 
            +
                    internal
         | 
| 362 | 
            +
                    view 
         | 
| 363 | 
            +
                {
         | 
| 364 | 
            +
                    // enfore distributor type belongs to the calling distribution
         | 
| 365 | 
            +
                    NftId distributorTypeDistributionNftId = instanceReader.getDistributorTypeInfo(distributorType).distributionNftId;
         | 
| 366 | 
            +
             | 
| 367 | 
            +
                    if (distributorTypeDistributionNftId != expectedDistributionNftId) {
         | 
| 368 | 
            +
                        revert ErrorDistributionServiceDistributorTypeDistributionMismatch(distributorType, distributorTypeDistributionNftId, expectedDistributionNftId);
         | 
| 369 | 
            +
                    }
         | 
| 370 | 
            +
                }
         | 
| 371 | 
            +
             | 
| 345 372 | 
             
                function _getInstanceForDistribution(NftId distributionNftId)
         | 
| 346 373 | 
             
                    internal
         | 
| 347 374 | 
             
                    view
         | 
| @@ -9,17 +9,8 @@ import {UFixed} from "../type/UFixed.sol"; | |
| 9 9 |  | 
| 10 10 | 
             
            interface IDistributionComponent is IInstanceLinkedComponent {
         | 
| 11 11 |  | 
| 12 | 
            -
                error ErrorDistributionNotDistributor(address distributor);
         | 
| 13 | 
            -
                error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
         | 
| 14 | 
            -
             | 
| 15 12 | 
             
                event LogDistributorUpdated(address to, address operator);
         | 
| 16 13 |  | 
| 17 | 
            -
                /// @dev Returns true iff the provided address is registered as a distributor with this distribution component.
         | 
| 18 | 
            -
                function isDistributor(address candidate) external view returns (bool);
         | 
| 19 | 
            -
             | 
| 20 | 
            -
                /// @dev Returns the distributor Nft Id for the provided address
         | 
| 21 | 
            -
                function getDistributorNftId(address distributor) external view returns (NftId distributorNftId);
         | 
| 22 | 
            -
             | 
| 23 14 | 
             
                function getDiscountPercentage(
         | 
| 24 15 | 
             
                    string memory referralCode
         | 
| 25 16 | 
             
                ) external view returns (UFixed discountPercentage, ReferralStatus status);
         | 
| @@ -13,7 +13,6 @@ import {Timestamp} from "../type/Timestamp.sol"; | |
| 13 13 |  | 
| 14 14 |  | 
| 15 15 | 
             
            interface IDistributionService is IService {
         | 
| 16 | 
            -
             | 
| 17 16 | 
             
                error ErrorDistributionServiceCallerNotRegistered(address caller);
         | 
| 18 17 | 
             
                error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
         | 
| 19 18 | 
             
                error ErrorDistributionServiceCallerNotDistributor(address caller);
         | 
| @@ -26,6 +25,8 @@ interface IDistributionService is IService { | |
| 26 25 | 
             
                error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
         | 
| 27 26 | 
             
                error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
         | 
| 28 27 | 
             
                error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
         | 
| 28 | 
            +
                error ErrorDistributionServiceDistributorTypeDistributionMismatch(DistributorType distributorType, NftId distributorTypeDistributionNftId, NftId distributionNftId);
         | 
| 29 | 
            +
                error ErrorDistributionServiceDistributorDistributionMismatch(NftId distributorNftId, NftId distributorDistributionNftId, NftId distributionNftId);
         | 
| 29 30 |  | 
| 30 31 | 
             
                error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
         | 
| 31 32 |  | 
| @@ -34,6 +35,7 @@ interface IDistributionService is IService { | |
| 34 35 |  | 
| 35 36 | 
             
                error ErrorDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
         | 
| 36 37 | 
             
                error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
         | 
| 38 | 
            +
                error ErrorDistributionServiceReferralDistributionMismatch(ReferralId referralId, NftId referralDistributionNft, NftId distributionNftId);
         | 
| 37 39 |  | 
| 38 40 | 
             
                event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount);
         | 
| 39 41 |  | 
| @@ -59,7 +61,7 @@ interface IDistributionService is IService { | |
| 59 61 |  | 
| 60 62 | 
             
                function changeDistributorType(
         | 
| 61 63 | 
             
                    NftId distributorNftId,
         | 
| 62 | 
            -
                    DistributorType  | 
| 64 | 
            +
                    DistributorType newDistributorType,
         | 
| 63 65 | 
             
                    bytes memory data
         | 
| 64 66 | 
             
                ) external;
         | 
| 65 67 |  | 
| @@ -19,7 +19,6 @@ contract FirePool is | |
| 19 19 | 
             
                    address registry,
         | 
| 20 20 | 
             
                    NftId fireProductNftId,
         | 
| 21 21 | 
             
                    string memory componentName,
         | 
| 22 | 
            -
                    address token,
         | 
| 23 22 | 
             
                    IAuthorization authorization
         | 
| 24 23 | 
             
                ) 
         | 
| 25 24 | 
             
                {
         | 
| @@ -28,7 +27,6 @@ contract FirePool is | |
| 28 27 | 
             
                        registry,
         | 
| 29 28 | 
             
                        fireProductNftId,
         | 
| 30 29 | 
             
                        componentName,
         | 
| 31 | 
            -
                        token,
         | 
| 32 30 | 
             
                        IComponents.PoolInfo({
         | 
| 33 31 | 
             
                            maxBalanceAmount: AmountLib.max(),
         | 
| 34 32 | 
             
                            isInterceptingBundleTransfers: false,
         | 
| @@ -46,7 +44,6 @@ contract FirePool is | |
| 46 44 | 
             
                    address registry,
         | 
| 47 45 | 
             
                    NftId fireProductNftId,
         | 
| 48 46 | 
             
                    string memory componentName,
         | 
| 49 | 
            -
                    address token,
         | 
| 50 47 | 
             
                    IComponents.PoolInfo memory poolInfo,
         | 
| 51 48 | 
             
                    IAuthorization authorization,
         | 
| 52 49 | 
             
                    address initialOwner
         | 
| @@ -58,7 +55,6 @@ contract FirePool is | |
| 58 55 | 
             
                        registry,
         | 
| 59 56 | 
             
                        fireProductNftId,
         | 
| 60 57 | 
             
                        componentName,
         | 
| 61 | 
            -
                        token,
         | 
| 62 58 | 
             
                        poolInfo,
         | 
| 63 59 | 
             
                        authorization,
         | 
| 64 60 | 
             
                        initialOwner);
         | 
| @@ -68,7 +68,6 @@ contract FireProduct is | |
| 68 68 | 
             
                    address registry,
         | 
| 69 69 | 
             
                    NftId instanceNftid,
         | 
| 70 70 | 
             
                    string memory componentName,
         | 
| 71 | 
            -
                    address token,
         | 
| 72 71 | 
             
                    IAuthorization authorization
         | 
| 73 72 | 
             
                )
         | 
| 74 73 | 
             
                {
         | 
| @@ -78,7 +77,6 @@ contract FireProduct is | |
| 78 77 | 
             
                        registry,
         | 
| 79 78 | 
             
                        instanceNftid,
         | 
| 80 79 | 
             
                        componentName,
         | 
| 81 | 
            -
                        token,
         | 
| 82 80 | 
             
                        authorization,
         | 
| 83 81 | 
             
                        initialOwner);
         | 
| 84 82 | 
             
                }
         | 
| @@ -87,7 +85,6 @@ contract FireProduct is | |
| 87 85 | 
             
                    address registry,
         | 
| 88 86 | 
             
                    NftId instanceNftId,
         | 
| 89 87 | 
             
                    string memory componentName,
         | 
| 90 | 
            -
                    address token,
         | 
| 91 88 | 
             
                    IAuthorization authorization,
         | 
| 92 89 | 
             
                    address initialOwner
         | 
| 93 90 | 
             
                )
         | 
| @@ -98,7 +95,6 @@ contract FireProduct is | |
| 98 95 | 
             
                        registry,
         | 
| 99 96 | 
             
                        instanceNftId,
         | 
| 100 97 | 
             
                        componentName,
         | 
| 101 | 
            -
                        token,
         | 
| 102 98 | 
             
                        IComponents.ProductInfo({
         | 
| 103 99 | 
             
                            isProcessingFundedClaims: false,
         | 
| 104 100 | 
             
                            isInterceptingPolicyTransfers: false,
         |