ignite / cli-plugin-airdrop Goto Github PK
View Code? Open in Web Editor NEWIgnite CLI plugin for airdrop tool
License: Apache License 2.0
Ignite CLI plugin for airdrop tool
License: Apache License 2.0
Provide features in order to help create a web UI for claiming airdrop for a chain that imports the claim
module
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
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)
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.
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:
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
Designing and specifying the config file is the first step in this task. It should include all flexibility related to airdrop:
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
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:
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.