Giter VIP home page Giter VIP logo

juanumusic / constructor-eth-merkle-airdrop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smartzplatform/constructor-eth-merkle-airdrop

0.0 2.0 0.0 104 KB

Smart-contract and constructor on Smartz platform, allowng to perform very cheap and simple token airdrop to millions on addresses with easy interface

Home Page: https://smartz.io

License: MIT License

JavaScript 38.88% Python 61.12%

constructor-eth-merkle-airdrop's Introduction

merkle-airdrop-contract

Merkle airdrop contract is example of usage of simple and very efficient method for executing arbitrary action on very large set of Ethereum addresses.

Overview

Contract allows to mint() fixed amount of tokens to very big amount of addresses, using Merkle proof, provided by user. User claims his tokens by providing additional data in transaction. It allows to prepare a really big list of addresses, set amount of tokens to give, calculate merkle root (a single hash, that "contains" all hashes in binary tree) and deploy very lightweight and simple contract, described below.

Description

Example user story:

  1. Owner of contract prepares a list of addresses with many entries and publishes this list in public static .js file in JSON format
  2. Owner reads this list, builds the merkle tree structure and writes down the Merkle root of it.
  3. Owner creates contract and places calculated Merkle root into it.
  4. Owner says to users, that they can claim their tokens, if they owe any of addresses, presented in list, published on onwer's site.
  5. User wants to claim his N tokens, he also builds Merkle tree from public list and prepares Merkle proof, consisting from log2N hashes, describing the way to reach Merkle root
  6. User sends transaction with Merkle proof to contract
  7. Contract checks Merkle proof, and, if proof is correct, then sender's address is in list of allowed addresses, and contract does some action for this use. In our case it mints some amount of token

Notes

Merkle tree data structure is the very efficient way to check if arbitrary data is in some list when we're not able to store this list in contract, it takes too much storage space. In our case we store a single hash in contract, allowing user to build the proof by himself. This scheme has advantage in sotrage requirements, but requires additional computations on client side, so, use in wisely.

constructor-eth-merkle-airdrop's People

Contributors

algys avatar boogerwooger avatar techraed avatar yuvasee avatar

Watchers

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