@etherisc/gif-next 0.0.2-9306579-093 → 0.0.2-93a7619-595
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/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- 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/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- 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/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- 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/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +31 -31
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +2 -2
- 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/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- 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/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- 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/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- 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/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- 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/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- 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/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- 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/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- 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/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/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- 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/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- 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/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- 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/UFixed.sol/MathLib.dbg.json +1 -1
- 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/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/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/examples/fire/FireProduct.sol +27 -28
- package/package.json +2 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {ACTIVE,
|
4
|
+
import {ACTIVE, PAUSED} from "../../type/StateId.sol";
|
5
5
|
import {Amount, AmountLib} from "../../type/Amount.sol";
|
6
6
|
import {BasicProduct} from "../../product/BasicProduct.sol";
|
7
7
|
import {ClaimId} from "../../type/ClaimId.sol";
|
@@ -14,12 +14,9 @@ import {POLICY} from "../../type/ObjectType.sol";
|
|
14
14
|
import {ReferralLib} from "../../type/Referral.sol";
|
15
15
|
import {RiskId, RiskIdLib} from "../../type/RiskId.sol";
|
16
16
|
import {Seconds} from "../../type/Seconds.sol";
|
17
|
-
import {StateId} from "../../type/StateId.sol";
|
18
17
|
import {Timestamp, TimestampLib} from "../../type/Timestamp.sol";
|
19
18
|
import {UFixed, UFixedLib} from "../../type/UFixed.sol";
|
20
19
|
|
21
|
-
uint64 constant SPECIAL_ROLE_INT = 11111;
|
22
|
-
|
23
20
|
// solhint-disable-next-line func-name-mixedcase
|
24
21
|
function HALF_YEAR() pure returns (Seconds) {
|
25
22
|
return Seconds.wrap(180 * 86400);
|
@@ -53,6 +50,7 @@ contract FireProduct is
|
|
53
50
|
error ErrorFireProductUnknownDamageLevel(DamageLevel damageLevel);
|
54
51
|
error ErrorFireProductFireUnknown(uint256 fireId);
|
55
52
|
error ErrorFireProductNotPolicyOwner(NftId nftId, address owner);
|
53
|
+
error ErrorFireProductFireNotInCoveredCity(uint256 fireId, string cityName);
|
56
54
|
|
57
55
|
string[] private _cities;
|
58
56
|
// map from city name to the RiskId
|
@@ -160,13 +158,13 @@ contract FireProduct is
|
|
160
158
|
view
|
161
159
|
returns (Amount premiumAmount)
|
162
160
|
{
|
163
|
-
RiskId
|
164
|
-
if (
|
161
|
+
RiskId risk = _riskMapping[cityName];
|
162
|
+
if (risk.eqz()) {
|
165
163
|
revert ErrorFireProductCityUnknown(cityName);
|
166
164
|
}
|
167
165
|
premiumAmount = calculatePremium(
|
168
166
|
sumInsured,
|
169
|
-
|
167
|
+
risk,
|
170
168
|
lifetime,
|
171
169
|
"",
|
172
170
|
bundleNftId,
|
@@ -202,11 +200,11 @@ contract FireProduct is
|
|
202
200
|
returns (NftId policyNftId)
|
203
201
|
{
|
204
202
|
address applicationOwner = msg.sender;
|
205
|
-
RiskId
|
203
|
+
RiskId risk = initializeCity(cityName);
|
206
204
|
|
207
205
|
Amount premiumAmount = calculatePremium(
|
208
206
|
sumInsured,
|
209
|
-
|
207
|
+
risk,
|
210
208
|
lifetime,
|
211
209
|
"",
|
212
210
|
bundleNftId,
|
@@ -214,7 +212,7 @@ contract FireProduct is
|
|
214
212
|
|
215
213
|
return _createApplication(
|
216
214
|
applicationOwner,
|
217
|
-
|
215
|
+
risk,
|
218
216
|
sumInsured,
|
219
217
|
premiumAmount,
|
220
218
|
lifetime,
|
@@ -228,15 +226,15 @@ contract FireProduct is
|
|
228
226
|
string memory cityName
|
229
227
|
)
|
230
228
|
public
|
231
|
-
returns (RiskId
|
229
|
+
returns (RiskId risk)
|
232
230
|
{
|
233
231
|
if (! _riskMapping[cityName].eqz()) {
|
234
232
|
return _riskMapping[cityName];
|
235
233
|
}
|
236
234
|
_cities.push(cityName);
|
237
|
-
|
238
|
-
_createRisk(
|
239
|
-
_riskMapping[cityName] =
|
235
|
+
risk = RiskIdLib.toRiskId(cityName);
|
236
|
+
_createRisk(risk, "");
|
237
|
+
_riskMapping[cityName] = risk;
|
240
238
|
}
|
241
239
|
|
242
240
|
/// @dev Calling this method will lock the sum insured amount in the pool and activate the policy at the given time.
|
@@ -329,12 +327,12 @@ contract FireProduct is
|
|
329
327
|
returns (ClaimId claimId, PayoutId payoutId)
|
330
328
|
{
|
331
329
|
IPolicy.PolicyInfo memory policyInfo = _getInstanceReader().getPolicyInfo(policyNftId);
|
332
|
-
_checkClaimConditions(policyNftId,
|
330
|
+
_checkClaimConditions(policyNftId, policyInfo, fireId);
|
333
331
|
|
334
|
-
Fire memory
|
332
|
+
Fire memory theFire = _fires[fireId];
|
335
333
|
_claimed[fireId][policyNftId] = true;
|
336
334
|
|
337
|
-
Amount claimAmount = _getClaimAmount(policyNftId, policyInfo.sumInsuredAmount,
|
335
|
+
Amount claimAmount = _getClaimAmount(policyNftId, policyInfo.sumInsuredAmount, theFire.damageLevel);
|
338
336
|
|
339
337
|
claimId = _submitClaim(policyNftId, claimAmount, abi.encodePacked(fireId));
|
340
338
|
_confirmClaim(policyNftId, claimId, claimAmount, "");
|
@@ -345,34 +343,35 @@ contract FireProduct is
|
|
345
343
|
|
346
344
|
function _checkClaimConditions(
|
347
345
|
NftId policyNftId,
|
348
|
-
|
349
|
-
|
346
|
+
IPolicy.PolicyInfo memory policyInfo,
|
347
|
+
uint256 fireId
|
350
348
|
)
|
351
349
|
internal
|
350
|
+
view
|
352
351
|
{
|
353
352
|
// check fire exists
|
354
353
|
if (_fires[fireId].reportedAt.eqz()) {
|
355
354
|
revert ErrorFireProductFireUnknown(fireId);
|
356
355
|
}
|
357
356
|
|
357
|
+
// check fire is in same city as policy coverage
|
358
|
+
if (_riskMapping[_fires[fireId].cityName] != policyInfo.riskId) {
|
359
|
+
revert ErrorFireProductFireNotInCoveredCity(fireId, _fires[fireId].cityName);
|
360
|
+
}
|
361
|
+
|
358
362
|
// check policy has not been claimed yet for this fire
|
359
363
|
if (_claimed[fireId][policyNftId]) {
|
360
364
|
revert ErrorFireProductAlreadyClaimed();
|
361
365
|
}
|
362
366
|
|
363
|
-
|
364
|
-
|
365
|
-
if (! policyState.eq(COLLATERALIZED())) {
|
366
|
-
revert ErrorFireProductPolicyNotActive(policyNftId);
|
367
|
-
}
|
368
|
-
|
369
|
-
Fire memory fire = _fires[fireId];
|
367
|
+
Fire memory theFire = _fires[fireId];
|
370
368
|
|
371
|
-
|
369
|
+
// check fire is during policy lifetime
|
370
|
+
if (theFire.reportedAt < policyInfo.activatedAt) {
|
372
371
|
revert ErrorFireProductPolicyNotYetActive(policyNftId, policyInfo.activatedAt);
|
373
372
|
}
|
374
373
|
|
375
|
-
if (
|
374
|
+
if (theFire.reportedAt >= policyInfo.expiredAt) {
|
376
375
|
revert ErrorFireProductPolicyExpired(policyNftId, policyInfo.expiredAt);
|
377
376
|
}
|
378
377
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@etherisc/gif-next",
|
3
|
-
"version": "0.0.2-
|
3
|
+
"version": "0.0.2-93a7619-595",
|
4
4
|
"description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -49,6 +49,7 @@
|
|
49
49
|
"abi-coder": "^5.0.0",
|
50
50
|
"antlr4ng": "^3.0.4",
|
51
51
|
"ethers": "^6.7.1",
|
52
|
+
"ethers-decode-error": "^2.1.3",
|
52
53
|
"solidity-docgen": "^0.6.0-beta.36",
|
53
54
|
"winston": "^3.10.0"
|
54
55
|
}
|