Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rapidddenis opened this issue Jun 9, 2023 · 1 comment

Comments

@rapidddenis
Copy link

rapidddenis commented Jun 9, 2023

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.

@rapidddenis rapidddenis changed the title Component suspend() and pause() prevents component from completing its responsibilities after premiums being paid suspend() and pause() prevents component from completing its responsibilities after premiums being paid Jun 9, 2023
@rapidddenis
Copy link
Author

Similar situation with RiskpoolService:
When risk pool is paused then revert on createBundle(), fundBundle(), collateralisePolicy() but continue to defundBundle() (Capital provider can withdraw not locked funds at any time except after suspend()), processPremium(), releasePolicy(), processPayout()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant