CoLinksEligibility is a Hats Protocol eligibility module that sets eligibility for a target hat based on the supply of a user's (aka "wearer's") CoLinks links.
Since the supply of a user's links is a fuzzy-yet-credible signal of their reputation within the Coordinape and CoLinks ecosystem, this module can be used to help ensure that wearers of a given hat meet minimum reputation requirements. Similarly, it can also be used as a Sybil-resistance mechanism for the hat.
This module inherits from HatsModule, which means that it is designed to be used by deploying a new instance (i.e. a minimal proxy clone) via the HatsModuleFactory and then attached to the target hat.
The module can be configured with a single parameter threshold
, which is the minimum number of links that a wearer must have in order to be eligible for the hat. The module will then set the wearer's eligibility to true
if they have at least threshold
links, and false
otherwise.
This module does not deal with the standing
portion of Hats eligibility, so standing
is always set to true
for the wearer. However, this module can be chained together with another eligibility module that does deal with standing
.
This repo uses Foundry for development and testing. To get started:
- Fork the project
- Install Foundry
- To install dependencies, run
forge install
- To compile the contracts, run
forge build
- To test, run
forge test