Skip to content

Commit

Permalink
feat: add withdraw method for batchers in servicemanager (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRampoldi authored Aug 27, 2024
1 parent 61624d9 commit 2274416
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions contracts/src/core/AlignedLayerServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,21 @@ contract AlignedLayerServiceManager is
);
}

function withdraw(uint256 amount) external {
if (batchersBalances[msg.sender] < amount) {
revert InsufficientFunds(
msg.sender,
amount,
batchersBalances[msg.sender]
);
}

batchersBalances[msg.sender] -= amount;
emit BatcherBalanceUpdated(msg.sender, batchersBalances[msg.sender]);

payable(msg.sender).transfer(amount);
}

function balanceOf(address account) public view returns (uint256) {
return batchersBalances[account];
}
Expand Down

0 comments on commit 2274416

Please sign in to comment.