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
Tools for running airdrop and token distribution campaigns on the Solana blockchain.

Overview This repository contains some of the scripts we have used for running our airdrop campaigns and other distributions. Initially, all of these

147 Nov 17, 2022
The leading native Python SSHv2 protocol library.

Paramiko Paramiko: Python SSH module Copyright: Copyright (c) 2009 Robey Pointer 8.1k Jan 08, 2023

A symmetric cryptographic module.

Exemple of use : import Seleni MyKey = "GitHub" MySecretText = "Seleni is wonderfull !!!" MyEncryptedText = Seleni.crypt(MyKey, MySecretText) print(My

Polaris 1 Jan 15, 2022
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
Python Encryption Name Game

Python 3.9.7 Encryption Name Game Encrypt a name with numbers using a Caesar cipher! You can choose different numbers to encrypt your name from 1 to o

Armand Brunelle 3 Dec 24, 2021
Looks for Bitcoin Wallets starting 1 compresses and Uncompressesed, segwit address and MultiSig starting 3.

Looks for Bitcoin Wallets starting 1 compresses and Uncompressesed, segwit address and MultiSig starting 3. Pick your starting and stop numbers to start looking. Need a database of addresses to check

10 Dec 22, 2022
A python-jvm wrapper for interacting with the Ergo blockchain.

ergpy A python-jvm wrapper for interacting with the Ergo blockchain. Usage Requires Java 8 or higher to be installed on system pip install JPype1 pip

mgpai 16 Oct 05, 2022
Highly decentralized and censorship-resistant way to store key data

Beacon coin Beacon coin is a Chia singelton coin that can store data that needs to be: always available censorship resistant versioned potentially imm

Sebastjan Trepca 24 Oct 04, 2022
This is a webpage that contains login and signup page by which the password is stored using elliptic curve cryptography

LoginPage_using_Elliptic_curve_cryptography- This is a webpage that contains login and signup page by which the password is stored using elliptic curv

1 Oct 15, 2021
Simple bitcoin ticker for the Pimorono Inky pHAT Red.

bitcoin-ticker Simple bitcoin ticker for the Pimorono Inky pHAT Red. Equipment Raspberry Pi Zero W v1.1 or Pi 2 model b v1.1 Pimorono Inky pHAT Red (S

2 Mar 15, 2022
Tracking (of choice) cryptocurrencies' daily prices and moving average.

Crypto-price-moving_average Tracking (of choice) cryptocurrencies' daily prices and moving average. About Alpha Vantage The Alpha Vantage library (htt

Thong Huynh 2 Jan 22, 2022
Programme de chiffrement et déchiffrement affine d'un message en python3.

Chiffrement Affine En Python3 Programme de chiffrement et déchiffrement affine d'un message en python3. Explication du chiffrement affine avec complex

Malik Makkes 1 Mar 26, 2022
Scrambler - Useful File/Directory Encryption Program

This is a program that is used to scramble/encrypt files on your computer. Do not use this program to do malicious things with. I am not responsible for any damage that you do with this software.

0 Oct 01, 2021
Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Tink A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse. Ubuntu

Google 12.9k Jan 05, 2023
Vaulty - Encrypt/Decrypt with ChaCha20-Poly1305

Vaulty Encrypt/Decrypt with ChaCha20-Poly1305 Vaulty is an extremely lightweight encryption/decryption tool which uses ChaCha20-Poly1305 to provide 25

Chris Mason 1 Jul 04, 2022
smartpassgen - A cross-platform package of modules for generating, secure storage and recovery of complex, cryptographic, smart passwords on the fly.

smartpassgen - A cross-platform package of modules for generating, secure storage and recovery of complex, cryptographic, smart passwords on the fly.

4 Sep 04, 2021
A Python module to encrypt and decrypt data with AES-128 CFB mode.

cryptocfb A Python module to encrypt and decrypt data with AES-128 CFB mode. This module supports 8/64/128-bit CFB mode. It can encrypt and decrypt la

Quan Lin 2 Sep 23, 2022
A simple program written in python to convert: USD, EUR & BTC to BRL

CoinsPrice This is a simple program written in python to convert: USD EUR BTC to BRL, and I used an API to get coins price. Take a look at the window

Luiz Henrique 1 Feb 09, 2022
The Qis|krypt⟩ is a software suite of protocols of quantum cryptography and quantum communications

The Qis|krypt⟩ is a software suite of protocols of quantum cryptography and quantum communications, as well, other protocols and algorithms, built using IBM’s open-source Software Development Kit for

Qiskrypt 14 Oct 31, 2022
⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡

⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡

11.2k Jan 09, 2023