The acceptAdminOwnership() function has incorrect access control that prevents the pending admin from accepting ownership while allowing the current admin to complete the transfer unilaterally. This completely defeats the purpose of the two-step transfer pattern, which requires the new admin to explicitly accept ownership to prevent accidental transfers to incorrect or inaccessible addresses.
The function uses onlyAdmin modifier, which checks msg.sender == admin (the current admin), when it should check msg.sender == pendingAdmin (the new pending admin).
function testBrokenAdminTransfer() public {
address pendingAdmin = address(0x6666666666666666666666666666666666666666);
// Step 1: Current admin initiates transfer to new address
vm.prank(admin);
mytCuratorProxy.transferAdminOwnerShip(pendingAdmin);
// Step 2: Pending admin CANNOT accept because onlyAdmin requires current admin
vm.prank(pendingAdmin);
vm.expectRevert(abi.encode("PD")); // This should not revert in a proper 2-step transfer
mytCuratorProxy.acceptAdminOwnership();
// Step 3:Current admin can accept on behalf of pending admin
vm.prank(admin);
mytCuratorProxy.acceptAdminOwnership();
// Result: Admin changed without pendingAdmin ever calling accept
// The pendingAdmin is now the admin, but they never confirmed the transfer
assertEq(mytCuratorProxy.pendingAdmin(), address(0));
}