Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ contract EigenDAEjectionManager is IEigenDAEjectionManager, IEigenDASemVer {

/// @inheritdoc IEigenDAEjectionManager
function cancelEjectionByEjector(address operator) external onlyEjector(msg.sender) {
require(EigenDAEjectionLib.getEjectionRecord(operator).ejector == msg.sender, "only ejector that issued ejection can cancel");
operator.cancelEjection();
}

Expand Down
24 changes: 24 additions & 0 deletions contracts/test/unit/EigenDAEjectionManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,28 @@ contract EigenDAEjectionManagerTest is Test {
ejectionManager.startEjection(ejectee, "0x");
vm.stopPrank();
}

function testCancelEjectionByEjectorRevertsWhenCalledByDifferentEjector() public {
// 0) create a second ejector and grant access for ejection role
address ejector2 = makeAddr("ejector2");
accessControl.grantRole(AccessControlConstants.EJECTOR_ROLE, ejector);
accessControl.grantRole(AccessControlConstants.EJECTOR_ROLE, ejector2);
accessControl.grantRole(AccessControlConstants.OWNER_ROLE, ejector);

// 1) first ejector starts an ejection
vm.startPrank(ejector);
ejectionManager.setCooldown(0);
ejectionManager.setDelay(0);
ejectionManager.startEjection(ejectee, "0x");
vm.stopPrank();

// 2) verify the ejection was created with the first ejector
assertEq(ejectionManager.getEjector(ejectee), ejector);

// 3) attempting to cancel the ejection from a different ejector should revert
vm.startPrank(ejector2);
vm.expectRevert("only ejector that issued ejection can cancel");
ejectionManager.cancelEjectionByEjector(ejectee);
vm.stopPrank();
}
Comment on lines +195 to +217
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test case that verifies the original ejector can still successfully cancel their own ejection after the fix. This would provide more comprehensive coverage and confirm the fix doesn't break the intended behavior.

Copilot uses AI. Check for mistakes.
}
Loading