@etherisc/gif-next 0.0.2-de9ede4-391 → 0.0.2-df69269-973
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +65 -58
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +20 -22
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +27 -3
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +103 -55
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +233 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +115 -21
- 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 +37 -5
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +42 -13
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +77 -47
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +90 -33
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +51 -21
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +117 -110
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +46 -48
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +38 -8
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +27 -3
- 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 +76 -42
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +93 -40
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +233 -184
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +90 -33
- 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 +104 -54
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +90 -33
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +95 -45
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +98 -48
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +93 -40
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +262 -147
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +90 -33
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +54 -21
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -3
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +80 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +289 -92
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +97 -40
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +81 -195
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +65 -58
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +20 -22
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +40 -268
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +68 -38
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +92 -35
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +38 -8
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +52 -22
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +75 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +25 -27
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +51 -21
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +93 -40
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +101 -94
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +38 -40
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +27 -3
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +38 -8
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +27 -3
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +51 -21
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +85 -78
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +30 -32
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +57 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +16 -18
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +157 -112
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +90 -33
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +249 -150
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +57 -55
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +27 -3
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +143 -3
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +27 -3
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +27 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +144 -99
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +27 -3
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +95 -88
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +35 -37
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +85 -78
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -33
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +157 -112
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +76 -77
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +25 -19
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +7 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- 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 +45 -40
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +176 -214
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +11 -13
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1795 -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 +307 -49
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +51 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +113 -90
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +44 -38
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +57 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +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 +38 -8
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +27 -3
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +38 -8
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -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 +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +51 -21
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -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 +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +3 -3
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +38 -8
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +27 -3
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +90 -57
- 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 +27 -19
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +59 -52
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +17 -19
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -128
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- 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 +23 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +47 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +3 -4
- package/contracts/accounting/AccountingServiceManager.sol +1 -1
- package/contracts/authorization/AccessAdmin.sol +115 -71
- package/contracts/authorization/AccessManagerCloneable.sol +136 -3
- package/contracts/authorization/Authorization.sol +268 -227
- package/contracts/authorization/IAccessAdmin.sol +6 -3
- package/contracts/authorization/IAuthorization.sol +7 -1
- package/contracts/distribution/BasicDistributionAuthorization.sol +9 -8
- package/contracts/distribution/DistributionService.sol +6 -6
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -1
- package/contracts/examples/fire/FireProduct.sol +3 -1
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +18 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +1 -1
- package/contracts/instance/BundleSet.sol +0 -1
- package/contracts/instance/IInstance.sol +6 -7
- package/contracts/instance/IInstanceService.sol +2 -0
- package/contracts/instance/Instance.sol +17 -9
- package/contracts/instance/InstanceAdmin.sol +227 -53
- package/contracts/instance/InstanceAuthorizationV3.sol +14 -8
- package/contracts/instance/InstanceReader.sol +6 -6
- package/contracts/instance/InstanceService.sol +41 -29
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +1 -0
- package/contracts/instance/RiskSet.sol +7 -9
- package/contracts/instance/base/ObjectLifecycle.sol +2 -1
- package/contracts/instance/module/IComponents.sol +0 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +11 -10
- package/contracts/oracle/Oracle.sol +1 -1
- package/contracts/oracle/OracleService.sol +16 -15
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPoolAuthorization.sol +10 -9
- package/contracts/pool/BundleService.sol +3 -3
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/PoolService.sol +4 -4
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +3 -3
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -0
- package/contracts/product/BasicProductAuthorization.sol +10 -9
- package/contracts/product/ClaimService.sol +144 -50
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IClaimService.sol +13 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/PolicyService.sol +3 -3
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +23 -19
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +36 -0
- package/contracts/product/RiskService.sol +65 -21
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +6 -15
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/Registry.sol +3 -2
- package/contracts/registry/RegistryAdmin.sol +117 -230
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +245 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +124 -99
- package/contracts/registry/ServiceAuthorizationV3.sol +36 -1
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +24 -17
- package/contracts/shared/ComponentService.sol +63 -51
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +29 -1
- package/contracts/shared/IComponent.sol +3 -4
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/NftOwnable.sol +4 -4
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +45 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +2 -2
- package/contracts/staking/Staking.sol +23 -12
- package/contracts/staking/StakingService.sol +2 -3
- package/contracts/type/ObjectType.sol +41 -27
- package/contracts/type/RiskId.sol +5 -0
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/Version.sol +15 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +1 -1
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
@@ -1,19 +1,6 @@
|
|
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
5
|
import {IComponents} from "../instance/module/IComponents.sol";
|
19
6
|
import {IInstance} from "../instance/IInstance.sol";
|
@@ -22,10 +9,25 @@ import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
|
22
9
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
23
10
|
import {IPolicyService} from "../product/IPolicyService.sol";
|
24
11
|
import {IPoolService} from "../pool/IPoolService.sol";
|
12
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
13
|
+
|
14
|
+
import {Amount, AmountLib} from "../type/Amount.sol";
|
15
|
+
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
16
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
17
|
+
import {FeeLib} from "../type/Fee.sol";
|
18
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
19
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
20
|
+
import {NftId} from "../type/NftId.sol";
|
21
|
+
import {ObjectType, COMPONENT, CLAIM, POLICY, POOL, PRODUCT} from "../type/ObjectType.sol";
|
22
|
+
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
23
|
+
import {Service} from "../shared/Service.sol";
|
24
|
+
import {StateId} from "../type/StateId.sol";
|
25
|
+
import {SUBMITTED, KEEP_STATE, DECLINED, REVOKED, CANCELLED, CONFIRMED, CLOSED, EXPECTED, PAID} from "../type/StateId.sol";
|
26
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
25
27
|
|
26
28
|
|
27
29
|
contract ClaimService is
|
28
|
-
|
30
|
+
Service,
|
29
31
|
IClaimService
|
30
32
|
{
|
31
33
|
|
@@ -41,11 +43,11 @@ contract ClaimService is
|
|
41
43
|
initializer()
|
42
44
|
{
|
43
45
|
(
|
44
|
-
address
|
45
|
-
address
|
46
|
+
address authority,
|
47
|
+
address registry
|
46
48
|
) = abi.decode(data, (address, address));
|
47
49
|
|
48
|
-
|
50
|
+
__Service_init(authority, registry, owner);
|
49
51
|
|
50
52
|
_policyService = IPolicyService(getRegistry().getServiceAddress(POLICY(), getVersion().toMajorPart()));
|
51
53
|
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
@@ -61,10 +63,10 @@ contract ClaimService is
|
|
61
63
|
external
|
62
64
|
virtual
|
63
65
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
66
|
+
restricted()
|
64
67
|
returns (ClaimId claimId)
|
65
68
|
{
|
66
|
-
|
67
|
-
|
69
|
+
// checks
|
68
70
|
(
|
69
71
|
,
|
70
72
|
IInstance instance,,
|
@@ -77,15 +79,9 @@ contract ClaimService is
|
|
77
79
|
revert ErrorClaimServicePolicyNotOpen(policyNftId);
|
78
80
|
}
|
79
81
|
|
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
|
-
}
|
82
|
+
_checkClaimAmount(policyNftId, policyInfo, claimAmount);
|
88
83
|
|
84
|
+
// effects
|
89
85
|
// create new claim
|
90
86
|
claimId = ClaimIdLib.toClaimId(policyInfo.claimsCount + 1);
|
91
87
|
instanceStore.createClaim(
|
@@ -120,6 +116,7 @@ contract ClaimService is
|
|
120
116
|
virtual
|
121
117
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
122
118
|
{
|
119
|
+
// checks
|
123
120
|
_checkNftType(policyNftId, POLICY());
|
124
121
|
|
125
122
|
(
|
@@ -130,8 +127,9 @@ contract ClaimService is
|
|
130
127
|
IPolicy.PolicyInfo memory policyInfo
|
131
128
|
) = _verifyCallerWithPolicy(policyNftId);
|
132
129
|
|
133
|
-
|
130
|
+
_checkClaimAmount(policyNftId, policyInfo, confirmedAmount);
|
134
131
|
|
132
|
+
// effects
|
135
133
|
// check/update claim info
|
136
134
|
IPolicy.ClaimInfo memory claimInfo = _verifyClaim(instanceReader, policyNftId, claimId, SUBMITTED());
|
137
135
|
claimInfo.claimAmount = confirmedAmount;
|
@@ -149,6 +147,7 @@ contract ClaimService is
|
|
149
147
|
|
150
148
|
emit LogClaimServiceClaimConfirmed(policyNftId, claimId, confirmedAmount);
|
151
149
|
|
150
|
+
// interactions
|
152
151
|
// callback to pool if applicable
|
153
152
|
_processConfirmedClaimByPool(instanceReader, productNftId, policyNftId, claimId, confirmedAmount);
|
154
153
|
|
@@ -190,7 +189,6 @@ contract ClaimService is
|
|
190
189
|
}
|
191
190
|
|
192
191
|
|
193
|
-
// TODO add test case
|
194
192
|
function revoke(
|
195
193
|
NftId policyNftId,
|
196
194
|
ClaimId claimId
|
@@ -198,9 +196,7 @@ contract ClaimService is
|
|
198
196
|
external
|
199
197
|
virtual
|
200
198
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
201
|
-
{
|
202
|
-
_checkNftType(policyNftId, POLICY());
|
203
|
-
|
199
|
+
{
|
204
200
|
(
|
205
201
|
,
|
206
202
|
IInstance instance,
|
@@ -277,8 +273,6 @@ contract ClaimService is
|
|
277
273
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
278
274
|
returns (PayoutId payoutId)
|
279
275
|
{
|
280
|
-
_checkNftType(policyNftId, POLICY());
|
281
|
-
|
282
276
|
if (beneficiary == address(0)) {
|
283
277
|
revert ErrorClaimServiceBeneficiaryIsZero(policyNftId, claimId);
|
284
278
|
}
|
@@ -322,8 +316,7 @@ contract ClaimService is
|
|
322
316
|
virtual
|
323
317
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
324
318
|
{
|
325
|
-
|
326
|
-
|
319
|
+
// checks
|
327
320
|
(
|
328
321
|
,
|
329
322
|
IInstance instance,
|
@@ -332,9 +325,24 @@ contract ClaimService is
|
|
332
325
|
IPolicy.PolicyInfo memory policyInfo
|
333
326
|
) = _verifyCallerWithPolicy(policyNftId);
|
334
327
|
|
335
|
-
//
|
328
|
+
// check that payout exists and is open
|
336
329
|
IPolicy.PayoutInfo memory payoutInfo = instanceReader.getPayoutInfo(policyNftId, payoutId);
|
330
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
331
|
+
if(payoutState != EXPECTED()) {
|
332
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
333
|
+
}
|
334
|
+
|
335
|
+
// check that payout amount does not violate claim amount
|
336
|
+
IPolicy.ClaimInfo memory 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
|
+
}
|
337
344
|
|
345
|
+
// effects
|
338
346
|
// update and save payout info with instance
|
339
347
|
payoutInfo.paidAt = TimestampLib.blockTimestamp();
|
340
348
|
instanceStore.updatePayout(policyNftId, payoutId, payoutInfo, PAID());
|
@@ -360,7 +368,7 @@ contract ClaimService is
|
|
360
368
|
}
|
361
369
|
|
362
370
|
// update and save policy info with instance
|
363
|
-
policyInfo.payoutAmount = policyInfo.payoutAmount
|
371
|
+
policyInfo.payoutAmount = policyInfo.payoutAmount + payoutAmount;
|
364
372
|
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
365
373
|
|
366
374
|
// inform pool about payout
|
@@ -400,8 +408,64 @@ contract ClaimService is
|
|
400
408
|
}
|
401
409
|
}
|
402
410
|
|
411
|
+
function cancelPayout(
|
412
|
+
NftId policyNftId,
|
413
|
+
PayoutId payoutId
|
414
|
+
)
|
415
|
+
external
|
416
|
+
virtual
|
417
|
+
{
|
418
|
+
// checks
|
419
|
+
(
|
420
|
+
,
|
421
|
+
IInstance instance,
|
422
|
+
InstanceReader instanceReader,
|
423
|
+
InstanceStore instanceStore,
|
424
|
+
IPolicy.PolicyInfo memory policyInfo
|
425
|
+
) = _verifyCallerWithPolicy(policyNftId);
|
426
|
+
|
427
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
428
|
+
if (payoutState != EXPECTED()) {
|
429
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
430
|
+
}
|
431
|
+
|
432
|
+
// effects
|
433
|
+
// update and save payout info with instance
|
434
|
+
instanceStore.updatePayoutState(policyNftId, payoutId, CANCELLED());
|
435
|
+
|
436
|
+
{
|
437
|
+
ClaimId claimId = payoutId.toClaimId();
|
438
|
+
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
439
|
+
claimInfo.openPayoutsCount -= 1;
|
440
|
+
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
441
|
+
}
|
442
|
+
|
443
|
+
emit LogClaimServicePayoutCancelled(policyNftId, payoutId);
|
444
|
+
}
|
445
|
+
|
403
446
|
// internal functions
|
404
447
|
|
448
|
+
function _checkClaimAmount(
|
449
|
+
NftId policyNftId,
|
450
|
+
IPolicy.PolicyInfo memory policyInfo,
|
451
|
+
Amount claimAmount
|
452
|
+
)
|
453
|
+
internal
|
454
|
+
pure
|
455
|
+
{
|
456
|
+
// check claim amount > 0
|
457
|
+
if (claimAmount.eqz()) {
|
458
|
+
revert ErrorClaimServiceClaimAmountIsZero(policyNftId);
|
459
|
+
}
|
460
|
+
|
461
|
+
// check policy including this claim is still within sum insured
|
462
|
+
if(policyInfo.claimAmount + claimAmount > policyInfo.sumInsuredAmount) {
|
463
|
+
revert ErrorClaimServiceClaimExceedsSumInsured(
|
464
|
+
policyNftId,
|
465
|
+
policyInfo.sumInsuredAmount,
|
466
|
+
policyInfo.payoutAmount + claimAmount);
|
467
|
+
}
|
468
|
+
}
|
405
469
|
|
406
470
|
function _createPayout(
|
407
471
|
NftId policyNftId,
|
@@ -414,6 +478,7 @@ contract ClaimService is
|
|
414
478
|
virtual
|
415
479
|
returns (PayoutId payoutId)
|
416
480
|
{
|
481
|
+
// checks
|
417
482
|
(
|
418
483
|
,
|
419
484
|
,
|
@@ -423,13 +488,23 @@ contract ClaimService is
|
|
423
488
|
) = _verifyCallerWithPolicy(policyNftId);
|
424
489
|
|
425
490
|
IPolicy.ClaimInfo memory claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
426
|
-
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
427
491
|
|
428
|
-
|
429
|
-
|
430
|
-
|
492
|
+
{
|
493
|
+
// check claim state
|
494
|
+
StateId claimState = instanceReader.getClaimState(policyNftId, claimId);
|
495
|
+
if (claimState != CONFIRMED()) {
|
496
|
+
revert ErrorClaimServiceClaimNotConfirmed(policyNftId, claimId, claimState);
|
497
|
+
}
|
498
|
+
|
499
|
+
// check total payout amount remains within claim limit
|
500
|
+
Amount newPaidAmount = claimInfo.paidAmount + amount;
|
501
|
+
if (newPaidAmount > claimInfo.claimAmount) {
|
502
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
503
|
+
policyNftId, claimId, claimInfo.claimAmount, newPaidAmount);
|
504
|
+
}
|
505
|
+
}
|
431
506
|
|
432
|
-
//
|
507
|
+
// effects
|
433
508
|
// create payout info with instance
|
434
509
|
uint24 payoutNo = claimInfo.payoutsCount + 1;
|
435
510
|
payoutId = PayoutIdLib.toPayoutId(claimId, payoutNo);
|
@@ -452,10 +527,6 @@ contract ClaimService is
|
|
452
527
|
claimInfo.openPayoutsCount += 1;
|
453
528
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, KEEP_STATE());
|
454
529
|
|
455
|
-
// update and save policy info with instance
|
456
|
-
policyInfo.payoutAmount.add(amount);
|
457
|
-
instanceStore.updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
458
|
-
|
459
530
|
emit LogClaimServicePayoutCreated(policyNftId, payoutId, amount, beneficiary);
|
460
531
|
}
|
461
532
|
|
@@ -467,6 +538,7 @@ contract ClaimService is
|
|
467
538
|
IPolicy.PayoutInfo memory payoutInfo
|
468
539
|
)
|
469
540
|
internal
|
541
|
+
view
|
470
542
|
returns (
|
471
543
|
Amount netPayoutAmount,
|
472
544
|
Amount processingFeeAmount,
|
@@ -490,8 +562,8 @@ contract ClaimService is
|
|
490
562
|
beneficiary = payoutInfo.beneficiary;
|
491
563
|
}
|
492
564
|
|
493
|
-
IComponents.
|
494
|
-
if(FeeLib.gtz(
|
565
|
+
IComponents.FeeInfo memory feeInfo = instanceReader.getFeeInfo(productNftId);
|
566
|
+
if(FeeLib.gtz(feeInfo.processingFee)) {
|
495
567
|
// TODO calculate and set net payout and processing fees
|
496
568
|
}
|
497
569
|
}
|
@@ -512,7 +584,7 @@ contract ClaimService is
|
|
512
584
|
IPolicy.PolicyInfo memory policyInfo
|
513
585
|
)
|
514
586
|
{
|
515
|
-
(productNftId
|
587
|
+
(productNftId, instance) = _getAndVerifyActiveComponent(PRODUCT());
|
516
588
|
instanceReader = instance.getInstanceReader();
|
517
589
|
instanceStore = instance.getInstanceStore();
|
518
590
|
|
@@ -525,6 +597,28 @@ contract ClaimService is
|
|
525
597
|
}
|
526
598
|
}
|
527
599
|
|
600
|
+
function _getAndVerifyActiveComponent(ObjectType expectedType)
|
601
|
+
internal
|
602
|
+
view
|
603
|
+
returns (
|
604
|
+
NftId productNftId,
|
605
|
+
IInstance instance
|
606
|
+
)
|
607
|
+
{
|
608
|
+
(
|
609
|
+
IRegistry.ObjectInfo memory info,
|
610
|
+
address instanceAddress
|
611
|
+
) = ContractLib.getAndVerifyComponent(
|
612
|
+
getRegistry(),
|
613
|
+
msg.sender, // caller
|
614
|
+
PRODUCT(),
|
615
|
+
true); // isActive
|
616
|
+
|
617
|
+
// get component nft id and instance
|
618
|
+
productNftId = info.nftId;
|
619
|
+
instance = IInstance(instanceAddress);
|
620
|
+
}
|
621
|
+
|
528
622
|
function _verifyClaim(
|
529
623
|
InstanceReader instanceReader,
|
530
624
|
NftId policyNftId,
|
@@ -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),
|
@@ -28,10 +28,13 @@ interface IClaimService is
|
|
28
28
|
|
29
29
|
event LogClaimServicePayoutCreated(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary);
|
30
30
|
event LogClaimServicePayoutProcessed(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary, Amount netAmount, Amount processingFeeAmount);
|
31
|
+
event LogClaimServicePayoutCancelled(NftId policyNftId, PayoutId payoutId);
|
32
|
+
|
31
33
|
error ErrorClaimServiceBeneficiarySet(NftId policyNftId, PayoutId payoutId, address beneficiary);
|
32
34
|
|
33
35
|
error ErrorClaimServicePolicyProductMismatch(NftId policyNftId, NftId expectedProduct, NftId actualProduct);
|
34
36
|
error ErrorClaimServicePolicyNotOpen(NftId policyNftId);
|
37
|
+
error ErrorClaimServiceClaimAmountIsZero(NftId policyNftId);
|
35
38
|
error ErrorClaimServiceClaimExceedsSumInsured(NftId policyNftId, Amount sumInsured, Amount payoutsIncludingClaimAmount);
|
36
39
|
error ErrorClaimServiceBeneficiaryIsZero(NftId policyNftId, ClaimId claimId);
|
37
40
|
error ErrorClaimsServicePayoutAmountIsZero(NftId policyNftId, PayoutId payoutId);
|
@@ -40,6 +43,10 @@ interface IClaimService is
|
|
40
43
|
error ErrorClaimServiceClaimWithMissingPayouts(NftId policyNftId, ClaimId claimId, Amount claimAmount, Amount paidAmount);
|
41
44
|
error ErrorClaimServiceClaimNotInExpectedState(NftId policyNftId, ClaimId claimId, StateId expectedState, StateId actualState);
|
42
45
|
|
46
|
+
error ErrorClaimServiceClaimNotConfirmed(NftId policyNftId, ClaimId claimId, StateId actualState);
|
47
|
+
error ErrorClaimServicePayoutExceedsClaimAmount(NftId policyNftId, ClaimId claimId, Amount claimAmount, Amount totalPayoutAmount);
|
48
|
+
error ErrorClaimServicePayoutNotExpected(NftId policyNftId, PayoutId payoutId, StateId actualState);
|
49
|
+
|
43
50
|
/// @dev create a new claim for the specified policy
|
44
51
|
/// returns the id of the newly created claim
|
45
52
|
/// function can only be called by product, policy needs to match with calling product
|
@@ -120,4 +127,10 @@ interface IClaimService is
|
|
120
127
|
NftId policyNftId,
|
121
128
|
PayoutId payoutId
|
122
129
|
) external;
|
130
|
+
|
131
|
+
/// @dev cancels the specified payout. no tokens are moved, payout is set to cancelled.
|
132
|
+
function cancelPayout(
|
133
|
+
NftId policyNftId,
|
134
|
+
PayoutId payoutId
|
135
|
+
) external;
|
123
136
|
}
|
@@ -53,7 +53,10 @@ interface IProductComponent is
|
|
53
53
|
) external view returns (Amount netPremiumAmount);
|
54
54
|
|
55
55
|
|
56
|
-
/// @dev returns initial
|
56
|
+
/// @dev returns initial product specific infos
|
57
57
|
function getInitialProductInfo() external view returns (IComponents.ProductInfo memory info);
|
58
|
+
|
59
|
+
/// @dev returns initial fee infos
|
60
|
+
function getInitialFeeInfo() external view returns (IComponents.FeeInfo memory info);
|
58
61
|
|
59
62
|
}
|
@@ -50,11 +50,11 @@ contract PolicyService is
|
|
50
50
|
initializer
|
51
51
|
{
|
52
52
|
(
|
53
|
-
address
|
54
|
-
address
|
53
|
+
address authority,
|
54
|
+
address registry
|
55
55
|
) = abi.decode(data, (address, address));
|
56
56
|
|
57
|
-
|
57
|
+
__Service_init(authority, registry, owner);
|
58
58
|
|
59
59
|
VersionPart majorVersion = getVersion().toMajorPart();
|
60
60
|
_accountingService = IAccountingService(getRegistry().getServiceAddress(ACCOUNTING(), majorVersion));
|
@@ -17,7 +17,7 @@ contract PolicyServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
PolicyService svc = new PolicyService{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),
|
@@ -42,14 +42,15 @@ contract PricingService is
|
|
42
42
|
initializer()
|
43
43
|
{
|
44
44
|
(
|
45
|
-
address
|
46
|
-
address
|
45
|
+
address authority,
|
46
|
+
address registry
|
47
47
|
) = abi.decode(data, (address, address));
|
48
48
|
|
49
|
-
|
50
|
-
_registerInterface(type(IPricingService).interfaceId);
|
49
|
+
__Service_init(authority, registry, owner);
|
51
50
|
|
52
51
|
_distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
52
|
+
|
53
|
+
_registerInterface(type(IPricingService).interfaceId);
|
53
54
|
}
|
54
55
|
|
55
56
|
/// @dev calculates the premium amount for the specified attributes
|
@@ -98,6 +99,7 @@ contract PricingService is
|
|
98
99
|
{
|
99
100
|
// get configurations for all involed objects
|
100
101
|
IComponents.ProductInfo memory productInfo = reader.getProductInfo(productNftId);
|
102
|
+
IComponents.FeeInfo memory feeInfo = reader.getFeeInfo(productNftId);
|
101
103
|
|
102
104
|
IBundle.BundleInfo memory bundleInfo = reader.getBundleInfo(bundleNftId);
|
103
105
|
if(bundleInfo.poolNftId != productInfo.poolNftId) {
|
@@ -107,21 +109,22 @@ contract PricingService is
|
|
107
109
|
// calculate fixed fees for product, pool, bundle
|
108
110
|
premium = _getFixedFeeAmounts(
|
109
111
|
netPremiumAmount,
|
110
|
-
|
112
|
+
feeInfo,
|
111
113
|
bundleInfo
|
112
114
|
);
|
113
115
|
|
114
116
|
// calculate variable fees for product, pool, bundle
|
115
117
|
premium = _calculateVariableFeeAmounts(
|
116
118
|
premium,
|
117
|
-
|
119
|
+
feeInfo,
|
118
120
|
bundleInfo
|
119
121
|
);
|
120
122
|
|
121
123
|
// calculate distribution fee and (if applicable) commission
|
122
124
|
premium = _calculateDistributionOwnerFeeAmount(
|
123
125
|
premium,
|
124
|
-
|
126
|
+
feeInfo,
|
127
|
+
productInfo.distributionNftId,
|
125
128
|
referralId,
|
126
129
|
reader
|
127
130
|
);
|
@@ -137,7 +140,7 @@ contract PricingService is
|
|
137
140
|
revert ErrorPricingServiceTargetWalletAmountsMismatch();
|
138
141
|
}
|
139
142
|
|
140
|
-
if (premium.distributionOwnerFeeFixAmount.toInt() <
|
143
|
+
if (premium.distributionOwnerFeeFixAmount.toInt() < feeInfo.minDistributionOwnerFee.fixedFee) {
|
141
144
|
revert ErrorPricingServiceFeeCalculationMismatch(
|
142
145
|
premium.distributionFeeFixAmount,
|
143
146
|
premium.distributionFeeVarAmount,
|
@@ -164,7 +167,7 @@ contract PricingService is
|
|
164
167
|
// internal functions
|
165
168
|
function _getFixedFeeAmounts(
|
166
169
|
Amount netPremiumAmount,
|
167
|
-
IComponents.
|
170
|
+
IComponents.FeeInfo memory feeInfo,
|
168
171
|
IBundle.BundleInfo memory bundleInfo
|
169
172
|
)
|
170
173
|
internal
|
@@ -177,11 +180,11 @@ contract PricingService is
|
|
177
180
|
premium.netPremiumAmount = netPremiumAmount;
|
178
181
|
premium.fullPremiumAmount = netPremiumAmount;
|
179
182
|
|
180
|
-
Amount t = AmountLib.toAmount(
|
183
|
+
Amount t = AmountLib.toAmount(feeInfo.productFee.fixedFee);
|
181
184
|
premium.productFeeFixAmount = t;
|
182
185
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
183
186
|
|
184
|
-
t = AmountLib.toAmount(
|
187
|
+
t = AmountLib.toAmount(feeInfo.poolFee.fixedFee);
|
185
188
|
premium.poolFeeFixAmount = t;
|
186
189
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
187
190
|
|
@@ -189,14 +192,14 @@ contract PricingService is
|
|
189
192
|
premium.bundleFeeFixAmount = t;
|
190
193
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
191
194
|
|
192
|
-
t = AmountLib.toAmount(
|
195
|
+
t = AmountLib.toAmount(feeInfo.distributionFee.fixedFee);
|
193
196
|
premium.distributionFeeFixAmount = t;
|
194
197
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
195
198
|
}
|
196
199
|
|
197
200
|
function _calculateVariableFeeAmounts(
|
198
201
|
IPolicy.PremiumInfo memory premium,
|
199
|
-
IComponents.
|
202
|
+
IComponents.FeeInfo memory feeInfo,
|
200
203
|
IBundle.BundleInfo memory bundleInfo
|
201
204
|
)
|
202
205
|
internal
|
@@ -207,11 +210,11 @@ contract PricingService is
|
|
207
210
|
{
|
208
211
|
Amount netPremiumAmount = premium.netPremiumAmount;
|
209
212
|
|
210
|
-
Amount t = netPremiumAmount.multiplyWith(
|
213
|
+
Amount t = netPremiumAmount.multiplyWith(feeInfo.productFee.fractionalFee);
|
211
214
|
premium.productFeeVarAmount = t;
|
212
215
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
213
216
|
|
214
|
-
t = netPremiumAmount.multiplyWith(
|
217
|
+
t = netPremiumAmount.multiplyWith(feeInfo.poolFee.fractionalFee);
|
215
218
|
premium.poolFeeVarAmount = t;
|
216
219
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
217
220
|
|
@@ -219,7 +222,7 @@ contract PricingService is
|
|
219
222
|
premium.bundleFeeVarAmount = t;
|
220
223
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
221
224
|
|
222
|
-
t = netPremiumAmount.multiplyWith(
|
225
|
+
t = netPremiumAmount.multiplyWith(feeInfo.distributionFee.fractionalFee);
|
223
226
|
premium.distributionFeeVarAmount = t;
|
224
227
|
premium.fullPremiumAmount = premium.fullPremiumAmount + t;
|
225
228
|
|
@@ -228,7 +231,8 @@ contract PricingService is
|
|
228
231
|
|
229
232
|
function _calculateDistributionOwnerFeeAmount(
|
230
233
|
IPolicy.PremiumInfo memory premium,
|
231
|
-
IComponents.
|
234
|
+
IComponents.FeeInfo memory feeInfo,
|
235
|
+
NftId distributionNftId,
|
232
236
|
// ISetup.DistributionSetupInfo memory distInfo,
|
233
237
|
ReferralId referralId,
|
234
238
|
InstanceReader reader
|
@@ -239,14 +243,14 @@ contract PricingService is
|
|
239
243
|
{
|
240
244
|
|
241
245
|
// if the referral is not valid, then the distribution owner gets everything
|
242
|
-
if (
|
246
|
+
if (distributionNftId.eqz() || ! _distributionService.referralIsValid(distributionNftId, referralId)) {
|
243
247
|
premium.distributionOwnerFeeFixAmount = premium.distributionFeeFixAmount;
|
244
248
|
premium.distributionOwnerFeeVarAmount = premium.distributionFeeVarAmount;
|
245
249
|
premium.premiumAmount = premium.fullPremiumAmount;
|
246
250
|
return premium;
|
247
251
|
}
|
248
252
|
|
249
|
-
Fee memory minDistributionOwnerFee =
|
253
|
+
Fee memory minDistributionOwnerFee = feeInfo.minDistributionOwnerFee;
|
250
254
|
|
251
255
|
// if the referral is valid, the the commission and discount are calculated based in the full premium
|
252
256
|
// the remaing amount goes to the distribution owner
|
@@ -12,14 +12,14 @@ contract PricingServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with pricing service implementation and deploys instance
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
18
|
{
|
19
19
|
PricingService pricingSrv = new PricingService{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(pricingSrv),
|
24
24
|
data,
|
25
25
|
salt);
|