Git Product home page Git Product logo

shutter-dao-claiming-app-data's Introduction

claiming-app-data

The code in this repository was originally copied from the gnosis/safe-claiming-app-data repo and then modified to suit the Shutter DAO requirements.

A vesting data converter and proof generator.

Prerequisites

  • Place csv files with vesting data under vestings/assets/{chain_id}/*.csv.

Vesting CSVs

Vesting CSV files contains the following fields

  • owner: Must be an Ethereum address
  • amount: Token amount to be allocated
  • duration: Vesting duration in months
  • startDate: Vesting start date (ISO 8601 Format YYYY-MM-DD)
  • initialUnlock: Initial unlocked token share in decimal fraction (0...1)
  • requiresSPT: TRUE or FALSE if it is required to exchange SPT tokens upon claiming tokens (only valid for SPT holders)

Allocation file structure

Vesting file

Contains all defined allocations for a specific address with proofs.

[
    {
        "tag": "[user | spt_conversion]",
        "account": "checksummed address",
        "chainId": chain id,
        "vestingId": "vesting hash",
        "durationWeeks": integer,
        "startDate": timestamp,
        "amount": "amount in wei",
        "curve": integer,
        "proof": [
        ]
    },
    ...
 ]

Setting up locally

Create a Python virtual environment

python -m venv venv

Activate a virtual environment

source venv/bin/activate

Install dependencies

pip install -r requirements.txt
pip install pre-commit
pre-commit install -f

Generating output files

The exporter script can parse vesting CSV files, generate proofs, and export data for claiming. The steps mentioned earlier can be performed at once or separately.

Example:

cd vestings
python exporter.py --chain-id 1 --output-directory ../data/allocations

Exporter will place generated files under {output_directory}/{chain_id}

Output files

For each address, an allocation file is created {address}.json. These files contain the Merkle proof and all relevant data to redeem the tokens into the vesting pool contract later.

Additionally, the file root.txt containing the Merkle root is created. Take this value and configure the respective parameter upon DAO deployment.

All files are located under {output_directory}/{chain_id}.

Contribute

You can contribute to this repo by creating a Pull Request or an issue. Please follow the default template set for the Pull Requests.

shutter-dao-claiming-app-data's People

Contributors

fredo avatar ulope avatar compojoom avatar smokyish avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar Tolga Bilbey avatar Maximilian Langenfeld avatar  avatar  avatar

Forkers

itrocket-team

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.