@etherisc/gif-next 0.0.2-d96b9e1-825 → 0.0.2-d9d5e42-801
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +383 -21
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1046 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +752 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +814 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1664 -0
- 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 +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1403 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +790 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/{instance/module/access → authorization}/IAccess.sol/IAccess.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1372 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +455 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +397 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +646 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1225 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +805 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +930 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1665 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +912 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +829 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +1100 -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 +1461 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2018 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +805 -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 +1404 -0
- 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 +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1152 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1628 -0
- 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 +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2405 -0
- 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 +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +851 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +577 -1316
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +990 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +670 -1539
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2349 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +902 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2646 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1236 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +734 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3784 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +137 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +192 -0
- 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 +4 -0
- package/artifacts/contracts/instance/module/{bundle/IBundle.sol → IBundle.sol}/IBundle.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/{base/ModuleBase.sol/ModuleBase.json → module/IComponents.sol/IComponents.json} +2 -2
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{policy/IPolicy.sol → IPolicy.sol}/IPolicy.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
- package/artifacts/contracts/instance/module/{risk/IRisk.sol → IRisk.sol}/IRisk.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +938 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +810 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +753 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +733 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +854 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1013 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +772 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1231 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +805 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1293 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +832 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +880 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +886 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1230 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.json +1006 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +546 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1614 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +828 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +871 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +752 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1140 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +805 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1512 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +856 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +639 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +1064 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +981 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +623 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +997 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service/IProductService.sol/IProductService.json → product/IRiskService.sol/IRiskService.json} +233 -230
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1341 -0
- 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 +4 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +812 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +903 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +776 -0
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/product/Product.sol/Product.json +1098 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +688 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +736 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +242 -12
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +1024 -119
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +1043 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/{instance/IInstanceLinked.sol/IInstanceLinked.json → registry/IRelease.sol/IRelease.json} +6 -6
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +39 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +1450 -219
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2147 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1053 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1269 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +735 -0
- 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 +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1389 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +683 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +661 -0
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/shared/Component.sol/Component.json +686 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1487 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +816 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +632 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/{IOwnable.sol/IOwnable.json → ContractLib.sol/IInstanceAdminHelper.json} +5 -5
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- 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 +4 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +611 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +1127 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +688 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +140 -141
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +35 -4
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/{components/IBaseComponent.sol/IBaseComponent.json → shared/INftOwnable.sol/INftOwnable.json} +47 -74
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +175 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +229 -21
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{registry → shared}/IRegistryLinked.sol/IRegistryLinked.json +13 -2
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/{instance/service/IComponentOwnerService.sol/IComponentOwnerService.json → shared/IService.sol/IService.json} +198 -163
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +776 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +538 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +174 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +209 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +198 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +275 -18
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +58 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/{instance/service/IPoolService.sol/IPoolService.json → shared/Service.sol/Service.json} +248 -171
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +723 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1617 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +1167 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2025 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +804 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +616 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1396 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +744 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2297 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +617 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +10 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +398 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +225 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +203 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +104 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +373 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +125 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +228 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +33 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +241 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +142 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +204 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +254 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +265 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +148 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +105 -0
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +180 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +312 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +572 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.json +158 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +167 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +55 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +618 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +142 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +78 -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 +780 -0
- package/contracts/authorization/AccessAdminLib.sol +396 -0
- package/contracts/authorization/AccessManagerCloneable.sol +158 -0
- package/contracts/authorization/Authorization.sol +174 -0
- package/contracts/authorization/IAccess.sol +67 -0
- package/contracts/authorization/IAccessAdmin.sol +144 -0
- package/contracts/authorization/IAuthorization.sol +27 -0
- package/contracts/authorization/IServiceAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +320 -0
- package/contracts/distribution/BasicDistribution.sol +141 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +67 -0
- package/contracts/distribution/Distribution.sol +247 -0
- package/contracts/distribution/DistributionService.sol +435 -0
- package/contracts/distribution/DistributionServiceManager.sol +39 -0
- package/contracts/distribution/IDistributionComponent.sol +45 -0
- package/contracts/distribution/IDistributionService.sol +109 -0
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +433 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +81 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +133 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +102 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +373 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IInstance.sol +138 -45
- package/contracts/instance/IInstanceService.sol +113 -0
- package/contracts/instance/Instance.sol +332 -54
- package/contracts/instance/InstanceAdmin.sol +383 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +266 -0
- package/contracts/instance/InstanceReader.sol +632 -0
- package/contracts/instance/InstanceService.sol +512 -0
- package/contracts/instance/InstanceServiceManager.sol +39 -0
- package/contracts/instance/InstanceStore.sol +298 -0
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/BalanceStore.sol +121 -0
- package/contracts/instance/base/Cloneable.sol +28 -0
- package/contracts/instance/base/ObjectCounter.sol +20 -0
- package/contracts/instance/base/ObjectLifecycle.sol +113 -0
- package/contracts/instance/base/ObjectSet.sol +77 -0
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +21 -0
- package/contracts/instance/module/IComponents.sol +62 -0
- package/contracts/instance/module/IDistribution.sol +54 -0
- package/contracts/instance/module/IPolicy.sol +105 -0
- package/contracts/instance/module/IRisk.sol +16 -0
- package/contracts/{test/TestToken.sol → mock/Dip.sol} +6 -6
- package/contracts/oracle/BasicOracle.sol +45 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +53 -0
- package/contracts/oracle/IOracle.sol +41 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +154 -0
- package/contracts/oracle/OracleService.sol +310 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +173 -0
- package/contracts/pool/BasicPoolAuthorization.sol +82 -0
- package/contracts/pool/BundleService.sol +394 -0
- package/contracts/pool/BundleServiceManager.sol +39 -0
- package/contracts/pool/IBundleService.sol +115 -0
- package/contracts/pool/IPoolComponent.sol +62 -0
- package/contracts/pool/IPoolService.sol +165 -0
- package/contracts/pool/Pool.sol +343 -0
- package/contracts/pool/PoolLib.sol +356 -0
- package/contracts/pool/PoolService.sol +589 -0
- package/contracts/pool/PoolServiceManager.sol +39 -0
- package/contracts/product/ApplicationService.sol +299 -0
- package/contracts/product/ApplicationServiceManager.sol +38 -0
- package/contracts/product/BasicProduct.sol +49 -0
- package/contracts/product/BasicProductAuthorization.sol +63 -0
- package/contracts/product/ClaimService.sol +631 -0
- package/contracts/product/ClaimServiceManager.sol +38 -0
- package/contracts/product/IApplicationService.sol +69 -0
- package/contracts/product/IClaimService.sol +135 -0
- package/contracts/product/IPolicyService.sol +94 -0
- package/contracts/product/IPricingService.sol +40 -0
- package/contracts/product/IProductComponent.sol +62 -0
- package/contracts/product/IRiskService.sol +33 -0
- package/contracts/product/PolicyService.sol +637 -0
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +39 -0
- package/contracts/product/PricingService.sol +306 -0
- package/contracts/product/PricingServiceManager.sol +39 -0
- package/contracts/product/Product.sol +469 -0
- package/contracts/product/RiskService.sol +157 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +130 -40
- package/contracts/registry/IRegistry.sol +142 -29
- package/contracts/registry/IRegistryService.sol +62 -0
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +6 -0
- package/contracts/registry/Registry.sol +631 -282
- package/contracts/registry/RegistryAdmin.sol +188 -0
- package/contracts/registry/RegistryAuthorization.sol +284 -0
- package/contracts/registry/RegistryService.sol +241 -0
- package/contracts/registry/RegistryServiceManager.sol +53 -0
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +32 -0
- package/contracts/registry/ReleaseRegistry.sol +520 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +345 -0
- package/contracts/registry/TokenRegistry.sol +314 -0
- package/contracts/shared/Component.sol +210 -0
- package/contracts/shared/ComponentService.sol +678 -0
- package/contracts/shared/ComponentServiceManager.sol +38 -0
- package/contracts/shared/ContractLib.sol +311 -0
- package/contracts/shared/IComponent.sol +58 -0
- package/contracts/shared/IComponentService.sol +110 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +30 -0
- package/contracts/shared/IKeyValueStore.sol +54 -0
- package/contracts/{instance/base → shared}/ILifecycle.sol +6 -5
- package/contracts/shared/INftOwnable.sol +25 -0
- package/contracts/shared/IPolicyHolder.sol +35 -0
- package/contracts/shared/IRegisterable.sol +31 -19
- package/contracts/shared/IRegistryLinked.sol +11 -0
- package/contracts/shared/IService.sol +23 -0
- package/contracts/shared/InitializableERC165.sol +35 -0
- package/contracts/shared/InstanceLinkedComponent.sol +194 -0
- package/contracts/shared/KeyValueStore.sol +131 -0
- package/contracts/shared/Lifecycle.sol +88 -0
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +127 -0
- package/contracts/shared/PolicyHolder.sol +63 -0
- package/contracts/shared/Registerable.sol +80 -60
- package/contracts/shared/RegistryLinked.sol +38 -0
- package/contracts/shared/Service.sol +67 -0
- package/contracts/shared/TokenHandler.sol +342 -0
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +195 -0
- package/contracts/staking/IStakingService.sol +170 -0
- package/contracts/staking/Staking.sol +605 -0
- package/contracts/staking/StakingLib.sol +281 -0
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +52 -0
- package/contracts/staking/StakingReader.sol +199 -0
- package/contracts/staking/StakingService.sol +468 -0
- package/contracts/staking/StakingServiceManager.sol +45 -0
- package/contracts/staking/StakingStore.sol +606 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/{types → type}/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +150 -0
- package/contracts/{types → type}/Blocknumber.sol +27 -3
- package/contracts/type/ClaimId.sol +80 -0
- package/contracts/type/DistributorType.sol +55 -0
- package/contracts/type/Fee.sol +66 -0
- package/contracts/{types → type}/Key32.sol +10 -5
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/{types → type}/NftId.sol +28 -15
- package/contracts/type/NftIdSet.sol +62 -0
- package/contracts/type/ObjectType.sol +307 -0
- package/contracts/type/PayoutId.sol +82 -0
- package/contracts/type/Referral.sol +90 -0
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +75 -0
- package/contracts/type/RoleId.sol +180 -0
- package/contracts/type/Seconds.sol +105 -0
- package/contracts/type/Selector.sol +107 -0
- package/contracts/{types → type}/StateId.sol +53 -5
- package/contracts/type/String.sol +65 -0
- package/contracts/{types → type}/Timestamp.sol +37 -19
- package/contracts/{types → type}/UFixed.sol +90 -34
- package/contracts/type/Version.sol +159 -0
- package/contracts/upgradeability/IVersionable.sol +53 -0
- package/contracts/upgradeability/ProxyManager.sol +234 -0
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +20 -0
- package/contracts/upgradeability/Versionable.sol +62 -0
- package/package.json +16 -8
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -174
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +0 -356
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +0 -279
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.json +0 -387
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.json +0 -305
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +0 -300
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -63
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IService.sol/IService.json +0 -300
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.json +0 -326
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -692
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -169
- package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.json +0 -300
- package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.json +0 -333
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.json +0 -333
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +0 -296
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +0 -296
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +0 -10
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.json +0 -10
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.json +0 -10
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +0 -188
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.json +0 -10
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +0 -188
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +0 -261
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +0 -261
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.json +0 -10
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -149
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -149
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +0 -10
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +0 -10
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.json +0 -10
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +0 -533
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +0 -76
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
- package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +0 -533
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -491
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -471
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -673
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +0 -452
- package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -35
- package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +0 -4
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +0 -164
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +0 -164
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +0 -4
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +0 -119
- package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +0 -4
- package/artifacts/contracts/test/TestPool.sol/TestPool.json +0 -387
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +0 -4
- package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +0 -393
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +0 -4
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +0 -137
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +0 -4
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +0 -82
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +0 -4
- package/artifacts/contracts/test/TestService.sol/TestService.json +0 -379
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +0 -4
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +0 -338
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +0 -4
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +0 -218
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +0 -4
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +0 -206
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +0 -4
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.json +0 -10
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +0 -174
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +0 -10
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +0 -4
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +0 -218
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +0 -4
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +0 -111
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -153
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +0 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +0 -10
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +0 -4
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +0 -92
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +0 -92
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +0 -236
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +0 -4
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +0 -453
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +0 -4
- package/artifacts/contracts/types/Version.sol/VersionLib.json +0 -139
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +0 -4
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +0 -30
- package/contracts/components/BaseComponent.sol +0 -88
- package/contracts/components/IBaseComponent.sol +0 -19
- package/contracts/components/IPoolComponent.sol +0 -57
- package/contracts/components/IProductComponent.sol +0 -19
- package/contracts/components/Pool.sol +0 -174
- package/contracts/components/Product.sol +0 -117
- package/contracts/experiment/errors/Require.sol +0 -38
- package/contracts/experiment/errors/Revert.sol +0 -44
- package/contracts/experiment/inheritance/A.sol +0 -53
- package/contracts/experiment/inheritance/B.sol +0 -28
- package/contracts/experiment/inheritance/C.sol +0 -34
- package/contracts/experiment/inheritance/IA.sol +0 -13
- package/contracts/experiment/inheritance/IB.sol +0 -10
- package/contracts/experiment/inheritance/IC.sol +0 -12
- package/contracts/experiment/statemachine/Dummy.sol +0 -27
- package/contracts/experiment/statemachine/ISM.sol +0 -25
- package/contracts/experiment/statemachine/README.md +0 -112
- package/contracts/experiment/statemachine/SM.sol +0 -57
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
- package/contracts/experiment/types/TypeA.sol +0 -47
- package/contracts/experiment/types/TypeB.sol +0 -29
- package/contracts/instance/IInstanceLinked.sol +0 -8
- package/contracts/instance/base/ComponentServiceBase.sol +0 -42
- package/contracts/instance/base/IInstanceBase.sol +0 -14
- package/contracts/instance/base/IKeyValueStore.sol +0 -49
- package/contracts/instance/base/IService.sol +0 -15
- package/contracts/instance/base/InstanceBase.sol +0 -80
- package/contracts/instance/base/KeyValueStore.sol +0 -147
- package/contracts/instance/base/Lifecycle.sol +0 -95
- package/contracts/instance/base/ModuleBase.sol +0 -52
- package/contracts/instance/base/ServiceBase.sol +0 -37
- package/contracts/instance/module/access/Access.sol +0 -149
- package/contracts/instance/module/access/IAccess.sol +0 -53
- package/contracts/instance/module/bundle/BundleModule.sol +0 -136
- package/contracts/instance/module/bundle/IBundle.sol +0 -58
- package/contracts/instance/module/compensation/CompensationModule.sol +0 -8
- package/contracts/instance/module/compensation/ICompensation.sol +0 -10
- package/contracts/instance/module/component/ComponentModule.sol +0 -95
- package/contracts/instance/module/component/IComponent.sol +0 -53
- package/contracts/instance/module/policy/IPolicy.sol +0 -60
- package/contracts/instance/module/policy/PolicyModule.sol +0 -76
- package/contracts/instance/module/pool/IPoolModule.sol +0 -41
- package/contracts/instance/module/pool/PoolModule.sol +0 -87
- package/contracts/instance/module/risk/IRisk.sol +0 -10
- package/contracts/instance/module/risk/RiskModule.sol +0 -8
- package/contracts/instance/module/treasury/ITreasury.sol +0 -103
- package/contracts/instance/module/treasury/TokenHandler.sol +0 -48
- package/contracts/instance/module/treasury/TreasuryModule.sol +0 -152
- package/contracts/instance/service/ComponentOwnerService.sol +0 -170
- package/contracts/instance/service/IComponentOwnerService.sol +0 -22
- package/contracts/instance/service/IPoolService.sol +0 -30
- package/contracts/instance/service/IProductService.sol +0 -58
- package/contracts/instance/service/PoolService.sol +0 -123
- package/contracts/instance/service/ProductService.sol +0 -354
- package/contracts/registry/IChainNft.sol +0 -21
- package/contracts/registry/IRegistryLinked.sol +0 -8
- package/contracts/shared/ERC165.sol +0 -21
- package/contracts/shared/IOwnable.sol +0 -6
- package/contracts/shared/IVersionable.sol +0 -52
- package/contracts/shared/Versionable.sol +0 -89
- package/contracts/test/TestFee.sol +0 -25
- package/contracts/test/TestPool.sol +0 -22
- package/contracts/test/TestProduct.sol +0 -44
- package/contracts/test/TestRegisterable.sol +0 -19
- package/contracts/test/TestRoleId.sol +0 -14
- package/contracts/test/TestService.sol +0 -32
- package/contracts/test/TestVersion.sol +0 -44
- package/contracts/test/TestVersionable.sol +0 -17
- package/contracts/types/ChainId.sol +0 -38
- package/contracts/types/Fee.sol +0 -51
- package/contracts/types/NftIdSet.sol +0 -60
- package/contracts/types/ObjectType.sol +0 -115
- package/contracts/types/RoleId.sol +0 -36
- package/contracts/types/Version.sol +0 -95
@@ -0,0 +1,631 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IClaimService} from "./IClaimService.sol";
|
5
|
+
import {IInstance} from "../instance/IInstance.sol";
|
6
|
+
import {IPolicy} from "../instance/module/IPolicy.sol";
|
7
|
+
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
8
|
+
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
9
|
+
import {IPolicyService} from "../product/IPolicyService.sol";
|
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
|
+
|
26
|
+
|
27
|
+
contract ClaimService is
|
28
|
+
Service,
|
29
|
+
IClaimService
|
30
|
+
{
|
31
|
+
|
32
|
+
IPolicyService internal _policyService;
|
33
|
+
IPoolService internal _poolService;
|
34
|
+
|
35
|
+
function _initialize(
|
36
|
+
address owner,
|
37
|
+
bytes memory data
|
38
|
+
)
|
39
|
+
internal
|
40
|
+
virtual override
|
41
|
+
initializer()
|
42
|
+
{
|
43
|
+
(
|
44
|
+
address authority,
|
45
|
+
address registry
|
46
|
+
) = abi.decode(data, (address, address));
|
47
|
+
|
48
|
+
__Service_init(authority, registry, owner);
|
49
|
+
|
50
|
+
_policyService = IPolicyService(getRegistry().getServiceAddress(POLICY(), getVersion().toMajorPart()));
|
51
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
52
|
+
|
53
|
+
_registerInterface(type(IClaimService).interfaceId);
|
54
|
+
}
|
55
|
+
|
56
|
+
function submit(
|
57
|
+
NftId policyNftId,
|
58
|
+
Amount claimAmount,
|
59
|
+
bytes memory claimData // claim submission data
|
60
|
+
)
|
61
|
+
external
|
62
|
+
virtual
|
63
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
64
|
+
restricted()
|
65
|
+
returns (ClaimId claimId)
|
66
|
+
{
|
67
|
+
// checks
|
68
|
+
(
|
69
|
+
,,,
|
70
|
+
InstanceStore instanceStore,
|
71
|
+
IPolicy.PolicyInfo memory policyInfo
|
72
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
73
|
+
|
74
|
+
// check policy is in its active period
|
75
|
+
if(policyInfo.activatedAt.eqz() || TimestampLib.blockTimestamp() >= policyInfo.expiredAt) {
|
76
|
+
revert ErrorClaimServicePolicyNotOpen(policyNftId);
|
77
|
+
}
|
78
|
+
|
79
|
+
_checkClaimAmount(policyNftId, policyInfo, claimAmount);
|
80
|
+
|
81
|
+
// effects
|
82
|
+
// create new claim
|
83
|
+
claimId = ClaimIdLib.toClaimId(policyInfo.claimsCount + 1);
|
84
|
+
instanceStore.createClaim(
|
85
|
+
policyNftId,
|
86
|
+
claimId,
|
87
|
+
IPolicy.ClaimInfo({
|
88
|
+
claimAmount: claimAmount,
|
89
|
+
paidAmount: AmountLib.zero(),
|
90
|
+
payoutsCount: 0,
|
91
|
+
openPayoutsCount: 0,
|
92
|
+
submissionData: claimData,
|
93
|
+
processData: "",
|
94
|
+
closedAt: TimestampLib.zero()}));
|
95
|
+
|
96
|
+
// update and save policy info with instance
|
97
|
+
// policy claim amount is only updated when claim is confirmed
|
98
|
+
policyInfo.claimsCount += 1;
|
99
|
+
policyInfo.openClaimsCount += 1;
|
100
|
+
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
101
|
+
|
102
|
+
emit LogClaimServiceClaimSubmitted(policyNftId, claimId, claimAmount);
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
function confirm(
|
107
|
+
NftId policyNftId,
|
108
|
+
ClaimId claimId,
|
109
|
+
Amount confirmedAmount,
|
110
|
+
bytes memory data // claim processing data
|
111
|
+
)
|
112
|
+
external
|
113
|
+
virtual
|
114
|
+
restricted()
|
115
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
116
|
+
{
|
117
|
+
// checks
|
118
|
+
_checkNftType(policyNftId, POLICY());
|
119
|
+
|
120
|
+
(
|
121
|
+
NftId productNftId,
|
122
|
+
IInstance instance,
|
123
|
+
InstanceReader instanceReader,
|
124
|
+
InstanceStore instanceStore,
|
125
|
+
IPolicy.PolicyInfo memory policyInfo
|
126
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
127
|
+
|
128
|
+
_checkClaimAmount(policyNftId, policyInfo, confirmedAmount);
|
129
|
+
|
130
|
+
// effects
|
131
|
+
// check/update claim info
|
132
|
+
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
133
|
+
claimInfo.claimAmount = confirmedAmount;
|
134
|
+
claimInfo.processData = data;
|
135
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CONFIRMED());
|
136
|
+
|
137
|
+
// update and save policy info with instance
|
138
|
+
policyInfo.claimAmount = policyInfo.claimAmount + confirmedAmount;
|
139
|
+
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
140
|
+
|
141
|
+
// should policy still be active it needs to become expired
|
142
|
+
if (policyInfo.claimAmount >= policyInfo.sumInsuredAmount) {
|
143
|
+
_policyService.expirePolicy(instance, policyNftId, TimestampLib.blockTimestamp());
|
144
|
+
}
|
145
|
+
|
146
|
+
emit LogClaimServiceClaimConfirmed(policyNftId, claimId, confirmedAmount);
|
147
|
+
|
148
|
+
// interactions
|
149
|
+
// callback to pool if applicable
|
150
|
+
_processConfirmedClaimByPool(instanceReader, productNftId, policyNftId, claimId, confirmedAmount);
|
151
|
+
|
152
|
+
// callback to policy holder if applicable
|
153
|
+
_policyHolderClaimConfirmed(policyNftId, claimId, confirmedAmount);
|
154
|
+
}
|
155
|
+
|
156
|
+
|
157
|
+
function decline(
|
158
|
+
NftId policyNftId,
|
159
|
+
ClaimId claimId,
|
160
|
+
bytes memory data // claim processing data
|
161
|
+
)
|
162
|
+
external
|
163
|
+
virtual
|
164
|
+
restricted()
|
165
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
166
|
+
{
|
167
|
+
_checkNftType(policyNftId, POLICY());
|
168
|
+
|
169
|
+
(
|
170
|
+
,,
|
171
|
+
InstanceReader instanceReader,
|
172
|
+
InstanceStore instanceStore,
|
173
|
+
IPolicy.PolicyInfo memory policyInfo
|
174
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
175
|
+
|
176
|
+
// check/update claim info
|
177
|
+
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
178
|
+
claimInfo.processData = data;
|
179
|
+
claimInfo.closedAt = TimestampLib.blockTimestamp();
|
180
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, DECLINED());
|
181
|
+
|
182
|
+
// update and save policy info with instance
|
183
|
+
policyInfo.openClaimsCount -= 1;
|
184
|
+
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
185
|
+
|
186
|
+
emit LogClaimServiceClaimDeclined(policyNftId, claimId);
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
function revoke(
|
191
|
+
NftId policyNftId,
|
192
|
+
ClaimId claimId
|
193
|
+
)
|
194
|
+
external
|
195
|
+
virtual
|
196
|
+
restricted()
|
197
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
198
|
+
{
|
199
|
+
(
|
200
|
+
,,
|
201
|
+
InstanceReader instanceReader,
|
202
|
+
InstanceStore instanceStore,
|
203
|
+
IPolicy.PolicyInfo memory policyInfo
|
204
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
205
|
+
|
206
|
+
// check/update claim info
|
207
|
+
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
208
|
+
claimInfo.closedAt = TimestampLib.blockTimestamp();
|
209
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, REVOKED());
|
210
|
+
|
211
|
+
// update and save policy info with instance
|
212
|
+
policyInfo.openClaimsCount -= 1;
|
213
|
+
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
214
|
+
|
215
|
+
emit LogClaimServiceClaimRevoked(policyNftId, claimId);
|
216
|
+
}
|
217
|
+
|
218
|
+
|
219
|
+
function close(
|
220
|
+
NftId policyNftId,
|
221
|
+
ClaimId claimId
|
222
|
+
)
|
223
|
+
external
|
224
|
+
virtual
|
225
|
+
restricted()
|
226
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
227
|
+
{
|
228
|
+
_checkNftType(policyNftId, POLICY());
|
229
|
+
|
230
|
+
(
|
231
|
+
,,
|
232
|
+
InstanceReader instanceReader,
|
233
|
+
InstanceStore instanceStore,
|
234
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
235
|
+
|
236
|
+
// check/update claim info
|
237
|
+
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, CONFIRMED());
|
238
|
+
|
239
|
+
// check claim has no open payouts
|
240
|
+
if(claimInfo.openPayoutsCount > 0) {
|
241
|
+
revert ErrorClaimServiceClaimWithOpenPayouts(
|
242
|
+
policyNftId,
|
243
|
+
claimId,
|
244
|
+
claimInfo.openPayoutsCount);
|
245
|
+
}
|
246
|
+
|
247
|
+
// check claim paid amount matches with claim amount
|
248
|
+
if(claimInfo.paidAmount.toInt() < claimInfo.claimAmount.toInt()) {
|
249
|
+
revert ErrorClaimServiceClaimWithMissingPayouts(
|
250
|
+
policyNftId,
|
251
|
+
claimId,
|
252
|
+
claimInfo.claimAmount,
|
253
|
+
claimInfo.paidAmount);
|
254
|
+
}
|
255
|
+
|
256
|
+
claimInfo.closedAt = TimestampLib.blockTimestamp();
|
257
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CLOSED());
|
258
|
+
}
|
259
|
+
|
260
|
+
|
261
|
+
function createPayoutForBeneficiary(
|
262
|
+
NftId policyNftId,
|
263
|
+
ClaimId claimId,
|
264
|
+
Amount amount,
|
265
|
+
address beneficiary,
|
266
|
+
bytes memory data
|
267
|
+
)
|
268
|
+
external
|
269
|
+
virtual
|
270
|
+
restricted()
|
271
|
+
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
272
|
+
returns (PayoutId payoutId)
|
273
|
+
{
|
274
|
+
if (beneficiary == address(0)) {
|
275
|
+
revert ErrorClaimServiceBeneficiaryIsZero(policyNftId, claimId);
|
276
|
+
}
|
277
|
+
|
278
|
+
return _createPayout(
|
279
|
+
policyNftId,
|
280
|
+
claimId,
|
281
|
+
amount,
|
282
|
+
beneficiary,
|
283
|
+
data);
|
284
|
+
}
|
285
|
+
|
286
|
+
|
287
|
+
function createPayout(
|
288
|
+
NftId policyNftId,
|
289
|
+
ClaimId claimId,
|
290
|
+
Amount amount,
|
291
|
+
bytes memory data
|
292
|
+
)
|
293
|
+
external
|
294
|
+
virtual
|
295
|
+
restricted()
|
296
|
+
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
297
|
+
returns (PayoutId payoutId)
|
298
|
+
{
|
299
|
+
_checkNftType(policyNftId, POLICY());
|
300
|
+
|
301
|
+
return _createPayout(
|
302
|
+
policyNftId,
|
303
|
+
claimId,
|
304
|
+
amount,
|
305
|
+
address(0), // defaults to owner of policy nft
|
306
|
+
data);
|
307
|
+
}
|
308
|
+
|
309
|
+
|
310
|
+
function processPayout(
|
311
|
+
NftId policyNftId,
|
312
|
+
PayoutId payoutId
|
313
|
+
)
|
314
|
+
external
|
315
|
+
virtual
|
316
|
+
restricted()
|
317
|
+
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
318
|
+
{
|
319
|
+
// checks
|
320
|
+
(
|
321
|
+
,,
|
322
|
+
InstanceReader instanceReader,
|
323
|
+
InstanceStore instanceStore,
|
324
|
+
IPolicy.PolicyInfo memory policyInfo
|
325
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
326
|
+
|
327
|
+
// check that payout exists and is open
|
328
|
+
IPolicy.PayoutInfo memory payoutInfo = instanceReader.getPayoutInfo(policyNftId, payoutId);
|
329
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
330
|
+
if(payoutState != EXPECTED()) {
|
331
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
332
|
+
}
|
333
|
+
|
334
|
+
// check that payout amount does not violate claim amount
|
335
|
+
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, payoutId.toClaimId());
|
336
|
+
if(claimInfo.paidAmount + payoutInfo.amount > claimInfo.claimAmount) {
|
337
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
338
|
+
policyNftId,
|
339
|
+
payoutId.toClaimId(),
|
340
|
+
claimInfo.claimAmount,
|
341
|
+
claimInfo.paidAmount + payoutInfo.amount);
|
342
|
+
}
|
343
|
+
|
344
|
+
// effects
|
345
|
+
// update and save payout info with instance
|
346
|
+
payoutInfo.paidAt = TimestampLib.blockTimestamp();
|
347
|
+
instanceStore.updatePayout(policyNftId, payoutId, payoutInfo, PAID());
|
348
|
+
|
349
|
+
// update and save claim info with instance
|
350
|
+
Amount payoutAmount = payoutInfo.amount;
|
351
|
+
{
|
352
|
+
ClaimId claimId = payoutId.toClaimId();
|
353
|
+
// TODO cleanup
|
354
|
+
// IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
355
|
+
claimInfo.paidAmount = claimInfo.paidAmount.add(payoutAmount);
|
356
|
+
claimInfo.openPayoutsCount -= 1;
|
357
|
+
|
358
|
+
// check if this payout is closing the linked claim
|
359
|
+
// update claim and policy info accordingly
|
360
|
+
if(claimInfo.openPayoutsCount == 0 && claimInfo.paidAmount == claimInfo.claimAmount) {
|
361
|
+
claimInfo.closedAt = TimestampLib.blockTimestamp();
|
362
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CLOSED());
|
363
|
+
|
364
|
+
policyInfo.openClaimsCount -= 1;
|
365
|
+
} else {
|
366
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
// update and save policy info with instance
|
371
|
+
policyInfo.payoutAmount = policyInfo.payoutAmount + payoutAmount;
|
372
|
+
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
373
|
+
|
374
|
+
emit LogClaimServicePayoutProcessed(policyNftId, payoutId, payoutAmount);
|
375
|
+
|
376
|
+
// effects + interactions (push tokens to beneficiary, product)
|
377
|
+
// delegate to pool to update book keeping and moving tokens payout
|
378
|
+
_poolService.processPayout(
|
379
|
+
instanceReader,
|
380
|
+
instanceStore,
|
381
|
+
policyInfo.productNftId, // product nft id
|
382
|
+
policyNftId,
|
383
|
+
policyInfo.bundleNftId,
|
384
|
+
payoutId,
|
385
|
+
payoutAmount,
|
386
|
+
payoutInfo.beneficiary);
|
387
|
+
}
|
388
|
+
|
389
|
+
function cancelPayout(
|
390
|
+
NftId policyNftId,
|
391
|
+
PayoutId payoutId
|
392
|
+
)
|
393
|
+
external
|
394
|
+
virtual
|
395
|
+
restricted()
|
396
|
+
{
|
397
|
+
// checks
|
398
|
+
(
|
399
|
+
,,
|
400
|
+
InstanceReader instanceReader,
|
401
|
+
InstanceStore instanceStore,
|
402
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
403
|
+
|
404
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
405
|
+
if (payoutState != EXPECTED()) {
|
406
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
407
|
+
}
|
408
|
+
|
409
|
+
// effects
|
410
|
+
// update and save payout info with instance
|
411
|
+
instanceStore.updatePayoutState(policyNftId, payoutId, CANCELLED());
|
412
|
+
|
413
|
+
{
|
414
|
+
ClaimId claimId = payoutId.toClaimId();
|
415
|
+
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
416
|
+
claimInfo.openPayoutsCount -= 1;
|
417
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
418
|
+
}
|
419
|
+
|
420
|
+
emit LogClaimServicePayoutCancelled(policyNftId, payoutId);
|
421
|
+
}
|
422
|
+
|
423
|
+
// internal functions
|
424
|
+
|
425
|
+
function _checkClaimAmount(
|
426
|
+
NftId policyNftId,
|
427
|
+
IPolicy.PolicyInfo memory policyInfo,
|
428
|
+
Amount claimAmount
|
429
|
+
)
|
430
|
+
internal
|
431
|
+
pure
|
432
|
+
{
|
433
|
+
// check claim amount > 0
|
434
|
+
if (claimAmount.eqz()) {
|
435
|
+
revert ErrorClaimServiceClaimAmountIsZero(policyNftId);
|
436
|
+
}
|
437
|
+
|
438
|
+
// check policy including this claim is still within sum insured
|
439
|
+
if(policyInfo.claimAmount + claimAmount > policyInfo.sumInsuredAmount) {
|
440
|
+
revert ErrorClaimServiceClaimExceedsSumInsured(
|
441
|
+
policyNftId,
|
442
|
+
policyInfo.sumInsuredAmount,
|
443
|
+
policyInfo.payoutAmount + claimAmount);
|
444
|
+
}
|
445
|
+
}
|
446
|
+
|
447
|
+
function _createPayout(
|
448
|
+
NftId policyNftId,
|
449
|
+
ClaimId claimId,
|
450
|
+
Amount amount,
|
451
|
+
address beneficiary,
|
452
|
+
bytes memory data
|
453
|
+
)
|
454
|
+
internal
|
455
|
+
virtual
|
456
|
+
returns (PayoutId payoutId)
|
457
|
+
{
|
458
|
+
// checks
|
459
|
+
(
|
460
|
+
,,
|
461
|
+
InstanceReader instanceReader,
|
462
|
+
InstanceStore instanceStore,
|
463
|
+
// IPolicy.PolicyInfo memory policyInfo
|
464
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
465
|
+
|
466
|
+
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
467
|
+
|
468
|
+
{
|
469
|
+
// check claim state
|
470
|
+
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
471
|
+
if (claimState != CONFIRMED()) {
|
472
|
+
revert ErrorClaimServiceClaimNotConfirmed(policyNftId, claimId, claimState);
|
473
|
+
}
|
474
|
+
|
475
|
+
// check total payout amount remains within claim limit
|
476
|
+
Amount newPaidAmount = claimInfo.paidAmount + amount;
|
477
|
+
if (newPaidAmount > claimInfo.claimAmount) {
|
478
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
479
|
+
policyNftId, claimId, claimInfo.claimAmount, newPaidAmount);
|
480
|
+
}
|
481
|
+
}
|
482
|
+
|
483
|
+
// effects
|
484
|
+
// create payout info with instance
|
485
|
+
uint24 payoutNo = claimInfo.payoutsCount + 1;
|
486
|
+
payoutId = PayoutIdLib.toPayoutId(claimId, payoutNo);
|
487
|
+
if (beneficiary == address(0)) {
|
488
|
+
beneficiary = getRegistry().ownerOf(policyNftId);
|
489
|
+
}
|
490
|
+
|
491
|
+
instanceStore.createPayout(
|
492
|
+
policyNftId,
|
493
|
+
payoutId,
|
494
|
+
IPolicy.PayoutInfo({
|
495
|
+
claimId: payoutId.toClaimId(),
|
496
|
+
amount: amount,
|
497
|
+
beneficiary: beneficiary,
|
498
|
+
data: data,
|
499
|
+
paidAt: TimestampLib.zero()}));
|
500
|
+
|
501
|
+
// update and save claim info with instance
|
502
|
+
claimInfo.payoutsCount += 1;
|
503
|
+
claimInfo.openPayoutsCount += 1;
|
504
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
505
|
+
|
506
|
+
emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount, beneficiary);
|
507
|
+
}
|
508
|
+
|
509
|
+
|
510
|
+
function _verifyCallerWithPolicy(
|
511
|
+
NftId policyNftId
|
512
|
+
)
|
513
|
+
internal
|
514
|
+
view
|
515
|
+
virtual
|
516
|
+
returns (
|
517
|
+
NftId productNftId,
|
518
|
+
IInstance instance,
|
519
|
+
InstanceReader instanceReader,
|
520
|
+
InstanceStore instanceStore,
|
521
|
+
IPolicy.PolicyInfo memory policyInfo
|
522
|
+
)
|
523
|
+
{
|
524
|
+
(productNftId, instance) = _getAndVerifyActiveProduct();
|
525
|
+
instanceReader = instance.getInstanceReader();
|
526
|
+
instanceStore = instance.getInstanceStore();
|
527
|
+
|
528
|
+
// check caller(product) policy match
|
529
|
+
policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
530
|
+
if(policyInfo.productNftId != productNftId) {
|
531
|
+
revert ErrorClaimServicePolicyProductMismatch(policyNftId,
|
532
|
+
policyInfo.productNftId,
|
533
|
+
productNftId);
|
534
|
+
}
|
535
|
+
}
|
536
|
+
|
537
|
+
|
538
|
+
function _getAndVerifyActiveProduct()
|
539
|
+
internal
|
540
|
+
view
|
541
|
+
returns (
|
542
|
+
NftId productNftId,
|
543
|
+
IInstance instance
|
544
|
+
)
|
545
|
+
{
|
546
|
+
(
|
547
|
+
IRegistry.ObjectInfo memory info,
|
548
|
+
address instanceAddress
|
549
|
+
) = ContractLib.getAndVerifyComponent(
|
550
|
+
getRegistry(),
|
551
|
+
msg.sender, // caller
|
552
|
+
PRODUCT(),
|
553
|
+
true); // isActive
|
554
|
+
|
555
|
+
// get component nft id and instance
|
556
|
+
productNftId = info.nftId;
|
557
|
+
instance = IInstance(instanceAddress);
|
558
|
+
}
|
559
|
+
|
560
|
+
function _verifyClaim(
|
561
|
+
InstanceReader instanceReader,
|
562
|
+
NftId policyNftId,
|
563
|
+
ClaimId claimId,
|
564
|
+
StateId expectedState
|
565
|
+
)
|
566
|
+
internal
|
567
|
+
view
|
568
|
+
returns (
|
569
|
+
IPolicy.ClaimInfo memory claimInfo
|
570
|
+
)
|
571
|
+
{
|
572
|
+
// check claim is created state
|
573
|
+
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
574
|
+
if(claimState != expectedState) {
|
575
|
+
revert ErrorClaimServiceClaimNotInExpectedState(
|
576
|
+
policyNftId, claimId, expectedState, claimState);
|
577
|
+
}
|
578
|
+
|
579
|
+
// get claim info
|
580
|
+
claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
581
|
+
}
|
582
|
+
|
583
|
+
function _processConfirmedClaimByPool(
|
584
|
+
InstanceReader instanceReader,
|
585
|
+
NftId productNftId,
|
586
|
+
NftId policyNftId,
|
587
|
+
ClaimId claimId,
|
588
|
+
Amount amount
|
589
|
+
)
|
590
|
+
internal
|
591
|
+
{
|
592
|
+
NftId poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
|
593
|
+
if (instanceReader.getPoolInfo(poolNftId).isProcessingConfirmedClaims) {
|
594
|
+
address poolAddress = getRegistry().getObjectAddress(poolNftId);
|
595
|
+
IPoolComponent(poolAddress).processConfirmedClaim(policyNftId, claimId, amount);
|
596
|
+
}
|
597
|
+
}
|
598
|
+
|
599
|
+
|
600
|
+
function _policyHolderClaimConfirmed(
|
601
|
+
NftId policyNftId,
|
602
|
+
ClaimId claimId,
|
603
|
+
Amount confirmedAmount
|
604
|
+
)
|
605
|
+
internal
|
606
|
+
{
|
607
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
608
|
+
if(address(policyHolder) != address(0)) {
|
609
|
+
policyHolder.claimConfirmed(policyNftId, claimId, confirmedAmount);
|
610
|
+
}
|
611
|
+
}
|
612
|
+
|
613
|
+
// TODO: move to policy helper lib or something
|
614
|
+
function _getPolicyHolder(NftId policyNftId)
|
615
|
+
internal
|
616
|
+
view
|
617
|
+
returns (IPolicyHolder policyHolder)
|
618
|
+
{
|
619
|
+
address policyHolderAddress = getRegistry().ownerOf(policyNftId);
|
620
|
+
policyHolder = IPolicyHolder(policyHolderAddress);
|
621
|
+
|
622
|
+
if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
|
623
|
+
policyHolder = IPolicyHolder(address(0));
|
624
|
+
}
|
625
|
+
}
|
626
|
+
|
627
|
+
|
628
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
629
|
+
return CLAIM();
|
630
|
+
}
|
631
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
|
+
import {ClaimService} from "./ClaimService.sol";
|
7
|
+
|
8
|
+
contract ClaimServiceManager is ProxyManager {
|
9
|
+
|
10
|
+
ClaimService private _claimService;
|
11
|
+
|
12
|
+
/// @dev initializes proxy manager with service implementation
|
13
|
+
constructor(
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
18
|
+
{
|
19
|
+
ClaimService svc = new ClaimService{salt: salt}();
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
|
+
address(svc),
|
24
|
+
data,
|
25
|
+
salt);
|
26
|
+
|
27
|
+
_claimService = ClaimService(address(versionable));
|
28
|
+
}
|
29
|
+
|
30
|
+
//--- view functions ----------------------------------------------------//
|
31
|
+
function getClaimService()
|
32
|
+
external
|
33
|
+
view
|
34
|
+
returns (ClaimService)
|
35
|
+
{
|
36
|
+
return _claimService;
|
37
|
+
}
|
38
|
+
}
|