Created
January 25, 2022 08:37
-
-
Save bensig/ae269295548d9b359b798ee8050c8282 to your computer and use it in GitHub Desktop.
Mass send tokens on Proton Network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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