Created
May 14, 2021 05:36
-
-
Save percybolmer/46160d6e17a379f9817790a70ef8da7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @notice renounceOwnership will set the owner to zero address | |
* This will make the contract owner less, It will make ALL functions with | |
* onlyOwner no longer callable. | |
* There is no way of restoring the owner | |
*/ | |
function renounceOwnership() public onlyOwner { | |
emit OwnershipTransferred(_owner, address(0)); | |
_owner = address(0); | |
} | |
/** | |
* @notice transferOwnership will assign the {newOwner} as owner | |
* | |
*/ | |
function transferOwnership(address newOwner) public onlyOwner { | |
_transferOwnership(newOwner); | |
} | |
/** | |
* @notice _transferOwnership will assign the {newOwner} as owner | |
* | |
*/ | |
function _transferOwnership(address newOwner) internal { | |
require(newOwner != address(0), "Ownable: new owner is the zero address"); | |
emit OwnershipTransferred(_owner, newOwner); | |
_owner = newOwner; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment