openzeppelin Ownable.sol is a good resource, and well commented:

/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/

Feb 11, 2022, 6:02 AM
you can transfer to some other dead address, just not zero
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
contracts can send tokens or ether
Feb 11, 2022, 6:17 AM

© 2024 Draquery.com All rights reserved.