Skip to content

Commit

Permalink
feat: add a deposit to batcher method in servicemanager (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRampoldi authored Aug 27, 2024
1 parent 2274416 commit 43b266e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions contracts/src/core/AlignedLayerServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,20 @@ contract AlignedLayerServiceManager is
return batchersBalances[account];
}

function depositToBatcher(address account) external payable {
_depositToBatcher(account, msg.value);
}

function _depositToBatcher(address account, uint256 amount) internal {
if (amount <= 0) {
revert InvalidDepositAmount(amount);
}
batchersBalances[account] += amount;
emit BatcherBalanceUpdated(account, batchersBalances[account]);
}

receive() external payable {
batchersBalances[msg.sender] += msg.value;
emit BatcherBalanceUpdated(msg.sender, batchersBalances[msg.sender]);
_depositToBatcher(msg.sender, msg.value);
}

function checkPublicInput(
Expand Down
1 change: 1 addition & 0 deletions contracts/src/core/IAlignedLayerServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface IAlignedLayerServiceManager {
uint256 available
); // 5c54305e
error InvalidQuorumThreshold(uint256 signedStake, uint256 requiredStake); // a61eb88a
error InvalidDepositAmount(uint256 amount); // 412ed242

function createNewTask(
bytes32 batchMerkleRoot,
Expand Down

0 comments on commit 43b266e

Please sign in to comment.