Skip to content

Commit 20d73bc

Browse files
committed
refactor(N-01): emit PoolTotalsUpdated in _unstake, reserve ExchangeRateUpdated for fee distribution only
1 parent b06d84a commit 20d73bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/RNBWStaking.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ contract RNBWStaking is IRNBWStaking, ReentrancyGuard, Pausable, EIP712 {
704704

705705
// 10. Emit events
706706
emit Unstaked(user, sharesToBurn, rnbwValue, exitFee, netAmount);
707+
emit PoolTotalsUpdated(totalPooledRnbw, totalShares);
707708
}
708709

709710
/// @dev Stakes from the pre-funded staking reserve — no token transfer,

src/interfaces/IRNBWStaking.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ interface IRNBWStaking {
5959
/// @param totalShares The total shares outstanding
6060
event ExchangeRateUpdated(uint256 totalPooledRnbw, uint256 totalShares);
6161

62-
/// @notice Emitted after stake or cashback allocation — both totalPooledRnbw and totalShares
63-
/// increase proportionally, so the exchange rate stays ~constant (modulo rounding dust).
64-
/// Use ExchangeRateUpdated to track actual rate changes (unstake, fee distribution).
62+
/// @notice Emitted after stake, unstake, or cashback allocation — pool totals change but
63+
/// the exchange rate stays ~constant (both sides scale proportionally, modulo rounding dust).
6564
/// @param totalPooledRnbw The total RNBW in the staking pool
6665
/// @param totalShares The total shares outstanding
6766
event PoolTotalsUpdated(uint256 totalPooledRnbw, uint256 totalShares);

0 commit comments

Comments
 (0)