Skip to content

Commit

Permalink
Merge pull request #1 from OnGridSystems/airdrop_cli
Browse files Browse the repository at this point in the history
Airdrop cli
  • Loading branch information
999max authored Jul 12, 2021
2 parents 74ab714 + 7e87412 commit d1d0970
Show file tree
Hide file tree
Showing 9 changed files with 911 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci_airdrop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: airdrop_pytest

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests with pytest
run: |
pip install pytest
pytest
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# dev env
.vscode/
.idea

# db
*.sqlite
60 changes: 57 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Build Status - GitHub](https://github.com/OnGridSystems/erc20_airdrop_cli/workflows/airdrop_pytest/badge.svg)](https://github.com/OnGridSystems/erc20_airdrop_cli/actions?query=workflow%3Aairdrop_pytest)


# Simple CLI app for ERC-20 Airdrops on Ethereum

* compose and verify the list of token recipients
* generate transactions
* execute them
Allows controllable ERC-20/BEP-20 token airdrops by the given list of recipients and amounts. Simplifies control of sending and eliminates human mistakes. The process of airdrop looks like this:

* fill in the list of recipients and amounts for each
* verify the list, number of recepients and total sum
* generate and sign transactions
* top up sending account with tokens and ETH/BNB
* execute (send) them


## Installation

Clone repositiry.
Create venv:

```sh
python -m venv venv
```

Install dependencies:
```sh
pip install -r requirements.txt
```


## Using app

At any time run ```./airdrop.py help``` to call help menu.
To show current status ```./airdrop.py show```.

1. ```./airdrop.py init``` to initialize database - creates SQLite fine in the directory
2. ```./airdrop.py import``` to set sender's private key
3. ```./airdrop.py token <token-address> ``` to set token address for airdrop.
4. ```./airdrop.py update``` to update balances and current account's nonce. You can run it anytime.

5. Add recipietns for airdrop, one recipient per command. Amounts are in decimal format. If you specify 1.49, it means you'll send 1490000000000000000 of token units (decimals=18 assumed).

```./airdrop.py add <address> <amount>```


6. Sign **all** your transactions ```./airdrop.py sign```

7. Send transactions on the wire, one at a time ```./airdrop.py sign``` - sends **first** SIGNED transaction and it becomes SENT. And now you can check transaction hash in show menu.

8. If the execution was interrupted and the receipt was not received. You can request it:
```./airdrop.py receipt```


#### Testing

```sh
pip install pytest
pytest
```
Loading

0 comments on commit d1d0970

Please sign in to comment.