Tools for running airdrop and token distribution campaigns on the Solana blockchain.

Overview

samoyed logo

Overview

This repository contains some of the scripts we have used for running our airdrop campaigns and other distributions.

Initially, all of these were made purely for internal use and there were little to none UI considerations. However, as we decided to release these publicly, we have made some improvements on that front. We also created accompanying README documents that will hopefully allow you to use these in your own projects without issues.

Before using our scripts, we strongly recommend that you get to grips with the mechanics of using the tools on Solana's testnet/devnet before doing any live mainnet transactions. Any mistakes you make there are completely harmless and will serve as a learning experience.

Built with

Everything was written and tested on a Linux-based 64-bit system running Ubuntu 20.04 and Python 3.8.5. These tools should also work on other Linux distros and MacOS systems, but they will definitely not run on Windows. If you are on a Windows machine, we recommend looking into WSL and WSL2.

All tools currently available are built with python3 and no external modules or packages, but they are dependant on having local installations of Solana CLI tools available on the PATH.

Below are links on the installation steps for solana-cli and spl-token-cli tools:

If you haven't used these tools before, we would recommend following along with the documentation, as it explains some basic usage scenarios that will familiarize you with them.

Available tools

Tools Description
address-fetcher Fetching addresses of token holders and accounts
flat-distributor Distribute a fixed amount of tokens
proportional-distributor Distribute a proportional amount of tokens

The accompanying README for each tool is located in its directory. Refer to them for usage examples.

Issues

Feel free to report any issues you encounter while using these tools, or ideas you may have for improvement. We will try to help out with any problems when we can, but understand that these tools were made for private use and there might be usage scenarios that we never thought of or got around to testing.

License

Distributed under the MIT License

Links

Contact me on Discord: praskOo#0892

Comments
  • fix flat-distributor.py

    fix flat-distributor.py

    Fix options

    context

    If my understanding is correct, this options leaves flexibilities to add arguments like --fund-recipient and --allow-unfunded-recipient for spl-token command.

    issue

    Without this modification, the to_str() will fail because the self.options is always None It is not a critical bug, but maybe worth to fix it.

    Fix csv header of unconfirmed log:

    lu.write('recipient,amount,error') -> lu.write('recipient,amount,error\n')

    opened by leafwind 3
  • Flat-distributor: cancelling airdrop

    Flat-distributor: cancelling airdrop

    Hi, it seems that I'm not able to perform the airdrop with flat-distributor, I've double checked everything and the env is correct, mint address, solana address etc.

    The error I'm getting is:

    Running the airdrop in non-interactive mode. The airdrop will run without additional confirmations.
    --------------------------------------------------
    Enter Y to proceed
    > y
    Log file handlers closed.
    Cancelling the airdrop.
    

    this happens instantly and quits. Nothing in the logs

    opened by k666-bit 2
  • Merge funding-options feature

    Merge funding-options feature

    Allow users to use --fund-recipient and --allow-unfunded-recipient flags in the transfer sub-command of distributor tools. Both flags behave in the same manner as they do in the spl-token transfer command.

    • --fund-recipient - if an address doesn't own an associated token account, the sender will create one (and fund it, this costs a bit of SOL!)
    • --allow-unfunded-recipient - complete the transaction, even if the recipient has 0 SOL on their balance.

    check-before and check-after sub-commands have been adjusted to better account for this use-case.

    enhancement 
    opened by praskoson 1
  • fix proportional-distributor.py

    fix proportional-distributor.py

    FYI, all the fixes are the same as #1

    Fix options

    context

    If my understanding is correct, this options leaves flexibilities to add arguments like --fund-recipient and --allow-unfunded-recipient for spl-token command.

    issue

    Without this modification, the to_str() will fail because the self.options is always None It is not a critical bug, but maybe worth to fix it.

    Fix csv header of unconfirmed log:

    lu.write('recipient,amount,error') -> lu.write('recipient,amount,error\n')

    opened by leafwind 1
  • Improved duplicate removal code.

    Improved duplicate removal code.

    Duplication removal is now done immediately after fetching the raw address data.

    This still only affects owner type addresses. A different solution is needed to better handle multiple token addresses that belong to the same account.

    Resolves #5

    bug 
    opened by praskoson 0
  • Hotfix handle 429 timeout

    Hotfix handle 429 timeout

    Implement a --retry-on-429 option for distributors when using transfer sub-command.

    This was previously the default behaviour, but we learned that if spl-token transfer returns a HTTP Too Many Requests error (429), this is not a guarantee of a failed transaction. This is a bug in how spl-token handles those errors and according to Solana developer support, a fix is on the way.

    A transaction happening despite this error is rare, but it can happen. The safe way to treat this error is to consider the transaction as unconfirmed, until the error is fixed in spl-token. The --retry-on-429 option will use the old behaviour, where the tool retried the transaction if it encountered this error.

    bug 
    opened by praskoson 0
  • Issue when handling HTTP Too Many Requests (429) error

    Issue when handling HTTP Too Many Requests (429) error

    When a HTTP 429 error is received while transferring tokens, the distributor attempts to retry the transfer. In rare cases, the transaction is completed regardless of the error. A possible explanation is that the error happens while polling the transaction status, according to Solana developer support.

    ATM there is no clear solution other than to handle a 429 error as an unconfirmed transaction, even though this happens very rarely.

    opened by praskoson 0
  • Estimated drop

    Estimated drop

    Print the number of addresses that are being dropped to (flat-distributor and proportional-distributor) and print the estimated total tokens to be dropped (flat-distributor˙).

    enhancement 
    opened by praskoson 0
  • Address fetcher sorting issue

    Address fetcher sorting issue

    address-fetcher is supposed to sort the address - balance pairs by the current balance amount in the address-list-balance.txt file.

    When using owner type addresses, the tool sums up the balances of all pairs that have the same owner address (this happens when an owner account owns multiple token accounts, likely because of trading on some dex). Those address - balance pairs are sometimes not sorted properly.

    E.g. when fetching Samoyed owner addresses:

    3o35HGWTqvkTUX77CZN4VrFg1xAzZrTqs2oEGxRSvjNm,6472.0
    AVYXwvrJLCdqJ1dEKieTnpQHvndT2ef5wwhPTULqfFBd,10431.0
    2bn5FRNy3SD2udDxkW6oQY1ghSY3buxForh6BKsagyis,6459.0
    

    AVYX... account owns 2 SAMO token accounts.

    A simple solution would be to sort the list again after summing up the duplicate balances, but this might impact performance.

    bug 
    opened by praskoson 0
  • App doesn't exit when missing parameters

    App doesn't exit when missing parameters

    When either distribution tool (proportional-distributor or flat-distributor) is started without any parameters and without a config file, it will still prompt for the RPC API URL, token address and token decimals before exiting.

    ./flat-distributor.py
    
    Select an endpoint
    1. https://api.mainnet-beta.solana.com
    2. https://api.testnet.solana.com
    3. https://api.devnet.solana.com
    Select an option:
    > 1
    
    Enter the token mint address:
    > aaaa
    
    Enter the number of token decimals:
    > 8
    No mode selected, use -h
    
    bug 
    opened by praskoson 0
  • Can't start the address-fetcher.py

    Can't start the address-fetcher.py

    I use macOs 11.6 (Big Sur) When running the python script I got this error

    % ./address-fetcher.py 
    Traceback (most recent call last):
      File "./address-fetcher.py", line 4, in <module>
        import requests
    ModuleNotFoundError: No module named 'requests'
    

    Do I need to deploy some depencies to be able to run the script?

    opened by cdric 1
Releases(v0.2.1)
  • v0.2.1(Jun 15, 2021)

    Includes address-fetcher, flat-distributor and proportional-distributor. This is not a build, just a package with all the tools and readmes.

    Changelog

    • Bugfixes
      • address-fetcher will correctly eliminate duplicates and sort owner type addresses according to their total balance (#5)
      • Added a --retry-on-429 option (this was previously the default behaviour) to distributors when using transfer sub-command (#13)

    Check the PR #14 for more information on the --retry-on-429 option. Using it will keep the old behaviour of transfer, but in rare cases it can result in a duplicate transaction. When Solana rolls out their fix, this will not be an issue anymore.

    UPDATE Solana released spl-token version 2.0.12 which handles 429 Too Many Request errors with exponential backoff, meaning that the --retry-on-429 option is obsoleted. You can update spl-token with solana-install update and you shouldn't see those errors any more.

    Source code(tar.gz)
    Source code(zip)
    distribution-tools-v0.2.1.zip(23.89 KB)
  • v0.2.0(Jun 12, 2021)

    Includes address-fetcher, flat-distributor and proportional-distributor. This is not a build, just a package with all the tools and readmes.

    Changelog

    • Features
      • Short option (-t) for specifying address type (available in all tools, #11)
      • Show the estimated total drop amount when running distributors (#7)
      • Allow usage of --fund-recipient and --allow-unfunded-recipient options with distributors (#8)
    • Bugfixes
      • Fixed CSV headers in log files for unconfirmed transfers (thanks @leafwind, #3)
      • Exit immediately when there is no config or console params in distributors (#4)
    Source code(tar.gz)
    Source code(zip)
    distribution-tools-v0.2.0.zip(23.52 KB)
  • v0.1.0(Jun 4, 2021)

Owner
Hello there
A cairo port for Rari Capital Vaults

crypts • Architecture contracts ├─ CryptFactory — "Factory for deploying Crypt contracts for any ERC20 token." ├─ Crypt — "Flexible, minimalist, and g

alucard 9 Sep 02, 2022
Tron Wallet (TRX) Crack Finder With Python Just 64 Line

TRXGEN Tron Wallet Finder and Crack With Python Tron Wallet (TRX) Crack Finder With Python Just 64 Line My tools [pycharm + anaconda3 + python3.8 + vi

MMDRZA 6 Dec 18, 2022
💰 An Alfred Workflow that provides current price of cryptocurrency

Coin Ticker for Alfred Workflow An Alfred Workflow that provides current price and status about cryptocurrency from cryptocompare.com. Supports Alfred

Bumsoo Kim (Ian) 14 Nov 17, 2022
Dicoding Machine Learning for Expert Submission 1 - Predictive Analytics

Laporan Proyek Machine Learning - Azhar Rizki Zulma Domain Proyek Domain proyek yang dipilih dalam proyek machine learning ini adalah mengenai keuanga

Azhar Rizki Zulma 6 Jul 23, 2022
A simple Ethereum mining pool

A simple getWork pool for ethereum mining

93 Oct 05, 2022
gcrypter: an encryption algorithm based on bytes and their correspondent numbers to encode strings

gcrypter: an encryption algorithm based on bytes and their correspondent numbers to encode strings

Nuninha-GC 1 Jan 10, 2022
wdepy: Decryption and Inspection for PGP WDE Disks

This is a small python tool to inspect and decrypt disk images encrypted with PGP Whole Disk Encryption (including the Symantec-branded versions like Symantec Drive Encryption). It takes advantage of

Brendan Dolan-Gavitt 17 Oct 07, 2022
Algo-burner - Burner account for the Algorand blockchain

algo-burner Burner address for Algorand's blockchain Apparently it was a problem

1 Jan 12, 2022
How to setup a multi-client ethereum Eth1-Eth2 merge testnet

Mergenet tutorial Let's set up a local eth1-eth2 merge testnet! Preparing the setup environment In this tutorial, we use a series of scripts to genera

Diederik Loerakker 24 Jun 17, 2022
bitcoin-ticker is a E-ink ticker that shows usefull information about bitcoin

bitcoin-ticker bitcoin-ticker is a E-ink ticker that shows usefull information about bitcoin. Due to the limited refresh lifetime, new information is

32 Nov 09, 2022
An automated Risk Management Monitor Bot for ByBit cryptocurrencies exchange.

An automated Risk Management Monitor Bot for ByBit cryptocurrencies exchange that forces all open positions to adhere to a specific risk ratio, defined per asset. It supports USDT Perpetual, Inverse

Hadi Aladdin 25 Nov 27, 2022
Python program that handles the creation, encryption and storage of log/journal files. Kinda works like a diary of sorts.

LucaSoft J.O.U.R.N.A.L The J.O.U.R.N.A.L (Just anOther User Redaction & Navigation Assistant by Lucaspec72) is a Python program that handles the creat

Lucaspec72 8 Oct 27, 2021
Get the SHA256 hash of any file with this Python Script

Hashfile-SHA256 A SHA256 hash verifying script, written in python. Report Bug Table of Contents About The Project Built With Getting Started Prerequis

Ethan Gallucci 1 Nov 01, 2021
blockchain address database

Blockchain Address Ownership Database The database is in data/addresses.db This is a SQLite database of addresses from several blockchains. It's obtai

37 Nov 26, 2022
Simple python crypto bot to trade crypto on Binance based on RSI. Utilizing web sockets to get real-time prices

Py Crypto Bot Using Binance WebSocket API to get real-time price data for cryptocurrencies. Using the TA-Lib library to calculate the RSI and execute

Kennedy Ngugi Mwaura 15 Jan 04, 2023
A Python script to implement Hill's Cipher Encryption and Decryption.

Hill_Cipher-Encryption_and_Decryption A Python script to implement Hill's Cipher Encryption and Decryption. Initially in the Encryption part, the Plai

Vishvendra Singh 1 Jan 19, 2022
Discord webhooks for alerting crypto currency price changes & historical data.

Crypto-Discord Discord Webhooks for alerting crypto currency price changes & historical data. Create virtual environment and install requirements. $ s

Филип Арсовски 1 Sep 02, 2022
Advanced Digital Envelope System Using Cryptography Techniques (Encryption & Decryption)

Advanced-Digital-Envelope-System Advanced Digital Envelope System Using Cryptography Encryption Techniques The digital envelope system is the techniqu

NelakurthiSudheer 2 Jan 03, 2022
Simple encryption/decryption utility using Pycryptodome module. Working with AES and RSA algorithms.

EncypherUtil Simple encryption/decryption utility using PyCryptodome module. Working with AES and RSA algorithms. THIS UTILITY IS NOT LICENSED AS CRYP

Egor Yakubovich 0 Jun 14, 2022
An BlockChain Based solution for storing the medical records

Blockchain-based Medical Records 📄 Abstract Blockchain has the ability to keep an incorruptible, decentralized, and transparent log of all patient da

Yuvraj Singh Deora 3 Jan 14, 2022