# IAccessControl

*Developer note: External interface of AccessControl declared to support ERC165 detection.*

## Events

### RoleAdminChanged

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

\*Developer note: Emitted when \`newAdminRole\` is set as \`\`role\`\`'s admin role, replacing \`previousAdminRole\`

\`DEFAULT\_ADMIN\_ROLE\` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.

*Available since v3.1.*\*

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role              | bytes32 |             |
| previousAdminRole | bytes32 |             |
| newAdminRole      | bytes32 |             |

### RoleGranted

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

\*Developer note: Emitted when \`account\` is granted \`role\`.

\`sender\` is the account that originated the contract call, an admin role bearer except when using {AccessControl-\_setupRole}.\*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |
| sender  | address |             |

### RoleRevoked

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

\*Developer note: Emitted when \`account\` is revoked \`role\`.

\`sender\` is the account that originated the contract call:

* if using \`revokeRole\`, it is the admin role bearer
* if using \`renounceRole\`, it is the role bearer (i.e. \`account\`)\*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |
| sender  | address |             |

## Functions

### hasRole

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

*Developer note: Returns \`true\` if \`account\` has been granted \`role\`.*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |

**Returns:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| \[0] | bool |             |

### getRoleAdmin

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

\*Developer note: Returns the admin role that controls \`role\`. See {grantRole} and {revokeRole}.

To change a role's admin, use {AccessControl-\_setRoleAdmin}.\*

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 |             |

**Returns:**

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \[0] | bytes32 |             |

### grantRole

`function grantRole(bytes32 role, address account) external` external

\*Developer note: 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.\*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |

### revokeRole

`function revokeRole(bytes32 role, address account) external` external

\*Developer note: Revokes \`role\` from \`account\`.

If \`account\` had been granted \`role\`, emits a {RoleRevoked} event.

Requirements:

* the caller must have \`\`role\`\`'s admin role.\*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |

### renounceRole

`function renounceRole(bytes32 role, address account) external` external

\*Developer note: 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 granted \`role\`, emits a {RoleRevoked} event.

Requirements:

* the caller must be \`account\`.\*

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 |             |
| account | address |             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.algebra.finance/algebra-integral-documentation/algebra-v1-technical-reference/contracts/api-reference-v2.0-directional-fees/v2.0-directional-fees-tokenomics/iaccesscontrol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
