Skip to content

ElectionRegistry_Nominate

ElectionRegistry_Nominate is an integration mandate that allows users to self-nominate (or withdraw) from a specific election managed by the ElectionRegistry contract.

This mandate acts as the registration booth for an election. It interacts with the ElectionRegistry helper contract to add or remove candidates. Unlike the generic Nominate mandate (which operates on a global or single-purpose Nominees list), this mandate is aware of specific election instances identified by their parameters.

Usually, two separate instances of this mandate are deployed for an election system:

  1. One configured to Nominate (shouldNominate = true).
  2. One configured to Revoke Nomination (shouldNominate = false).

When adopting an ElectionRegistry_Nominate instance, the following parameters are required:

  1. ElectionRegistry (address): The address of the ElectionRegistry helper contract.
  2. shouldNominate (bool): The mode of operation.
    • true: The mandate will nominate the caller.
    • false: The mandate will revoke the caller’s nomination.

When calling the mandate, one parameter must be provided:

  1. Title (string): The title of the election. The unique election ID is derived from this title and the Powers contract address.
  1. Identification

    • Computes the unique electionId hash from the inputs and the Powers address.
  2. Action

    • Nominate Mode: Calls nominate(electionId, caller) on the ElectionRegistry contract.
    • Revoke Mode: Calls revokeNomination(electionId, caller) on the ElectionRegistry contract.
function initializeMandate(...) public override
  • Initializes the ElectionRegistry address and mode.
  • Sets input parameters to (string Title).
function handleRequest(...) public view override returns (...)
  • Computes the ID.
  • Generates the appropriate call to the ElectionRegistry.
Chain IDChain NameAddress