@etherisc/gif-next 0.0.2-e1f23dc-329 → 0.0.2-e3f4f82-063
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +8 -8
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +2 -2
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +16 -11
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +18 -8
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +30 -0
- 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/Instance.sol/Instance.json +52 -22
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +55 -40
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +1 -1
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.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/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/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +2 -2
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +2 -2
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +2 -2
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +21 -0
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +21 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +59 -14
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +20 -8
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +89 -36
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +35 -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/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/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.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/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/contracts/components/Distribution.sol +5 -1
- package/contracts/components/IPoolComponent.sol +1 -1
- package/contracts/components/Pool.sol +12 -7
- package/contracts/components/Product.sol +7 -2
- package/contracts/instance/module/ISetup.sol +3 -0
- package/contracts/instance/service/IPoolService.sol +2 -0
- package/contracts/instance/service/IProductService.sol +3 -0
- package/contracts/instance/service/PoolService.sol +15 -12
- package/contracts/instance/service/ProductService.sol +66 -68
- package/package.json +1 -1
@@ -323,7 +323,7 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
323
323
|
returns (IBundle.BundleInfo memory)
|
324
324
|
{
|
325
325
|
bundleInfo.lockedAmount += collateralAmount;
|
326
|
-
// FIXME:
|
326
|
+
// FIXME: track policy in bundle and how much is locked for it
|
327
327
|
// instance.collateralizePolicy(bundleNftId, policyNftId, collateralAmount);
|
328
328
|
return bundleInfo;
|
329
329
|
}
|
@@ -374,7 +374,6 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
374
374
|
|
375
375
|
// check match between policy and calling product
|
376
376
|
NftId productNftId = productInfo.nftId;
|
377
|
-
// FIXME: this
|
378
377
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
379
378
|
require(policyInfo.productNftId == productNftId, "POLICY_PRODUCT_MISMATCH");
|
380
379
|
require(instanceReader.getPolicyState(policyNftId) == APPLIED(), "ERROR:PRS-021:STATE_NOT_APPLIED");
|
@@ -382,18 +381,20 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
382
381
|
NftId bundleNftId;
|
383
382
|
IBundle.BundleInfo memory bundleInfo;
|
384
383
|
uint256 collateralAmount;
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
384
|
+
{
|
385
|
+
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
386
|
+
|
387
|
+
(
|
388
|
+
bundleNftId,
|
389
|
+
bundleInfo,
|
390
|
+
collateralAmount
|
391
|
+
) = _getAndVerifyUnderwritingSetup(
|
392
|
+
instance,
|
393
|
+
instanceReader,
|
394
|
+
policyInfo,
|
395
|
+
productSetupInfo
|
396
|
+
);
|
397
|
+
}
|
397
398
|
|
398
399
|
// lock bundle collateral
|
399
400
|
bundleInfo = _lockCollateralInBundle(
|
@@ -402,9 +403,11 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
402
403
|
bundleInfo,
|
403
404
|
policyNftId,
|
404
405
|
collateralAmount);
|
406
|
+
StateId newPolicyState = UNDERWRITTEN();
|
405
407
|
|
406
408
|
// optional activation of policy
|
407
409
|
if(activateAt > zeroTimestamp()) {
|
410
|
+
newPolicyState = ACTIVE();
|
408
411
|
policyInfo.activatedAt = activateAt;
|
409
412
|
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
410
413
|
}
|
@@ -421,7 +424,7 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
421
424
|
bundleInfo.balanceAmount += netPremiumAmount;
|
422
425
|
}
|
423
426
|
|
424
|
-
instance.updatePolicy(policyNftId, policyInfo,
|
427
|
+
instance.updatePolicy(policyNftId, policyInfo, newPolicyState);
|
425
428
|
_poolService.updateBundle(productInfo.parentNftId, bundleNftId, bundleInfo, KEEP_STATE());
|
426
429
|
|
427
430
|
// involve pool if necessary
|
@@ -429,8 +432,7 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
429
432
|
NftId poolNftId = bundleInfo.poolNftId;
|
430
433
|
ISetup.PoolSetupInfo memory poolInfo = instanceReader.getPoolSetupInfo(poolNftId);
|
431
434
|
|
432
|
-
|
433
|
-
if(poolInfo.isIntercepting) {
|
435
|
+
if(poolInfo.isConfirmingApplication) {
|
434
436
|
_underwriteByPool(
|
435
437
|
poolNftId,
|
436
438
|
policyNftId,
|
@@ -453,51 +455,46 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
453
455
|
function collectPremium(NftId policyNftId, Timestamp activateAt) external override {
|
454
456
|
// check caller is registered product
|
455
457
|
(IRegistry.ObjectInfo memory productInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
458
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
456
459
|
|
457
|
-
//
|
458
|
-
//
|
459
|
-
//
|
460
|
-
// ITreasury.TreasuryInfo memory treasuryInfo = instance.getTreasuryInfo(productInfo.nftId);
|
460
|
+
// TODO: check if not paid
|
461
|
+
// TODO: transfer premium
|
462
|
+
// TODO: optionally activate
|
461
463
|
|
464
|
+
// // perform actual token transfers (this code is probably not complete)
|
465
|
+
// IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
466
|
+
|
462
467
|
// uint256 premiumAmount = policyInfo.premiumAmount;
|
463
|
-
// _processPremiumByTreasury(instance, productInfo.nftId,
|
468
|
+
// _processPremiumByTreasury(instance, productInfo.nftId, policyNftId, premiumAmount);
|
464
469
|
|
465
470
|
// // policy level book keeping for premium paid
|
466
471
|
// policyInfo.premiumPaidAmount += premiumAmount;
|
467
472
|
|
473
|
+
// instance.updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
474
|
+
|
468
475
|
// // optional activation of policy
|
469
476
|
// if(activateAt > zeroTimestamp()) {
|
470
|
-
//
|
471
|
-
// policyInfo.activatedAt.eqz(),
|
472
|
-
// "ERROR:PRS-030:ALREADY_ACTIVATED");
|
473
|
-
|
474
|
-
// policyInfo.activatedAt = activateAt;
|
475
|
-
// policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
476
|
-
|
477
|
-
// instance.updatePolicyState(policyNftId, ACTIVE());
|
477
|
+
// activate(policyNftId, activateAt);
|
478
478
|
// }
|
479
479
|
|
480
|
-
// instance.setPolicyInfo(policyNftId, policyInfo);
|
481
|
-
|
482
480
|
// TODO add logging
|
483
481
|
}
|
484
482
|
|
485
|
-
|
486
|
-
function activate(NftId policyNftId, Timestamp activateAt) external override {
|
483
|
+
function activate(NftId policyNftId, Timestamp activateAt) public override {
|
487
484
|
// check caller is registered product
|
488
485
|
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(PRODUCT());
|
486
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
489
487
|
|
490
|
-
|
488
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
491
489
|
|
492
|
-
|
493
|
-
|
494
|
-
|
490
|
+
require(
|
491
|
+
policyInfo.activatedAt.eqz(),
|
492
|
+
"ERROR:PRS-020:ALREADY_ACTIVATED");
|
495
493
|
|
496
|
-
|
497
|
-
|
494
|
+
policyInfo.activatedAt = activateAt;
|
495
|
+
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
498
496
|
|
499
|
-
|
500
|
-
// instance.updatePolicyState(policyNftId, ACTIVE());
|
497
|
+
instance.updatePolicy(policyNftId, policyInfo, ACTIVE());
|
501
498
|
|
502
499
|
// TODO add logging
|
503
500
|
}
|
@@ -517,8 +514,9 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
517
514
|
view
|
518
515
|
returns (NftId poolNftid)
|
519
516
|
{
|
520
|
-
|
521
|
-
|
517
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
518
|
+
ISetup.ProductSetupInfo memory productSetupInfo = instanceReader.getProductSetupInfo(productNftId);
|
519
|
+
return productSetupInfo.poolNftId;
|
522
520
|
}
|
523
521
|
|
524
522
|
|
@@ -533,30 +531,30 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
533
531
|
{
|
534
532
|
// process token transfer(s)
|
535
533
|
if(premiumAmount > 0) {
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
534
|
+
ISetup.ProductSetupInfo memory productSetupInfo = instance.getInstanceReader().getProductSetupInfo(productNftId);
|
535
|
+
TokenHandler tokenHandler = productSetupInfo.tokenHandler;
|
536
|
+
address policyOwner = getRegistry().ownerOf(policyNftId);
|
537
|
+
ISetup.PoolSetupInfo memory poolSetupInfo = instance.getInstanceReader().getPoolSetupInfo(productSetupInfo.poolNftId);
|
538
|
+
address poolWallet = poolSetupInfo.wallet;
|
539
|
+
netPremiumAmount = premiumAmount;
|
540
|
+
Fee memory productFee = productSetupInfo.productFee;
|
541
|
+
|
542
|
+
if (FeeLib.feeIsZero(productFee)) {
|
543
|
+
tokenHandler.transfer(
|
544
|
+
policyOwner,
|
545
|
+
poolWallet,
|
546
|
+
premiumAmount
|
547
|
+
);
|
548
|
+
} else {
|
549
|
+
(uint256 productFeeAmount, uint256 netAmount) = FeeLib.calculateFee(productSetupInfo.productFee, netPremiumAmount);
|
550
|
+
address productWallet = productSetupInfo.wallet;
|
551
|
+
if (tokenHandler.getToken().allowance(policyOwner, address(tokenHandler)) < premiumAmount) {
|
552
|
+
revert ErrorIProductServiceInsufficientAllowance(policyOwner, address(tokenHandler), premiumAmount);
|
553
|
+
}
|
554
|
+
tokenHandler.transfer(policyOwner, productWallet, productFeeAmount);
|
555
|
+
tokenHandler.transfer(policyOwner, poolWallet, netAmount);
|
556
|
+
netPremiumAmount = netAmount;
|
557
|
+
}
|
560
558
|
}
|
561
559
|
|
562
560
|
// TODO add logging
|
package/package.json
CHANGED