Skip to main content

AccessManager

AccessManager

This contract is responsible for managing role based access control for the Admin, Operator, and Member roles.

NOTE: Addresses granted the Admin role should be as limited as possible as this role has root level access to the network and can cause irreversible damage to the network.

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

getRoleAdmin

function getRoleAdmin(bytes32 role) external view returns (bytes32)

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0bytes32undefined

grantAdmin

function grantAdmin(address admin) external nonpayable

grants admin access to a given address

caller must have admin access

Parameters

NameTypeDescription
adminaddressundefined

grantMember

function grantMember(address member) external nonpayable

grants member access to a given address

caller must have operator access

Parameters

NameTypeDescription
memberaddressundefined

grantOperator

function grantOperator(address operator) external nonpayable

grants operator access to a given address

caller must have operator access

Parameters

NameTypeDescription
operatoraddressundefined

grantRole

function grantRole(bytes32 role, address account) external nonpayable

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role. May emit a {RoleGranted} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns

NameTypeDescription
_0boolundefined

initialize

function initialize(address admin) external nonpayable

Initializes role hierarchy and grant provided address 'admin' role access.

should be called directly after deployment (see OpenZeppelin upgradeable standards).

Parameters

NameTypeDescription
adminaddressinitial address to grant admin role access

isAdmin

function isAdmin(address admin) external view returns (bool)

returns true if the given address has admin access

Parameters

NameTypeDescription
adminaddressundefined

Returns

NameTypeDescription
_0boolundefined

isMember

function isMember(address member) external view returns (bool)

returns true if the given address has member access

Parameters

NameTypeDescription
memberaddressundefined

Returns

NameTypeDescription
_0boolundefined

isOperator

function isOperator(address operator) external view returns (bool)

returns true if the given address has operator access

Parameters

NameTypeDescription
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeAdmin

function revokeAdmin(address admin) external nonpayable

revokes admin access to a given address

caller must have admin access

Parameters

NameTypeDescription
adminaddressundefined

revokeMember

function revokeMember(address member) external nonpayable

revokes member access to a given address

caller must have operator access

Parameters

NameTypeDescription
memberaddressundefined

revokeOperator

function revokeOperator(address operator) external nonpayable

revokes operator access to a given address

caller must have operator access

Parameters

NameTypeDescription
operatoraddressundefined

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

Events

AdminAdded

event AdminAdded(address admin)

Parameters

NameTypeDescription
adminaddressundefined

AdminRemoved

event AdminRemoved(address admin)

Parameters

NameTypeDescription
adminaddressundefined

Initialized

event Initialized(uint8 version)

Parameters

NameTypeDescription
versionuint8undefined

MemberAdded

event MemberAdded(address member)

Parameters

NameTypeDescription
memberaddressundefined

MemberRemoved

event MemberRemoved(address member)

Parameters

NameTypeDescription
memberaddressundefined

OperatorAdded

event OperatorAdded(address operator)

Parameters

NameTypeDescription
operatoraddressundefined

OperatorRemoved

event OperatorRemoved(address operator)

Parameters

NameTypeDescription
operatoraddressundefined

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined