Skip to content

Commit e6f5f43

Browse files
committed
feat: event on setAvs
1 parent b2f368a commit e6f5f43

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/SlashingRegistryCoordinator.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,8 @@ contract SlashingRegistryCoordinator is
934934
function _setAVS(
935935
address _avs
936936
) internal {
937+
address prevAVS = avs;
938+
emit AVSUpdated(prevAVS, _avs);
937939
avs = _avs;
938940
}
939941

src/interfaces/ISlashingRegistryCoordinator.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ interface ISlashingRegistryCoordinatorEvents is ISlashingRegistryCoordinatorType
190190
*/
191191
event ChurnApproverUpdated(address prevChurnApprover, address newChurnApprover);
192192

193+
/**
194+
* @notice Emitted when the AVS address is updated.
195+
* @param prevAVS The previous AVS address.
196+
* @param newAVS The new AVS address.
197+
*/
198+
event AVSUpdated(address prevAVS, address newAVS);
199+
193200
/**
194201
* @notice Emitted when the ejector address is updated.
195202
* @dev Emitted in _setEjector().

test/unit/SlashingRegistryCoordinatorUnit.t.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,14 @@ contract SlashingRegistryCoordinator_SetAVS is SlashingRegistryCoordinatorUnitTe
567567
vm.prank(address(0xdead));
568568
slashingRegistryCoordinator.setAVS(newAVS);
569569
}
570+
571+
function test_emitsAVSUpdatedEvent() public {
572+
vm.expectEmit(true, true, true, true);
573+
emit AVSUpdated(serviceManager, newAVS);
574+
575+
vm.prank(proxyAdminOwner);
576+
slashingRegistryCoordinator.setAVS(newAVS);
577+
}
570578
}
571579

572580
contract SlashingRegistryCoordinator_CreateSlashableStakeQuorum is

0 commit comments

Comments
 (0)