Skip to content

Instantly share code, notes, and snippets.

@bensig
Created January 25, 2022 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bensig/ae269295548d9b359b798ee8050c8282 to your computer and use it in GitHub Desktop.
Save bensig/ae269295548d9b359b798ee8050c8282 to your computer and use it in GitHub Desktop.
Mass send tokens on Proton Network
#!/bin/bash
# You should already have cleos, keosd installed with a wallet created
# In that wallet you will need your private key
# Usage:
# 1. Create a recipients.csv in the same dir as this script
# ** FORMAT OF CSV SHOULD BE like this:
# benobi 0.00000001
# paul 0.00000001
# That will send one SAT to "benobi" and 1 sat to "paul"
# 2. Update the TOKENBANK - this is the account you will be sending FROM
# 3. Update the MEMO variable - leave the quotes the way they are set now
# 4. Run this script and it will output into the database file
# 5. Once you havve the db file, you will be able to preview all of your transactions
# 6. Type cat log_masstransfer.txt|grep cleos > send_all.sh
# 7. Check out the contents of send_all.sh - verify that it is all correct
# 8. Run chmod 755 send_all.sh
# 9. Unlock your wallet
# 10. Run ./send_all.sh
# set variables
TOKENBANK="youraccount"
LIST="recipients.csv"
MEMO='"Change this memo field"'
API="https://proton.greymass.com"
TOKENCONTRACT="xtokens"
DBFILE="log_masstransfer.txt"
TOKEN="XBTC"
echo "running" > $DBFILE
echo `date` >> $DBFILE
while read line; do
set -- $line
echo "reading line"
DESTACCT=`echo $1`
AMOUNT=`echo $2`
TOKENAMOUNT="\"$AMOUNT $TOKEN\""
echo -e $DESTACCT >> $DBFILE
echo -e $TOKENAMOUNT >> $DBFILE
echo -e cleos -u $API transfer -c $TOKENCONTRACT $TOKENBANK $DESTACCT "$TOKENAMOUNT" "$MEMO" -p $TOKENBANK >> $DBFILE
echo -e "\n" >> $DBFILE
done < $LIST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment