Owner
Owner
Contract module which provides access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions.
The initial owner is specified at deployment time in the constructor for Owner
. This
can later be changed with {transferOwnership} and {acceptOwnership}.
This module is used through inheritance. It will make available all functions from parent (Owner).
Modified from the OpenZeppelin Contracts library (5.0.0)
Addresses
Chain | Address |
---|
Functions
constructor
constructor(address initialOwner) internal
Initializes the contract setting the address provided by the deployer as the initial owner.
transferOwner
function transferOwner(address newOwner) public virtual
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.
_transferOwner
function _transferOwner(address newOwner) internal virtual
Transfers ownership of the contract to a new account (newOwner
) and deletes any pending owner.
Internal function without access restriction.
acceptOwner
function acceptOwner() public virtual
The new owner accepts the ownership transfer.
_checkOwner
function _checkOwner() internal view virtual
Throws if the sender is not the owner.
pendingOwner
function pendingOwner() public view virtual returns (address)
Returns the address of the pending owner.
owner
function owner() public view virtual returns (address)
Returns the address of the current owner.
Modifiers
onlyOwner
modifier onlyOwner()
Throws if called by any account other than the owner.