Git Product home page Git Product logo

merkle-distributor's Introduction

@pooltogether/merkle-distributor

Tests Lint

This project contains the distribution, code, and deployment scripts for the PoolTogether retroactive token claims. The BigQuery output was generated by the Retroactive Query

Setup

Install Dependencies

$ yarn

Compile Contracts

$ yarn compile

Run Tests

$ yarn test

Verify the output from the Retroactive Query

The file bq-results-20210202-094742-fvr9ifm390n3.json contains the full set of rows (ordered by address ascending) of the Retroactive Query. You can follow the steps in that project to generate this file.

In this repo the file merkle_tree.json is generated from the BigQuery output and fed into the contract deployment script. You can generate the merkle proof file yourself using the steps below.

Generate Merkle Proof

First pre-process the BigQuery results (the file is missing commas):

$ ts-node ./scripts/pre-process-json.ts -i bq-results-20210202-094742-fvr9ifm390n3.json > bq-results.processed.json

Now generate a merkle proof blob:

$ ts-node ./scripts/generate-merkle-root -i bq-results.processed.json > merkle-proof.generated.json

You can compare your proof to the committed proof:

$ diff merkle-proof.generated.json merkle_tree.json

You will not see any differences!

Deploy the Contract

The contract deployment script consumes the merkle_tree.json file as the distribution. Make sure this file exists before running the deploy script.

You can deploy to rinkeby:

$ yarn deploy rinkeby

Or you can deploy to mainnet:

$ yarn deploy mainnet

merkle-distributor's People

Contributors

aodhgan avatar asselstine avatar gakonst avatar lint-action avatar moodysalem avatar noahzinsmeister avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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