Peer Select
PeerSelect is an electoral mandate that allows an authorized caller to select exactly N nominees from a candidate list, fully replacing the current set of role holders with the new selection. It is designed as a one-time-use mandate: after execution, it revokes itself.
Overview
Section titled “Overview”This mandate allows an authorized caller to:
- View the current list of nominees from a
Nomineescontract. - Submit a boolean selection array — one entry per nominee.
- Revoke the role from all current holders.
- Assign the role to the selected nominees.
- Revoke the mandate itself, preventing it from being executed again.
This is a full reset mechanism, not a toggle. Every execution replaces the entire set of role holders with the chosen nominees.
Configuration
Section titled “Configuration”When adopting a PeerSelect instance, the following parameters are required:
numberToSelect(uint8): The exact number of nominees that must be selected. The caller must select precisely this many — no more, no fewer.roleId(uint256): The role ID to be assigned to the selected nominees (and revoked from all current holders).NomineesContract(address): The address of the Nominees helper contract providing the list of candidates.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, one parameter must be provided:
selection(bool[]): An array of booleans, one per nominee in theNomineesContractlist.true: Select this nominee for the role.false: Do not select this nominee.
The array length must exactly match the current number of nominees, and exactly numberToSelect entries must be true.
Execution Flow
Section titled “Execution Flow”-
Validation
- Verifies that the
selectionarray length matches the nominee list length. - Verifies there are at least
numberToSelectnominees available. - Verifies that the number of
trueentries equals exactlynumberToSelect.
- Verifies that the
-
Role Reset
- Revokes the role from every current role holder.
-
Role Assignment
- Assigns the role to each selected nominee.
-
Self-Revocation
- Revokes the mandate itself (
revokeMandate), making it impossible to execute again. This ensures PeerSelect is a one-time selection event.
- Revokes the mandate itself (
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Initializes configuration.
- Dynamically generates the input parameter list from the current nominee addresses at the time of initialization (one
boolper nominee).
handleRequest
Section titled “handleRequest”function handleRequest(...) public view virtual override returns (...)- Validates the selection array.
- Builds revocation calls for all current role holders.
- Builds assignment calls for selected nominees.
- Appends a final
revokeMandatecall targeting itself.
Error Conditions
Section titled “Error Conditions”"Invalid selection length."— Theselectionarray length does not match the current nominee count."Not enough nominees to fill the seats."— Fewer nominees exist thannumberToSelectrequires."Must select exactly numberToSelect options."— The number oftrueentries in the selection does not equalnumberToSelect.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|