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

fix: patch getallocatable mag #772

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 7 additions & 8 deletions src/contracts/core/AllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,15 @@ contract AllocationManager is
* that could be completed at the same time. This is the sum of freeMagnitude and the sum of all pending completable deallocations.
* @param operator the operator to get the allocatable magnitude for
* @param strategy the strategy to get the allocatable magnitude for
* @param numToComplete the number of pending free magnitudes deallocations to complete
*/
function getAllocatableMagnitude(
address operator,
IStrategy strategy,
uint16 numToComplete
) external view returns (uint64) {
function getAllocatableMagnitude(address operator, IStrategy strategy) external view returns (uint64) {
OperatorMagnitudeInfo storage info = operatorMagnitudeInfo[operator][strategy];
(uint64 freeMagnitudeToAdd,) =
_getPendingFreeMagnitude(operator, strategy, numToComplete, info.nextPendingFreeMagnitudeIndex);
(uint64 freeMagnitudeToAdd,) = _getPendingFreeMagnitude({
operator: operator,
strategy: strategy,
numToComplete: type(uint16).max,
nextIndex: info.nextPendingFreeMagnitudeIndex
});
return info.freeMagnitude + freeMagnitudeToAdd;
}

Expand Down
7 changes: 1 addition & 6 deletions src/contracts/interfaces/IAllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,8 @@ interface IAllocationManager is ISignatureUtils {
* that could be completed at the same time. This is the sum of freeMagnitude and the sum of all pending completable deallocations.
* @param operator the operator to get the allocatable magnitude for
* @param strategy the strategy to get the allocatable magnitude for
* @param numToComplete the number of pending free magnitudes deallocations to complete, 0 to complete all (uint8 max 256)
*/
function getAllocatableMagnitude(
address operator,
IStrategy strategy,
uint16 numToComplete
) external view returns (uint64);
function getAllocatableMagnitude(address operator, IStrategy strategy) external view returns (uint64);

/**
* @notice Returns the pending allocations of an operator for a given strategy and operatorSets
Expand Down
Loading