You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

98 lines
2.7 KiB

#!/bin/bash
echo "🔥 Sending All Tokens to Burn Address"
echo "====================================="
echo "🎯 Burn Address: 1nc1nerator11111111111111111111111111111111"
echo "📍 Cluster: devnet (safe for testing)"
echo ""
# Confirm before proceeding
read -p "Send ALL tokens to burn address? (type 'yes' to confirm): " confirm
if [ "$confirm" != "yes" ]; then
echo "❌ Aborted"
exit 1
fi
echo "🔥 Starting burn process..."
echo ""
# Set to devnet
solana config set --url devnet > /dev/null
BURN_ADDRESS="1nc1nerator11111111111111111111111111111111"
echo "💰 Wallet: $(solana address)"
echo "🔥 Burn Address: $BURN_ADDRESS"
echo ""
# Get all token accounts
echo "📊 Current token accounts:"
spl-token accounts --url devnet
echo ""
# List of token mints to burn
MINTS=(
"4auc435LJ9AfprLeMziHTJbP8wQmbSi7o4ZpeXdR66jQ"
"5xEQF57sR2L3tJBfdiiqaVtepTMa7nQR9uMybMojEY8n"
"8cJ8APx5TwwmpeRk4Zhz1Qbyi1T3HHdHUEw4GUJqxAGN"
"AK9fXWyDNWurYjZSDhbqBo6fczqLmCLbCZ3vq9Vftsqb"
)
# Function to send tokens to burn address
burn_tokens() {
local mint=$1
echo "🔥 Processing mint: $mint"
# Get balance
local balance=$(spl-token balance $mint --url devnet 2>/dev/null || echo "0")
if [ "$balance" == "0" ] || [ -z "$balance" ]; then
echo " ℹ No balance - skipping"
return
fi
echo " 💰 Current balance: $balance"
# Create associated token account for burn address if needed
echo " 🏭 Creating burn address token account..."
spl-token create-account $mint --owner $BURN_ADDRESS --url devnet 2>/dev/null || true
# Transfer all tokens to burn address
echo " 🔥 Sending $balance tokens to burn address..."
local result=$(spl-token transfer $mint $balance $BURN_ADDRESS --url devnet --allow-unfunded-recipient 2>&1)
if [ $? -eq 0 ]; then
echo " ✅ Successfully sent $balance tokens to burn address"
# Close the now-empty account to reclaim rent
echo " 🗑 Closing empty token account..."
spl-token close $mint --url devnet 2>/dev/null
if [ $? -eq 0 ]; then
echo " ✅ Token account closed, rent reclaimed"
else
echo " ⚠ Could not close account"
fi
else
echo " ❌ Transfer failed: $result"
fi
echo ""
}
# Process each mint
for mint in "${MINTS[@]}"; do
burn_tokens $mint
done
echo "🎯 Burn process complete!"
echo ""
echo "📊 Final token account status:"
spl-token accounts --url devnet
echo ""
echo "💰 Final SOL balance:"
solana balance --url devnet
echo ""
echo "🔥 All tokens have been sent to the incinerator!"
echo "✅ Ready for clean testing!"