ElectionList_CleanUpVoteMandate
ElectionList_CleanUpVoteMandate is an integration mandate that cleans up the temporary voting mandate created for an election after the election has concluded.
Overview
Section titled “Overview”In the PowerLabs election system, each election can spawn a dedicated “Vote Mandate” (a clone of ElectionList_Vote) to handle voting for that specific event. This keeps permissions clean. Once the election is over and tallied, this mandate is used to revoke (remove) that temporary vote mandate from the Powers contract, keeping the system tidy.
It retrieves the address of the vote mandate to revoke by re-computing the action ID of the creation event and looking up the return data.
Configuration
Section titled “Configuration”When adopting an ElectionList_CleanUpVoteMandate instance, the following parameter is required:
CreateVoteMandate_Id(uint16): The ID of theElectionList_CreateVoteMandatethat was used to create the election. This is needed to trace the creation action.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, the inputs must match exactly the inputs used to create the election (to ensure the Action ID matches):
Title(string): The title of the election.StartBlock(uint48): The start block of the election.EndBlock(uint48): The end block of the election.
Execution Flow
Section titled “Execution Flow”-
Lookup
- Re-computes the
actionIdof the originalcreateVoteaction using the inputs (Title,StartBlock,EndBlock) and the configuredCreateVoteMandate_Id. - Queries the Powers contract for the
returnDataof that action. The return data contains the ID of the deployed vote mandate.
- Re-computes the
-
Revocation
- Decodes the
voteMandate_Idfrom the return data. - Generates a call to
IPowers.revokeMandatefor that ID.
- Decodes the
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Initializes the creator mandate ID.
- Sets input parameters to
(string Title, uint48 StartBlock, uint48 EndBlock).
handleRequest
Section titled “handleRequest”function handleRequest(...) public view override returns (...)- Performs the lookup and generates the revocation call.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|