@stdlib/ownable
This content is not available in your language yet.
Provides traits for ownable contracts. This is most commonly used trait that is required by most other traits.
To use this library, import @stdlib/ownable
:
Messages
ChangeOwner
ChangeOwnerOk
Traits
Ownable
Trait Ownable
declares an owner (non-editable) of a contract and provides a helper function requireOwner()
that checks that a message was sent by an owner.
This trait requires a field owner: Address
to be declared and exposes a getter function owner()
, which reads it from the contract.
Source code:
Usage example:
OwnableTransferable
OwnableTransferable
is an extension of an Ownable
that allows to transfer ownership of a contract to another address. It provides a secure handle Message ChangeOwner
that could be called by an owner to transfer ownership.
If the owner transfer request succeeds, the contract will reply with a ChangeOwnerOk
Message.
Source code:
Usage example: