Hello! I have recently found a BSC smart contract that has a “transferOwnership” function
So, I just started with smart contract programming 201, and I was wondering, why would anyone want to be able to transfer the ownership of the contract?
In my mind this seems like a rugpull?
Can someone explain please?
function in contract:
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0));
emit onOwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
Here’s the link to the full code:
https://bscscan.com/address/0x05137854F050e809F0Bf013d60BDb89bB18Cd580#code
update: also I’ve found that the contract owner is just a regular wallet address… isn’t this extra dangerous as well?
here’s the link for the owner address:
https://bscscan.com/address/0x1a4f8f8e2669b87d5d017dda4cdc46acff34953c