Developer Guide
Role Management
Role Management Introduction
The Role Management developer guide will describe the functions associated with Roles, Role Registry, Role Contexts, and Role Context Factory.
This enables developers to perform the following:
- Create a Role
- Update Role's name and description
- Update Role's Controller
- Update Role's Visibility
- Create a Role Context
- Add a Role to a Role Context
- Assign a Role to a wallet/EOA/smart contract
- Remove a Role from a Role Context
- Add a Role Context to a context
- Remove a Role Context from a context
- Override the default role
Role Registry
Create a Role
Use IRoleRegistry interface's createRole function to create a new Role.
To retrieve the role address, list to the transaction receipt and collect the RoleCreatedInRegistry event.
function createRole(string calldata name, string calldata description, address controller) external returns (address role);
Note: Address returned will be the role smart contract address.
Parameters
Name
Role name. e.g., "Transfer Agent"
Description
Role description. eg. "Transfer Agent performs minting, burning and etc."
Controller
Controller address. eg. transfer agent wallet address