Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AxlOwnable

Git Source

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

NameTypeDescription
_owneraddressAddress 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

NameTypeDescription
owner_addressThe current owner of the contract

pendingOwner

Returns the pending owner of the contract.

function pendingOwner() public view returns (address owner_);

Returns

NameTypeDescription
owner_addressThe 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

NameTypeDescription
newOwneraddressThe 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

NameTypeDescription
newOwneraddressThe 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

NameTypeDescription
newOwneraddressThe address to transfer ownership to