Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ownable2StepUpgradeable

Inherits: Initializable, OwnableUpgradeable

Contract module which provides access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. This extension of the {Ownable} contract includes a two-step mechanism to transfer ownership, where the new owner must call {acceptOwnership} in order to replace the old one. This can help prevent common mistakes, such as transfers of ownership to incorrect accounts, or to contracts that are unable to interact with the permission system. The initial owner is specified at deployment time in the constructor for Ownable. This can later be changed with {transferOwnership} and {acceptOwnership}. This module is used through inheritance. It will make available all functions from parent (Ownable).

State Variables

Ownable2StepStorageLocation

bytes32 private constant Ownable2StepStorageLocation =
    0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00;

Functions

_getOwnable2StepStorage

function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $);

__Ownable2Step_init

function __Ownable2Step_init() internal onlyInitializing;

__Ownable2Step_init_unchained

function __Ownable2Step_init_unchained() internal onlyInitializing;

pendingOwner

Returns the address of the pending owner.

function pendingOwner() public view virtual returns (address);

transferOwnership

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;

_transferOwnership

Transfers ownership of the contract to a new account (newOwner) and deletes any pending owner. Internal function without access restriction.

function _transferOwnership(address newOwner) internal virtual override;

acceptOwnership

The new owner accepts the ownership transfer.

function acceptOwnership() public virtual;

Events

OwnershipTransferStarted

event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

Structs

Ownable2StepStorage

Note: storage-location: erc7201:openzeppelin.storage.Ownable2Step

struct Ownable2StepStorage {
    address _pendingOwner;
}