Search
⌃K

RolesAuthority

@rari-capital/solmate/src (https://github.com/Rari-Capital/@rari-capital/solmate/src/blob/main/src/auth/authorities/RolesAuthority.sol)Modified from Dappsys (https://github.com/dapphub/ds-roles/blob/master/src/roles.sol)
Role based Authority that supports up to 256 roles.

Methods

authority

function authority() external view returns (contract Authority)

Returns

Name
Type
Description
_0
contract Authority
undefined

canCall

function canCall(address user, address target, bytes4 functionSig) external view returns (bool)

Parameters

Name
Type
Description
user
address
undefined
target
address
undefined
functionSig
bytes4
undefined

Returns

Name
Type
Description
_0
bool
undefined

doesRoleHaveCapability

function doesRoleHaveCapability(uint8 role, address target, bytes4 functionSig) external view returns (bool)

Parameters

Name
Type
Description
role
uint8
undefined
target
address
undefined
functionSig
bytes4
undefined

Returns

Name
Type
Description
_0
bool
undefined

doesUserHaveRole

function doesUserHaveRole(address user, uint8 role) external view returns (bool)

Parameters

Name
Type
Description
user
address
undefined
role
uint8
undefined

Returns

Name
Type
Description
_0
bool
undefined

getRolesWithCapability

function getRolesWithCapability(address, bytes4) external view returns (bytes32)

Parameters

Name
Type
Description
_0
address
undefined
_1
bytes4
undefined

Returns

Name
Type
Description
_0
bytes32
undefined

getUserRoles

function getUserRoles(address) external view returns (bytes32)

Parameters

Name
Type
Description
_0
address
undefined

Returns

Name
Type
Description
_0
bytes32
undefined

isCapabilityPublic

function isCapabilityPublic(address, bytes4) external view returns (bool)

Parameters

Name
Type
Description
_0
address
undefined
_1
bytes4
undefined

Returns

Name
Type
Description
_0
bool
undefined

owner

function owner() external view returns (address)

Returns

Name
Type
Description
_0
address
undefined

setAuthority

function setAuthority(contract Authority newAuthority) external nonpayable

Parameters

Name
Type
Description
newAuthority
contract Authority
undefined

setOwner

function setOwner(address newOwner) external nonpayable

Parameters

Name
Type
Description
newOwner
address
undefined

setPublicCapability

function setPublicCapability(address target, bytes4 functionSig, bool enabled) external nonpayable

Parameters

Name
Type
Description
target
address
undefined
functionSig
bytes4
undefined
enabled
bool
undefined

setRoleCapability

function setRoleCapability(uint8 role, address target, bytes4 functionSig, bool enabled) external nonpayable

Parameters

Name
Type
Description
role
uint8
undefined
target
address
undefined
functionSig
bytes4
undefined
enabled
bool
undefined

setUserRole

function setUserRole(address user, uint8 role, bool enabled) external nonpayable

Parameters

Name
Type
Description
user
address
undefined
role
uint8
undefined
enabled
bool
undefined

Events

AuthorityUpdated

event AuthorityUpdated(address indexed user, contract Authority indexed newAuthority)

Parameters

Name
Type
Description
user indexed
address
undefined
newAuthority indexed
contract Authority
undefined

OwnerUpdated

event OwnerUpdated(address indexed user, address indexed newOwner)

Parameters

Name
Type
Description
user indexed
address
undefined
newOwner indexed
address
undefined

PublicCapabilityUpdated

event PublicCapabilityUpdated(address indexed target, bytes4 indexed functionSig, bool enabled)

Parameters

Name
Type
Description
target indexed
address
undefined
functionSig indexed
bytes4
undefined
enabled
bool
undefined

RoleCapabilityUpdated

event RoleCapabilityUpdated(uint8 indexed role, address indexed target, bytes4 indexed functionSig, bool enabled)

Parameters

Name
Type
Description
role indexed
uint8
undefined
target indexed
address
undefined
functionSig indexed
bytes4
undefined
enabled
bool
undefined

UserRoleUpdated

event UserRoleUpdated(address indexed user, uint8 indexed role, bool enabled)

Parameters

Name
Type
Description
user indexed
address
undefined
role indexed
uint8
undefined
enabled
bool
undefined