Skip to main content

Owner

Owner

Dev note

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

ChainAddress

Functions

constructor

constructor(address initialOwner) internal
Dev note

Initializes the contract setting the address provided by the deployer as the initial owner.

transferOwner

function transferOwner(address newOwner) public virtual
Dev note

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
Dev note

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
Dev note

The new owner accepts the ownership transfer.

_checkOwner

function _checkOwner() internal view virtual
Dev note

Throws if the sender is not the owner.

pendingOwner

function pendingOwner() public view virtual returns (address)
Dev note

Returns the address of the pending owner.

owner

function owner() public view virtual returns (address)
Dev note

Returns the address of the current owner.

Modifiers

onlyOwner

modifier onlyOwner()
Dev note

Throws if called by any account other than the owner.