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
¶
The currently-nominated owner.
Type: address
owner
¶
The contract owner.
Type: address
Constructor¶
constructor
¶
Initialises the owner of this contract.
Details
Signature
constructor(address _owner)
Visibility
public
State Mutability
``
Requires
Emits
Restricted Functions¶
nominateNewOwner
¶
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
¶
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
¶
Reverts the transaction if msg.sender
is not the owner
.
Events¶
OwnerChanged
¶
Ownership has been handed over from oldOwner
to newOwner
, which is the new value of owner
.
Signature: OwnerChanged(address oldOwner, address newOwner)
OwnerNominated
¶
newOwner
has been set as the nominatedOwner
.
Signature: OwnerNominated(address newOwner)