Skip to content

Owned

Description

Allows inheriting contracts to have an owner and provides the onlyOwner modifier, which restricts function access to that owner. The owner can be changed by a nomination process, where the nominated owner must accept ownership before it is switched.

Source: contracts/Owned.sol

Variables

nominatedOwner

Source

The currently-nominated owner.

Type: address

owner

Source

The contract owner.

Type: address

Constructor

constructor

Source

Initialises the owner of this contract.

Details

Signature

constructor(address _owner)

Visibility

public

State Mutability

``

Requires

Emits

Restricted Functions

nominateNewOwner

Source

Nominates a new owner of this contract, who may then call acceptOwnership to become the owner.

Details

Signature

nominateNewOwner(address _owner)

Visibility

external

State Mutability

``

Modifiers

Emits

External Functions

acceptOwnership

Source

If called by nominatedOwner, ownership is transferred to that address. The nominated owner is reset to the zero address.

Details

Signature

acceptOwnership()

Visibility

external

State Mutability

``

Requires

Emits

Modifiers

onlyOwner

Source

Reverts the transaction if msg.sender is not the owner.

Events

OwnerChanged

Source

Ownership has been handed over from oldOwner to newOwner, which is the new value of owner.

Signature: OwnerChanged(address oldOwner, address newOwner)

OwnerNominated

Source

newOwner has been set as the nominatedOwner.

Signature: OwnerNominated(address newOwner)