Code Monkey home page Code Monkey logo

claiming-app-data's Introduction

claiming-app-data

Vesting data converter and proofs generator.

Guardian data converter, address resolver, and image loader. All images are scaled and converted to PNG.

Endpoints

Staging endpoints

List of guardians

https://safe-claiming-app-data.staging.5afe.dev/guardians/guardians.json

Guardian images

https://safe-claiming-app-data.staging.5afe.dev/guardians/images/\(address_checksummed)_\(scale=1|2|3)x.png

Allocation

https://safe-claiming-app-data.staging.5afe.dev/allocations/{chain_id}/{address}.json

Snapshot allocations

https://safe-claiming-app-data.staging.5afe.dev/allocations/{chain_id}/snapshot-allocations-data.json

Production endpoints

https://safe-claiming-app-data.gnosis-safe.io/guardians/guardians.json

Guardian images

https://safe-claiming-app-data.gnosis-safe.io/guardians/images/\(address_checksummed)_\(scale=1|2|3)x.png

Allocation

https://safe-claiming-app-data.gnosis-safe.io/allocations/{chain_id}/{address}.json

Snapshot allocations

https://safe-claiming-app-data.gnosis-safe.io/allocations/{chain_id}/snapshot-allocations-data.json

Deployments

Guardians

Staging

Deployment on staging can be started using Deploy Guardians action. Action runs only on main branch and can be started manually.

Production

Deployment to production is done with Deploy All (Release) action. Action is triggered by publishing new release:

  1. Draft a release and tag it with vx.y.z version tag.
  2. Deployment action will be triggered for release.
  3. Ask devops to deploy data to production.

Prerequisites

  • Place csv with guardian data under guardians/assets/guardians.csv.

  • Not all guardian images could be scaled to square dimensions without distorting the image. Separate versions of images were created and placed under guardians/assets/images for such guardians. This image collection should be extended if another guardian is added, that has long or wide image. Images from guardians/assets/images will be taken for a guardian during conversion instead of an image specified by a link.

  • Naming convention for image files under guardians/assets/images:

<guardian name>.png

Guardians CSV

Guardians csv file contains following fields

  • Guardian name
  • Description of reasons for becoming a delegate
  • Description of former contributions
  • Guardian address or ENS name
  • Image url
  • Start Date (UTC)
  • Submit Date (UTC)
  • Network ID
  • Tags

Guardians file structure

[
    {
        "name": "guardian name",
        "address": "checksummed address",
        "ens": "ens name if available",
        "image" "(address_checksummed)_3x.png"
        "reason": "reason for becoming a delegate",
        "contribution": "former contributions"
    },
    ...
]

Vesting Data

Staging

Deployment on staging can be started using Deploy Vestings action. Action runs only on main branch and can be started manually. Workflow input parameter chain_id must be selected before action can be started.

Production

Deployment to production is done with Deploy All (Release) action. Action is triggered by publishing new release.

  1. Draft a release and tag it with vx.y.z version tag.
  2. Deployment action will be triggered for release.
  3. Ask devops to deploy data to production.

Prerequisites

  • Place csv files with vesting data under vestings/assets/{chain_id}/{type}_airdrop.csv. Naming should be user_airdrop.csv for user airdrop and ecosystem_airdrop.csv for ecosystem airdrop (type is user or ecosystem).

Vesting csv

Vesting csv file contains following fields

  • Owner address
  • Vesting duration in weeks
  • Vesting start date (ISO 8601 Format)
  • Vesting amount in wei

Allocation file structure

Vesting file (--export allocations)

Contains all defined allocations for a specific address with proofs.

[
    {
        "tag": "[user | user_v2 | ecosystem]",
        "account": "checksummed address",
        "chainId": chain id,
        "contract": "checksummed airdrop contract addres",
        "vestingId": "vesting hash",
        "durationWeeks": integer,
        "startDate": timestamp,
        "amount": "amount in wei",
        "curve": integer,
        "proof": [
        ]
    },
    ...
 ]
Snapshot file (--export snapshot)

Contains all defined allocation. Proofs are not included.

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

Setting up locally

Create python virtual environment

mkdir env
python -m venv env

Activate a virtual environment

source env/bin/activate

Install dependencies

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

Guardians

Place guardians.csv under guardians/assets

Custom guardian images should be placed under guardians/assets/images

Make your infura project id available for guardian processing script

export INFURA_PROJECT_ID=<your infura project id>

Generating

Start guardian data processing by running

python import_guardians.py

Generated data will be placed under ../data/guardians

Guardians list: ../data/guardians/guardians.json

Guardian images: ../data/guardians/images/

Vestings

Place vesting csv files for a network under vestings/assets/{chain_id}. Naming should be user_airdrop.csv for user airdrop and ecosystem_airdrop.csv for ecosystem airdrop.

Generating

Now exporter script can be used to parse vesting csv files, generate proofs, and export data to different formats: either one file for snapshot allocation data or multiple files that contain vesting data for an address. The aforementioned steps can be performed at once or separately.

Example:

cd vestings
python exporter.py --chain-id 1 --output-directory ../data/allocations --process-vestings --generate-proofs --export allocations

If you want to see all possible parameters

python vestings/exporter.py -h

Exporter will place generated files 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.

claiming-app-data's People

Contributors

dasanra avatar dependabot[bot] avatar dmitrybespalov avatar elgatovital avatar ennisjo avatar iamacook avatar katspaugh avatar liliya-soroka avatar rmeissner avatar schmanu avatar shelbyt avatar uxio0 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

claiming-app-data's Issues

Add README and document use of tools

  • Add README
    • Short description
    • Description of the endpoints provided
    • Specification of the CSV structures
      • guardians CSV
      • airdrop CSVs
    • How to set up for development
    • How to change data
      • Changing guardians
      • Updating airdrop data
    • Contributors

[Guardians]

Environment

  • staging
  • production

Action

  • update data
  • remove guardian

Current guardian data:

  • name: [elbagococina],
  • address: [address],
  • ens: [ens],
  • image_url: [image_url],
  • reason: [reason],
  • contribution: [contribution]

Change guardian data to (if updating):

  • name: [Karpatkey],
  • address: [address],
  • ens: [ens],
  • image_url: [image_url],
  • reason: [reason],
  • contribution: [contribution]

Acceptance Criteria

  • Update:
    • Guardian has a name.
    • Provided address is valid.
    • If ens name is available it can be resolved to a valid address.
    • Provided image can be fit into a square placeholder. Too long or too wide images are not acceptable.
    • Reason for becoming a guardian is provided (not empty).
    • Previous contribution is provided (not empty).
  • Delete:
    • All guardian data is removed

Optional comments

Please only update the guardian name from "elbagococina" to "Karpatkey". The rest of the information stays the same.

[Testdata] add airdrop data for goerli testnet

what is this issue about?

The current test contracts and data are deployed on the now deprecated rinkeby testnet.
We still need a working test environment and therefore need to redeploy on goerli.

Details

We need to deploy:

  • safe token contract

  • airdrop and vesting contracts

    • user airdrop
    • ecosystem airdrop
    • investor vesting

Enable 'investor' claiming data

User Story

We'd like to enable investors to claim vested tokens to be able to participate in SAFE ecosystem.

Details

There's already an investor data supplied in this repository, however, it is only used to calculate the snapshot strategy details. Claiming data for accounts does not include investor data yet.

This proposal is to generate vesting json data for the investor accounts with the tag investor.

The investors' vesting pool is already initialized and contains vesting information, so this json data would be already useful for display in balances of the claiming app UIs and create claiming transactions with the ability to delegate the tokens.

Other

Initiator: @lukasschor (slack)

We must check that adding this data won't break existing web and iOS app.

Add support for SEP#5

  • Add support for a new type of airdrop: user_v2
  • The input csv filename should be user_airdrop_v2.csv
  • The vesting information and proof data should be generated alongside the information of the existing user airdrop.

References:

Note:
The current csv files (and Google sheet) denote the airdrop amount in SAFE (so including decimals) while the script currently expects "SAFE Atoms" (so the decimals should be offset). Potentially a separate issue should be created for this.

Proofs for Rinkeby do not match previously generated proofs

During the testing we found out that the Merkle proofs for some Rinkeby accounts have changed

See the example below:
data-Archive.zip

From the analysis and trying out different accounts, we could confirm that the rinkeby claiming data has wrong proofs, and the current code generates a wrong merkle root.

However, the data generated for the mainnet matches the merkle root.

It may be the case that the production data will be correct, while the rinkeby data is not correct.
However, this cannot be guaranteed since we know that the code has broken the previous proof data.

Add scripts with default parameters

Create command line scripts with default parameters for the guardians and allocation generations, so that it is easy to invoke with one command

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.