Version 0.3.2
An expanded Owned
API for safe two stage ownership transfers.
This API encodes a safe pattern of ownership transfers in which ownership does not change until the new owner accepts the ownership thus proving the new owner address is capable of calling. This prevents inadvertant loss of contract control by assigning ownership to an incorrect address.
This contract does not initialise the owner with an address and must be done by the deriving contract
OwnedAbstract <- Owned
[{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangeOwnerTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_oldOwner","type":"address"},{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangedOwner","type":"event"}]
function owner() public constant returns (address);
Returns the address of the contract's current owner.
function newOwner() public constant returns (address);
Returns the address which is permissioned to accept ownership of the contract
function changeOwner(address _newOwner) public returns (bool);
Permissions an address to accept ownership.
_newOwner
The address to permission ownership acceptance.
Returns success boolean
function acceptOwnership() public returns (bool);
Allows a permissioned address to take ownership of the contract.
event ChangeOwnerTo(address indexed _newOwner);
Logged on initiation of ownership transfer.
event ChangedOwner(address indexed _oldOwner, address indexed _newOwner);
Logged on change of owner address.
A contract of type Owning
provisions the contract to call acceptOwnership()
upon an Owned
contract.
OwnedAbstract <- Owned -.
|
OwningItfc <------------+- Owning
[{"constant":false,"inputs":[{"name":"_kAddr","type":"address"}],"name":"receiveOwnershipOf","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_kAddr","type":"address"},{"name":"_owner","type":"address"}],"name":"changeOwnerOf","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_kAddr","type":"address"}],"name":"ReceivedOwnership","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_kAddr","type":"address"},{"indexed":true,"name":"_owner","type":"address"}],"name":"ChangeOwnerOf","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangeOwnerTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_oldOwner","type":"address"},{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangedOwner","type":"event"}]
function receiveOwnershipOf(address _kAddr) public returns (bool);
Calls acceptOwnership()
upon an Owned
contract.
_kAddr
The address of a contract.
Returns boolean success value
function changeOwnerOf(address _kAddr, address _owner) public returns (bool)
Change the owner of the owned contract _kAddr
to _owner
_kAddr
The address of the owned contract
_owner
The address of the new owner
Returns boolean success value
event ReceivedOwnership(address indexed _kAddr);
Logged when a contract accepts ownership of another contract.
Disownable is an Owned
contract that explicitly allows deleting the owner
. This may be a requirement for trustless contracts.
OwnedAbstract <- Owned -.
|
DisownableItfc <--------+- Disownable
[{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_safePhrase","type":"bytes32"}],"name":"burnOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangeOwnerTo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_oldOwner","type":"address"},{"indexed":true,"name":"_newOwner","type":"address"}],"name":"ChangedOwner","type":"event"}]
function burnOwnership(bytes32 _safePhrase);
Deletes the owner
state variable.
WARNING: This will block all calls to functions which are permissioned only to the owner.
_safePhrase
Must be equal to the string "This contract is to be disowned."
Returns boolean success value