Change to endEpoch add liability

This commit is contained in:
2025-09-26 19:22:09 +02:00
parent b1cd4ddb1e
commit c329181447
2 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -330,7 +330,7 @@ contract CunaFinanceBsc is Initializable, ReentrancyGuardUpgradeable {
/// @param estDaysRemaining Estimated days remaining for the protocol
/// @param currentTreasuryTvl Current treasury total value locked
/// @param _paybackPercent Percentage multiplier for unlock calculation (scaled by 10000)
function endEpoch(uint256 estDaysRemaining, uint256 currentTreasuryTvl, uint256 _paybackPercent) external onlyOwner {
function endEpoch(uint256 estDaysRemaining, uint256 currentTreasuryTvl, uint256 _paybackPercent, uint256 _currentLiability) external onlyOwner {
uint256 unlockPercentage = 0;
if (currentEpochId > 0) {
@@ -339,7 +339,7 @@ contract CunaFinanceBsc is Initializable, ReentrancyGuardUpgradeable {
unlockPercentage = calculateUnlockPercentage(
currentTreasuryTvl,
totalBigStakes,
_currentLiability,
lastEpoch.currentTreasuryTvl,
lastEpoch.totalLiability,
_paybackPercent