Administrable

Git Source

Inherits: IAdministrable

Author: mortimr @ Kiln

This contract provides all the utilities to handle the administration and its transfer.

Unstructured Storage Friendly

State Variables

$admin

The admin address in storage.

Slot: keccak256(bytes("administrable.admin")) - 1

types.Address internal constant $admin =
    types.Address.wrap(0x927a17e5ea75d9461748062a2652f4d3698a628896c9832f8488fa0d2846af09);

$pendingAdmin

The pending admin address in storage.

Slot: keccak256(bytes("administrable.pendingAdmin")) - 1

types.Address internal constant $pendingAdmin =
    types.Address.wrap(0x3c1eebcc225c6cc7f5f8765767af6eff617b4139dc3624923a2db67dbca7b68e);

Functions

onlyAdmin

This modifier ensures that only the admin is able to call the method.

modifier onlyAdmin();

onlyPendingAdmin

This modifier ensures that only the pending admin is able to call the method.

modifier onlyPendingAdmin();

admin

Retrieve the admin address.

function admin() external view returns (address);

Returns

NameTypeDescription
<none>addressadminAddress The admin address

pendingAdmin

Retrieve the pending admin address.

function pendingAdmin() external view returns (address);

Returns

NameTypeDescription
<none>addresspendingAdminAddress The pending admin address

transferAdmin

Propose a new admin.

Only callable by the admin.

function transferAdmin(address newAdmin) external onlyAdmin;

Parameters

NameTypeDescription
newAdminaddressThe new admin to propose

acceptAdmin

Accept an admin transfer.

Only callable by the pending admin.

function acceptAdmin() external onlyPendingAdmin;

_getAdmin

Retrieve the admin address.

function _getAdmin() internal view returns (address);

Returns

NameTypeDescription
<none>addressThe admin address

_setAdmin

Change the admin address.

function _setAdmin(address newAdmin) internal;

Parameters

NameTypeDescription
newAdminaddressThe new admin address

_getPendingAdmin

Retrieve the pending admin address.

function _getPendingAdmin() internal view returns (address);

Returns

NameTypeDescription
<none>addressThe pending admin address

_setPendingAdmin

Change the pending admin address.

function _setPendingAdmin(address newPendingAdmin) internal;

Parameters

NameTypeDescription
newPendingAdminaddressThe new pending admin address