Giter Site home page Giter Site logo

merkle-registry's Introduction

Merkle Registry

Decentralized the storage of your Merkle tree data today ๐ŸŒฑ

Background

Many ERC20 and ERC721 contracts gate access to minting via a Merkle Claim. Often, the claim parameters are hardcoded into the frontend or stored on a centralized backend, preventing direct contract interaction and cross-app composability. This contract serves as a decentralized registry for any contract with merkle claim data.

How it works

TODO: Add mainnet address
TODO: Add Goerli address
TODO: Add Polygon address
TODO: Add Mumbai address
TODO: Deploy to other chains!

The contract is deployed on various chains. You can use the IMerkleRegistry interface to interact with the read and write functions in the contract. Note that in order to call the setURI function, four conditions must be met:

  1. The Merkle Registry contract must be deployed on that chain.
  2. The contract you're setting the data for must be deployed on that chain.
  3. The contract must provied a public owner function that returns an address, as specified in the IOwner interface. It is sufficient if your contract imlements OpenZepplin Ownable.
  4. The address calling the function must be the owner of the contract.

Storing and Retrieving Merkle Data

The merkleTrees query returns a URI in the form of a string, giving flexibility to contract owners and clients to choose how to store the URI and retrieve its data. A simple and decentralized option is to store the IPFS CID of a JSON file which contains all the Merkle data specific to one tree index for the contract. An example JSON file is provided for reference and to help standardize formatting for composabaility.

merkle-registry's People

Stargazers

Gus avatar

Watchers

Nathan Hausman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.