Skip to content

suspend() and pause() prevents component from completing its responsibilities after premiums being paid #112

@rapidddenis

Description

@rapidddenis

In release 2.0.0-rc1:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions