@etherisc/gif-next 0.0.2-8773a53-517 → 0.0.2-88095ce-205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +33 -52
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
- 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 +0 -19
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
- 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 +52 -212
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +16 -184
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +150 -286
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +100 -120
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +16 -37
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +65 -62
- 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 +1507 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +410 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1978 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +414 -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 +1427 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1187 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1561 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +1996 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +16 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +16 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +26 -99
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +97 -100
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +14 -14
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +424 -74
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +55 -146
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +77 -81
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +249 -111
- 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 +42 -202
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +18 -18
- 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 +16 -37
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +16 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +16 -184
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +53 -144
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +76 -80
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +48 -188
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +160 -223
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +115 -107
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +52 -32
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +48 -41
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +215 -145
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +45 -185
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +290 -314
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +96 -96
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +52 -162
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +73 -89
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +44 -210
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +258 -184
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +117 -101
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +21 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +148 -7
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +247 -140
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +59 -43
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +44 -63
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +18 -2
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +323 -363
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +108 -116
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +133 -261
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +97 -117
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +44 -210
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +604 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +698 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +288 -21
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +16 -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 +494 -82
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +243 -131
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +39 -313
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +68 -72
- 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 +24 -14
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +16 -173
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +105 -228
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +112 -122
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +21 -112
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +16 -26
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +16 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +16 -37
- 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/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +16 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +16 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -22
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +16 -184
- 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 +22 -57
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +24 -97
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +21 -112
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +288 -16
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +43 -27
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +16 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +63 -93
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +101 -248
- 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 +93 -100
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -11
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +47 -159
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +72 -76
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +84 -84
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +54 -23
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +32 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +26 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +15 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +55 -70
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +25 -24
- package/contracts/authorization/Authorization.sol +5 -2
- package/contracts/authorization/IAccessAdmin.sol +0 -1
- package/contracts/distribution/BasicDistribution.sol +2 -0
- package/contracts/distribution/Distribution.sol +3 -2
- package/contracts/distribution/DistributionService.sol +72 -60
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionService.sol +9 -5
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +75 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +411 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +50 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +76 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +351 -0
- package/contracts/instance/IInstance.sol +7 -30
- package/contracts/instance/Instance.sol +10 -35
- package/contracts/instance/InstanceAdmin.sol +29 -7
- package/contracts/instance/InstanceAuthorizationV3.sol +3 -3
- package/contracts/instance/InstanceReader.sol +107 -25
- package/contracts/instance/InstanceService.sol +63 -41
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +11 -1
- package/contracts/instance/base/ObjectLifecycle.sol +9 -4
- package/contracts/instance/module/IComponents.sol +4 -3
- package/contracts/instance/module/IPolicy.sol +23 -23
- package/contracts/oracle/Oracle.sol +2 -1
- package/contracts/oracle/OracleService.sol +41 -33
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +16 -17
- package/contracts/pool/BasicPoolAuthorization.sol +2 -2
- package/contracts/pool/BundleService.sol +57 -37
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +14 -4
- package/contracts/pool/IPoolComponent.sol +18 -8
- package/contracts/pool/IPoolService.sol +54 -32
- package/contracts/pool/Pool.sol +65 -36
- package/contracts/pool/PoolService.sol +148 -110
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +50 -29
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +1 -0
- package/contracts/product/ClaimService.sol +245 -88
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +1 -0
- package/contracts/product/IClaimService.sol +30 -7
- package/contracts/product/IPolicyService.sol +31 -35
- package/contracts/product/IPricingService.sol +7 -7
- package/contracts/product/IProductComponent.sol +17 -4
- package/contracts/product/{IProductService.sol → IRiskService.sol} +1 -1
- package/contracts/product/PolicyService.sol +317 -173
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +47 -47
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +76 -53
- package/contracts/product/{ProductService.sol → RiskService.sol} +7 -10
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +65 -32
- package/contracts/registry/IRegistry.sol +55 -15
- package/contracts/registry/IRegistryService.sol +0 -9
- package/contracts/registry/Registry.sol +336 -197
- package/contracts/registry/RegistryAdmin.sol +150 -51
- package/contracts/registry/RegistryService.sol +55 -48
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseRegistry.sol +12 -6
- package/contracts/registry/ServiceAuthorizationV3.sol +6 -8
- package/contracts/shared/Component.sol +12 -32
- package/contracts/shared/ComponentService.sol +20 -29
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +2 -3
- package/contracts/shared/ContractLib.sol +38 -0
- package/contracts/shared/IComponent.sol +0 -1
- package/contracts/shared/IInstanceLinkedComponent.sol +8 -15
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/InitializableERC165.sol +2 -2
- package/contracts/shared/InstanceLinkedComponent.sol +5 -6
- package/contracts/shared/NftOwnable.sol +22 -5
- package/contracts/shared/PolicyHolder.sol +15 -52
- package/contracts/shared/Registerable.sol +4 -4
- package/contracts/shared/RegistryLinked.sol +3 -2
- package/contracts/shared/Service.sol +16 -11
- package/contracts/shared/TokenHandler.sol +99 -22
- package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
- package/contracts/staking/IStaking.sol +2 -1
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/StakeManagerLib.sol +18 -25
- package/contracts/staking/Staking.sol +11 -29
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +3 -17
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/staking/TargetManagerLib.sol +7 -3
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/NftId.sol +1 -0
- package/contracts/type/ObjectType.sol +16 -11
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +15 -1
- package/contracts/type/Seconds.sol +8 -0
- package/contracts/type/StateId.sol +1 -0
- package/contracts/type/UFixed.sol +4 -0
- package/contracts/upgradeability/ProxyManager.sol +67 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +2 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -708
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/contracts/product/ProductServiceManager.sol +0 -39
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -14,13 +14,14 @@ import {TokenHandler} from "../shared/TokenHandler.sol";
|
|
14
14
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
15
15
|
import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
16
16
|
import {ObjectType, APPLICATION, COMPONENT, DISTRIBUTION, PRODUCT, POOL, POLICY, BUNDLE, CLAIM, PRICE} from "../type/ObjectType.sol";
|
17
|
-
import {APPLIED, COLLATERALIZED,
|
17
|
+
import {APPLIED, COLLATERALIZED, KEEP_STATE, CLOSED, DECLINED, PAID} from "../type/StateId.sol";
|
18
18
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
19
19
|
import {ReferralId} from "../type/Referral.sol";
|
20
20
|
import {StateId} from "../type/StateId.sol";
|
21
21
|
import {VersionPart} from "../type/Version.sol";
|
22
22
|
|
23
23
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
24
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
24
25
|
import {IApplicationService} from "./IApplicationService.sol";
|
25
26
|
import {IBundleService} from "../pool/IBundleService.sol";
|
26
27
|
import {IClaimService} from "./IClaimService.sol";
|
@@ -28,6 +29,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
|
|
28
29
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
29
30
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
30
31
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
32
|
+
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
31
33
|
import {IPolicyService} from "./IPolicyService.sol";
|
32
34
|
import {IPoolService} from "../pool/IPoolService.sol";
|
33
35
|
import {IPricingService} from "./IPricingService.sol";
|
@@ -47,8 +49,6 @@ contract PolicyService is
|
|
47
49
|
IPoolService internal _poolService;
|
48
50
|
IPricingService internal _pricingService;
|
49
51
|
|
50
|
-
event LogProductServiceSender(address sender);
|
51
|
-
|
52
52
|
function _initialize(
|
53
53
|
address owner,
|
54
54
|
bytes memory data
|
@@ -58,12 +58,11 @@ contract PolicyService is
|
|
58
58
|
initializer
|
59
59
|
{
|
60
60
|
(
|
61
|
-
address registryAddress
|
62
|
-
//address managerAddress
|
61
|
+
address registryAddress,
|
63
62
|
address authority
|
64
|
-
) = abi.decode(data, (address, address
|
63
|
+
) = abi.decode(data, (address, address));
|
65
64
|
|
66
|
-
|
65
|
+
_initializeService(registryAddress, authority, owner);
|
67
66
|
|
68
67
|
VersionPart majorVersion = getVersion().toMajorPart();
|
69
68
|
_applicationService = IApplicationService(getRegistry().getServiceAddress(APPLICATION(), majorVersion));
|
@@ -74,22 +73,16 @@ contract PolicyService is
|
|
74
73
|
_distributionService = IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), majorVersion));
|
75
74
|
_pricingService = IPricingService(getRegistry().getServiceAddress(PRICE(), majorVersion));
|
76
75
|
|
77
|
-
|
76
|
+
_registerInterface(type(IPolicyService).interfaceId);
|
78
77
|
}
|
79
78
|
|
80
79
|
|
81
|
-
function _getAndVerifyInstanceAndProduct() internal view returns (Product product) {
|
82
|
-
IRegistry.ObjectInfo memory productInfo;
|
83
|
-
(, productInfo,) = _getAndVerifyActiveComponent(PRODUCT());
|
84
|
-
product = Product(productInfo.objectAddress);
|
85
|
-
}
|
86
|
-
|
87
|
-
|
88
80
|
function decline(
|
89
81
|
NftId applicationNftId // = policyNftId
|
90
82
|
)
|
91
83
|
external
|
92
|
-
virtual
|
84
|
+
virtual
|
85
|
+
nonReentrant()
|
93
86
|
{
|
94
87
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
95
88
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -117,16 +110,15 @@ contract PolicyService is
|
|
117
110
|
emit LogPolicyServicePolicyDeclined(applicationNftId);
|
118
111
|
}
|
119
112
|
|
120
|
-
event LogDebug(uint idx, string message);
|
121
113
|
|
122
114
|
/// @inheritdoc IPolicyService
|
123
|
-
function
|
115
|
+
function createPolicy(
|
124
116
|
NftId applicationNftId, // = policyNftId
|
125
|
-
bool requirePremiumPayment,
|
126
117
|
Timestamp activateAt
|
127
118
|
)
|
128
119
|
external
|
129
|
-
virtual
|
120
|
+
virtual
|
121
|
+
nonReentrant()
|
130
122
|
{
|
131
123
|
// check caller is registered product
|
132
124
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -146,13 +138,8 @@ contract PolicyService is
|
|
146
138
|
productNftId);
|
147
139
|
}
|
148
140
|
|
149
|
-
StateId newPolicyState = COLLATERALIZED();
|
150
|
-
|
151
141
|
// actual collateralizaion
|
152
|
-
(
|
153
|
-
Amount localCollateralAmount,
|
154
|
-
Amount totalCollateralAmount
|
155
|
-
) = _poolService.lockCollateral(
|
142
|
+
_poolService.lockCollateral(
|
156
143
|
instance,
|
157
144
|
address(instanceReader.getComponentInfo(productNftId).token),
|
158
145
|
productNftId,
|
@@ -162,39 +149,53 @@ contract PolicyService is
|
|
162
149
|
|
163
150
|
// optional activation of policy
|
164
151
|
if(activateAt > zeroTimestamp()) {
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
IPolicy.Premium memory premium;
|
171
|
-
|
172
|
-
// optional: calculate the premium and update counters for collection at the end of this function
|
173
|
-
if(requirePremiumPayment) {
|
174
|
-
premium = _calculateAndProcessPremium(
|
175
|
-
instance,
|
176
|
-
applicationNftId,
|
177
|
-
applicationInfo);
|
178
|
-
|
179
|
-
applicationInfo.premiumPaidAmount = AmountLib.toAmount(premium.premiumAmount);
|
152
|
+
applicationInfo = _activate(
|
153
|
+
applicationNftId,
|
154
|
+
applicationInfo,
|
155
|
+
activateAt);
|
180
156
|
}
|
181
157
|
|
182
|
-
//
|
158
|
+
// update policy and set state to collateralized
|
183
159
|
instance.getInstanceStore().updatePolicy(
|
184
160
|
applicationNftId,
|
185
161
|
applicationInfo,
|
186
|
-
|
162
|
+
COLLATERALIZED());
|
187
163
|
|
188
|
-
//
|
164
|
+
// calculate and store premium
|
165
|
+
IPolicy.PremiumInfo memory premium = _pricingService.calculatePremium(
|
166
|
+
productNftId,
|
167
|
+
applicationInfo.riskId,
|
168
|
+
applicationInfo.sumInsuredAmount,
|
169
|
+
applicationInfo.lifetime,
|
170
|
+
applicationInfo.applicationData,
|
171
|
+
applicationInfo.bundleNftId,
|
172
|
+
applicationInfo.referralId);
|
189
173
|
|
190
|
-
|
174
|
+
instance.getInstanceStore().createPremium(
|
175
|
+
applicationNftId,
|
176
|
+
premium);
|
177
|
+
|
178
|
+
// update referral counter
|
179
|
+
{
|
180
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
191
181
|
|
192
|
-
|
193
|
-
|
194
|
-
|
182
|
+
if (! productInfo.distributionNftId.eqz()) { // only call distribution service if a distribution component is connected to the product
|
183
|
+
_distributionService.processReferral(
|
184
|
+
productInfo.distributionNftId,
|
185
|
+
applicationInfo.referralId);
|
186
|
+
}
|
195
187
|
}
|
188
|
+
|
189
|
+
// log policy creation before interactions with token and policy holder
|
190
|
+
emit LogPolicyServicePolicyCreated(applicationNftId, premium.premiumAmount, activateAt);
|
191
|
+
|
192
|
+
// TODO add calling pool contract if it needs to validate application
|
193
|
+
|
194
|
+
// callback to policy holder if applicable
|
195
|
+
_policyHolderPolicyActivated(applicationNftId, activateAt);
|
196
196
|
}
|
197
197
|
|
198
|
+
|
198
199
|
/// @inheritdoc IPolicyService
|
199
200
|
function collectPremium(
|
200
201
|
NftId policyNftId,
|
@@ -202,6 +203,7 @@ contract PolicyService is
|
|
202
203
|
)
|
203
204
|
external
|
204
205
|
virtual
|
206
|
+
nonReentrant()
|
205
207
|
{
|
206
208
|
// check caller is registered product
|
207
209
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -209,76 +211,75 @@ contract PolicyService is
|
|
209
211
|
StateId stateId = instanceReader.getPolicyState(policyNftId);
|
210
212
|
|
211
213
|
// check policy is in state collateralized or active
|
212
|
-
if (!(stateId == COLLATERALIZED()
|
213
|
-
revert
|
214
|
+
if (!(stateId == COLLATERALIZED())) {
|
215
|
+
revert ErrorPolicyServicePolicyStateNotCollateralized(policyNftId);
|
214
216
|
}
|
215
217
|
|
216
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
217
|
-
|
218
218
|
// check if premium is already collected
|
219
|
-
if (
|
220
|
-
revert ErrorPolicyServicePremiumAlreadyPaid(policyNftId
|
219
|
+
if (instanceReader.getPremiumInfoState(policyNftId) == PAID()) {
|
220
|
+
revert ErrorPolicyServicePremiumAlreadyPaid(policyNftId);
|
221
221
|
}
|
222
222
|
|
223
|
-
|
224
|
-
IPolicy.
|
225
|
-
|
226
|
-
|
227
|
-
|
223
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
224
|
+
IPolicy.PremiumInfo memory premium = instanceReader.getPremiumInfo(policyNftId);
|
225
|
+
|
226
|
+
_processPremium(
|
227
|
+
instance,
|
228
|
+
policyNftId,
|
229
|
+
policyInfo,
|
230
|
+
premium);
|
228
231
|
|
229
|
-
|
232
|
+
// optionally activate policy
|
233
|
+
if(activateAt.gtz()) {
|
234
|
+
policyInfo = _activate(policyNftId, policyInfo, activateAt);
|
235
|
+
}
|
230
236
|
|
231
237
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
238
|
+
instance.getInstanceStore().updatePremiumState(policyNftId, PAID());
|
232
239
|
|
233
|
-
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
// TODO: add logging
|
240
|
+
// log premium collection before interactions with token
|
241
|
+
emit LogPolicyServicePolicyPremiumCollected(policyNftId, premium.premiumAmount);
|
238
242
|
|
239
243
|
_transferFunds(instanceReader, policyNftId, policyInfo.productNftId, premium);
|
240
244
|
}
|
241
245
|
|
242
246
|
/// @inheritdoc IPolicyService
|
243
|
-
function activate(NftId policyNftId, Timestamp activateAt)
|
247
|
+
function activate(NftId policyNftId, Timestamp activateAt)
|
248
|
+
external
|
249
|
+
virtual
|
250
|
+
nonReentrant()
|
251
|
+
{
|
244
252
|
// check caller is registered product
|
245
253
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
246
254
|
InstanceReader instanceReader = instance.getInstanceReader();
|
247
255
|
|
248
256
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
257
|
+
policyInfo = _activate(policyNftId, policyInfo, activateAt);
|
249
258
|
|
250
|
-
|
251
|
-
policyInfo.activatedAt.eqz(),
|
252
|
-
"ERROR:PRS-020:ALREADY_ACTIVATED");
|
253
|
-
|
254
|
-
policyInfo.activatedAt = activateAt;
|
255
|
-
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
259
|
+
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
256
260
|
|
257
|
-
|
261
|
+
// log policy activation before interactions with policy holder
|
262
|
+
emit LogPolicyServicePolicyActivated(policyNftId, activateAt);
|
258
263
|
|
259
|
-
//
|
264
|
+
// callback to policy holder if applicable
|
265
|
+
_policyHolderPolicyActivated(policyNftId, activateAt);
|
260
266
|
}
|
261
267
|
|
268
|
+
|
262
269
|
/// @inheritdoc IPolicyService
|
263
270
|
function expire(
|
264
271
|
NftId policyNftId,
|
265
272
|
Timestamp expireAt
|
266
273
|
)
|
267
274
|
external
|
268
|
-
override
|
269
275
|
virtual
|
270
|
-
|
276
|
+
nonReentrant()
|
277
|
+
returns (Timestamp expiredAt)
|
271
278
|
{
|
272
279
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
273
|
-
|
274
|
-
|
275
|
-
// check policy is in state applied
|
276
|
-
if (instanceReader.getPolicyState(policyNftId) != ACTIVE()) {
|
277
|
-
revert ErrorIPolicyServicePolicyNotActive(policyNftId, instanceReader.getPolicyState(policyNftId));
|
278
|
-
}
|
279
|
-
|
280
|
+
|
280
281
|
// check policy matches with calling product
|
281
|
-
IPolicy.PolicyInfo memory policyInfo =
|
282
|
+
IPolicy.PolicyInfo memory policyInfo = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
282
283
|
if(policyInfo.productNftId != productNftId) {
|
283
284
|
revert ErrorPolicyServicePolicyProductMismatch(
|
284
285
|
policyNftId,
|
@@ -286,115 +287,149 @@ contract PolicyService is
|
|
286
287
|
productNftId);
|
287
288
|
}
|
288
289
|
|
289
|
-
|
290
|
-
|
290
|
+
return _expire(
|
291
|
+
instance,
|
292
|
+
policyNftId,
|
293
|
+
expireAt
|
294
|
+
);
|
295
|
+
}
|
296
|
+
|
297
|
+
/// @inheritdoc IPolicyService
|
298
|
+
function expirePolicy(
|
299
|
+
IInstance instance,
|
300
|
+
NftId policyNftId,
|
301
|
+
Timestamp expireAt
|
302
|
+
)
|
303
|
+
external
|
304
|
+
virtual
|
305
|
+
nonReentrant()
|
306
|
+
returns (Timestamp expiredAt)
|
307
|
+
{
|
308
|
+
return _expire(
|
309
|
+
instance,
|
310
|
+
policyNftId,
|
311
|
+
expireAt
|
312
|
+
);
|
313
|
+
}
|
314
|
+
|
315
|
+
function _expire(
|
316
|
+
IInstance instance,
|
317
|
+
NftId policyNftId,
|
318
|
+
Timestamp expireAt
|
319
|
+
)
|
320
|
+
internal
|
321
|
+
returns (Timestamp expiredAt)
|
322
|
+
{
|
323
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
324
|
+
|
325
|
+
// check policy is active
|
326
|
+
StateId policyState = instanceReader.getPolicyState(policyNftId);
|
327
|
+
IPolicy.PolicyInfo memory policyInfo = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
328
|
+
if (!_policyHasBeenActivated(policyState, policyInfo)) {
|
329
|
+
revert ErrorPolicyServicePolicyNotActive(policyNftId, policyState);
|
291
330
|
}
|
292
331
|
|
293
|
-
//
|
294
|
-
|
295
|
-
|
332
|
+
// set return value to provided timestamp
|
333
|
+
expiredAt = expireAt;
|
334
|
+
|
335
|
+
// update expiredAt to current block timestamp if not set
|
336
|
+
if (expiredAt.eqz()) {
|
337
|
+
expiredAt = TimestampLib.blockTimestamp();
|
296
338
|
}
|
297
|
-
|
298
|
-
|
339
|
+
|
340
|
+
// check expiredAt represents a valid expiry time
|
341
|
+
if (expiredAt >= policyInfo.expiredAt) {
|
342
|
+
revert ErrorPolicyServicePolicyExpirationTooLate(policyNftId, policyInfo.expiredAt, expireAt);
|
299
343
|
}
|
300
|
-
if (
|
301
|
-
revert
|
344
|
+
if (expiredAt < TimestampLib.blockTimestamp()) {
|
345
|
+
revert ErrorPolicyServicePolicyExpirationTooEarly(policyNftId, TimestampLib.blockTimestamp(), expireAt);
|
302
346
|
}
|
303
347
|
|
304
|
-
policyInfo
|
348
|
+
// update policyInfo with new expiredAt timestamp
|
349
|
+
Timestamp originalExpiredAt = policyInfo.expiredAt;
|
350
|
+
policyInfo.expiredAt = expiredAt;
|
305
351
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
306
352
|
|
307
|
-
emit LogPolicyServicePolicyExpirationUpdated(policyNftId,
|
353
|
+
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, originalExpiredAt, expiredAt);
|
308
354
|
|
309
|
-
|
355
|
+
// callback to policy holder if applicable
|
356
|
+
_policyHolderPolicyExpired(policyNftId, expiredAt);
|
310
357
|
}
|
311
358
|
|
359
|
+
|
312
360
|
function close(
|
313
361
|
NftId policyNftId
|
314
362
|
)
|
315
363
|
external
|
316
|
-
|
364
|
+
virtual
|
365
|
+
nonReentrant()
|
317
366
|
{
|
318
367
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
319
368
|
InstanceReader instanceReader = instance.getInstanceReader();
|
320
369
|
|
370
|
+
// check that policy has been activated
|
321
371
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
322
|
-
|
323
|
-
if (policyInfo
|
324
|
-
revert
|
325
|
-
}
|
326
|
-
|
327
|
-
StateId state = instanceReader.getPolicyState(policyNftId);
|
328
|
-
if (state != ACTIVE()) {
|
329
|
-
revert ErrorIPolicyServicePolicyNotActive(policyNftId, state);
|
372
|
+
StateId policyState = instanceReader.getPolicyState(policyNftId);
|
373
|
+
if (!_policyHasBeenActivated(policyState, policyInfo)) {
|
374
|
+
revert ErrorPolicyServicePolicyNotActive(policyNftId, policyState);
|
330
375
|
}
|
331
376
|
|
377
|
+
// check that policy has not already been closed
|
332
378
|
if (policyInfo.closedAt.gtz()) {
|
333
|
-
revert
|
334
|
-
}
|
335
|
-
|
336
|
-
// TODO consider to allow for underpaid premiums (with the effects of reducing max payouts accordingly)
|
337
|
-
if (!(policyInfo.premiumAmount == policyInfo.premiumPaidAmount)) {
|
338
|
-
revert ErrorPolicyServicePremiumNotFullyPaid(policyNftId, policyInfo.premiumAmount, policyInfo.premiumPaidAmount);
|
379
|
+
revert ErrorPolicyServicePolicyAlreadyClosed(policyNftId);
|
339
380
|
}
|
340
381
|
|
382
|
+
// check that policy does not have any open claims
|
341
383
|
if (policyInfo.openClaimsCount > 0) {
|
342
|
-
revert
|
384
|
+
revert ErrorPolicyServiceOpenClaims(policyNftId, policyInfo.openClaimsCount);
|
343
385
|
}
|
344
386
|
|
345
|
-
|
387
|
+
// TODO consider to allow for underpaid premiums (with the effects of reducing max payouts accordingly)
|
388
|
+
// TODO consider to remove requirement for fully paid premiums altogether
|
389
|
+
if (! instanceReader.getPremiumInfoState(policyNftId).eq(PAID())) {
|
390
|
+
revert ErrorPolicyServicePremiumNotPaid(policyNftId, policyInfo.premiumAmount);
|
391
|
+
}
|
346
392
|
|
393
|
+
// release (remaining) collateral that was blocked by policy
|
347
394
|
_poolService.releaseCollateral(
|
348
395
|
instance,
|
349
396
|
address(instanceReader.getComponentInfo(policyInfo.productNftId).token),
|
350
397
|
policyNftId,
|
351
398
|
policyInfo);
|
352
399
|
|
400
|
+
// TODO consider to also set expiredAt to current block timestamp if that timestamp is still in the futue
|
401
|
+
|
402
|
+
// update policy state to closed
|
403
|
+
policyInfo.closedAt = TimestampLib.blockTimestamp();
|
353
404
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, CLOSED());
|
405
|
+
|
406
|
+
emit LogPolicyServicePolicyClosed(policyNftId);
|
354
407
|
}
|
355
408
|
|
356
409
|
|
357
410
|
/// @dev calculates the premium and updates all counters in the other services
|
358
|
-
function
|
411
|
+
function _processPremium(
|
359
412
|
IInstance instance,
|
360
413
|
NftId applicationNftId,
|
361
|
-
IPolicy.PolicyInfo memory applicationInfo
|
414
|
+
IPolicy.PolicyInfo memory applicationInfo,
|
415
|
+
IPolicy.PremiumInfo memory premium
|
362
416
|
)
|
363
417
|
internal
|
364
418
|
virtual
|
365
|
-
returns (
|
366
|
-
IPolicy.Premium memory premium
|
367
|
-
)
|
368
419
|
{
|
369
420
|
NftId productNftId = applicationInfo.productNftId;
|
370
421
|
InstanceReader instanceReader = instance.getInstanceReader();
|
371
422
|
|
372
|
-
// calculate premium details
|
373
|
-
premium = _pricingService.calculatePremium(
|
374
|
-
productNftId,
|
375
|
-
applicationInfo.riskId,
|
376
|
-
applicationInfo.sumInsuredAmount,
|
377
|
-
applicationInfo.lifetime,
|
378
|
-
applicationInfo.applicationData,
|
379
|
-
applicationInfo.bundleNftId,
|
380
|
-
applicationInfo.referralId);
|
381
|
-
|
382
|
-
// ensure the calculated premium is not higher than the expected premium from the application
|
383
|
-
if (applicationInfo.premiumAmount.toInt() < premium.premiumAmount) {
|
384
|
-
revert ErrorPolicyServicePremiumHigherThanExpected(applicationInfo.premiumAmount.toInt(), premium.premiumAmount);
|
385
|
-
}
|
386
|
-
|
387
423
|
// check if premium balance and allowance of policy holder is sufficient
|
388
424
|
{
|
389
|
-
TokenHandler tokenHandler = instanceReader
|
425
|
+
TokenHandler tokenHandler = _getTokenHandler(instanceReader, productNftId);
|
390
426
|
address policyHolder = getRegistry().ownerOf(applicationNftId);
|
391
427
|
|
392
428
|
_checkPremiumBalanceAndAllowance(
|
393
429
|
tokenHandler.getToken(),
|
394
430
|
address(tokenHandler),
|
395
431
|
policyHolder,
|
396
|
-
|
397
|
-
AmountLib.toAmount(premium.premiumAmount));
|
432
|
+
premium.premiumAmount);
|
398
433
|
}
|
399
434
|
|
400
435
|
// update the counters
|
@@ -407,29 +442,30 @@ contract PolicyService is
|
|
407
442
|
premium);
|
408
443
|
}
|
409
444
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
address policyHolder,
|
415
|
-
Amount premiumExpectedAmount,
|
416
|
-
Amount premiumAmount
|
445
|
+
function _activate(
|
446
|
+
NftId policyNftId,
|
447
|
+
IPolicy.PolicyInfo memory policyInfo,
|
448
|
+
Timestamp activateAt
|
417
449
|
)
|
418
450
|
internal
|
419
451
|
virtual
|
420
|
-
view
|
452
|
+
view
|
453
|
+
returns (IPolicy.PolicyInfo memory)
|
421
454
|
{
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
if (balance < premium) {
|
427
|
-
revert ErrorPolicyServiceBalanceInsufficient(policyHolder, premium, balance);
|
455
|
+
// fail if policy has already been activated and activateAt is different
|
456
|
+
if(! policyInfo.activatedAt.eqz() && activateAt != policyInfo.activatedAt) {
|
457
|
+
revert ErrorPolicyServicePolicyAlreadyActivated(policyNftId);
|
428
458
|
}
|
429
459
|
|
430
|
-
if
|
431
|
-
|
460
|
+
// ignore if policy has already been activated and activateAt is the same
|
461
|
+
if (policyInfo.activatedAt == activateAt) {
|
462
|
+
return policyInfo;
|
432
463
|
}
|
464
|
+
|
465
|
+
policyInfo.activatedAt = activateAt;
|
466
|
+
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
467
|
+
|
468
|
+
return policyInfo;
|
433
469
|
}
|
434
470
|
|
435
471
|
/// @dev update counters by calling the involved services
|
@@ -439,17 +475,12 @@ contract PolicyService is
|
|
439
475
|
NftId productNftId,
|
440
476
|
NftId bundleNftId,
|
441
477
|
ReferralId referralId,
|
442
|
-
IPolicy.
|
478
|
+
IPolicy.PremiumInfo memory premium
|
443
479
|
)
|
444
480
|
internal
|
445
481
|
virtual
|
446
482
|
{
|
447
|
-
(
|
448
|
-
NftId distributionNftId,
|
449
|
-
address distributionWallet,
|
450
|
-
address poolWallet,
|
451
|
-
address productWallet
|
452
|
-
) = _getDistributionNftAndWallets(
|
483
|
+
(NftId distributionNftId, , , ) = _getDistributionNftAndWallets(
|
453
484
|
instanceReader,
|
454
485
|
productNftId);
|
455
486
|
|
@@ -457,13 +488,15 @@ contract PolicyService is
|
|
457
488
|
_componentService.increaseProductFees(
|
458
489
|
instanceStore,
|
459
490
|
productNftId,
|
460
|
-
|
491
|
+
premium.productFeeVarAmount + premium.productFeeFixAmount);
|
461
492
|
|
462
493
|
// update distribution fees and distributor commission and pool fees
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
494
|
+
if (!distributionNftId.eqz()) { // only call distribution service if a distribution component is connected to the product
|
495
|
+
_distributionService.processSale(
|
496
|
+
distributionNftId,
|
497
|
+
referralId,
|
498
|
+
premium);
|
499
|
+
}
|
467
500
|
|
468
501
|
// update pool and bundle fees
|
469
502
|
_poolService.processSale(
|
@@ -471,21 +504,22 @@ contract PolicyService is
|
|
471
504
|
premium);
|
472
505
|
}
|
473
506
|
|
507
|
+
|
474
508
|
/// @dev transfer the premium to the wallets the premium is distributed to
|
475
509
|
function _transferFunds(
|
476
510
|
InstanceReader instanceReader,
|
477
511
|
NftId policyNftId,
|
478
512
|
NftId productNftId,
|
479
|
-
IPolicy.
|
513
|
+
IPolicy.PremiumInfo memory premium
|
480
514
|
)
|
481
515
|
internal
|
482
516
|
virtual
|
483
517
|
{
|
484
|
-
TokenHandler tokenHandler = instanceReader
|
518
|
+
TokenHandler tokenHandler = _getTokenHandler(instanceReader, productNftId);
|
485
519
|
address policyHolder = getRegistry().ownerOf(policyNftId);
|
486
520
|
|
487
521
|
(
|
488
|
-
|
522
|
+
,
|
489
523
|
address distributionWallet,
|
490
524
|
address poolWallet,
|
491
525
|
address productWallet
|
@@ -493,15 +527,117 @@ contract PolicyService is
|
|
493
527
|
instanceReader,
|
494
528
|
productNftId);
|
495
529
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
530
|
+
tokenHandler.collectTokensToThreeRecipients(
|
531
|
+
policyHolder,
|
532
|
+
productWallet,
|
533
|
+
premium.productFeeAmount,
|
534
|
+
distributionWallet,
|
535
|
+
premium.distributionFeeAndCommissionAmount,
|
536
|
+
poolWallet,
|
537
|
+
premium.poolPremiumAndFeeAmount);
|
538
|
+
}
|
539
|
+
|
540
|
+
|
541
|
+
/// @dev checks that policy has been collateralized and has been activated.
|
542
|
+
/// does not check if policy has been expired or closed.
|
543
|
+
function _policyHasBeenActivated(
|
544
|
+
StateId policyState,
|
545
|
+
IPolicy.PolicyInfo memory policyInfo
|
546
|
+
)
|
547
|
+
internal
|
548
|
+
view
|
549
|
+
returns (bool)
|
550
|
+
{
|
551
|
+
if (policyState != COLLATERALIZED()) { return false; }
|
552
|
+
if (TimestampLib.blockTimestamp() < policyInfo.activatedAt) { return false; }
|
553
|
+
return true;
|
554
|
+
}
|
555
|
+
|
556
|
+
|
557
|
+
/// @dev checks the balance and allowance of the policy holder
|
558
|
+
function _checkPremiumBalanceAndAllowance(
|
559
|
+
IERC20Metadata token,
|
560
|
+
address tokenHandlerAddress,
|
561
|
+
address policyHolder,
|
562
|
+
Amount premiumAmount
|
563
|
+
)
|
564
|
+
internal
|
565
|
+
virtual
|
566
|
+
view
|
567
|
+
{
|
568
|
+
uint256 premium = premiumAmount.toInt();
|
569
|
+
uint256 balance = token.balanceOf(policyHolder);
|
570
|
+
uint256 allowance = token.allowance(policyHolder, tokenHandlerAddress);
|
571
|
+
|
572
|
+
if (balance < premium) {
|
573
|
+
revert ErrorPolicyServiceBalanceInsufficient(policyHolder, premium, balance);
|
574
|
+
}
|
575
|
+
|
576
|
+
if (allowance < premium) {
|
577
|
+
revert ErrorPolicyServiceAllowanceInsufficient(policyHolder, tokenHandlerAddress, premium, allowance);
|
578
|
+
}
|
579
|
+
}
|
580
|
+
|
581
|
+
|
582
|
+
function _policyHolderPolicyActivated(
|
583
|
+
NftId policyNftId,
|
584
|
+
Timestamp activateAt
|
585
|
+
)
|
586
|
+
internal
|
587
|
+
virtual
|
588
|
+
{
|
589
|
+
// immediately return if policy is not activated
|
590
|
+
if (activateAt.eqz()) {
|
591
|
+
return;
|
592
|
+
}
|
593
|
+
|
594
|
+
// get policy holder address
|
595
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
596
|
+
|
597
|
+
// execute callback if policy holder implements IPolicyHolder
|
598
|
+
if (address(policyHolder) != address(0)) {
|
599
|
+
policyHolder.policyActivated(policyNftId, activateAt);
|
600
|
+
}
|
601
|
+
}
|
602
|
+
|
603
|
+
|
604
|
+
function _policyHolderPolicyExpired(
|
605
|
+
NftId policyNftId,
|
606
|
+
Timestamp expiredAt
|
607
|
+
)
|
608
|
+
internal
|
609
|
+
virtual
|
610
|
+
{
|
611
|
+
// immediately return if policy is not activated
|
612
|
+
if (expiredAt.eqz()) {
|
613
|
+
return;
|
614
|
+
}
|
615
|
+
|
616
|
+
// get policy holder address
|
617
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
618
|
+
|
619
|
+
// execute callback if policy holder implements IPolicyHolder
|
620
|
+
if (address(policyHolder) != address(0)) {
|
621
|
+
policyHolder.policyExpired(policyNftId, expiredAt);
|
622
|
+
}
|
501
623
|
}
|
502
624
|
|
503
625
|
|
504
|
-
function
|
626
|
+
function _getPolicyHolder(NftId policyNftId)
|
627
|
+
internal
|
628
|
+
view
|
629
|
+
returns (IPolicyHolder policyHolder)
|
630
|
+
{
|
631
|
+
address policyHolderAddress = getRegistry().ownerOf(policyNftId);
|
632
|
+
policyHolder = IPolicyHolder(policyHolderAddress);
|
633
|
+
|
634
|
+
if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
|
635
|
+
policyHolder = IPolicyHolder(address(0));
|
636
|
+
}
|
637
|
+
}
|
638
|
+
|
639
|
+
|
640
|
+
function _getTokenHandler(
|
505
641
|
InstanceReader instanceReader,
|
506
642
|
NftId productNftId
|
507
643
|
)
|
@@ -515,6 +651,7 @@ contract PolicyService is
|
|
515
651
|
tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
|
516
652
|
}
|
517
653
|
|
654
|
+
|
518
655
|
function _getDistributionNftAndWallets(
|
519
656
|
InstanceReader instanceReader,
|
520
657
|
NftId productNftId
|
@@ -536,6 +673,13 @@ contract PolicyService is
|
|
536
673
|
}
|
537
674
|
|
538
675
|
|
676
|
+
function _getAndVerifyInstanceAndProduct() internal view returns (Product product) {
|
677
|
+
IRegistry.ObjectInfo memory productInfo;
|
678
|
+
(, productInfo,) = _getAndVerifyActiveComponent(PRODUCT());
|
679
|
+
product = Product(productInfo.objectAddress);
|
680
|
+
}
|
681
|
+
|
682
|
+
|
539
683
|
function _getDomain() internal pure override returns(ObjectType) {
|
540
684
|
return POLICY();
|
541
685
|
}
|