I'm trying to create a contract and give a certain address, that is not the owner, permission to transfer ownership, or to atleast have the transferOwnership function public but only be able to transfer the ownership to one certain address. I've tried the following code (0x96c17dc512A94e4c4A9d8A9D7D7596a8c14addBf is the address that I in this case want to have access):
function _transferOwnership(address newOwner) public virtual {
require(newOwner != address(0x96c17dc512A94e4c4A9d8A9D7D7596a8c14addBf));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
Even with the 'require' line anyone can still transfer the ownership to any address without it having to be the address that I put in above. Would be eternally greatful if anyone could help