IAccessControlFacet
It defines the basic interface of AccessControl Facet.
RoleGranted
Emitted at grantRole().
RoleGrantedForId
Emitted at grantRoleForId().
RoleMultipleGranted
Emitted at grantRoleMultiple().
RoleMultipleGrantedForId
Emitted at grantRoleMultipleForId().
RoleRevoked
Emitted at revokeRole().
RoleRevokedForId
Emitted at revokeRoleForId().
RoleMultipleRevoked
Emitted at revokeRoleMultiple().
RoleMultipleRevokedForId
Emitted at revokeRoleMultipleForId().
RoleHandlerAdded
Emitted at addRoleHandler().
RoleHandlerRemoved
Emitted at removeRoleHandler().
AdminChanged
Emitted at changeAdmin().
AccessControlInitialized
Emitted at initAccessControlFacet().
TrustedForwarderUpdated
Emitted at updateTrustedForwarder().
initAccessControlFacet
Initializes the AccessControlFacetStorage by setting the Admin of the tmi-tokenizer platform.
admin cannot be address(0).
Emmits a {AccessControlInitialized} event.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to be the designated Admin of the tmi-tokenizer platform, responsible for managing permissions. |
hasRole
Checks whether a specific account holds a specified role within the tmi-fractions platform.
This function verifies role-based permissions within a platform-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The role identifier to check. |
| account | address | The address to verify for the specified role. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | true if account holds role; false otherwise. |
hasRoleForId
Checks whether a specific account holds a specified role within a given campaign.
This function verifies role-based permissions within a campaign-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The role identifier to check. |
| account | address | The address to verify for the specified role in the given campaign. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | true if account holds role within campaignId; false otherwise. |
getRolesOf
Returns all the roles that a specified account holds within a platform-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to query for platform-scoped roles. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes32[] | An array of all the platform-scoped roles that account holds. |
getAccountsWithRole
Returns all the accounts that hold the specified role within a platform-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The role to check for. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address[] | An array of all the accounts that hold the specified role. |
getRolesOfAccountForId
Returns all the roles that a specified account holds within a campaign-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| account | address | The address to query for the targeted campaign-scoped roles. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes32[] | An array of all the roles held by account within campaignId. |
getAccountsWithRoleForId
Returns all the accounts that hold a specified role within a given campaign.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The role to check for. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address[] | An array of all the accounts that hold the specified role within campaignId. |
getHandledRolesOf
Returns all the roles that a specified account is a role handler for.
A role handler manages its role both in a platform-scoped and campaign-scoped context.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account to check. |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bytes32[] | An array of all the roles that account is a role handler for. |
grantRole
Grants role to account within a platform-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleGranted} event.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to grant. |
| account | address | The address to which role is granted. |
grantRoleForId
Grants role to account within a campaign-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleGrantedForId} event.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The identifier of the role to grant. |
| account | address | The address to which role is granted. |
grantRoleMultiple
Grants role to multiple accounts within a platform-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleMultipleGranted} event.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to grant. |
| accounts | address[] | An array of addresses to which role is granted. |
grantRoleMultipleForId
Grants role to multiple accounts within a campaign-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleMultipleGrantedForId} event.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The identifier of the role to grant. |
| accounts | address[] | An array of addresses to which role is granted. |
revokeRole
Revokes role from account within a platform-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleRevoked} event.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to revoke. |
| account | address | The address from which role is revoked. |
revokeRoleForId
Revokes role from account within a campaign-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleRevokedForId} event.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The identifier of the role to revoke. |
| account | address | The address from which role is revoked. |
revokeRoleMultiple
Revokes role from multiple accounts within a platform-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleMultipleRevoked} event.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to revoke. |
| accounts | address[] | An array of addresses from which role is revoked. |
revokeRoleMultipleForId
Revokes role from multiple accounts within a campaign-scoped context.
Only callable by the Admin or a handler of role.
Emits a {RoleMultipleRevokedForId} event.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| role | bytes32 | The identifier of the role to revoke. |
| accounts | address[] | An array of addresses from which role is revoked. |
addRoleHandler
Delegates the handling of role to the specified account, allowing account to manage
the granting and revocation of this role.
_Only callable by the Admin.
Designated role handlers can manage the associated roles both at the platform level (platform-scoped context) and within individual campaigns (campaign-scoped context).
Emits a {RoleHandlerAdded} event._
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to delegate handling for. |
| account | address | The address to be designated as a role handler for role. |
removeRoleHandler
Revokes role handling privileges from the specified account, preventing account from managing
the granting and revocation of this role.
Only callable by the Admin. Emits a {RoleHandlerRemoved} event.
Parameters
| Name | Type | Description |
|---|---|---|
| role | bytes32 | The identifier of the role to revoke handling for. |
| account | address | The address to be removed as a role handler for role. |
changeAdmin
Replaces the current Admin with a new Admin.
Only callable by the (current) Admin. In this version, only one Admin is supported per tokenizer platform. Emits an {AdminChanged} event.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address of the new Admin. |
updateTrustedForwarder
Updates the trusted forwarder.
Only callable by the Admin. Emits an {TrustedForwarderUpdated} event.
Parameters
| Name | Type | Description |
|---|---|---|
| newForwarder | address | The address of the new forwarder. |

