Add comment and tests for zero address behavior in Ownable2Step.transferOwnership() (#5226)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -37,6 +37,8 @@ abstract contract Ownable2Step is Ownable {
|
||||
/**
|
||||
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
|
||||
* Can only be called by the current owner.
|
||||
*
|
||||
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
|
||||
*/
|
||||
function transferOwnership(address newOwner) public virtual override onlyOwner {
|
||||
_pendingOwner = newOwner;
|
||||
|
||||
Reference in New Issue
Block a user