@etherisc/gif-next 0.0.2-e79d227-681 → 0.0.2-e7a5428-226
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 +57 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1075 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +790 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +843 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +640 -269
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +1289 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +409 -33
- 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 +525 -213
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +179 -19
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +246 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +420 -27
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +105 -185
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +381 -46
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +58 -127
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +533 -218
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +150 -82
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +37 -106
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +379 -79
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +183 -128
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +355 -52
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +324 -250
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +380 -45
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +191 -182
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +94 -100
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +196 -155
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +600 -296
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +805 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +482 -50
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +373 -13
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +493 -85
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1017 -334
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +380 -52
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +914 -554
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +377 -80
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +83 -57
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +690 -566
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +141 -85
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +77 -81
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +379 -47
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +41 -45
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +56 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +61 -65
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +120 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +99 -55
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +102 -114
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +355 -52
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +304 -226
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +120 -76
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +200 -89
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +59 -63
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +333 -169
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +72 -76
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +574 -360
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +146 -74
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +293 -63
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +106 -46
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +193 -182
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +380 -45
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +292 -195
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +127 -99
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +235 -4
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +181 -19
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +160 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +77 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +168 -157
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +258 -22
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +278 -187
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +129 -85
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +135 -126
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +103 -75
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +187 -176
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +326 -91
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +103 -47
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +54 -19
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +56 -3
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/{authorization/AccessAdmin.sol/IAccessManagedChecker.json → registry/IRelease.sol/IRelease.json} +6 -6
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +92 -57
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +727 -479
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1061 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +75 -39
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +79 -43
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2152 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +386 -64
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +437 -26
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +120 -60
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +60 -50
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +247 -531
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +111 -95
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +178 -34
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +41 -31
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +155 -382
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +41 -45
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +6 -6
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +19 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +139 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +56 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +60 -64
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +6 -6
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +21 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +137 -62
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +51 -11
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1026 -101
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +214 -110
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1218 -214
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +139 -61
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +174 -217
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +253 -174
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +87 -55
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +957 -603
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +101 -51
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +11 -11
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +45 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +94 -38
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +30 -6
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +42 -157
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +45 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +50 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +3 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +61 -37
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +65 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +274 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +47 -0
- package/contracts/authorization/AccessAdmin.sol +422 -258
- package/contracts/authorization/AccessAdminLib.sol +396 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +142 -262
- package/contracts/authorization/IAccess.sol +25 -7
- package/contracts/authorization/IAccessAdmin.sol +87 -80
- package/contracts/authorization/IAuthorization.sol +9 -43
- package/contracts/authorization/IServiceAuthorization.sol +55 -17
- package/contracts/authorization/ServiceAuthorization.sol +248 -34
- package/contracts/distribution/BasicDistribution.sol +16 -14
- package/contracts/distribution/BasicDistributionAuthorization.sol +29 -9
- package/contracts/distribution/Distribution.sol +38 -75
- package/contracts/distribution/DistributionService.sol +181 -87
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +3 -10
- package/contracts/distribution/IDistributionService.sol +34 -19
- package/contracts/examples/fire/FirePool.sol +6 -6
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +15 -13
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +34 -11
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -13
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +119 -27
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +92 -19
- package/contracts/instance/IInstanceService.sol +52 -9
- package/contracts/instance/Instance.sol +163 -57
- package/contracts/instance/InstanceAdmin.sol +271 -166
- package/contracts/instance/InstanceAuthorizationV3.sol +89 -40
- package/contracts/instance/InstanceReader.sol +422 -369
- package/contracts/instance/InstanceService.sol +252 -176
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +21 -14
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +6 -8
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +19 -7
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +4 -0
- package/contracts/oracle/BasicOracle.sol +2 -4
- package/contracts/oracle/BasicOracleAuthorization.sol +15 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +3 -5
- package/contracts/oracle/OracleService.sol +24 -23
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +3 -16
- package/contracts/pool/BasicPoolAuthorization.sol +29 -16
- package/contracts/pool/BundleService.sol +67 -104
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +27 -33
- package/contracts/pool/IPoolService.sol +57 -40
- package/contracts/pool/Pool.sol +13 -25
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +203 -201
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +86 -18
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +3 -3
- package/contracts/product/BasicProductAuthorization.sol +32 -11
- package/contracts/product/ClaimService.sol +187 -171
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +24 -2
- package/contracts/product/IClaimService.sol +18 -5
- package/contracts/product/IPolicyService.sol +20 -8
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +25 -10
- package/contracts/product/PolicyService.sol +110 -198
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +52 -46
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +93 -27
- package/contracts/product/RiskService.sol +119 -36
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +23 -24
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +22 -11
- package/contracts/registry/RegistryAdmin.sol +100 -363
- package/contracts/registry/RegistryAuthorization.sol +309 -0
- package/contracts/registry/RegistryService.sol +4 -4
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +157 -117
- package/contracts/registry/ServiceAuthorizationV3.sol +194 -27
- package/contracts/registry/TokenRegistry.sol +61 -59
- package/contracts/shared/Component.sol +34 -37
- package/contracts/shared/ComponentService.sol +314 -433
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +164 -76
- package/contracts/shared/IComponent.sol +1 -10
- package/contracts/shared/IComponentService.sol +22 -41
- package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
- package/contracts/shared/IKeyValueStore.sol +1 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +15 -5
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +7 -18
- package/contracts/shared/KeyValueStore.sol +3 -3
- package/contracts/shared/NftOwnable.sol +8 -6
- package/contracts/shared/PolicyHolder.sol +4 -3
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +13 -30
- package/contracts/shared/TokenHandler.sol +45 -92
- package/contracts/staking/IStaking.sol +155 -64
- package/contracts/staking/IStakingService.sol +45 -75
- package/contracts/staking/Staking.sol +444 -203
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +55 -84
- package/contracts/staking/StakingManager.sol +1 -2
- package/contracts/staking/StakingReader.sol +41 -80
- package/contracts/staking/StakingService.sol +62 -181
- package/contracts/staking/StakingServiceManager.sol +6 -4
- package/contracts/staking/StakingStore.sol +697 -329
- package/contracts/staking/TargetManagerLib.sol +1 -1
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +15 -15
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/NftId.sol +3 -3
- package/contracts/type/ObjectType.sol +67 -38
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +63 -45
- package/contracts/type/Seconds.sol +14 -0
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/String.sol +12 -0
- package/contracts/type/Timestamp.sol +4 -7
- package/contracts/type/UFixed.sol +35 -127
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +26 -12
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +2 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -474
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
@@ -1,31 +1,31 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
|
-
import {TimestampLib} from "../type/Timestamp.sol";
|
6
|
-
import {ObjectType, CLAIM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
|
7
|
-
import {SUBMITTED, KEEP_STATE, DECLINED, REVOKED, CONFIRMED, CLOSED, PAID} from "../type/StateId.sol";
|
8
|
-
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {FeeLib} from "../type/Fee.sol";
|
10
|
-
import {StateId} from "../type/StateId.sol";
|
11
|
-
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
12
|
-
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
13
|
-
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
14
|
-
import {ContractLib} from "../shared/ContractLib.sol";
|
15
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
16
|
-
import {InstanceStore} from "../instance/InstanceStore.sol";
|
17
4
|
import {IClaimService} from "./IClaimService.sol";
|
18
|
-
import {IComponents} from "../instance/module/IComponents.sol";
|
19
5
|
import {IInstance} from "../instance/IInstance.sol";
|
20
6
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
21
7
|
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
22
8
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
23
9
|
import {IPolicyService} from "../product/IPolicyService.sol";
|
24
10
|
import {IPoolService} from "../pool/IPoolService.sol";
|
11
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
12
|
+
|
13
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
14
|
+
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
15
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
16
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
17
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
18
|
+
import {NftId} from "../type/NftId.sol";
|
19
|
+
import {ObjectType, CLAIM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
|
20
|
+
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
21
|
+
import {Service} from "../shared/Service.sol";
|
22
|
+
import {StateId} from "../type/StateId.sol";
|
23
|
+
import {SUBMITTED, KEEP_STATE, DECLINED, REVOKED, CANCELLED, CONFIRMED, CLOSED, EXPECTED, PAID} from "../type/StateId.sol";
|
24
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
25
25
|
|
26
26
|
|
27
27
|
contract ClaimService is
|
28
|
-
|
28
|
+
Service,
|
29
29
|
IClaimService
|
30
30
|
{
|
31
31
|
|
@@ -41,11 +41,11 @@ contract ClaimService is
|
|
41
41
|
initializer()
|
42
42
|
{
|
43
43
|
(
|
44
|
-
address
|
45
|
-
address
|
44
|
+
address authority,
|
45
|
+
address registry
|
46
46
|
) = abi.decode(data, (address, address));
|
47
47
|
|
48
|
-
|
48
|
+
__Service_init(authority, registry, owner);
|
49
49
|
|
50
50
|
_policyService = IPolicyService(getRegistry().getServiceAddress(POLICY(), getVersion().toMajorPart()));
|
51
51
|
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
@@ -61,31 +61,24 @@ contract ClaimService is
|
|
61
61
|
external
|
62
62
|
virtual
|
63
63
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
64
|
+
restricted()
|
64
65
|
returns (ClaimId claimId)
|
65
66
|
{
|
66
|
-
|
67
|
-
|
67
|
+
// checks
|
68
68
|
(
|
69
|
-
|
70
|
-
IInstance instance,,
|
69
|
+
,,,
|
71
70
|
InstanceStore instanceStore,
|
72
71
|
IPolicy.PolicyInfo memory policyInfo
|
73
72
|
) = _verifyCallerWithPolicy(policyNftId);
|
74
73
|
|
75
74
|
// check policy is in its active period
|
76
|
-
if(policyInfo.activatedAt.eqz() || TimestampLib.
|
75
|
+
if(policyInfo.activatedAt.eqz() || TimestampLib.current() >= policyInfo.expiredAt) {
|
77
76
|
revert ErrorClaimServicePolicyNotOpen(policyNftId);
|
78
77
|
}
|
79
78
|
|
80
|
-
|
81
|
-
// check policy including this claim is still within sum insured
|
82
|
-
if(policyInfo.payoutAmount + claimAmount > policyInfo.sumInsuredAmount) {
|
83
|
-
revert ErrorClaimServiceClaimExceedsSumInsured(
|
84
|
-
policyNftId,
|
85
|
-
policyInfo.sumInsuredAmount,
|
86
|
-
AmountLib.toAmount(policyInfo.payoutAmount.toInt() + claimAmount.toInt()));
|
87
|
-
}
|
79
|
+
_checkClaimAmount(policyNftId, policyInfo, claimAmount);
|
88
80
|
|
81
|
+
// effects
|
89
82
|
// create new claim
|
90
83
|
claimId = ClaimIdLib.toClaimId(policyInfo.claimsCount + 1);
|
91
84
|
instanceStore.createClaim(
|
@@ -118,8 +111,10 @@ contract ClaimService is
|
|
118
111
|
)
|
119
112
|
external
|
120
113
|
virtual
|
114
|
+
restricted()
|
121
115
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
122
116
|
{
|
117
|
+
// checks
|
123
118
|
_checkNftType(policyNftId, POLICY());
|
124
119
|
|
125
120
|
(
|
@@ -130,8 +125,9 @@ contract ClaimService is
|
|
130
125
|
IPolicy.PolicyInfo memory policyInfo
|
131
126
|
) = _verifyCallerWithPolicy(policyNftId);
|
132
127
|
|
133
|
-
|
128
|
+
_checkClaimAmount(policyNftId, policyInfo, confirmedAmount);
|
134
129
|
|
130
|
+
// effects
|
135
131
|
// check/update claim info
|
136
132
|
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
137
133
|
claimInfo.claimAmount = confirmedAmount;
|
@@ -144,11 +140,12 @@ contract ClaimService is
|
|
144
140
|
|
145
141
|
// should policy still be active it needs to become expired
|
146
142
|
if (policyInfo.claimAmount >= policyInfo.sumInsuredAmount) {
|
147
|
-
_policyService.expirePolicy(instance, policyNftId, TimestampLib.
|
143
|
+
_policyService.expirePolicy(instance, policyNftId, TimestampLib.current());
|
148
144
|
}
|
149
145
|
|
150
146
|
emit LogClaimServiceClaimConfirmed(policyNftId, claimId, confirmedAmount);
|
151
147
|
|
148
|
+
// interactions
|
152
149
|
// callback to pool if applicable
|
153
150
|
_processConfirmedClaimByPool(instanceReader, productNftId, policyNftId, claimId, confirmedAmount);
|
154
151
|
|
@@ -164,13 +161,13 @@ contract ClaimService is
|
|
164
161
|
)
|
165
162
|
external
|
166
163
|
virtual
|
164
|
+
restricted()
|
167
165
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
168
166
|
{
|
169
167
|
_checkNftType(policyNftId, POLICY());
|
170
168
|
|
171
169
|
(
|
172
|
-
|
173
|
-
IInstance instance,
|
170
|
+
,,
|
174
171
|
InstanceReader instanceReader,
|
175
172
|
InstanceStore instanceStore,
|
176
173
|
IPolicy.PolicyInfo memory policyInfo
|
@@ -179,7 +176,7 @@ contract ClaimService is
|
|
179
176
|
// check/update claim info
|
180
177
|
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
181
178
|
claimInfo.processData = data;
|
182
|
-
claimInfo.closedAt = TimestampLib.
|
179
|
+
claimInfo.closedAt = TimestampLib.current();
|
183
180
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, DECLINED());
|
184
181
|
|
185
182
|
// update and save policy info with instance
|
@@ -190,20 +187,17 @@ contract ClaimService is
|
|
190
187
|
}
|
191
188
|
|
192
189
|
|
193
|
-
// TODO add test case
|
194
190
|
function revoke(
|
195
191
|
NftId policyNftId,
|
196
192
|
ClaimId claimId
|
197
193
|
)
|
198
194
|
external
|
199
195
|
virtual
|
196
|
+
restricted()
|
200
197
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
201
|
-
{
|
202
|
-
_checkNftType(policyNftId, POLICY());
|
203
|
-
|
198
|
+
{
|
204
199
|
(
|
205
|
-
|
206
|
-
IInstance instance,
|
200
|
+
,,
|
207
201
|
InstanceReader instanceReader,
|
208
202
|
InstanceStore instanceStore,
|
209
203
|
IPolicy.PolicyInfo memory policyInfo
|
@@ -211,7 +205,7 @@ contract ClaimService is
|
|
211
205
|
|
212
206
|
// check/update claim info
|
213
207
|
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
214
|
-
claimInfo.closedAt = TimestampLib.
|
208
|
+
claimInfo.closedAt = TimestampLib.current();
|
215
209
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, REVOKED());
|
216
210
|
|
217
211
|
// update and save policy info with instance
|
@@ -222,22 +216,21 @@ contract ClaimService is
|
|
222
216
|
}
|
223
217
|
|
224
218
|
|
225
|
-
function
|
219
|
+
function cancelConfirmedClaim(
|
226
220
|
NftId policyNftId,
|
227
221
|
ClaimId claimId
|
228
222
|
)
|
229
223
|
external
|
230
224
|
virtual
|
225
|
+
restricted()
|
231
226
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
232
227
|
{
|
233
228
|
_checkNftType(policyNftId, POLICY());
|
234
229
|
|
235
230
|
(
|
236
|
-
|
237
|
-
IInstance instance,
|
231
|
+
,,
|
238
232
|
InstanceReader instanceReader,
|
239
233
|
InstanceStore instanceStore,
|
240
|
-
IPolicy.PolicyInfo memory policyInfo
|
241
234
|
) = _verifyCallerWithPolicy(policyNftId);
|
242
235
|
|
243
236
|
// check/update claim info
|
@@ -251,17 +244,10 @@ contract ClaimService is
|
|
251
244
|
claimInfo.openPayoutsCount);
|
252
245
|
}
|
253
246
|
|
254
|
-
|
255
|
-
|
256
|
-
revert ErrorClaimServiceClaimWithMissingPayouts(
|
257
|
-
policyNftId,
|
258
|
-
claimId,
|
259
|
-
claimInfo.claimAmount,
|
260
|
-
claimInfo.paidAmount);
|
261
|
-
}
|
247
|
+
claimInfo.closedAt = TimestampLib.current();
|
248
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CANCELLED());
|
262
249
|
|
263
|
-
|
264
|
-
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CLOSED());
|
250
|
+
emit LogClaimServiceClaimCancelled(policyNftId, claimId);
|
265
251
|
}
|
266
252
|
|
267
253
|
|
@@ -274,11 +260,10 @@ contract ClaimService is
|
|
274
260
|
)
|
275
261
|
external
|
276
262
|
virtual
|
263
|
+
restricted()
|
277
264
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
278
265
|
returns (PayoutId payoutId)
|
279
266
|
{
|
280
|
-
_checkNftType(policyNftId, POLICY());
|
281
|
-
|
282
267
|
if (beneficiary == address(0)) {
|
283
268
|
revert ErrorClaimServiceBeneficiaryIsZero(policyNftId, claimId);
|
284
269
|
}
|
@@ -300,6 +285,7 @@ contract ClaimService is
|
|
300
285
|
)
|
301
286
|
external
|
302
287
|
virtual
|
288
|
+
restricted()
|
303
289
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
304
290
|
returns (PayoutId payoutId)
|
305
291
|
{
|
@@ -320,37 +306,58 @@ contract ClaimService is
|
|
320
306
|
)
|
321
307
|
external
|
322
308
|
virtual
|
309
|
+
restricted()
|
323
310
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
311
|
+
returns (Amount netPayoutAmount, Amount processingFeeAmount)
|
324
312
|
{
|
325
|
-
|
326
|
-
|
313
|
+
// checks
|
327
314
|
(
|
328
|
-
|
329
|
-
IInstance instance,
|
315
|
+
,,
|
330
316
|
InstanceReader instanceReader,
|
331
317
|
InstanceStore instanceStore,
|
332
318
|
IPolicy.PolicyInfo memory policyInfo
|
333
319
|
) = _verifyCallerWithPolicy(policyNftId);
|
334
320
|
|
335
|
-
|
336
|
-
|
321
|
+
IPolicy.ClaimInfo memory claimInfo;
|
322
|
+
address payoutBeneficiary;
|
323
|
+
Amount payoutAmount;
|
324
|
+
|
325
|
+
{
|
326
|
+
// check that payout exists and is open
|
327
|
+
IPolicy.PayoutInfo memory payoutInfo = instanceReader.getPayoutInfo(policyNftId, payoutId);
|
328
|
+
payoutBeneficiary = payoutInfo.beneficiary;
|
329
|
+
payoutAmount = payoutInfo.amount;
|
330
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
331
|
+
if(payoutState != EXPECTED()) {
|
332
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
333
|
+
}
|
337
334
|
|
338
|
-
|
339
|
-
|
340
|
-
|
335
|
+
// check that payout amount does not violate claim amount
|
336
|
+
claimInfo = instanceReader.getClaimInfo(policyNftId, payoutId.toClaimId());
|
337
|
+
if(claimInfo.paidAmount + payoutInfo.amount > claimInfo.claimAmount) {
|
338
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
339
|
+
policyNftId,
|
340
|
+
payoutId.toClaimId(),
|
341
|
+
claimInfo.claimAmount,
|
342
|
+
claimInfo.paidAmount + payoutInfo.amount);
|
343
|
+
}
|
341
344
|
|
342
|
-
|
345
|
+
// effects
|
346
|
+
// update and save payout info with instance
|
347
|
+
payoutInfo.paidAt = TimestampLib.current();
|
348
|
+
instanceStore.updatePayout(policyNftId, payoutId, payoutInfo, PAID());
|
349
|
+
}
|
343
350
|
|
351
|
+
// update and save claim info with instance
|
344
352
|
{
|
345
353
|
ClaimId claimId = payoutId.toClaimId();
|
346
|
-
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
347
354
|
claimInfo.paidAmount = claimInfo.paidAmount.add(payoutAmount);
|
348
355
|
claimInfo.openPayoutsCount -= 1;
|
349
356
|
|
350
357
|
// check if this payout is closing the linked claim
|
351
358
|
// update claim and policy info accordingly
|
352
359
|
if(claimInfo.openPayoutsCount == 0 && claimInfo.paidAmount == claimInfo.claimAmount) {
|
353
|
-
claimInfo.closedAt = TimestampLib.
|
360
|
+
claimInfo.closedAt = TimestampLib.current();
|
354
361
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CLOSED());
|
355
362
|
|
356
363
|
policyInfo.openClaimsCount -= 1;
|
@@ -360,48 +367,81 @@ contract ClaimService is
|
|
360
367
|
}
|
361
368
|
|
362
369
|
// update and save policy info with instance
|
363
|
-
policyInfo.payoutAmount = policyInfo.payoutAmount
|
370
|
+
policyInfo.payoutAmount = policyInfo.payoutAmount + payoutAmount;
|
364
371
|
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
365
372
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
373
|
+
emit LogClaimServicePayoutProcessed(policyNftId, payoutId, payoutAmount);
|
374
|
+
|
375
|
+
// effects + interactions (push tokens to beneficiary, product)
|
376
|
+
// delegate to pool to update book keeping and moving tokens payout
|
377
|
+
(netPayoutAmount, processingFeeAmount) = _poolService.processPayout(
|
378
|
+
instanceReader,
|
379
|
+
instanceStore,
|
380
|
+
policyInfo.productNftId, // product nft id
|
370
381
|
policyNftId,
|
371
|
-
policyInfo,
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
(
|
377
|
-
Amount netPayoutAmount,
|
378
|
-
Amount processingFeeAmount,
|
379
|
-
address beneficiary
|
380
|
-
) = _calculatePayoutAmount(
|
381
|
-
instanceReader,
|
382
|
-
policyNftId,
|
383
|
-
policyInfo,
|
384
|
-
payoutInfo);
|
385
|
-
|
386
|
-
emit LogClaimServicePayoutProcessed(policyNftId, payoutId, payoutAmount, beneficiary, netPayoutAmount, processingFeeAmount);
|
387
|
-
|
388
|
-
{
|
389
|
-
NftId poolNftId = getRegistry().getObjectInfo(policyInfo.bundleNftId).parentNftId;
|
390
|
-
IComponents.ComponentInfo memory poolInfo = instanceReader.getComponentInfo(poolNftId);
|
391
|
-
poolInfo.tokenHandler.pushToken(
|
392
|
-
beneficiary,
|
393
|
-
netPayoutAmount);
|
394
|
-
|
395
|
-
// TODO add 2nd token tx if processingFeeAmount > 0
|
396
|
-
}
|
382
|
+
policyInfo.bundleNftId,
|
383
|
+
payoutId,
|
384
|
+
payoutAmount,
|
385
|
+
payoutBeneficiary);
|
386
|
+
}
|
397
387
|
|
398
|
-
|
399
|
-
|
388
|
+
function cancelPayout(
|
389
|
+
NftId policyNftId,
|
390
|
+
PayoutId payoutId
|
391
|
+
)
|
392
|
+
external
|
393
|
+
virtual
|
394
|
+
restricted()
|
395
|
+
{
|
396
|
+
// checks
|
397
|
+
(
|
398
|
+
,,
|
399
|
+
InstanceReader instanceReader,
|
400
|
+
InstanceStore instanceStore,
|
401
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
402
|
+
|
403
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
404
|
+
if (payoutState != EXPECTED()) {
|
405
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
400
406
|
}
|
407
|
+
|
408
|
+
// effects
|
409
|
+
// update and save payout info with instance
|
410
|
+
instanceStore.updatePayoutState(policyNftId, payoutId, CANCELLED());
|
411
|
+
|
412
|
+
{
|
413
|
+
ClaimId claimId = payoutId.toClaimId();
|
414
|
+
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
415
|
+
claimInfo.openPayoutsCount -= 1;
|
416
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
417
|
+
}
|
418
|
+
|
419
|
+
emit LogClaimServicePayoutCancelled(policyNftId, payoutId);
|
401
420
|
}
|
402
421
|
|
403
422
|
// internal functions
|
404
423
|
|
424
|
+
function _checkClaimAmount(
|
425
|
+
NftId policyNftId,
|
426
|
+
IPolicy.PolicyInfo memory policyInfo,
|
427
|
+
Amount claimAmount
|
428
|
+
)
|
429
|
+
internal
|
430
|
+
pure
|
431
|
+
{
|
432
|
+
// check claim amount > 0
|
433
|
+
if (claimAmount.eqz()) {
|
434
|
+
revert ErrorClaimServiceClaimAmountIsZero(policyNftId);
|
435
|
+
}
|
436
|
+
|
437
|
+
// check policy including this claim is still within sum insured
|
438
|
+
if(policyInfo.claimAmount + claimAmount > policyInfo.sumInsuredAmount) {
|
439
|
+
revert ErrorClaimServiceClaimExceedsSumInsured(
|
440
|
+
policyNftId,
|
441
|
+
policyInfo.sumInsuredAmount,
|
442
|
+
policyInfo.payoutAmount + claimAmount);
|
443
|
+
}
|
444
|
+
}
|
405
445
|
|
406
446
|
function _createPayout(
|
407
447
|
NftId policyNftId,
|
@@ -414,22 +454,32 @@ contract ClaimService is
|
|
414
454
|
virtual
|
415
455
|
returns (PayoutId payoutId)
|
416
456
|
{
|
457
|
+
// checks
|
417
458
|
(
|
418
|
-
|
419
|
-
,
|
459
|
+
,,
|
420
460
|
InstanceReader instanceReader,
|
421
461
|
InstanceStore instanceStore,
|
422
|
-
IPolicy.PolicyInfo memory policyInfo
|
462
|
+
// IPolicy.PolicyInfo memory policyInfo
|
423
463
|
) = _verifyCallerWithPolicy(policyNftId);
|
424
464
|
|
425
465
|
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
426
|
-
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
427
466
|
|
428
|
-
|
429
|
-
|
430
|
-
|
467
|
+
{
|
468
|
+
// check claim state
|
469
|
+
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
470
|
+
if (claimState != CONFIRMED()) {
|
471
|
+
revert ErrorClaimServiceClaimNotConfirmed(policyNftId, claimId, claimState);
|
472
|
+
}
|
431
473
|
|
432
|
-
|
474
|
+
// check total payout amount remains within claim limit
|
475
|
+
Amount newPaidAmount = claimInfo.paidAmount + amount;
|
476
|
+
if (newPaidAmount > claimInfo.claimAmount) {
|
477
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
478
|
+
policyNftId, claimId, claimInfo.claimAmount, newPaidAmount);
|
479
|
+
}
|
480
|
+
}
|
481
|
+
|
482
|
+
// effects
|
433
483
|
// create payout info with instance
|
434
484
|
uint24 payoutNo = claimInfo.payoutsCount + 1;
|
435
485
|
payoutId = PayoutIdLib.toPayoutId(claimId, payoutNo);
|
@@ -452,52 +502,10 @@ contract ClaimService is
|
|
452
502
|
claimInfo.openPayoutsCount += 1;
|
453
503
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
454
504
|
|
455
|
-
// update and save policy info with instance
|
456
|
-
policyInfo.payoutAmount.add(amount);
|
457
|
-
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
458
|
-
|
459
505
|
emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount, beneficiary);
|
460
506
|
}
|
461
507
|
|
462
508
|
|
463
|
-
function _calculatePayoutAmount(
|
464
|
-
InstanceReader instanceReader,
|
465
|
-
NftId policyNftId,
|
466
|
-
IPolicy.PolicyInfo memory policyInfo,
|
467
|
-
IPolicy.PayoutInfo memory payoutInfo
|
468
|
-
)
|
469
|
-
internal
|
470
|
-
returns (
|
471
|
-
Amount netPayoutAmount,
|
472
|
-
Amount processingFeeAmount,
|
473
|
-
address beneficiary
|
474
|
-
)
|
475
|
-
{
|
476
|
-
Amount payoutAmount = payoutInfo.amount;
|
477
|
-
|
478
|
-
if(payoutAmount.gtz()) {
|
479
|
-
NftId productNftId = policyInfo.productNftId;
|
480
|
-
|
481
|
-
// get pool component info from policy or product
|
482
|
-
NftId poolNftId = getRegistry().getObjectInfo(policyInfo.bundleNftId).parentNftId;
|
483
|
-
IComponents.ComponentInfo memory poolInfo = instanceReader.getComponentInfo(poolNftId);
|
484
|
-
|
485
|
-
netPayoutAmount = payoutAmount;
|
486
|
-
|
487
|
-
if (payoutInfo.beneficiary == address(0)) {
|
488
|
-
beneficiary = getRegistry().ownerOf(policyNftId);
|
489
|
-
} else {
|
490
|
-
beneficiary = payoutInfo.beneficiary;
|
491
|
-
}
|
492
|
-
|
493
|
-
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
494
|
-
if(FeeLib.gtz(productInfo.processingFee)) {
|
495
|
-
// TODO calculate and set net payout and processing fees
|
496
|
-
}
|
497
|
-
}
|
498
|
-
}
|
499
|
-
|
500
|
-
|
501
509
|
function _verifyCallerWithPolicy(
|
502
510
|
NftId policyNftId
|
503
511
|
)
|
@@ -512,7 +520,7 @@ contract ClaimService is
|
|
512
520
|
IPolicy.PolicyInfo memory policyInfo
|
513
521
|
)
|
514
522
|
{
|
515
|
-
(productNftId
|
523
|
+
(productNftId, instance) = _getAndVerifyActiveProduct();
|
516
524
|
instanceReader = instance.getInstanceReader();
|
517
525
|
instanceStore = instance.getInstanceStore();
|
518
526
|
|
@@ -525,6 +533,29 @@ contract ClaimService is
|
|
525
533
|
}
|
526
534
|
}
|
527
535
|
|
536
|
+
|
537
|
+
function _getAndVerifyActiveProduct()
|
538
|
+
internal
|
539
|
+
view
|
540
|
+
returns (
|
541
|
+
NftId productNftId,
|
542
|
+
IInstance instance
|
543
|
+
)
|
544
|
+
{
|
545
|
+
(
|
546
|
+
IRegistry.ObjectInfo memory info,
|
547
|
+
address instanceAddress
|
548
|
+
) = ContractLib.getAndVerifyComponent(
|
549
|
+
getRegistry(),
|
550
|
+
msg.sender, // caller
|
551
|
+
PRODUCT(),
|
552
|
+
true); // isActive
|
553
|
+
|
554
|
+
// get component nft id and instance
|
555
|
+
productNftId = info.nftId;
|
556
|
+
instance = IInstance(instanceAddress);
|
557
|
+
}
|
558
|
+
|
528
559
|
function _verifyClaim(
|
529
560
|
InstanceReader instanceReader,
|
530
561
|
NftId policyNftId,
|
@@ -578,22 +609,7 @@ contract ClaimService is
|
|
578
609
|
}
|
579
610
|
}
|
580
611
|
|
581
|
-
|
582
|
-
function _policyHolderPayoutExecuted(
|
583
|
-
NftId policyNftId,
|
584
|
-
PayoutId payoutId,
|
585
|
-
address beneficiary,
|
586
|
-
Amount payoutAmount
|
587
|
-
)
|
588
|
-
internal
|
589
|
-
{
|
590
|
-
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
591
|
-
if(address(policyHolder) != address(0)) {
|
592
|
-
policyHolder.payoutExecuted(policyNftId, payoutId, payoutAmount, beneficiary);
|
593
|
-
}
|
594
|
-
}
|
595
|
-
|
596
|
-
|
612
|
+
// TODO: move to policy helper lib or something
|
597
613
|
function _getPolicyHolder(NftId policyNftId)
|
598
614
|
internal
|
599
615
|
view
|
@@ -17,7 +17,7 @@ contract ClaimServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
ClaimService svc = new ClaimService{salt: salt}();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|
@@ -6,7 +6,6 @@ import {IService} from "../shared/IService.sol";
|
|
6
6
|
|
7
7
|
import {Amount} from "../type/Amount.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
10
9
|
import {ReferralId} from "../type/Referral.sol";
|
11
10
|
import {RiskId} from "../type/RiskId.sol";
|
12
11
|
import {Seconds} from "../type/Seconds.sol";
|
@@ -15,11 +14,34 @@ import {Seconds} from "../type/Seconds.sol";
|
|
15
14
|
/// only product components may call transaction functions
|
16
15
|
interface IApplicationService is IService {
|
17
16
|
|
17
|
+
event LogApplicationServiceApplicationCreated(
|
18
|
+
NftId applicationNftId,
|
19
|
+
NftId productNftId,
|
20
|
+
NftId bundleNftId,
|
21
|
+
RiskId riskId,
|
22
|
+
ReferralId referralId,
|
23
|
+
address applicationOwner,
|
24
|
+
Amount sumInsuredAmount,
|
25
|
+
Amount premiumAmount,
|
26
|
+
Seconds lifetime);
|
27
|
+
event LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId);
|
28
|
+
event LogApplicationServiceApplicationAdjusted(
|
29
|
+
NftId applicationNftId,
|
30
|
+
NftId bundleNftId,
|
31
|
+
RiskId riskId,
|
32
|
+
ReferralId referralId,
|
33
|
+
Amount sumInsuredAmount,
|
34
|
+
Seconds lifetime);
|
35
|
+
event LogApplicationServiceApplicationRevoked(NftId applicationNftId);
|
36
|
+
|
18
37
|
// _checkLinkedApplicationParameters
|
38
|
+
error ErrorApplicationServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
19
39
|
error ErrorApplicationServiceRiskUnknown(RiskId riskId, NftId productNftId);
|
20
|
-
error
|
40
|
+
error ErrorApplicationServiceRiskLocked(RiskId riskId, NftId productNftId);
|
21
41
|
error ErrorApplicationServiceBundleUnknown(NftId bundleNftId, NftId poolNftId);
|
22
42
|
error ErrorApplicationServiceBundleLocked(NftId bundleNftId, NftId poolNftId);
|
43
|
+
error ErrorApplicationServiceReferralInvalid(NftId productNftId, NftId distributionNftId, ReferralId referralId);
|
44
|
+
|
23
45
|
|
24
46
|
/// @dev creates a new application based on the specified attributes
|
25
47
|
/// may only be called by a product component
|