-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor distrbiuteProfit #304
Conversation
bin-57blocks
commented
Dec 30, 2023
- Update distProfitToTranches to include first loss cover profits
- Move distLossToTranches and distLossRecoveryToTranches out to pool
Fix a bug Fix failed tests Move distLossToTranches and distLossRecoveryToTranches from policy to pool
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nits
for (uint256 i = 0; i < covers.length; i++) { | ||
if (covers[i] != address(0)) { | ||
_firstLossCovers.push(IFirstLossCover(covers[i])); | ||
} else break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not put this into the termination condition i.e. i < cover.length && covers[i] != address(0)
?
} | ||
} | ||
|
||
function _distributeProfitForSeniorTranche( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would name this _distProfitToSeniorTranche
to be consistent.
) | ||
external | ||
returns ( | ||
uint256[2] memory profitsForTrancheVault, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: profitsForTranches
?
* @param juniorTotalAssets the total asset amount for junior tranche | ||
* @custom:access Internal function without access restriction. Caller needs to control access | ||
*/ | ||
function _calcProfitForFirstLossCovers( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this _distProditToFirstLossCovers
to be consistent?
@@ -11,25 +11,23 @@ import {SENIOR_TRANCHE, JUNIOR_TRANCHE, HUNDRED_PERCENT_IN_BPS} from "./SharedDe | |||
*/ | |||
contract RiskAdjustedTranchesPolicy is BaseTranchesPolicy { | |||
/** | |||
* @notice Distributes profit between tranches. | |||
* @dev Ignores solhint warning, it can't be view function because it implements ITranchesPolicy's disProfitToTranches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer accurate, is it?