Giter Club home page Giter Club logo

cli-plugin-airdrop's People

Contributors

jeronimoalbi avatar lumtis avatar pantani avatar tbruyelle avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-plugin-airdrop's Issues

Add `AirdropSupply` option

Most of the time, the total amount to be distributed for airdrop will not be calculated dynamically from the sum of all claim records obtained from the snapshots and formula, but each claim record will be calculated from a fixed airdrop supply

airdrop.yml:

AirdropSupply: 1000000udrop

Invariant:

AirdropSupply == (DustWallet * NbClaimRecords) + Σ(ClaimRecord)

There should be an additional step in the claim records creation that calculate the final claim record from the processed data and airdrop supply:

(naming not definitive, just ideas)

- [BlockchainState]

-> snapshot()

- [RawSnapshotData]

-> filter(addresses)

- [FilteredSnapshotData]

-> process(formula)

- [ProcessedSnapshotData]

-> finalize(airdropSupply)

- [ClaimRecords] + [WalletBalances] (dust wallets)

Add features for UI interface for Airdrop

Provide features in order to help create a web UI for claiming airdrop for a chain that imports the claim module

  • Generic Web UI that can be served to interact with claims
ignite airdrop serve-ui [rpc-url]
  • The interface allows to complete missions for staking and governance (showing validators to stake and proposals to vote for) so the claim can be automatic

  • Interface to claim completed other custom mission

  • Information on decay and airdrop start

  • Information about eligible airdrop

  • Command to generate code for UI that can be then customized by the developer

ignite airdrop generate-ui

Contains code for the generic UI above

Write readme v1

  • Description of the tool
  • How to use -- example of a workflow usage of the tool. Example: generating a genesis state for ATOM staking on the Hub
  • How it works -- more details on how the tool work internal, the different phases to generate the claim records
  • Commands API

[WIP] - Concept - airdrop snapshot data generator

Airdrop snapshot data generator

drawing

The airdrop snapshot generator is a new command or set of commands allowing to create snapshot for airdrop with mainnet.
Chains distribute airdrop in the following way:

  • Allocating the tokens directly in the account balance, or a small amount named dust wallet
  • Use a claim module that define rules for airdrop distribution and airdrop allocations (claim record)

We are developing a general usage claim module, so we can use this module as a reference for this functionality.
Claim module contains claim record in its genesis state for eligible addresses: https://github.com/ignite/modules/blob/main/x/claim/spec/01_state.md

Ignite airdrop snapshot generator is a command that allows generating a genesis state with dust wallet and claim records filled depending on the rules for the airdrop.
The rules would be stored in a yml file: airdrop.yml

ignite airdrop generate [airdrop_config] [input_genesis] > [output_genesis]

The command parses the airdrop_config adds the dust wallet, and the claim records in the input genesis, create the output genesis

Airdrop config

Designing and specifying the config file is the first step in this task. It should include all flexibility related to airdrop:

  • Snapshot for staking, liquidity, etc...
  • Date
  • Mathematical formula for the amount
  • Excluded addresses

Example format

version: 0.1.0

airdrop_token: ufoo

# balance as dust wallet for each eligible account to be able to perform first action
dust_wallet: 1

# list of snapshots
snapshots:
- ....

Snapshot:

# Type of snapshot
types: [staking|liquidity]

# Snapshot chain
chain: cosmos-hub

# Denom, related coin denom to stake for example, or pair for liquidity pool
denom: uatom

date: 2022-01-01T00:00:00Z

# TBD
formula:
  type: quadratic
  value: 2
  ...

# list of excluded addresses
excluded:
- ...
# TODO: rule for exclusion like exclusion after a specific balance

Phases

The process of generating a genesis state from snapshots should be divided into different phases with the ability to save file between phases.
The reason is that if a user want to add an excluded address or change the airdrop formula, they should fetch the chain data again.
The phases:

  • Parsing chain from data -> raw snapshot data
  • Applying formula and excluded-addresses -> processed snapshot data
  • Gathering snapshots -> genesis state

We can provide a full command that runs all phases and save intermediary files

ignite airdrop generate [airdrop_config] [input_genesis] > [output_genesis]

And command for each phase:

ignite airdrop raw airdrop.yml > raw.csv
ignite airdrop process airdrop.yml raw.csv > processed.csv
ignite airdrop genesis airdrop.yml processed.csv genesis.json > genesis.json

Write a PoC code to take a snapshot on Cosmos Hub

Write a simple PoC that can take a snapshot of the Cosmos Hub and generate records from ATOM delegations.

The PoC code should just have the ability to generate raw records (no filtered address) and put them in a file like CSV.

Specify airdrop config V0.1

Define the first, simplest but viable, config format for airdrop snapshot with the following options:
Contains a single chain to take snapshot that read delegated coins

  • airdrop_token: token to be distributed as airdrop
  • dust_wallet: dust value of eligible wallets (necessary to perform the initial action)
  • chain: chain to take snapshot on
  • snapshot_date: date for the snapshot

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.