@etherisc/gif-next 0.0.2-e8ea5fe-337 → 0.0.2-e91c6be-472
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 +28 -7
 - package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
 - package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +105 -65
 - package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
 - package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
 - package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
 - 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 +60 -32
 - package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
 - package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
 - package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
 - package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
 - package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
 - package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
 - package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +162 -327
 - package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
 - package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
 - package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +102 -243
 - package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
 - package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +180 -198
 - package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +131 -107
 - package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
 - package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +92 -81
 - package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
 - package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +52 -0
 - package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
 - package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1429 -0
 - package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
 - package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1979 -0
 - package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
 - package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
 - package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1430 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1177 -0
 - package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
 - package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1606 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
 - package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2281 -0
 - 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 +53 -31
 - package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
 - package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +31 -86
 - package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
 - package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -123
 - package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +165 -138
 - package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +57 -97
 - package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +286 -83
 - package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +96 -245
 - package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +99 -87
 - package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
 - package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +197 -116
 - 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 +46 -5
 - 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/module/IAccess.sol/IAccess.dbg.json +1 -1
 - 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 +121 -286
 - package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
 - 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 +87 -76
 - package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
 - package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
 - package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
 - package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +97 -238
 - package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
 - package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +107 -159
 - package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +99 -83
 - package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
 - package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +115 -256
 - package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
 - package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
 - package/artifacts/contracts/pool/BundleService.sol/BundleService.json +203 -208
 - package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +135 -107
 - package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
 - package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +72 -15
 - package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
 - package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +107 -107
 - package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
 - package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +272 -185
 - package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
 - package/artifacts/contracts/pool/Pool.sol/Pool.json +115 -267
 - package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
 - package/artifacts/contracts/pool/PoolService.sol/PoolService.json +420 -366
 - package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +128 -88
 - package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
 - package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +87 -144
 - package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +96 -80
 - package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
 - package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +156 -251
 - package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
 - package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
 - package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
 - package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +202 -200
 - package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +136 -104
 - package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
 - package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +29 -0
 - package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
 - package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +64 -8
 - package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
 - package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +147 -1
 - package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
 - package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
 - package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
 - package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +146 -89
 - package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
 - package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
 - package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
 - package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +267 -167
 - package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +127 -91
 - package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
 - package/artifacts/contracts/product/PricingService.sol/PricingService.json +170 -219
 - package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +111 -91
 - package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
 - package/artifacts/contracts/product/Product.sol/Product.json +154 -249
 - package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
 - package/artifacts/contracts/product/RiskService.sol/RiskService.json +81 -138
 - package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +93 -77
 - package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
 - package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
 - package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
 - package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +309 -33
 - package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
 - package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
 - package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
 - package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
 - package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
 - package/artifacts/contracts/registry/Registry.sol/Registry.json +515 -94
 - package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
 - package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +296 -143
 - package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
 - package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +94 -284
 - package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +91 -75
 - package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
 - package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
 - package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
 - package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +131 -223
 - package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
 - package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
 - 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 +76 -213
 - package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
 - package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +426 -263
 - package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +140 -110
 - package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
 - package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +47 -112
 - package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
 - package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +111 -0
 - package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
 - package/artifacts/contracts/shared/IComponent.sol/IComponent.json +66 -51
 - package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
 - package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +388 -19
 - package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
 - package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +87 -76
 - package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
 - package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
 - package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
 - package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
 - package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
 - package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
 - package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
 - package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
 - package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
 - package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -0
 - package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
 - package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
 - package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
 - package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
 - package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -22
 - package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
 - package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +97 -238
 - package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
 - package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
 - package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
 - package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -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 +22 -57
 - package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
 - package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
 - package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
 - package/artifacts/contracts/shared/Registerable.sol/Registerable.json +58 -89
 - package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
 - package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
 - package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
 - package/artifacts/contracts/shared/Service.sol/Service.json +47 -112
 - package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
 - package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
 - package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
 - package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
 - package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
 - package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
 - package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
 - package/artifacts/contracts/staking/IStaking.sol/IStaking.json +84 -87
 - package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
 - package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
 - package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
 - package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
 - package/artifacts/contracts/staking/Staking.sol/Staking.json +152 -311
 - package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
 - package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +112 -97
 - package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
 - package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -165
 - package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +95 -79
 - package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
 - package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +144 -103
 - package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
 - package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
 - package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
 - package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
 - package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
 - 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 +28 -4
 - 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 +2 -2
 - 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/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 +2 -2
 - package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
 - package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
 - 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 +60 -4
 - 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/StateId.sol/StateIdLib.json +15 -2
 - 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/MathLib.dbg.json +1 -1
 - package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
 - package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
 - package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
 - 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 +71 -70
 - 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 +64 -59
 - package/contracts/authorization/Authorization.sol +111 -39
 - package/contracts/authorization/IAccess.sol +1 -0
 - package/contracts/authorization/IAccessAdmin.sol +4 -3
 - package/contracts/authorization/IAuthorization.sol +13 -7
 - package/contracts/authorization/IServiceAuthorization.sol +3 -1
 - package/contracts/authorization/ReleaseAccessManager.sol +38 -0
 - package/contracts/authorization/ServiceAuthorization.sol +26 -10
 - package/contracts/distribution/BasicDistribution.sol +4 -3
 - package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
 - package/contracts/distribution/Distribution.sol +12 -23
 - package/contracts/distribution/DistributionService.sol +78 -60
 - package/contracts/distribution/DistributionServiceManager.sol +6 -6
 - package/contracts/distribution/IDistributionComponent.sol +1 -1
 - package/contracts/distribution/IDistributionService.sol +5 -6
 - package/contracts/examples/fire/DamageLevel.sol +59 -0
 - package/contracts/examples/fire/FirePool.sol +86 -0
 - package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
 - package/contracts/examples/fire/FireProduct.sol +431 -0
 - package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
 - package/contracts/examples/fire/FireUSD.sol +26 -0
 - package/contracts/examples/unpermissioned/SimpleDistribution.sol +58 -0
 - package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
 - package/contracts/examples/unpermissioned/SimplePool.sol +108 -0
 - package/contracts/examples/unpermissioned/SimpleProduct.sol +345 -0
 - package/contracts/instance/IInstance.sol +4 -1
 - package/contracts/instance/IInstanceService.sol +2 -23
 - package/contracts/instance/Instance.sol +22 -19
 - package/contracts/instance/InstanceAdmin.sol +23 -31
 - package/contracts/instance/InstanceAuthorizationV3.sol +9 -19
 - package/contracts/instance/InstanceReader.sol +83 -18
 - package/contracts/instance/InstanceService.sol +35 -88
 - package/contracts/instance/InstanceServiceManager.sol +6 -7
 - package/contracts/instance/module/IComponents.sol +10 -6
 - package/contracts/instance/module/IPolicy.sol +4 -3
 - package/contracts/oracle/BasicOracle.sol +0 -1
 - package/contracts/oracle/IOracleService.sol +2 -1
 - package/contracts/oracle/Oracle.sol +5 -16
 - package/contracts/oracle/OracleService.sol +56 -43
 - package/contracts/oracle/OracleServiceManager.sol +6 -6
 - package/contracts/pool/BasicPool.sol +33 -24
 - package/contracts/pool/BasicPoolAuthorization.sol +12 -2
 - package/contracts/pool/BundleService.sol +96 -49
 - package/contracts/pool/BundleServiceManager.sol +6 -6
 - package/contracts/pool/IBundleService.sol +11 -5
 - package/contracts/pool/IPoolComponent.sol +19 -15
 - package/contracts/pool/IPoolService.sol +42 -30
 - package/contracts/pool/Pool.sol +142 -123
 - package/contracts/pool/PoolService.sol +254 -143
 - package/contracts/pool/PoolServiceManager.sol +4 -4
 - package/contracts/product/ApplicationService.sol +20 -9
 - package/contracts/product/ApplicationServiceManager.sol +4 -4
 - package/contracts/product/BasicProduct.sol +8 -12
 - package/contracts/product/BasicProductAuthorization.sol +0 -1
 - package/contracts/product/ClaimService.sol +235 -108
 - package/contracts/product/ClaimServiceManager.sol +4 -4
 - package/contracts/product/IClaimService.sol +3 -2
 - package/contracts/product/IPolicyService.sol +13 -4
 - package/contracts/product/IPricingService.sol +9 -9
 - package/contracts/product/IProductComponent.sol +23 -3
 - package/contracts/product/PolicyService.sol +169 -47
 - package/contracts/product/PolicyServiceManager.sol +4 -4
 - package/contracts/product/PricingService.sol +12 -13
 - package/contracts/product/PricingServiceManager.sol +3 -3
 - package/contracts/product/Product.sol +77 -70
 - package/contracts/product/RiskService.sol +4 -5
 - package/contracts/product/RiskServiceManager.sol +4 -4
 - package/contracts/registry/ChainNft.sol +68 -38
 - package/contracts/registry/IRegistry.sol +56 -17
 - package/contracts/registry/IRegistryService.sol +5 -12
 - package/contracts/registry/ITransferInterceptor.sol +1 -2
 - package/contracts/registry/Registry.sol +349 -200
 - package/contracts/registry/RegistryAdmin.sol +146 -58
 - package/contracts/registry/RegistryService.sol +35 -46
 - package/contracts/registry/RegistryServiceManager.sol +2 -2
 - package/contracts/registry/ReleaseLifecycle.sol +6 -3
 - package/contracts/registry/ReleaseRegistry.sol +204 -204
 - package/contracts/registry/ServiceAuthorizationV3.sol +24 -20
 - package/contracts/shared/Component.sol +62 -101
 - package/contracts/shared/ComponentService.sol +291 -153
 - package/contracts/shared/ComponentServiceManager.sol +8 -5
 - package/contracts/shared/ComponentVerifyingService.sol +27 -16
 - package/contracts/shared/ContractLib.sol +54 -0
 - package/contracts/shared/IComponent.sol +10 -13
 - package/contracts/shared/IComponentService.sol +38 -16
 - package/contracts/shared/IInstanceLinkedComponent.sol +3 -11
 - package/contracts/shared/ILifecycle.sol +3 -1
 - package/contracts/shared/INftOwnable.sol +2 -0
 - package/contracts/shared/IPolicyHolder.sol +12 -22
 - package/contracts/shared/IRegisterable.sol +11 -0
 - package/contracts/shared/InitializableERC165.sol +2 -2
 - package/contracts/shared/InstanceLinkedComponent.sol +70 -37
 - package/contracts/shared/KeyValueStore.sol +1 -1
 - package/contracts/shared/Lifecycle.sol +15 -4
 - package/contracts/shared/NftOwnable.sol +26 -6
 - package/contracts/shared/PolicyHolder.sol +15 -52
 - package/contracts/shared/Registerable.sol +19 -11
 - package/contracts/shared/RegistryLinked.sol +9 -14
 - package/contracts/shared/Service.sol +20 -18
 - package/contracts/shared/TokenHandler.sol +324 -66
 - package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
 - package/contracts/staking/IStaking.sol +9 -4
 - package/contracts/staking/IStakingService.sol +0 -3
 - package/contracts/staking/Staking.sol +34 -27
 - package/contracts/staking/StakingManager.sol +8 -6
 - package/contracts/staking/StakingReader.sol +12 -5
 - package/contracts/staking/StakingService.sol +71 -25
 - package/contracts/staking/StakingServiceManager.sol +2 -2
 - package/contracts/type/Amount.sol +15 -0
 - package/contracts/type/ClaimId.sol +6 -1
 - package/contracts/type/NftId.sol +1 -0
 - package/contracts/type/ObjectType.sol +1 -0
 - package/contracts/type/PayoutId.sol +10 -10
 - package/contracts/type/RiskId.sol +16 -2
 - package/contracts/type/RoleId.sol +0 -12
 - package/contracts/type/StateId.sol +14 -1
 - package/contracts/type/UFixed.sol +4 -0
 - package/contracts/upgradeability/ProxyManager.sol +68 -34
 - package/contracts/upgradeability/Versionable.sol +2 -2
 - package/package.json +4 -3
 - package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
 - package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
 - package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
 - package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
 - package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
 - package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
 - package/contracts/authorization/IModuleAuthorization.sol +0 -21
 - package/contracts/authorization/ModuleAuthorization.sol +0 -78
 - package/contracts/shared/InitializableCustom.sol +0 -177
 
| 
         @@ -3,20 +3,23 @@ pragma solidity ^0.8.20; 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            import {Amount, AmountLib} from "../type/Amount.sol";
         
     | 
| 
       5 
5 
     | 
    
         
             
            import {ClaimId} from "../type/ClaimId.sol";
         
     | 
| 
       6 
     | 
    
         
            -
            import { 
     | 
| 
      
 6 
     | 
    
         
            +
            import {IComponent} from "../shared/IComponent.sol";
         
     | 
| 
       7 
7 
     | 
    
         
             
            import {Fee, FeeLib} from "../type/Fee.sol";
         
     | 
| 
       8 
8 
     | 
    
         
             
            import {IRisk} from "../instance/module/IRisk.sol";
         
     | 
| 
       9 
9 
     | 
    
         
             
            import {IApplicationService} from "./IApplicationService.sol";
         
     | 
| 
       10 
10 
     | 
    
         
             
            import {IAuthorization} from "../authorization/IAuthorization.sol";
         
     | 
| 
       11 
11 
     | 
    
         
             
            import {IComponentService} from "../shared/IComponentService.sol";
         
     | 
| 
      
 12 
     | 
    
         
            +
            import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
         
     | 
| 
      
 13 
     | 
    
         
            +
            import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
         
     | 
| 
       12 
14 
     | 
    
         
             
            import {IPolicyService} from "./IPolicyService.sol";
         
     | 
| 
       13 
15 
     | 
    
         
             
            import {IRiskService} from "./IRiskService.sol";
         
     | 
| 
       14 
16 
     | 
    
         
             
            import {IClaimService} from "./IClaimService.sol";
         
     | 
| 
       15 
17 
     | 
    
         
             
            import {IPricingService} from "./IPricingService.sol";
         
     | 
| 
       16 
18 
     | 
    
         
             
            import {IProductComponent} from "./IProductComponent.sol";
         
     | 
| 
       17 
     | 
    
         
            -
            import {NftId} from "../type/NftId.sol";
         
     | 
| 
      
 19 
     | 
    
         
            +
            import {NftId, NftIdLib} from "../type/NftId.sol";
         
     | 
| 
      
 20 
     | 
    
         
            +
            import {ObjectType, COMPONENT, DISTRIBUTION, ORACLE, POOL, PRODUCT, BUNDLE, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
         
     | 
| 
       18 
21 
     | 
    
         
             
            import {PayoutId} from "../type/PayoutId.sol";
         
     | 
| 
       19 
     | 
    
         
            -
            import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
         
     | 
| 
      
 22 
     | 
    
         
            +
            import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE, BUNDLE } from "../type/ObjectType.sol";
         
     | 
| 
       20 
23 
     | 
    
         
             
            import {ReferralId} from "../type/Referral.sol";
         
     | 
| 
       21 
24 
     | 
    
         
             
            import {RiskId, RiskIdLib} from "../type/RiskId.sol";
         
     | 
| 
       22 
25 
     | 
    
         
             
            import {Seconds} from "../type/Seconds.sol";
         
     | 
| 
         @@ -25,8 +28,9 @@ import {Timestamp} from "../type/Timestamp.sol"; 
     | 
|
| 
       25 
28 
     | 
    
         | 
| 
       26 
29 
     | 
    
         
             
            import {IPolicy} from "../instance/module/IPolicy.sol";
         
     | 
| 
       27 
30 
     | 
    
         
             
            import {IComponents} from "../instance/module/IComponents.sol";
         
     | 
| 
       28 
     | 
    
         
            -
            import { 
     | 
| 
       29 
     | 
    
         
            -
            import { 
     | 
| 
      
 31 
     | 
    
         
            +
            import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
         
     | 
| 
      
 32 
     | 
    
         
            +
            import {IOracleComponent} from "../oracle/IOracleComponent.sol";
         
     | 
| 
      
 33 
     | 
    
         
            +
            import {IPoolComponent} from "../pool/IPoolComponent.sol";
         
     | 
| 
       30 
34 
     | 
    
         | 
| 
       31 
35 
     | 
    
         
             
            abstract contract Product is
         
     | 
| 
       32 
36 
     | 
    
         
             
                InstanceLinkedComponent, 
         
     | 
| 
         @@ -36,16 +40,37 @@ abstract contract Product is 
     | 
|
| 
       36 
40 
     | 
    
         
             
                bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
         
     | 
| 
       37 
41 
     | 
    
         | 
| 
       38 
42 
     | 
    
         
             
                struct ProductStorage {
         
     | 
| 
      
 43 
     | 
    
         
            +
                    IComponents.ProductInfo _productInfo;
         
     | 
| 
      
 44 
     | 
    
         
            +
                    IComponentService _componentService;
         
     | 
| 
       39 
45 
     | 
    
         
             
                    IRiskService _riskService;
         
     | 
| 
       40 
46 
     | 
    
         
             
                    IApplicationService _applicationService;
         
     | 
| 
       41 
47 
     | 
    
         
             
                    IPolicyService _policyService;
         
     | 
| 
       42 
48 
     | 
    
         
             
                    IClaimService _claimService;
         
     | 
| 
       43 
49 
     | 
    
         
             
                    IPricingService _pricingService;
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
                     
     | 
| 
      
 50 
     | 
    
         
            +
                }
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                function registerComponent(address component)
         
     | 
| 
      
 54 
     | 
    
         
            +
                    external
         
     | 
| 
      
 55 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 56 
     | 
    
         
            +
                    onlyOwner()
         
     | 
| 
      
 57 
     | 
    
         
            +
                    returns (NftId componentNftId)
         
     | 
| 
      
 58 
     | 
    
         
            +
                {
         
     | 
| 
      
 59 
     | 
    
         
            +
                    return _getProductStorage()._componentService.registerComponent(component);
         
     | 
| 
      
 60 
     | 
    
         
            +
                }
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
                function processFundedClaim(
         
     | 
| 
      
 64 
     | 
    
         
            +
                    NftId policyNftId, 
         
     | 
| 
      
 65 
     | 
    
         
            +
                    ClaimId claimId, 
         
     | 
| 
      
 66 
     | 
    
         
            +
                    Amount availableAmount
         
     | 
| 
      
 67 
     | 
    
         
            +
                )
         
     | 
| 
      
 68 
     | 
    
         
            +
                    external
         
     | 
| 
      
 69 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 70 
     | 
    
         
            +
                    restricted() // pool service role
         
     | 
| 
      
 71 
     | 
    
         
            +
                    onlyNftOfType(policyNftId, POLICY())
         
     | 
| 
      
 72 
     | 
    
         
            +
                {
         
     | 
| 
      
 73 
     | 
    
         
            +
                    // default implementation does nothing
         
     | 
| 
       49 
74 
     | 
    
         
             
                }
         
     | 
| 
       50 
75 
     | 
    
         | 
| 
       51 
76 
     | 
    
         | 
| 
         @@ -60,6 +85,7 @@ abstract contract Product is 
     | 
|
| 
       60 
85 
     | 
    
         
             
                    public 
         
     | 
| 
       61 
86 
     | 
    
         
             
                    view 
         
     | 
| 
       62 
87 
     | 
    
         
             
                    override 
         
     | 
| 
      
 88 
     | 
    
         
            +
                    onlyNftOfType(bundleNftId, BUNDLE())
         
     | 
| 
       63 
89 
     | 
    
         
             
                    returns (Amount premiumAmount)
         
     | 
| 
       64 
90 
     | 
    
         
             
                {
         
     | 
| 
       65 
91 
     | 
    
         
             
                    IPolicy.PremiumInfo memory premium = _getProductStorage()._pricingService.calculatePremium(
         
     | 
| 
         @@ -91,57 +117,24 @@ abstract contract Product is 
     | 
|
| 
       91 
117 
     | 
    
         
             
                }
         
     | 
| 
       92 
118 
     | 
    
         | 
| 
       93 
119 
     | 
    
         | 
| 
       94 
     | 
    
         
            -
                function register()
         
     | 
| 
       95 
     | 
    
         
            -
                    external
         
     | 
| 
       96 
     | 
    
         
            -
                    virtual
         
     | 
| 
       97 
     | 
    
         
            -
                    onlyOwner()
         
     | 
| 
       98 
     | 
    
         
            -
                {
         
     | 
| 
       99 
     | 
    
         
            -
                    _getProductStorage()._componentService.registerProduct();
         
     | 
| 
       100 
     | 
    
         
            -
                    _approveTokenHandler(type(uint256).max);
         
     | 
| 
       101 
     | 
    
         
            -
                }
         
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
120 
     | 
    
         
             
                function getInitialProductInfo()
         
     | 
| 
       105 
121 
     | 
    
         
             
                    public 
         
     | 
| 
       106 
122 
     | 
    
         
             
                    virtual 
         
     | 
| 
       107 
123 
     | 
    
         
             
                    view 
         
     | 
| 
       108 
124 
     | 
    
         
             
                    returns (IComponents.ProductInfo memory poolInfo)
         
     | 
| 
       109 
125 
     | 
    
         
             
                {
         
     | 
| 
       110 
     | 
    
         
            -
                     
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
                    return IComponents.ProductInfo({
         
     | 
| 
       113 
     | 
    
         
            -
                        distributionNftId: $._distributionNftId,
         
     | 
| 
       114 
     | 
    
         
            -
                        poolNftId: $._poolNftId,
         
     | 
| 
       115 
     | 
    
         
            -
                        productFee: FeeLib.zero(),
         
     | 
| 
       116 
     | 
    
         
            -
                        processingFee: FeeLib.zero(),
         
     | 
| 
       117 
     | 
    
         
            -
                        distributionFee: FeeLib.zero(),
         
     | 
| 
       118 
     | 
    
         
            -
                        minDistributionOwnerFee: FeeLib.zero(),
         
     | 
| 
       119 
     | 
    
         
            -
                        poolFee: FeeLib.zero(),
         
     | 
| 
       120 
     | 
    
         
            -
                        stakingFee: FeeLib.zero(),
         
     | 
| 
       121 
     | 
    
         
            -
                        performanceFee: FeeLib.zero()
         
     | 
| 
       122 
     | 
    
         
            -
                    });
         
     | 
| 
       123 
     | 
    
         
            -
                }
         
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
                function getPoolNftId() external view override returns (NftId poolNftId) {
         
     | 
| 
       126 
     | 
    
         
            -
                    return getRegistry().getNftIdForAddress(address(_getProductStorage()._pool));
         
     | 
| 
      
 126 
     | 
    
         
            +
                    return _getProductStorage()._productInfo;
         
     | 
| 
       127 
127 
     | 
    
         
             
                }
         
     | 
| 
       128 
128 
     | 
    
         | 
| 
       129 
     | 
    
         
            -
                function getDistributionNftId() external view override returns (NftId distributionNftId) {
         
     | 
| 
       130 
     | 
    
         
            -
                    return getRegistry().getNftIdForAddress(address(_getProductStorage()._distribution));
         
     | 
| 
       131 
     | 
    
         
            -
                }
         
     | 
| 
       132 
129 
     | 
    
         | 
| 
       133 
130 
     | 
    
         
             
                function _initializeProduct(
         
     | 
| 
       134 
131 
     | 
    
         
             
                    address registry,
         
     | 
| 
       135 
132 
     | 
    
         
             
                    NftId instanceNftId,
         
     | 
| 
       136 
     | 
    
         
            -
                    IAuthorization authorization,
         
     | 
| 
       137 
     | 
    
         
            -
                    address initialOwner,
         
     | 
| 
       138 
133 
     | 
    
         
             
                    string memory name,
         
     | 
| 
       139 
134 
     | 
    
         
             
                    address token,
         
     | 
| 
       140 
     | 
    
         
            -
                     
     | 
| 
       141 
     | 
    
         
            -
                     
     | 
| 
       142 
     | 
    
         
            -
                    address  
     | 
| 
       143 
     | 
    
         
            -
                    // add NftId [] oracleNftIds (#527)
         
     | 
| 
       144 
     | 
    
         
            -
                    bytes memory registryData, // writeonly data that will saved in the object info record of the registry
         
     | 
| 
      
 135 
     | 
    
         
            +
                    IComponents.ProductInfo memory productInfo,
         
     | 
| 
      
 136 
     | 
    
         
            +
                    IAuthorization authorization,
         
     | 
| 
      
 137 
     | 
    
         
            +
                    address initialOwner,
         
     | 
| 
       145 
138 
     | 
    
         
             
                    bytes memory componentData // writeonly data that will saved in the object info record of the registry
         
     | 
| 
       146 
139 
     | 
    
         
             
                )
         
     | 
| 
       147 
140 
     | 
    
         
             
                    internal
         
     | 
| 
         @@ -155,26 +148,20 @@ abstract contract Product is 
     | 
|
| 
       155 
148 
     | 
    
         
             
                        token, 
         
     | 
| 
       156 
149 
     | 
    
         
             
                        PRODUCT(), 
         
     | 
| 
       157 
150 
     | 
    
         
             
                        authorization, 
         
     | 
| 
       158 
     | 
    
         
            -
                         
     | 
| 
      
 151 
     | 
    
         
            +
                        productInfo.isInterceptingPolicyTransfers, 
         
     | 
| 
       159 
152 
     | 
    
         
             
                        initialOwner, 
         
     | 
| 
       160 
     | 
    
         
            -
                        registryData, 
         
     | 
| 
       161 
153 
     | 
    
         
             
                        componentData);
         
     | 
| 
       162 
154 
     | 
    
         | 
| 
       163 
155 
     | 
    
         
             
                    ProductStorage storage $ = _getProductStorage();
         
     | 
| 
       164 
     | 
    
         
            -
                     
     | 
| 
       165 
     | 
    
         
            -
                    // TODO refactor to go via registry for all components linked to this product (#527)
         
     | 
| 
      
 156 
     | 
    
         
            +
                    $._productInfo = productInfo;
         
     | 
| 
       166 
157 
     | 
    
         
             
                    $._riskService = IRiskService(_getServiceAddress(PRODUCT())); 
         
     | 
| 
       167 
158 
     | 
    
         
             
                    $._applicationService = IApplicationService(_getServiceAddress(APPLICATION())); 
         
     | 
| 
       168 
159 
     | 
    
         
             
                    $._policyService = IPolicyService(_getServiceAddress(POLICY())); 
         
     | 
| 
       169 
160 
     | 
    
         
             
                    $._claimService = IClaimService(_getServiceAddress(CLAIM())); 
         
     | 
| 
       170 
161 
     | 
    
         
             
                    $._pricingService = IPricingService(_getServiceAddress(PRICE()));
         
     | 
| 
       171 
162 
     | 
    
         
             
                    $._componentService = IComponentService(_getServiceAddress(COMPONENT()));
         
     | 
| 
       172 
     | 
    
         
            -
                    $._pool = Pool(pool);
         
     | 
| 
       173 
     | 
    
         
            -
                    $._distribution = Distribution(distribution);
         
     | 
| 
       174 
     | 
    
         
            -
                    $._poolNftId = getRegistry().getNftIdForAddress(pool);
         
     | 
| 
       175 
     | 
    
         
            -
                    $._distributionNftId = getRegistry().getNftIdForAddress(distribution);
         
     | 
| 
       176 
163 
     | 
    
         | 
| 
       177 
     | 
    
         
            -
                     
     | 
| 
      
 164 
     | 
    
         
            +
                    _registerInterface(type(IProductComponent).interfaceId);  
         
     | 
| 
       178 
165 
     | 
    
         
             
                }
         
     | 
| 
       179 
166 
     | 
    
         | 
| 
       180 
167 
     | 
    
         | 
| 
         @@ -192,8 +179,11 @@ abstract contract Product is 
     | 
|
| 
       192 
179 
     | 
    
         
             
                function _createRisk(
         
     | 
| 
       193 
180 
     | 
    
         
             
                    RiskId id,
         
     | 
| 
       194 
181 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       195 
     | 
    
         
            -
                ) 
     | 
| 
       196 
     | 
    
         
            -
                     
     | 
| 
      
 182 
     | 
    
         
            +
                )
         
     | 
| 
      
 183 
     | 
    
         
            +
                    internal
         
     | 
| 
      
 184 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 185 
     | 
    
         
            +
                {
         
     | 
| 
      
 186 
     | 
    
         
            +
                    _getProductStorage()._riskService.createRisk(
         
     | 
| 
       197 
187 
     | 
    
         
             
                        id,
         
     | 
| 
       198 
188 
     | 
    
         
             
                        data
         
     | 
| 
       199 
189 
     | 
    
         
             
                    );
         
     | 
| 
         @@ -202,8 +192,11 @@ abstract contract Product is 
     | 
|
| 
       202 
192 
     | 
    
         
             
                function _updateRisk(
         
     | 
| 
       203 
193 
     | 
    
         
             
                    RiskId id,
         
     | 
| 
       204 
194 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       205 
     | 
    
         
            -
                ) 
     | 
| 
       206 
     | 
    
         
            -
                     
     | 
| 
      
 195 
     | 
    
         
            +
                )
         
     | 
| 
      
 196 
     | 
    
         
            +
                    internal
         
     | 
| 
      
 197 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 198 
     | 
    
         
            +
                {
         
     | 
| 
      
 199 
     | 
    
         
            +
                    _getProductStorage()._riskService.updateRisk(
         
     | 
| 
       207 
200 
     | 
    
         
             
                        id,
         
     | 
| 
       208 
201 
     | 
    
         
             
                        data
         
     | 
| 
       209 
202 
     | 
    
         
             
                    );
         
     | 
| 
         @@ -212,15 +205,18 @@ abstract contract Product is 
     | 
|
| 
       212 
205 
     | 
    
         
             
                function _updateRiskState(
         
     | 
| 
       213 
206 
     | 
    
         
             
                    RiskId id,
         
     | 
| 
       214 
207 
     | 
    
         
             
                    StateId state
         
     | 
| 
       215 
     | 
    
         
            -
                ) 
     | 
| 
       216 
     | 
    
         
            -
                     
     | 
| 
      
 208 
     | 
    
         
            +
                )
         
     | 
| 
      
 209 
     | 
    
         
            +
                    internal
         
     | 
| 
      
 210 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 211 
     | 
    
         
            +
                {
         
     | 
| 
      
 212 
     | 
    
         
            +
                    _getProductStorage()._riskService.updateRiskState(
         
     | 
| 
       217 
213 
     | 
    
         
             
                        id,
         
     | 
| 
       218 
214 
     | 
    
         
             
                        state
         
     | 
| 
       219 
215 
     | 
    
         
             
                    );
         
     | 
| 
       220 
216 
     | 
    
         
             
                }
         
     | 
| 
       221 
217 
     | 
    
         | 
| 
       222 
218 
     | 
    
         | 
| 
       223 
     | 
    
         
            -
                function _getRiskInfo(RiskId id) internal view returns (IRisk.RiskInfo memory info) {
         
     | 
| 
      
 219 
     | 
    
         
            +
                function _getRiskInfo(RiskId id) internal virtual view returns (IRisk.RiskInfo memory info) {
         
     | 
| 
       224 
220 
     | 
    
         
             
                    return getInstance().getInstanceReader().getRiskInfo(id);
         
     | 
| 
       225 
221 
     | 
    
         
             
                }
         
     | 
| 
       226 
222 
     | 
    
         | 
| 
         @@ -236,6 +232,7 @@ abstract contract Product is 
     | 
|
| 
       236 
232 
     | 
    
         
             
                    bytes memory applicationData
         
     | 
| 
       237 
233 
     | 
    
         
             
                )
         
     | 
| 
       238 
234 
     | 
    
         
             
                    internal
         
     | 
| 
      
 235 
     | 
    
         
            +
                    virtual
         
     | 
| 
       239 
236 
     | 
    
         
             
                    returns (NftId applicationNftId) 
         
     | 
| 
       240 
237 
     | 
    
         
             
                {
         
     | 
| 
       241 
238 
     | 
    
         
             
                    return _getProductStorage()._applicationService.create(
         
     | 
| 
         @@ -255,8 +252,10 @@ abstract contract Product is 
     | 
|
| 
       255 
252 
     | 
    
         
             
                    Timestamp activateAt
         
     | 
| 
       256 
253 
     | 
    
         
             
                )
         
     | 
| 
       257 
254 
     | 
    
         
             
                    internal
         
     | 
| 
      
 255 
     | 
    
         
            +
                    virtual
         
     | 
| 
      
 256 
     | 
    
         
            +
                    returns (Amount premiumAmount)
         
     | 
| 
       258 
257 
     | 
    
         
             
                {
         
     | 
| 
       259 
     | 
    
         
            -
                    _getProductStorage()._policyService.createPolicy(
         
     | 
| 
      
 258 
     | 
    
         
            +
                    premiumAmount = _getProductStorage()._policyService.createPolicy(
         
     | 
| 
       260 
259 
     | 
    
         
             
                        applicationNftId, 
         
     | 
| 
       261 
260 
     | 
    
         
             
                        activateAt);
         
     | 
| 
       262 
261 
     | 
    
         
             
                }
         
     | 
| 
         @@ -265,6 +264,7 @@ abstract contract Product is 
     | 
|
| 
       265 
264 
     | 
    
         
             
                    NftId policyNftId
         
     | 
| 
       266 
265 
     | 
    
         
             
                )
         
     | 
| 
       267 
266 
     | 
    
         
             
                    internal
         
     | 
| 
      
 267 
     | 
    
         
            +
                    virtual
         
     | 
| 
       268 
268 
     | 
    
         
             
                {
         
     | 
| 
       269 
269 
     | 
    
         
             
                    _getProductStorage()._policyService.decline(
         
     | 
| 
       270 
270 
     | 
    
         
             
                        policyNftId);
         
     | 
| 
         @@ -275,6 +275,7 @@ abstract contract Product is 
     | 
|
| 
       275 
275 
     | 
    
         
             
                    Timestamp expireAt
         
     | 
| 
       276 
276 
     | 
    
         
             
                )
         
     | 
| 
       277 
277 
     | 
    
         
             
                    internal
         
     | 
| 
      
 278 
     | 
    
         
            +
                    virtual
         
     | 
| 
       278 
279 
     | 
    
         
             
                    returns (Timestamp expiredAt)
         
     | 
| 
       279 
280 
     | 
    
         
             
                {
         
     | 
| 
       280 
281 
     | 
    
         
             
                    expiredAt = _getProductStorage()._policyService.expire(policyNftId, expireAt);
         
     | 
| 
         @@ -285,6 +286,7 @@ abstract contract Product is 
     | 
|
| 
       285 
286 
     | 
    
         
             
                    Timestamp activateAt
         
     | 
| 
       286 
287 
     | 
    
         
             
                )
         
     | 
| 
       287 
288 
     | 
    
         
             
                    internal
         
     | 
| 
      
 289 
     | 
    
         
            +
                    virtual
         
     | 
| 
       288 
290 
     | 
    
         
             
                {
         
     | 
| 
       289 
291 
     | 
    
         
             
                    _getProductStorage()._policyService.collectPremium(
         
     | 
| 
       290 
292 
     | 
    
         
             
                        policyNftId, 
         
     | 
| 
         @@ -296,6 +298,7 @@ abstract contract Product is 
     | 
|
| 
       296 
298 
     | 
    
         
             
                    Timestamp activateAt
         
     | 
| 
       297 
299 
     | 
    
         
             
                )
         
     | 
| 
       298 
300 
     | 
    
         
             
                    internal
         
     | 
| 
      
 301 
     | 
    
         
            +
                    virtual
         
     | 
| 
       299 
302 
     | 
    
         
             
                {
         
     | 
| 
       300 
303 
     | 
    
         
             
                    _getProductStorage()._policyService.activate(
         
     | 
| 
       301 
304 
     | 
    
         
             
                        policyNftId, 
         
     | 
| 
         @@ -306,6 +309,7 @@ abstract contract Product is 
     | 
|
| 
       306 
309 
     | 
    
         
             
                    NftId policyNftId
         
     | 
| 
       307 
310 
     | 
    
         
             
                )
         
     | 
| 
       308 
311 
     | 
    
         
             
                    internal
         
     | 
| 
      
 312 
     | 
    
         
            +
                    virtual
         
     | 
| 
       309 
313 
     | 
    
         
             
                {
         
     | 
| 
       310 
314 
     | 
    
         
             
                    _getProductStorage()._policyService.close(
         
     | 
| 
       311 
315 
     | 
    
         
             
                        policyNftId);
         
     | 
| 
         @@ -317,6 +321,7 @@ abstract contract Product is 
     | 
|
| 
       317 
321 
     | 
    
         
             
                    bytes memory claimData
         
     | 
| 
       318 
322 
     | 
    
         
             
                )
         
     | 
| 
       319 
323 
     | 
    
         
             
                    internal
         
     | 
| 
      
 324 
     | 
    
         
            +
                    virtual
         
     | 
| 
       320 
325 
     | 
    
         
             
                    returns(ClaimId)
         
     | 
| 
       321 
326 
     | 
    
         
             
                {
         
     | 
| 
       322 
327 
     | 
    
         
             
                    return _getProductStorage()._claimService.submit(
         
     | 
| 
         @@ -332,6 +337,7 @@ abstract contract Product is 
     | 
|
| 
       332 
337 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       333 
338 
     | 
    
         
             
                )
         
     | 
| 
       334 
339 
     | 
    
         
             
                    internal
         
     | 
| 
      
 340 
     | 
    
         
            +
                    virtual
         
     | 
| 
       335 
341 
     | 
    
         
             
                {
         
     | 
| 
       336 
342 
     | 
    
         
             
                    _getProductStorage()._claimService.confirm(
         
     | 
| 
       337 
343 
     | 
    
         
             
                        policyNftId,
         
     | 
| 
         @@ -346,6 +352,7 @@ abstract contract Product is 
     | 
|
| 
       346 
352 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       347 
353 
     | 
    
         
             
                )
         
     | 
| 
       348 
354 
     | 
    
         
             
                    internal
         
     | 
| 
      
 355 
     | 
    
         
            +
                    virtual
         
     | 
| 
       349 
356 
     | 
    
         
             
                {
         
     | 
| 
       350 
357 
     | 
    
         
             
                    _getProductStorage()._claimService.decline(
         
     | 
| 
       351 
358 
     | 
    
         
             
                        policyNftId,
         
     | 
| 
         @@ -358,6 +365,7 @@ abstract contract Product is 
     | 
|
| 
       358 
365 
     | 
    
         
             
                    ClaimId claimId
         
     | 
| 
       359 
366 
     | 
    
         
             
                )
         
     | 
| 
       360 
367 
     | 
    
         
             
                    internal
         
     | 
| 
      
 368 
     | 
    
         
            +
                    virtual
         
     | 
| 
       361 
369 
     | 
    
         
             
                {
         
     | 
| 
       362 
370 
     | 
    
         
             
                    _getProductStorage()._claimService.close(
         
     | 
| 
       363 
371 
     | 
    
         
             
                        policyNftId,
         
     | 
| 
         @@ -371,6 +379,7 @@ abstract contract Product is 
     | 
|
| 
       371 
379 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       372 
380 
     | 
    
         
             
                )
         
     | 
| 
       373 
381 
     | 
    
         
             
                    internal
         
     | 
| 
      
 382 
     | 
    
         
            +
                    virtual
         
     | 
| 
       374 
383 
     | 
    
         
             
                    returns (PayoutId)
         
     | 
| 
       375 
384 
     | 
    
         
             
                {
         
     | 
| 
       376 
385 
     | 
    
         
             
                    return _getProductStorage()._claimService.createPayout(
         
     | 
| 
         @@ -388,6 +397,7 @@ abstract contract Product is 
     | 
|
| 
       388 
397 
     | 
    
         
             
                    bytes memory data
         
     | 
| 
       389 
398 
     | 
    
         
             
                )
         
     | 
| 
       390 
399 
     | 
    
         
             
                    internal
         
     | 
| 
      
 400 
     | 
    
         
            +
                    virtual
         
     | 
| 
       391 
401 
     | 
    
         
             
                    returns (PayoutId)
         
     | 
| 
       392 
402 
     | 
    
         
             
                {
         
     | 
| 
       393 
403 
     | 
    
         
             
                    return _getProductStorage()._claimService.createPayoutForBeneficiary(
         
     | 
| 
         @@ -403,23 +413,20 @@ abstract contract Product is 
     | 
|
| 
       403 
413 
     | 
    
         
             
                    PayoutId payoutId
         
     | 
| 
       404 
414 
     | 
    
         
             
                )
         
     | 
| 
       405 
415 
     | 
    
         
             
                    internal
         
     | 
| 
      
 416 
     | 
    
         
            +
                    virtual
         
     | 
| 
       406 
417 
     | 
    
         
             
                {
         
     | 
| 
       407 
418 
     | 
    
         
             
                    _getProductStorage()._claimService.processPayout(
         
     | 
| 
       408 
419 
     | 
    
         
             
                        policyNftId,
         
     | 
| 
       409 
420 
     | 
    
         
             
                        payoutId);
         
     | 
| 
       410 
421 
     | 
    
         
             
                }
         
     | 
| 
       411 
422 
     | 
    
         | 
| 
       412 
     | 
    
         
            -
                function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
         
     | 
| 
      
 423 
     | 
    
         
            +
                function _toRiskId(string memory riskName) internal virtual pure returns (RiskId riskId) {
         
     | 
| 
       413 
424 
     | 
    
         
             
                    return RiskIdLib.toRiskId(riskName);
         
     | 
| 
       414 
425 
     | 
    
         
             
                }
         
     | 
| 
       415 
426 
     | 
    
         | 
| 
       416 
     | 
    
         
            -
                function _getProductStorage()  
     | 
| 
      
 427 
     | 
    
         
            +
                function _getProductStorage() internal virtual pure returns (ProductStorage storage $) {
         
     | 
| 
       417 
428 
     | 
    
         
             
                    assembly {
         
     | 
| 
       418 
429 
     | 
    
         
             
                        $.slot := PRODUCT_STORAGE_LOCATION_V1
         
     | 
| 
       419 
430 
     | 
    
         
             
                    }
         
     | 
| 
       420 
431 
     | 
    
         
             
                }
         
     | 
| 
       421 
     | 
    
         
            -
             
     | 
| 
       422 
     | 
    
         
            -
                function _getRiskService() internal view returns (IRiskService) {
         
     | 
| 
       423 
     | 
    
         
            -
                    return _getProductStorage()._riskService;
         
     | 
| 
       424 
     | 
    
         
            -
                }
         
     | 
| 
       425 
432 
     | 
    
         
             
            }
         
     | 
| 
         @@ -33,18 +33,17 @@ contract RiskService is 
     | 
|
| 
       33 
33 
     | 
    
         
             
                    virtual override
         
     | 
| 
       34 
34 
     | 
    
         
             
                {
         
     | 
| 
       35 
35 
     | 
    
         
             
                    (
         
     | 
| 
       36 
     | 
    
         
            -
                        address registryAddress 
     | 
| 
       37 
     | 
    
         
            -
                        //address managerAddress
         
     | 
| 
      
 36 
     | 
    
         
            +
                        address registryAddress,
         
     | 
| 
       38 
37 
     | 
    
         
             
                        address authority
         
     | 
| 
       39 
     | 
    
         
            -
                    ) = abi.decode(data, (address, address 
     | 
| 
      
 38 
     | 
    
         
            +
                    ) = abi.decode(data, (address, address));
         
     | 
| 
       40 
39 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                     
     | 
| 
      
 40 
     | 
    
         
            +
                    _initializeService(registryAddress, authority, owner);
         
     | 
| 
       42 
41 
     | 
    
         | 
| 
       43 
42 
     | 
    
         
             
                    _instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
         
     | 
| 
       44 
43 
     | 
    
         
             
                    _poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
         
     | 
| 
       45 
44 
     | 
    
         
             
                    _registryService = IRegistryService(_getServiceAddress(REGISTRY()));
         
     | 
| 
       46 
45 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
                     
     | 
| 
      
 46 
     | 
    
         
            +
                    _registerInterface(type(IRiskService).interfaceId);
         
     | 
| 
       48 
47 
     | 
    
         
             
                }
         
     | 
| 
       49 
48 
     | 
    
         | 
| 
       50 
49 
     | 
    
         | 
| 
         @@ -12,14 +12,14 @@ contract RiskServiceManager is ProxyManager { 
     | 
|
| 
       12 
12 
     | 
    
         
             
                /// @dev initializes proxy manager with product service implementation 
         
     | 
| 
       13 
13 
     | 
    
         
             
                constructor(
         
     | 
| 
       14 
14 
     | 
    
         
             
                    address authority, 
         
     | 
| 
       15 
     | 
    
         
            -
                    address  
     | 
| 
      
 15 
     | 
    
         
            +
                    address registry,
         
     | 
| 
       16 
16 
     | 
    
         
             
                    bytes32 salt
         
     | 
| 
       17 
17 
     | 
    
         
             
                ) 
         
     | 
| 
       18 
     | 
    
         
            -
                    ProxyManager(registryAddress)
         
     | 
| 
       19 
18 
     | 
    
         
             
                {
         
     | 
| 
       20 
19 
     | 
    
         
             
                    RiskService svc = new RiskService{salt: salt}();
         
     | 
| 
       21 
     | 
    
         
            -
                    bytes memory data = abi.encode( 
     | 
| 
       22 
     | 
    
         
            -
                    IVersionable versionable =  
     | 
| 
      
 20 
     | 
    
         
            +
                    bytes memory data = abi.encode(registry, authority);
         
     | 
| 
      
 21 
     | 
    
         
            +
                    IVersionable versionable = initialize(
         
     | 
| 
      
 22 
     | 
    
         
            +
                        registry,
         
     | 
| 
       23 
23 
     | 
    
         
             
                        address(svc), 
         
     | 
| 
       24 
24 
     | 
    
         
             
                        data,
         
     | 
| 
       25 
25 
     | 
    
         
             
                        salt);
         
     | 
| 
         @@ -8,6 +8,8 @@ import {ITransferInterceptor} from "./ITransferInterceptor.sol"; 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
            contract ChainNft is ERC721Enumerable {
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
      
 11 
     | 
    
         
            +
                event LogTokenInterceptorAddress(uint256 tokenId, address interceptor);
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       11 
13 
     | 
    
         
             
                // constants
         
     | 
| 
       12 
14 
     | 
    
         
             
                string public constant NAME = "Dezentralized Insurance Protocol NFT";
         
     | 
| 
       13 
15 
     | 
    
         
             
                string public constant SYMBOL = "DIPNFT";
         
     | 
| 
         @@ -15,12 +17,11 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       15 
17 
     | 
    
         
             
                uint256 public constant PROTOCOL_NFT_ID = 1101;
         
     | 
| 
       16 
18 
     | 
    
         
             
                uint256 public constant GLOBAL_REGISTRY_ID = 2101;
         
     | 
| 
       17 
19 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                // TODO rename errors to error pattern: CallerNotRegistry -> ErrorCallerNotRegistry etc.
         
     | 
| 
       19 
20 
     | 
    
         
             
                // custom errors
         
     | 
| 
       20 
     | 
    
         
            -
                error  
     | 
| 
       21 
     | 
    
         
            -
                error  
     | 
| 
       22 
     | 
    
         
            -
                error  
     | 
| 
       23 
     | 
    
         
            -
                error  
     | 
| 
      
 21 
     | 
    
         
            +
                error ErrorChainNftCallerNotRegistry(address caller);
         
     | 
| 
      
 22 
     | 
    
         
            +
                error ErrorChainNftRegistryAddressZero();
         
     | 
| 
      
 23 
     | 
    
         
            +
                error ErrorChainNftUriEmpty();
         
     | 
| 
      
 24 
     | 
    
         
            +
                error ErrorChainNftUriAlreadySet();
         
     | 
| 
       24 
25 
     | 
    
         | 
| 
       25 
26 
     | 
    
         
             
                // contract state
         
     | 
| 
       26 
27 
     | 
    
         | 
| 
         @@ -34,31 +35,25 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       34 
35 
     | 
    
         
             
                address private _registry;
         
     | 
| 
       35 
36 
     | 
    
         | 
| 
       36 
37 
     | 
    
         
             
                // only used for _getNextTokenId
         
     | 
| 
       37 
     | 
    
         
            -
                uint256 internal _chainIdInt;
         
     | 
| 
       38 
38 
     | 
    
         
             
                uint256 internal _chainIdDigits;
         
     | 
| 
       39 
39 
     | 
    
         
             
                uint256 internal _chainIdMultiplier;
         
     | 
| 
       40 
40 
     | 
    
         
             
                uint256 internal _idNext;
         
     | 
| 
       41 
41 
     | 
    
         
             
                uint256 internal _totalMinted;
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
43 
     | 
    
         
             
                modifier onlyRegistry() {
         
     | 
| 
       44 
     | 
    
         
            -
                    if (msg.sender != _registry) { revert  
     | 
| 
      
 44 
     | 
    
         
            +
                    if (msg.sender != _registry) { revert ErrorChainNftCallerNotRegistry(msg.sender); }
         
     | 
| 
       45 
45 
     | 
    
         
             
                    _;
         
     | 
| 
       46 
46 
     | 
    
         
             
                }
         
     | 
| 
       47 
47 
     | 
    
         | 
| 
       48 
     | 
    
         
            -
                constructor(address registry) 
     | 
| 
       49 
     | 
    
         
            -
                     
     | 
| 
      
 48 
     | 
    
         
            +
                constructor(address registry)
         
     | 
| 
      
 49 
     | 
    
         
            +
                    ERC721(NAME, SYMBOL)
         
     | 
| 
      
 50 
     | 
    
         
            +
                {
         
     | 
| 
      
 51 
     | 
    
         
            +
                    if (registry == address(0)) { revert ErrorChainNftRegistryAddressZero(); }
         
     | 
| 
       50 
52 
     | 
    
         | 
| 
      
 53 
     | 
    
         
            +
                    // NFT contract is deployed by the registry
         
     | 
| 
       51 
54 
     | 
    
         
             
                    _registry = registry;
         
     | 
| 
       52 
     | 
    
         
            -
                    _chainIdInt = block.chainid;
         
     | 
| 
       53 
     | 
    
         
            -
                    _chainIdDigits = 0;
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
                    // count digis
         
     | 
| 
       56 
     | 
    
         
            -
                    uint256 num = _chainIdInt;
         
     | 
| 
       57 
     | 
    
         
            -
                    while (num != 0) {
         
     | 
| 
       58 
     | 
    
         
            -
                        _chainIdDigits++;
         
     | 
| 
       59 
     | 
    
         
            -
                        num /= 10;
         
     | 
| 
       60 
     | 
    
         
            -
                    }
         
     | 
| 
       61 
55 
     | 
    
         | 
| 
      
 56 
     | 
    
         
            +
                    _chainIdDigits = _calculateChainIdDigits(block.chainid);
         
     | 
| 
       62 
57 
     | 
    
         
             
                    _chainIdMultiplier = 10 ** _chainIdDigits;
         
     | 
| 
       63 
58 
     | 
    
         | 
| 
       64 
59 
     | 
    
         
             
                    // the first object registered through normal registration starts with id 4
         
     | 
| 
         @@ -74,12 +69,16 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       74 
69 
     | 
    
         
             
                * not part of the IRegistry interface only needed for
         
     | 
| 
       75 
70 
     | 
    
         
             
                * initial registry setup (protocol and global registry objects)
         
     | 
| 
       76 
71 
     | 
    
         
             
                */
         
     | 
| 
       77 
     | 
    
         
            -
                function mint( 
     | 
| 
       78 
     | 
    
         
            -
                     
     | 
| 
       79 
     | 
    
         
            -
                     
     | 
| 
      
 72 
     | 
    
         
            +
                function mint(
         
     | 
| 
      
 73 
     | 
    
         
            +
                    address to, 
         
     | 
| 
      
 74 
     | 
    
         
            +
                    uint256 tokenId
         
     | 
| 
      
 75 
     | 
    
         
            +
                )
         
     | 
| 
      
 76 
     | 
    
         
            +
                    external
         
     | 
| 
      
 77 
     | 
    
         
            +
                    onlyRegistry()
         
     | 
| 
      
 78 
     | 
    
         
            +
                {
         
     | 
| 
      
 79 
     | 
    
         
            +
                    _safeMintWithInterceptorAddress(to, tokenId, address(0));
         
     | 
| 
       80 
80 
     | 
    
         
             
                }
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
82 
     | 
    
         
             
                /**
         
     | 
| 
       84 
83 
     | 
    
         
             
                * @dev mints the next token to register new objects
         
     | 
| 
       85 
84 
     | 
    
         
             
                * non-zero transferInterceptors are recorded and called during nft token transfers.
         
     | 
| 
         @@ -89,7 +88,11 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       89 
88 
     | 
    
         
             
                    address to,
         
     | 
| 
       90 
89 
     | 
    
         
             
                    address interceptor,
         
     | 
| 
       91 
90 
     | 
    
         
             
                    string memory uri
         
     | 
| 
       92 
     | 
    
         
            -
                ) 
     | 
| 
      
 91 
     | 
    
         
            +
                )
         
     | 
| 
      
 92 
     | 
    
         
            +
                    public
         
     | 
| 
      
 93 
     | 
    
         
            +
                    onlyRegistry()
         
     | 
| 
      
 94 
     | 
    
         
            +
                    returns (uint256 tokenId) 
         
     | 
| 
      
 95 
     | 
    
         
            +
                {
         
     | 
| 
       93 
96 
     | 
    
         
             
                    tokenId = _getNextTokenId();
         
     | 
| 
       94 
97 
     | 
    
         | 
| 
       95 
98 
     | 
    
         
             
                    if (interceptor != address(0)) {
         
     | 
| 
         @@ -100,12 +103,7 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       100 
103 
     | 
    
         
             
                        _uri[tokenId] = uri;
         
     | 
| 
       101 
104 
     | 
    
         
             
                    }
         
     | 
| 
       102 
105 
     | 
    
         | 
| 
       103 
     | 
    
         
            -
                     
     | 
| 
       104 
     | 
    
         
            -
                    _safeMint(to, tokenId);
         
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
     | 
    
         
            -
                    if(interceptor != address(0)) {
         
     | 
| 
       107 
     | 
    
         
            -
                        ITransferInterceptor(interceptor).nftMint(to, tokenId);
         
     | 
| 
       108 
     | 
    
         
            -
                    }
         
     | 
| 
      
 106 
     | 
    
         
            +
                    _safeMintWithInterceptorAddress(to, tokenId, interceptor);
         
     | 
| 
       109 
107 
     | 
    
         
             
                }
         
     | 
| 
       110 
108 
     | 
    
         | 
| 
       111 
109 
     | 
    
         | 
| 
         @@ -113,11 +111,12 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       113 
111 
     | 
    
         
             
                 * @dev amend the open zeppelin transferFrom function by an interceptor call if such an interceptor is defined for the nft token id
         
     | 
| 
       114 
112 
     | 
    
         
             
                 * this allows distribution, product and pool components to be notified when distributors, policies and bundles are transferred.
         
     | 
| 
       115 
113 
     | 
    
         
             
                 */
         
     | 
| 
       116 
     | 
    
         
            -
                function transferFrom(address from, address to, uint256 tokenId) public override ( 
     | 
| 
      
 114 
     | 
    
         
            +
                function transferFrom(address from, address to, uint256 tokenId) public override (IERC721, ERC721) {
         
     | 
| 
       117 
115 
     | 
    
         
             
                    super.transferFrom(from, to, tokenId);
         
     | 
| 
       118 
116 
     | 
    
         | 
| 
       119 
117 
     | 
    
         
             
                    if (_interceptor[tokenId] != address(0)) {
         
     | 
| 
       120 
     | 
    
         
            -
                         
     | 
| 
      
 118 
     | 
    
         
            +
                        address operator = msg.sender;
         
     | 
| 
      
 119 
     | 
    
         
            +
                        ITransferInterceptor(_interceptor[tokenId]).nftTransferFrom(from, to, tokenId, operator);
         
     | 
| 
       121 
120 
     | 
    
         
             
                    }
         
     | 
| 
       122 
121 
     | 
    
         
             
                }
         
     | 
| 
       123 
122 
     | 
    
         | 
| 
         @@ -132,8 +131,8 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       132 
131 
     | 
    
         
             
                    uint256 tokenId,
         
     | 
| 
       133 
132 
     | 
    
         
             
                    string memory uri
         
     | 
| 
       134 
133 
     | 
    
         
             
                ) external onlyRegistry {
         
     | 
| 
       135 
     | 
    
         
            -
                    if (bytes(uri).length == 0) { revert  
     | 
| 
       136 
     | 
    
         
            -
                    if (bytes(_uri[tokenId]).length > 0) { revert  
     | 
| 
      
 134 
     | 
    
         
            +
                    if (bytes(uri).length == 0) { revert ErrorChainNftUriEmpty(); }
         
     | 
| 
      
 135 
     | 
    
         
            +
                    if (bytes(_uri[tokenId]).length > 0) { revert ErrorChainNftUriAlreadySet(); }
         
     | 
| 
       137 
136 
     | 
    
         | 
| 
       138 
137 
     | 
    
         
             
                    _requireOwned(tokenId);
         
     | 
| 
       139 
138 
     | 
    
         
             
                    _uri[tokenId] = uri;
         
     | 
| 
         @@ -199,19 +198,50 @@ contract ChainNft is ERC721Enumerable { 
     | 
|
| 
       199 
198 
     | 
    
         
             
                * (42 * 10 ** 10 + 9876543210) * 100 + 10
         
     | 
| 
       200 
199 
     | 
    
         
             
                * (index * 10 ** digits + chainid) * 100 + digits (1 < digits < 100)
         
     | 
| 
       201 
200 
     | 
    
         
             
                */
         
     | 
| 
       202 
     | 
    
         
            -
                function calculateTokenId(uint256 idIndex) public view returns (uint256 id) {
         
     | 
| 
       203 
     | 
    
         
            -
                     
     | 
| 
       204 
     | 
    
         
            -
                        (idIndex * _chainIdMultiplier +  
     | 
| 
       205 
     | 
    
         
            -
             
     | 
| 
       206 
     | 
    
         
            -
                         
     | 
| 
      
 201 
     | 
    
         
            +
                function calculateTokenId(uint256 idIndex, uint256 chainId) public view returns (uint256 id) {
         
     | 
| 
      
 202 
     | 
    
         
            +
                    if(chainId == block.chainid) {
         
     | 
| 
      
 203 
     | 
    
         
            +
                        return 100 * (idIndex * _chainIdMultiplier + chainId) + _chainIdDigits;
         
     | 
| 
      
 204 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 205 
     | 
    
         
            +
                        uint256 chainIdDigits = _calculateChainIdDigits(chainId);
         
     | 
| 
      
 206 
     | 
    
         
            +
                        return 100 * (idIndex * (10 ** chainIdDigits) + chainId) + chainIdDigits;
         
     | 
| 
      
 207 
     | 
    
         
            +
                    }
         
     | 
| 
      
 208 
     | 
    
         
            +
                }
         
     | 
| 
      
 209 
     | 
    
         
            +
             
     | 
| 
      
 210 
     | 
    
         
            +
                function calculateTokenId(uint256 idIndex) public view returns (uint256) {
         
     | 
| 
      
 211 
     | 
    
         
            +
                    return 100 * (idIndex * _chainIdMultiplier + block.chainid) + _chainIdDigits;
         
     | 
| 
       207 
212 
     | 
    
         
             
                }
         
     | 
| 
       208 
213 
     | 
    
         | 
| 
       209 
214 
     | 
    
         
             
                function getNextTokenId() external view returns (uint256) {
         
     | 
| 
       210 
215 
     | 
    
         
             
                    return calculateTokenId(_idNext);
         
     | 
| 
       211 
216 
     | 
    
         
             
                }
         
     | 
| 
       212 
217 
     | 
    
         | 
| 
      
 218 
     | 
    
         
            +
                // ---------------- private functions ----------------- //
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
       213 
220 
     | 
    
         
             
                function _getNextTokenId() private returns (uint256 id) {
         
     | 
| 
       214 
221 
     | 
    
         
             
                    id = calculateTokenId(_idNext);
         
     | 
| 
       215 
222 
     | 
    
         
             
                    _idNext++;
         
     | 
| 
       216 
223 
     | 
    
         
             
                }
         
     | 
| 
      
 224 
     | 
    
         
            +
             
     | 
| 
      
 225 
     | 
    
         
            +
                function _calculateChainIdDigits(uint256 chainId) private pure returns (uint256) {
         
     | 
| 
      
 226 
     | 
    
         
            +
                    uint256 num = chainId;
         
     | 
| 
      
 227 
     | 
    
         
            +
                    uint256 digits = 0;
         
     | 
| 
      
 228 
     | 
    
         
            +
                    while (num != 0) {
         
     | 
| 
      
 229 
     | 
    
         
            +
                        digits++;
         
     | 
| 
      
 230 
     | 
    
         
            +
                        num /= 10;
         
     | 
| 
      
 231 
     | 
    
         
            +
                    }
         
     | 
| 
      
 232 
     | 
    
         
            +
                    return digits;
         
     | 
| 
      
 233 
     | 
    
         
            +
                }
         
     | 
| 
      
 234 
     | 
    
         
            +
             
     | 
| 
      
 235 
     | 
    
         
            +
                function _safeMintWithInterceptorAddress(
         
     | 
| 
      
 236 
     | 
    
         
            +
                    address to,
         
     | 
| 
      
 237 
     | 
    
         
            +
                    uint256 tokenId,
         
     | 
| 
      
 238 
     | 
    
         
            +
                    address interceptor
         
     | 
| 
      
 239 
     | 
    
         
            +
                )
         
     | 
| 
      
 240 
     | 
    
         
            +
                    private
         
     | 
| 
      
 241 
     | 
    
         
            +
                {        
         
     | 
| 
      
 242 
     | 
    
         
            +
                    _totalMinted++;
         
     | 
| 
      
 243 
     | 
    
         
            +
                    _safeMint(to, tokenId);
         
     | 
| 
      
 244 
     | 
    
         
            +
             
     | 
| 
      
 245 
     | 
    
         
            +
                    emit LogTokenInterceptorAddress(tokenId, interceptor);
         
     | 
| 
      
 246 
     | 
    
         
            +
                }
         
     | 
| 
       217 
247 
     | 
    
         
             
            }
         
     |