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:

  1. maxRoleHolders (uint256): Maximum number of accounts that can be assigned the role

  2. roleID (uint256): The role ID that can be directly assigned/revoked

Usage

Proposing an Action

When calling the law, two parameters must be provided:

  1. target (address): The account to assign/revoke the role from

  2. assign (bool):

    • true: Assign the role to the target

    • false: Revoke the role from the target

Execution Flow

  1. Target Validation

    • Verifies the target address

    • Checks target's current role status

    • Validates maximum role holders limit

  2. Role Assignment

    • If assign is true:

      • Checks if target already has the role

      • Verifies maximum role holders limit

      • Assigns role if conditions are met

    • If assign is false:

      • Verifies target has the role

      • Revokes role if conditions are met

  3. State Management

    • Updates directly assigned accounts list

    • Maintains sorted list of accounts

    • Records state changes

Technical Specifications

State Variables

Functions

initializeLaw

  • Initializes law with configuration parameters

  • Sets up maximum role holders and role ID

  • Initializes empty directly assigned lists

handleRequest

  • Processes the direct assignment request

  • Validates target's role status

  • Prepares role assignment/revocation call

  • Returns execution data

_changeState

  • Updates directly assigned accounts list

  • Maintains sorted list of accounts

  • Handles both assignments and revocations

getData

  • Returns the current state of the law

  • Includes all configuration and directly assigned accounts

Error Conditions

  1. Role Assignment Errors

    • "Account already has role"

    • "Max role holders reached"

  2. Role Revocation Errors

    • "Account does not have role"

  3. Validation Errors

    • Invalid role ID

    • Invalid target address

    • Zero address target

Current Deployments

Chain ID
Chain Name
Address

421614

Arbitrum Sepolia

0xa797799EE0C6FA7d9b76eF52e993288a04982267

11155420

Optimism Sepolia

0xa797799EE0C6FA7d9b76eF52e993288a04982267

11155111

Ethereum Sepolia

0xa797799EE0C6FA7d9b76eF52e993288a04982267

Last updated