Skip to content

Commit

Permalink
improve comment clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoticWalrus committed Oct 6, 2023
1 parent 8c02ab8 commit 3b4f1e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/contracts/pods/EigenPodManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,13 @@ contract EigenPodManager is
int256 updatedPodOwnerShares = currentPodOwnerShares + int256(shares);
podOwnerShares[podOwner] = updatedPodOwnerShares;

// skip dealing with deficit if there isn't any
// if there wasn't any deficit to begin with, then the increase must be the full `shares` amount
if (currentPodOwnerShares > 0) {
return shares;
// the updatedPodOwnerShares must be greater than zero for there to be any increase in the amount above zero
// simply return '0' early if this condition isn't met.
// if the updatedPodOwnerShares is zero or less, then there can't be any increase in the amount above zero, so return '0' in this case
} else if (updatedPodOwnerShares <= 0) {
return 0;
// otherwise, the pod owner's shares amount must have increased by the current amount above zero
// otherwise, the pod owner's shares amount must have increased by the amount that their updated balance exceeds zero
} else {
return uint256(updatedPodOwnerShares);
}
Expand Down

0 comments on commit 3b4f1e8

Please sign in to comment.