-
Notifications
You must be signed in to change notification settings - Fork 13
suspend() and pause() prevents component from completing its responsibilities after premiums being paid #112
Description
In release 2.0.0-rc1:
gif-contracts/contracts/services/ProductService.sol
Lines 20 to 28 in b58fd27
| fallback() external { | |
| // getAuthorizationStatus enforces msg.sender to be a registered product | |
| (,bool isAuthorized, address policyFlow) = _license().getAuthorizationStatus(_msgSender()); | |
| require(isAuthorized, "ERROR:PRS-001:NOT_AUTHORIZED"); | |
| require(policyFlow != address(0),"ERROR:PRS-002:POLICY_FLOW_NOT_RESOLVED"); | |
| _delegate(policyFlow); | |
| } |
ProductService reverts if product is not ACTIVE -> in case of depeg product, owner can pause() right after depeg event, wait for CLAIM_GRACE_PERIOD to expire then unpause() and close all policies / release all collateral without experiencing any claim. Of course owner can just stop processing claims but in this case collateral will remain locked (or just decline all claims).
In develop:
gif-contracts/contracts/modules/PoolController.sol
Lines 248 to 251 in d698b26
| function processPayout(bytes32 processId, uint256 amount) | |
| external override | |
| onlyPolicyFlow("Pool") | |
| onlyActivePoolForProcess(processId) |
PoolController::processPayout() reverts if risk pool is not ACTIVE -> risk pool owner can pause it to prevent payouts and collateral release.
For paused component, GIF MUST NOT revert when working with already existing "policy flows", only prevent creation of new one.
For example, at first glance:
ProductService must revert on newApplication(), underwrite(), but continue to decline(), revoke(), collectPremium(), adjustSumInsured(), expire(), close(), newClaim(), confirmClaim(), declineClaim(), closeClaim(), newPayout(), processPayout().
suspend() is more tricky if we assume that instance operator must have an option to stop operations in case of code malfunction.