Skip to content

Commit 1c253fa

Browse files
committed
feat(wip): withdraw_from_service_manager
1 parent 3a47b87 commit 1c253fa

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

contracts/src/core/BatcherPaymentService.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ contract BatcherPaymentService is
178178
emit FundsWithdrawn(msg.sender, amount);
179179
}
180180

181+
function withdraw_from_service_manager(
182+
uint256 amount
183+
) public onlyOwner { // or onlyBatcher ??
184+
alignedLayerServiceManager.withdraw(amount); // reverts on InsufficientBalance
185+
// money is now in this contract
186+
// now transfer to hardcoded batcher wallet
187+
payable(batcherWallet).transfer(amount);
188+
// todo test
189+
}
190+
181191
function pause() public onlyOwner {
182192
_pause();
183193
}

contracts/src/core/IAlignedLayerServiceManager.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ interface IAlignedLayerServiceManager {
6363

6464
function balanceOf(address account) external view returns (uint256);
6565

66+
function withdraw(uint256 amount) external;
67+
6668
function setAggregator(address _aggregator) external;
6769

6870
function isVerifierDisabled(

0 commit comments

Comments
 (0)