Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a deposit to batcher method in servicemanager #876

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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 @@ -208,9 +208,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
Loading