IAuthorizer_v1.sol
Inherits: IAccessControlEnumerable
Functions
checkForRole
Checks whether an address holds the required role to execute the current transaction.
The calling contract needs to generate the right role ID using its own address and the role identifier. In modules, this function should be used instead of hasRole
, as there are Authorizer-specific checks that need to be performed.
Parameters
role
bytes32
The identifier of the role we want to check
who
address
The address on which to perform the check.
Returns
<none>
bool
bool Returns if the address holds the role
generateRoleId
Helper function to generate a bytes32 role hash for a module role.
Parameters
module
address
The address of the module to generate the hash for.
role
bytes32
The ID number of the role to generate the hash for.
Returns
<none>
bytes32
bytes32 Returns the generated role hash.
grantRoleFromModule
Used by a Module to grant a role to a user.
Parameters
role
bytes32
The identifier of the role to grant.
target
address
The address to which to grant the role.
grantRoleFromModuleBatched
Used by a Module to grant a role to a set of users.
Parameters
role
bytes32
The identifier of the role to grant.
targets
address[]
The addresses to which to grant the role.
revokeRoleFromModule
Used by a Module to revoke a role from a user.
Parameters
role
bytes32
The identifier of the role to revoke.
target
address
The address to revoke the role from.
revokeRoleFromModuleBatched
Used by a Module to revoke a role from a set of users.
Parameters
role
bytes32
The identifier of the role to revoke.
targets
address[]
The address to revoke the role from.
transferAdminRole
Transfer the admin rights to a given role.
Parameters
roleId
bytes32
The role on which to peform the admin transfer.
newAdmin
bytes32
The new role to which to transfer admin access to.
burnAdminFromModuleRole
Irreversibly burns the admin of a given role.
The module itself can still grant and revoke it's own roles. This only burns third-party access to the role.
Parameters
role
bytes32
The role to remove admin access from.
grantGlobalRole
Grants a global role to a target.
Only the addresses with the Admin role should be able to call this function.
Parameters
role
bytes32
The role to grant.
target
address
The address to grant the role to.
grantGlobalRoleBatched
Grants a global role to a set of targets.
Only the addresses with the Admin role should be able to call this function.
Parameters
role
bytes32
The role to grant.
targets
address[]
The addresses to grant the role to.
revokeGlobalRole
Revokes a global role from a target.
Only the addresses with the Admin role should be able to call this function.
Parameters
role
bytes32
The role to grant.
target
address
The address to grant the role to.
revokeGlobalRoleBatched
Revokes a global role from a set of targets.
Only the addresses with the Admin role should be able to call this function.
Parameters
role
bytes32
The role to grant.
targets
address[]
The addresses to grant the role to.
getAdminRole
Returns the role ID of the admin role.
Returns
<none>
bytes32
The role ID.
Errors
Module__Authorizer__NotActiveModule
The function is only callable by an active Module.
Parameters
module
address
The address of the module.
Module__Authorizer__ModuleNotSelfManaged
The function is only callable if the Module is self-managing its roles.
Module__Authorizer__AdminRoleCannotBeEmpty
There always needs to be at least one admin.
Module__Authorizer__OrchestratorCannotHaveAdminRole
The orchestrator cannot own itself.
Module__Authorizer__InvalidInitialAdmin
The provided initial admin address is invalid.
Last updated