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
zhash is a simple Python tool which allows to create/crack hashes

zhash zhash is a simple python tool which allows you to crack/create hashes. Below are the list of supported algorithms that zhash can crack Supported

3 May 27, 2022
A community effort to bring back Duino-Coin

Duino-Coin-Revived A community effort to bring back Duino-Coin! Along with reviving the cryptocurrency, we will add many improvements to it, including

1 Dec 22, 2021
Solutions to all 6 programming assignments in Dan Boneh's course Cryptography I, in statically typed Python.

Solutions to Cryptography I programming exercises Dan Boneh from Stanford University has an excellent online course on cryptography, hosted on Courser

Axel Lindeberg 8 Dec 16, 2022
Given a string or a text file with plain text , returns his encryption using SHA256 method

Encryption using SHA256 Given a string or a .txt file with plain text. Returns his encryption using SHA256 method Requirements : pip install pyperclip

yuno 3 Jan 24, 2022
Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) consensus algorithm.

Ceres Combine-Harvester Ceres is a combine harvester designed to harvest plots for Chia blockchain and its forks using proof-of-space-and-time(PoST) c

38 Nov 14, 2022
PytoPrice is an automation program to fetch the latest price of a cryptocurrency of your choice at a user-customizable update interval.

PyToPrice (Python Crypto Price) PytoPrice is an automation program to fetch the latest price of a cryptocurrency of your choice at a user-customizable

Peter 1 Jun 16, 2022
Bsvlib - Bitcoin SV (BSV) Python Library

bsvlib A Bitcoin SV (BSV) Python Library that is extremely simple to use but mor

Aaron 22 Dec 15, 2022
Audits Python environments and dependency trees for known vulnerabilities

pip-audit pip-audit is a prototype tool for scanning Python environments for packages with known vulnerabilities. It uses the Python Packaging Advisor

Trail of Bits 701 Dec 28, 2022
cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.

pyca/cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your "c

Python Cryptographic Authority 5.2k Dec 30, 2022
Cryptocurrency with implementet Blockchain

Cryptocurrency with implementet Blockchain

Mario 1 Mar 24, 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
⚡ 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
A python tool to track prices of various cryptocurrencies and alert

CryptoPriceTracker This is a tool to track prices of various cryptocurrencies and alert the user once the user defined maximum & minimum target is rea

1 Oct 01, 2021
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
Tutela: an Ethereum and Tornado Cash Anonymity Tool

Tutela: an Ethereum and Tornado Cash Anonymity Tool The repo contains open-source code for Tutela, an anonymity tool for Ethereum and Tornado Cash use

TutelaLabs 96 Dec 05, 2022
Using with Jupyter making live crypto currency action

Make-Live-Crypto-Currency-With-Python Using with Jupyter making live crypto currency action 1.Note: 💣 You must Create a Binance account and also clic

Mahmut Can Gönül 5 Dec 13, 2021
Algorand-app - This tutorial is designed to get you started with Algorand development in a step by step process

Getting Started This tutorial is designed to get you started with Algorand devel

Connor 1 Jan 06, 2022
CertPy is a high level toolkit for generating x509 (e.g. SSL/TLS/HTTPS) certificates in Python.

CertPy CertPy is a high level toolkit for generating x509 (e.g. SSL/TLS/HTTPS) certificates in Python. Certificate “profiles” are implemented as Pytho

Ryan Castellucci 4 Feb 21, 2022
A little side-project API for me to learn about Blockchain and Tokens

BlockChain API I built this little side project to learn more about Blockchain and Tokens. It might be maintained and implemented to other projects bu

Loïk Mallat 1 Nov 16, 2021
A bot for FaucetCrypto a cryptocurrency faucet. The bot can currently claim PTC ads, main reward and all the shortlinks except exe.io and fc.lc.

A bot for the high paying popular cryptocurrency faucet Faucet Crypto. The bot is built using Python and Selenium, currently it is under active develo

Sourav R S 81 Dec 19, 2022