Skip to content

Commit

Permalink
fix: I12: State variable read multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko authored and dgusakov committed Sep 11, 2024
1 parent d390b2c commit 8bd1e0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/CSModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1051,20 +1051,21 @@ contract CSModule is
function settleELRewardsStealingPenalty(
uint256[] calldata nodeOperatorIds
) external onlyRole(SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE) {
ICSAccounting _accounting = accounting;
for (uint256 i; i < nodeOperatorIds.length; ++i) {
uint256 nodeOperatorId = nodeOperatorIds[i];
_onlyExistingNodeOperator(nodeOperatorId);
uint256 lockedBondBefore = accounting.getActualLockedBond(
uint256 lockedBondBefore = _accounting.getActualLockedBond(
nodeOperatorId
);

accounting.settleLockedBondETH(nodeOperatorId);
_accounting.settleLockedBondETH(nodeOperatorId);

// settled amount might be zero either if the lock expired, or the bond is zero
// so we need to check actual locked bond before to determine if the penalty was settled
if (lockedBondBefore > 0) {
// Bond curve should be reset to default in case of confirmed MEV stealing. See https://hackmd.io/@lido/SygBLW5ja
accounting.resetBondCurve(nodeOperatorId);
_accounting.resetBondCurve(nodeOperatorId);
// Nonce should be updated if depositableValidators change
_updateDepositableValidatorsCount({
nodeOperatorId: nodeOperatorId,
Expand Down

0 comments on commit 8bd1e0e

Please sign in to comment.