Skip to content

Commit

Permalink
Fix calculation for rage quit support
Browse files Browse the repository at this point in the history
  • Loading branch information
qian-hu committed Aug 1, 2024
1 parent 37a27e3 commit d4ee537
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/kontrol/EscrowAccounting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d4ee537

Please sign in to comment.