# ERC20 Eligibility

## **Overview**

A Hats Protocol eligibility module that checks if an address owns a minimum balance of an ERC20 token to determine eligibility.

The module's code is open source and is available [here](https://github.com/pumpedlunch/HatsEligibilityModules/blob/master/src/ERC20EligibilityModule.sol).

## **Adding the module to a hat**

* 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

<figure><img src="https://4112750745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYVrI6eFo60Gwsn2A05qA%2Fuploads%2FywY9MMxwS9ZFogi354Ng%2FRevocation%20And%20Eligibility%20Zoom.png?alt=media&#x26;token=beb3ee54-4fdb-4e73-8b85-9a52a02d882b" alt=""><figcaption></figcaption></figure>

* Choose "Automatically" and then choose "Create new Module". This will open the module creation form
* Choose "ERC20 Eligibility" in the module type

<figure><img src="https://4112750745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYVrI6eFo60Gwsn2A05qA%2Fuploads%2FiWqHa2Ab7N1Q4XNgnXld%2FERC20%20Eligibility%20Guide.png?alt=media&#x26;token=bca67b6b-8623-4e2b-a5df-98b61af0b847" alt=""><figcaption></figcaption></figure>

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

## Viewing the hat's eligibility criteria

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 general description
  * The module's live parameters
    * The ERC-20 token address
    * The minimum balance required for eligibility&#x20;
  * Useful links
    * The module's source code on GitHub

<figure><img src="https://4112750745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYVrI6eFo60Gwsn2A05qA%2Fuploads%2FySF15DmsRGJW7XPLYxJz%2FScreenshot%202024-02-15%20at%2011.03.23.png?alt=media&#x26;token=8c972396-88b4-428f-967e-b94e69432c17" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hatsprotocol.xyz/hats-integrations/eligibility-and-accountability-criteria/erc20-eligibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
