Skip to content

Commit

Permalink
Refactor claimAllETHGains to use helper func
Browse files Browse the repository at this point in the history
  • Loading branch information
RickGriff committed May 8, 2024
1 parent 4d3f91f commit 1b2f4f7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions contracts/src/StabilityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,7 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {
_updateDepositAndSnapshots(msg.sender, compoundedBoldDeposit);
}

uint256 stashedETHGain = stashedETH[msg.sender];
uint256 ETHToSend = currentETHGain + stashedETHGain;

stashedETH[msg.sender] = 0;

emit ETHGainWithdrawn(msg.sender, ETHToSend, boldLoss);
uint256 ETHToSend = _getTotalETHGainAndZeroStash(msg.sender, currentETHGain);

_sendETHGainToDepositor(ETHToSend);
assert(getDepositorETHGain(msg.sender) == 0);
Expand Down

0 comments on commit 1b2f4f7

Please sign in to comment.