โกDeactivating & Reactivating Hats
Last updated
Last updated
The permissions and authorities that can be accessed via a hat can be granted and revoked by designated individual or group admins, as well as based on a wide range of automated eligibility and accountability criteria using Hats Modules.
Hats Modules are programmable extensions for roles. Modules can be connected to hats to expand their functionality, such as enabling automatic granting and revocation of hats (and their associated permissions) based on specific conditions.
A hatโs toggle module is an address that determines whether the hat is active or inactive for all wearers. Toggle modules can be humanistic (as in an EOA or multisig) or mechanistic (as in a contract with custom logic) to automatically and instantly deactivate/activate the hat based on pre-defined triggers.
Toggle triggers you may use to determine whether or not a hat is active include:
Seasonal or time-specific toggle that automatically deactivates a hat at the end of a given season or period of time
Hat-based toggle that enables the wearer/s of one hat to decide on the activation/reactivation of another.
Circuit-breaker toggle to safeguard the DAO's assets and deactivate a set of hats and their associated authorities if certain conditions are met
Any custom logic you can imagine that can be represented onchain
Select "Edit Tree"
Locate and select the hat
Open the "Deactivation & Reactivation" section
You can choose between two types of modules:
Choose "Manually" in order to set a humanistic type of toggle (e.g. EAO or a Multisig)
Enter the address of the hat's toggle
Optionally, add any relevant context by adding requirements as pairs of labels and external links
Choose "Automatically" in order to set a mechanistic type of toggle (e.g. time-based automatic deactivation/activation)
Hats Modules are programmable extensions for roles. Modules can be connected to hats to expand their functionality, such as enabling automatic deactivation and reactivation of hats (and their associated permissions) based on specific conditions. For more details on Hats Modules, including what they can unlock and how builders can create new modules, see this blog post.
To deploy a toggle module for a given hat, first open the "Deactivation & Reactivation" panel for a hat within Edit Mode and select "Automatically" as detailed above. Then:
Choose "Create new Module"
Choose one of the available modules. As an example, we'll use the Pass-through Toggle module which enables the wearers of one hat to decide on the deactivation/reactivation of another hat.
Choose the module-specific parameters
Choose "Deploy & Return" to deploy the module and return to the hat edit form.
You'll be able to continue making any edits to the hat(s) and deploy them once ready.
Go here to check the complete list of available Toggle modules, including a step-by-step creation guide for each.
For more technical details on how Hats toggle modules work, see the Toggle Modules page within the "For Developers" section of these docs.