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:
PurrProof
2024-09-25 17:34:12 +02:00
committed by GitHub
parent 2f0bc58946
commit cc67e0eb83
2 changed files with 19 additions and 0 deletions

View File

@ -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;