Skip to main content

OwnableAccessManager

Git Source

OwnableAccessManager

A middleware extension that restricts access to a single owner address

Implements AccessManager with owner-based access control

Methods

__OwnableAccessManager_init

function __OwnableAccessManager_init(
address owner_
) internal onlyInitializing

Initializes the contract with an owner address

Parameters

NameTypeDescription
owner_addressThe address to set as the owner

owner

function owner() public view returns (address) 

Error thrown when a non-owner address attempts to call a restricted function

Returns

NameTypeDescription
address

_checkAccess

function _checkAccess() internal view virtual override 

Checks if the caller has access (is the owner)

Reverts if the caller is not the owner

setOwner

function setOwner(
address owner_
) public checkAccess

Updates the owner address

Can only be called by the current owner

Parameters

NameTypeDescription
owner_addressThe new owner address

renounceOwnership

function renounceOwnership() public virtual 

Renounces the ownership of the contract

Can only be called by the current owner