TaxSelect.sol
DirectSelect.sol is an electoral law that enables direct assignment or revocation of a specific role to any account. It provides a mechanism for authorized accounts to manage role assignments without requiring nominations.
Overview
This law provides a mechanism to:
Directly assign a specific role to any account
Directly revoke a role from any account
Track directly assigned accounts
Enforce maximum role holder limits
Configuration
When adopting a DirectSelect instance, two parameters must be provided:
maxRoleHolders(uint256): Maximum number of accounts that can be assigned the roleroleID(uint256): The role ID that can be directly assigned/revoked
Usage
Proposing an Action
When calling the law, two parameters must be provided:
target(address): The account to assign/revoke the role fromassign(bool):true: Assign the role to the targetfalse: Revoke the role from the target
Execution Flow
Target Validation
Verifies the target address
Checks target's current role status
Validates maximum role holders limit
Role Assignment
If
assignis true:Checks if target already has the role
Verifies maximum role holders limit
Assigns role if conditions are met
If
assignis false:Verifies target has the role
Revokes role if conditions are met
State Management
Updates directly assigned accounts list
Maintains sorted list of accounts
Records state changes
Technical Specifications
State Variables
Functions
initializeLaw
initializeLawInitializes law with configuration parameters
Sets up maximum role holders and role ID
Initializes empty directly assigned lists
handleRequest
handleRequestProcesses the direct assignment request
Validates target's role status
Prepares role assignment/revocation call
Returns execution data
_changeState
_changeStateUpdates directly assigned accounts list
Maintains sorted list of accounts
Handles both assignments and revocations
getData
getDataReturns the current state of the law
Includes all configuration and directly assigned accounts
Error Conditions
Role Assignment Errors
"Account already has role"
"Max role holders reached"
Role Revocation Errors
"Account does not have role"
Validation Errors
Invalid role ID
Invalid target address
Zero address target
Current Deployments
421614
Arbitrum Sepolia
0xa797799EE0C6FA7d9b76eF52e993288a04982267
11155420
Optimism Sepolia
0xa797799EE0C6FA7d9b76eF52e993288a04982267
11155111
Ethereum Sepolia
0xa797799EE0C6FA7d9b76eF52e993288a04982267
Last updated