JokeRace Eligibility
Tying hat eligibility to the results of a JokeRace Contest
Last updated
Tying hat eligibility to the results of a JokeRace Contest
Last updated
JokeRace enables communities to make, execute, and reward decisions onchain. Hats can read the results from a JokeRace contest and ensure that only the submitters of the top-voted proposals can wear a given hat and hold the powers associated with that hat. This removes the need for a trusted group of executors to accurately implement the results of a contest or election.
Built into a Hats-powered election is a term limit function. Once the specified term ends, the hat and its associated powers are automatically revoked and a new election can be triggered.
The module's code is open source and is available here.
See below for instructions on how to implement this eligibility module.
Using this module enables the wearers of the "Elected Role" hat to be the winners of a chosen JokeRace election:
Any JokeRace election can be used for any hat, even elections that were held in the past or ones scheduled in the future. Following is the election for the "Elected Role" hat:
The top 5 most voted candidates in the election are the ones eligible for the role, for a term period of 1 year, as defined in the module.
Go to the tree that includes the hat you wish to create the module for
Select "Edit Tree"
Locate and select the hat
Open the "Revocation & Eligibility" section
Choose "Automatically" and then choose "Create new Module". This will open the module creation form
Choose "JokeRace Eligibility" in the module type
Fill in the module-specific parameters
Choose "Deploy & Return" to deploy the module and return to the hat edit form. The module address will be automatically updated on the hat's eligibility property in the form. Once you deploy these changes, the hat's eligibility will be updated.
Once the module is attached to the hat, you can view the hat's updated eligibility criteria:
Select the hat
In the eligibility section, you can view:
The module's public actions
The module's general description
The module's live parameters
Admin Hat ID
Jokerace contest address
Ending time of the current term
Number of wearers that are elected to this role
Useful links
The module's source code on GitHub
The module has one special roles, which is set at the module's creation. The role is granted to a hat/s, providing its wearers certain authorities in the module:
Admin - can set up new terms.
To view or perform the Admin's authorities:
Select the admin hat
In the Authorities section, locate the Jokerace Admin authority card