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_allocationDelay #770

Merged
merged 1 commit 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
4 changes: 3 additions & 1 deletion src/contracts/core/AllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ contract AllocationManager is
* @param delay The allocation delay in seconds.
*/
function _setAllocationDelay(address operator, uint32 delay) internal {
require(delay != 0, InvalidDelay());

AllocationDelayInfo storage delayInfo = _allocationDelayInfo[operator];

bool pendingInEffect = delayInfo.pendingDelay != 0 && block.timestamp >= delayInfo.pendingDelayEffectTimestamp;
Expand Down Expand Up @@ -474,7 +476,7 @@ contract AllocationManager is

bool pendingInEffect = delayInfo.pendingDelay != 0 && block.timestamp >= delayInfo.pendingDelayEffectTimestamp;

isSet = delayInfo.pendingDelayEffectTimestamp != 0;
isSet = delayInfo.delay != 0 || pendingInEffect;

if (pendingInEffect) return (isSet, delayInfo.pendingDelay);

Expand Down
2 changes: 2 additions & 0 deletions src/contracts/interfaces/IAllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface IAllocationManager is ISignatureUtils {
error OperatorNotRegistered();
/// @dev Thrown when two array parameters have mismatching lengths.
error InputArrayLengthMismatch();
/// @dev Thrown when an operator attempts to set their allocation delay to 0
error InvalidDelay();
/// @dev Thrown when an operator's allocation delay has yet to be set.
error UninitializedAllocationDelay();
/// @dev Thrown when provided `expectedTotalMagnitude` for a given allocation does not match `currentTotalMagnitude`.
Expand Down
Loading