AxlOwnable
Inherits: IOwnable
Title: AxlOwnable
A contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. The owner account is set through ownership transfer. This module makes it possible to transfer the ownership of the contract to a new account in one step, as well as to an interim pending owner. In the second flow the ownership does not change until the pending owner accepts the ownership transfer.
State Variables
_OWNER_SLOT
bytes32 internal constant _OWNER_SLOT = 0x02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c0
_OWNERSHIP_TRANSFER_SLOT
bytes32 internal constant _OWNERSHIP_TRANSFER_SLOT =
0x9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d1
Functions
constructor
Initializes the contract by transferring ownership to the owner parameter.
constructor(address _owner) ;
Parameters
| Name | Type | Description |
|---|---|---|
_owner | address | Address to set as the initial owner of the contract |
onlyOwner
Modifier that throws an error if called by any account other than the owner.
modifier onlyOwner() ;
owner
Returns the current owner of the contract.
function owner() public view returns (address owner_);
Returns
| Name | Type | Description |
|---|---|---|
owner_ | address | The current owner of the contract |
pendingOwner
Returns the pending owner of the contract.
function pendingOwner() public view returns (address owner_);
Returns
| Name | Type | Description |
|---|---|---|
owner_ | address | The pending owner of the contract |
transferOwnership
Transfers ownership of the contract to a new account newOwner.
Can only be called by the current owner.
function transferOwnership(address newOwner) external virtual onlyOwner;
Parameters
| Name | Type | Description |
|---|---|---|
newOwner | address | The address to transfer ownership to |
proposeOwnership
Propose to transfer ownership of the contract to a new account newOwner.
Can only be called by the current owner. The ownership does not change until the new owner accepts the ownership transfer.
function proposeOwnership(address newOwner) external virtual onlyOwner;
Parameters
| Name | Type | Description |
|---|---|---|
newOwner | address | The address to transfer ownership to |
acceptOwnership
Accepts ownership of the contract.
Can only be called by the pending owner
function acceptOwnership() external virtual;
_transferOwnership
Internal function to transfer ownership of the contract to a new account newOwner.
Called in the constructor to set the initial owner.
function _transferOwnership(address newOwner) internal virtual;
Parameters
| Name | Type | Description |
|---|---|---|
newOwner | address | The address to transfer ownership to |