Skip to content

Solidity API

IPropsAccessControl

Interface for the PropsAccessControl contract, defining role-based access control functions

This interface provides methods for managing roles and permissions within the system

isDiamondOwner

solidity
function isDiamondOwner(address account) external view returns (bool)

Checks if an account is the diamond owner

This function verifies if the given account has the highest level of access

Parameters

NameTypeDescription
accountaddressThe address of the account to check

Return Values

NameTypeDescription
[0]boolbool True if the account is the diamond owner, false otherwise

grantRole

solidity
function grantRole(bytes32 role, address account) external

Grants a role to an account

This function assigns a specific role to the given account

Parameters

NameTypeDescription
rolebytes32The identifier of the role to grant
accountaddressThe address of the account to receive the role

hasRole

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

Checks if an account has a specific role

This function verifies if the given account has been granted a particular role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check
accountaddressThe address of the account to check

Return Values

NameTypeDescription
[0]boolbool True if the account has the role, false otherwise

hasMinimumRole

solidity
function hasMinimumRole(bytes32 role) external view returns (bool)

Checks if the caller has at least the specified role

This function verifies if the calling account has the specified role or a higher-level role

Parameters

NameTypeDescription
rolebytes32The identifier of the minimum role to check

Return Values

NameTypeDescription
[0]boolbool True if the caller has at least the specified role, false otherwise

getRoleAdmin

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

Returns the admin role for a specified role

This function retrieves the identifier of the role that can manage the given role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check

Return Values

NameTypeDescription
[0]bytes32bytes32 The identifier of the admin role

revokeRole

solidity
function revokeRole(bytes32 role, address account) external

Revokes a role from an account

This function removes a specific role from the given account

Parameters

NameTypeDescription
rolebytes32The identifier of the role to revoke
accountaddressThe address of the account to revoke the role from

renounceRole

solidity
function renounceRole(bytes32 role) external

Allows an account to renounce a role

This function allows the calling account to give up a role it possesses

Parameters

NameTypeDescription
rolebytes32The identifier of the role to renounce

getRoleMember

solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)

Returns a role member by index

This function retrieves the address of an account that has been granted a specific role, based on its index

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check
indexuint256The index of the member within the role's list of members

Return Values

NameTypeDescription
[0]addressaddress The address of the role member

getRoleMemberCount

solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)

Returns the number of accounts that have a specific role

This function counts how many accounts have been granted a particular role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check

Return Values

NameTypeDescription
[0]uint256uint256 The number of accounts with the role

setRoleAdmin

solidity
function setRoleAdmin(bytes32 role, bytes32 adminRole) external

Sets the admin role for a specified role

This function changes which role is responsible for managing another role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to set the admin for
adminRolebytes32The identifier of the new admin role

checkRole

solidity
function checkRole(bytes32 role) external view

Checks if the caller has a specific role

This function verifies if the calling account has been granted a particular role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check

checkRole

solidity
function checkRole(bytes32 role, address account) external view

Checks if an account has a specific role

This function verifies if the given account has been granted a particular role

Parameters

NameTypeDescription
rolebytes32The identifier of the role to check
accountaddressThe address of the account to check