Renounce Role
RenounceRole is an electoral mandate that allows users to voluntarily resign from specific roles they currently hold.
Overview
Section titled “Overview”This mandate provides a mechanism for self-revocation. It is useful for roles where members should be able to leave at will (e.g., opting out of a committee or resigning from a position) without needing an external authority to process the removal. The mandate is configured with a whitelist of roles that can be renounced.
Configuration
Section titled “Configuration”When adopting a RenounceRole instance, the following parameter is required:
allowedRoleIds(uint256[]): An array of role IDs that this mandate is authorized to process. Users can only renounce roles included in this list.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, one parameter must be provided:
roleId(uint256): The specific role ID the caller wishes to renounce.
Execution Flow
Section titled “Execution Flow”-
Validation
- Ownership Check: Verifies that the caller currently holds the specified
roleIdin the Powers contract. - Permission Check: Verifies that the
roleIdis present in theallowedRoleIdsconfiguration list.
- Ownership Check: Verifies that the caller currently holds the specified
-
Revocation
- If checks pass, the mandate generates a
revokeRolecall targeting the caller and the specified role. - The role is immediately revoked upon execution.
- If checks pass, the mandate generates a
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate( uint16 index, string memory nameDescription, bytes memory inputParams, bytes memory config) public override- Initializes the allowed role IDs.
- Sets input parameters to
(uint256 roleId).
handleRequest
Section titled “handleRequest”function handleRequest(...) public view virtual override returns (...)- Performs ownership and permission checks.
- Returns the revocation call.
Error Conditions
Section titled “Error Conditions”- Validation Errors
- “Account does not have role.”: The caller is trying to renounce a role they don’t hold.
- “Role not allowed to be renounced.”: The requested role ID is not in the allowed list.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|