8000 GitHub - gerantonyk/compound-eligibility-module: A Hats Protocol eligibility module based on tokenID specific ERC721 ownership
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gerantonyk/compound-eligibility-module

 
 

Repository files navigation

CompoundEligibility

CompoundEligibility is an eligibility module for Hats Protocol. In this module, a Hat can have multiple eligibility criteria. The module has two immutable arguments to add two desired modules that need to be combined. In case you want to combine more than 2 modules, you can use a desired eligibility module as the first argument and a Compound Eligibility module as the second parameter, allowing the association of 2 new modules.

There are two different modules: one for conjunction (AND) and a second one for disjunction (OR).

CompoundEligibility Details

ERC721Eligibility inherits from the HatsEligibilityModule base contract, from which it receives two major properties:

Setup

A CompoundEligibility instance requires several parameters to be set at deployment, passed to the HatsModuleFactory.createHatsModule() function in various ways.

Immutable values

  • hatId: The id of the hat to which this the instance will be attached as an eligibility module, passed as itself
  • EMODULE1: The address of the first Elegibility module contract to be combined, abi-encoded (packed) and passed as _otherImmutableArgs
  • EMODULE2: The address of the second Elegibility module contract to be combined, abi-encoded (packed) and passed as _otherImmutableArgs The following immutable values will also automatically be set within the instance at deployment:
  • IMPLEMENTATION: The address of the CompoundEligibility implementation contract
  • HATS: The address of the Hats Protocol contract

Development

This repo uses Foundry for development and testing. To get started:

  1. Fork the project
  2. Install Foundry
  3. To compile the contracts, run forge build
  4. To test, run forge test

Implementation

Implementation:

CompoundEligibilityModule: 0x5ea0D0b35197561002f1caAb7d85346fcC8A3b72 DisjunctionEligibilityModule: 0xE7C3CC12A41b4f4f24BA175AEAFc2F7952B03a2b

About

A Hats Protocol eligibility module based on tokenID specific ERC721 ownership

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 100.0%
0