Hats Protocol Docs
hatsprotocol.xyzGithub
  • ๐Ÿ‘‹Welcome to Hats Protocol
  • ๐ŸงขGetting Started with Hats
  • โญQuick Start
  • Using The Hats App
    • ๐Ÿค Essentials For Hat Wearers
    • ๐ŸŽฉCreating My First Hat
    • ๐Ÿง™Admins: Creating, Issuing, and Revising Hats
    • ๐Ÿ‘ฅWhat Hats Do I Need?
    • ๐ŸŒณDrafting, Exporting, and Deploying Tree Changes
    • ๐Ÿ—๏ธSetting a Hat's Basic Properties
    • ๐ŸฅณAdding Wearers
    • ๐Ÿ”Connecting Hats w/ Permissions & Authorities
      • Types of Hat-Powered Authorities
      • Connecting Hats to Token Gates
        • Hats Protocol Contract Addresses
        • Finding a Hat's Token ID
      • Documenting Hat Powers & Responsibilities
    • ๐ŸŒŸRevocation & Eligibility: Requirements for Wearers
    • โšกDeactivating & Reactivating Hats
    • โœ…Making Hats Claimable
    • ๐Ÿ”—Linking Trees Together
    • โ›“๏ธHats Protocol Supported Chains
    • โ“Glossary & FAQ
  • Hats Integrations
    • ๐Ÿ”Permissions & Authorities
      • Coordinape
      • Council Voting Vault
      • Charmverse
      • Discord
        • Collab.Land --> Discord
        • Guild.xyz --> Discord
      • Farcaster Casting Rights
      • Fileverse
      • Google Workspace
      • Hats Account
      • Role-Based Compensation
      • Safe Multisig Signing Authority
      • Telegram
        • Collab.Land --> Telegram
        • Guild.xyz --> Telegram
      • Snapshot: Voting, Weight & Proposal Creation
      • Wonderverse
    • ๐ŸŒŸEligibility & Accountability Criteria
      • Agreement Eligibility
      • Allow-List Eligibility
      • CoLinks Eligibility
      • ERC20 Eligibility
      • ERC721 Eligibility
      • ERC1155 Eligibility
      • Hat-Wearing Eligibility
      • Hats Election Eligibility
      • JokeRace Eligibility
      • Pass-Through (Hat-Based) Eligibility
      • Staking Eligibility
      • Subscription or Membership Fee (Unlock Protocol)
      • Gitcoin Passport Eligibility
    • โšกActivation & Deactivation Criteria
      • Seasonal/ Time-Expiry Toggle
      • Pass-Through (Hat-Based) Toggle
    • ๐Ÿ‘ทHatter Modules
      • Multi Claims Hatter
      • DAOhaus Moloch v3 Membership & Share Allocation
  • For Developers
    • ๐Ÿ‘ทHats Protocol, for Developers
      • Hat Properties
      • Wearing a Hat
      • Hat Admins & Hatter Contracts
      • Hats Trees
      • Hat IDs
      • Linking Hats Trees
      • Eligibility Modules
      • Toggle Modules
      • Hat Mutability and Editing
      • Creating Hats
      • Minting Hats
      • Transfering Hats
      • Renouncing Hats
      • Batch Actions
      • Hat Image URIs
      • ERC1155 Compatibility
      • โ›“๏ธSupported Chains
    • ๐Ÿค–v1 Protocol Spec
      • Hats.sol
      • HatsEvents.sol
      • HatsErrors.sol
      • HatsIdUtilities.sol
      • Interfaces
        • IHats.sol
        • IHatsIdUtilities.sol
        • IHatsEligibility.sol
        • IHatsToggle.sol
    • ๐Ÿ–ฅ๏ธv1 SDK
      • Core
        • Getting Started
        • Onchain Reads
        • Onchain Writes
        • Multicall
        • Claiming Hats
        • Utilities
      • Subgraph
        • Getting Started
        • Fetching Hats
        • Fetching Wearers
        • Fetching Trees
        • Misc
        • Types
      • Hat Details
        • Getting Started
        • Usage
    • ๐Ÿ”ญv1 Subgraphs
    • ๐ŸงฉHats Modules
      • ๐Ÿ”ŒModules SDK
        • Getting Started
        • Get Available Modules
        • Create New Instance/s
        • Composing Modules
        • Interact With Instances
        • Utilities
        • Types
      • โš’๏ธBuilding Hats Modules
        • Inside a Hats Module
          • Immutable Arguments
          • Module Setup
          • Versioning
        • Creating New Modules
        • How Module Instances Are Deployed
        • Modules Registry
        • About Module Chains
    • ๐Ÿ”Hats Signer Gate v2
    • ๐Ÿ‘’Hats Signer Gate SDK
      • Getting Started
      • Creating New Instances
      • Hats Signer Gate
      • Multi Hats Signer Gate
      • HSG & MHSG Handlers
    • ๐Ÿ’ผHats Account SDK
      • 1 of N Hats Account
        • Getting Started
        • Creating New Instances
        • Executing From An Instance
        • Constants
        • Types
    • ๐ŸŒHats Security Audits
  • Legal
    • Terms
      • Terms of Service
      • Acceptable Use
      • Privacy Policy
      • Cookie Policy
      • Attribution
Powered by GitBook
On this page
  • Toggle Examples
  • How to Set the Toggle for a given Hat
  • Hats Modules: Programmable Extensions for Roles & Permissions
  • Digging Deeper
  1. Using The Hats App

Deactivating & Reactivating Hats

PreviousRevocation & Eligibility: Requirements for WearersNextMaking Hats Claimable

Last updated 1 year ago

The 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.

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 Examples

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

How to Set the Toggle for a given Hat

  • Select "Edit Tree"

  • Locate and select the hat

  • Open the "Deactivation & Reactivation" section

You can choose between two types of modules:

Humanistic: EOA, Multisig Address, or DAO Contract Address

  • 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

Mechanistic: Hats Modules

  • Choose "Automatically" in order to set a mechanistic type of toggle (e.g. time-based automatic deactivation/activation)

Hats Modules: Programmable Extensions for Roles & Permissions

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.

Digging Deeper

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, .

Go 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 page within the "For Developers" section of these docs.

โšก
see this blog post
here
Toggle Modules
permissions and authorities
Hats Modules