From d4ee5371053b90e6d1b49991f8bd8a67a69f9963 Mon Sep 17 00:00:00 2001 From: qian-hu <88806138+qian-hu@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:07:50 -0400 Subject: [PATCH] Fix calculation for rage quit support --- test/kontrol/EscrowAccounting.t.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/kontrol/EscrowAccounting.t.sol b/test/kontrol/EscrowAccounting.t.sol index 5582054f..5db90d40 100644 --- a/test/kontrol/EscrowAccounting.t.sol +++ b/test/kontrol/EscrowAccounting.t.sol @@ -71,8 +71,11 @@ contract EscrowAccountingTest is EscrowInvariants { _setUpGenericState(); uint256 totalSharesLocked = escrow.getLockedAssetsTotals().stETHLockedShares; - uint256 totalFundsLocked = stEth.getPooledEthByShares(totalSharesLocked); - uint256 expectedRageQuitSupport = totalFundsLocked * 1e18 / stEth.totalSupply(); + uint256 unfinalizedShares = totalSharesLocked + escrow.getLockedAssetsTotals().unstETHUnfinalizedShares; + uint256 totalFundsLocked = stEth.getPooledEthByShares(unfinalizedShares); + uint256 finalizedETH = escrow.getLockedAssetsTotals().unstETHFinalizedETH; + uint256 expectedRageQuitSupport = + (totalFundsLocked + finalizedETH) * 1e18 / (stEth.totalSupply() + finalizedETH); assert(escrow.getRageQuitSupport() == expectedRageQuitSupport); }