Skip to content

Commit

Permalink
Minor changes part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat committed Feb 25, 2025
1 parent a7878b8 commit 46e3ec1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/core/StakeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ abstract contract StakeManager is IStakeManager {
uint256 withdrawAmount
) external {
DepositInfo storage info = deposits[msg.sender];
require(withdrawAmount <= info.deposit, "Withdraw amount too large");
info.deposit = info.deposit - withdrawAmount;
uint256 currentDeposit = info.deposit;
require(withdrawAmount <= currentDeposit, "Withdraw amount too large");
info.deposit = currentDeposit - withdrawAmount;
emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);
(bool success,) = withdrawAddress.call{value: withdrawAmount}("");
require(success, "failed to withdraw");
Expand Down

0 comments on commit 46e3ec1

Please sign in to comment.