ElectionList_CreateVoteMandate
ElectionList_CreateVoteMandate is an integration mandate that initiates a new election by deploying a dedicated “Vote Mandate”.
Overview
Section titled “Overview”In the PowerLabs election system, voting rights and logic are encapsulated in a temporary mandate (an instance of ElectionList_Vote). This mandate factory handles the creation of these instances. When executed, it:
- Calculates a unique ID for the new election based on the proposal details.
- Deploys/Adopts a new
ElectionList_Votemandate configured for that specific election. - Configures the new mandate to be accessible only by a specific
voterRoleId.
This separation ensures that each election is isolated and access-controlled.
Configuration
Section titled “Configuration”When adopting an ElectionList_CreateVoteMandate instance, the following parameters are required:
ElectionList(address): The address of the ElectionList helper contract.ElectionList_Vote(address): The address of theElectionList_Votemandate implementation (used as a template).maxVotes(uint256): The maximum number of votes a voter can cast in the spawned elections.voterRoleId(uint256): The role ID that will be granted permission to call (vote in) the spawned mandate.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, three parameters must be provided to define the election:
Title(string): A descriptive title for the election.StartBlock(uint48): The block number when the election starts.EndBlock(uint48): The block number when the election ends.
Execution Flow
Section titled “Execution Flow”-
Initialization
- Computes a unique
electionIdhash from the inputs and the Powers address. - Prepares the initialization data (
MandateInitData) for a newElectionList_Votemandate. - Sets the configuration of the new mandate to point to the correct
ElectionListandelectionId. - Sets the
allowedRolecondition of the new mandate to the configuredvoterRoleId.
- Computes a unique
-
Adoption
- Generates a call to
IPowers.adoptMandateto install the new vote mandate. - Returns the adoption call for execution.
- Generates a call to
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Initializes the factory configuration.
- Sets input parameters to
(string Title, uint48 StartBlock, uint48 EndBlock).
handleRequest
Section titled “handleRequest”function handleRequest(...) public view override returns (...)- Constructs the
MandateInitDatafor the new vote mandate. - Encodes the adoption call.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|