Skip to content

Commit 0eef062

Browse files
committed
passing
1 parent dbb7fa2 commit 0eef062

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

src/contracts/core/AllocationManager.sol

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,19 @@ contract AllocationManager is
739739
/// @inheritdoc IAllocationManagerView
740740
function getAllocationDelay(
741741
address operator
742-
) public view returns (bool isSet, uint32 delay) {
743-
_delegateView(secondHalf);
742+
) public view returns (bool, uint32) {
743+
AllocationDelayInfo memory info = _allocationDelayInfo[operator];
744+
745+
uint32 delay = info.delay;
746+
bool isSet = info.isSet;
747+
748+
// If there is a pending delay that can be applied, apply it
749+
if (info.effectBlock != 0 && block.number >= info.effectBlock) {
750+
delay = info.pendingDelay;
751+
isSet = true;
752+
}
753+
754+
return (isSet, delay);
744755
}
745756

746757
/// @inheritdoc IAllocationManagerView
@@ -780,7 +791,9 @@ contract AllocationManager is
780791
function getAVSRegistrar(
781792
address avs
782793
) public view returns (IAVSRegistrar) {
783-
_delegateView(secondHalf);
794+
IAVSRegistrar registrar = _avsRegistrar[avs];
795+
796+
return address(registrar) == address(0) ? IAVSRegistrar(avs) : registrar;
784797
}
785798

786799
/// @inheritdoc IAllocationManagerView
@@ -811,21 +824,27 @@ contract AllocationManager is
811824

812825
/// @inheritdoc IAllocationManagerView
813826
function isOperatorSlashable(address operator, OperatorSet memory operatorSet) public view returns (bool) {
814-
_delegateView(secondHalf);
827+
RegistrationStatus memory status = registrationStatus[operator][operatorSet.key()];
828+
829+
// slashableUntil returns the last block the operator is slashable in so we check for
830+
// less than or equal to
831+
return status.registered || block.number <= status.slashableUntil;
815832
}
816833

817834
/// @inheritdoc IAllocationManagerView
818835
function getRedistributionRecipient(
819836
OperatorSet memory operatorSet
820-
) external view returns (address) {
821-
_delegateView(secondHalf);
837+
) public view returns (address) {
838+
// Load the redistribution recipient and return it if set, otherwise return the default burn address.
839+
address redistributionRecipient = _redistributionRecipients[operatorSet.key()];
840+
return redistributionRecipient == address(0) ? DEFAULT_BURN_ADDRESS : redistributionRecipient;
822841
}
823842

824843
/// @inheritdoc IAllocationManagerView
825844
function isRedistributingOperatorSet(
826845
OperatorSet memory operatorSet
827846
) public view returns (bool) {
828-
_delegateView(secondHalf);
847+
return getRedistributionRecipient(operatorSet) != DEFAULT_BURN_ADDRESS;
829848
}
830849

831850
/// @inheritdoc IAllocationManagerView

0 commit comments

Comments
 (0)