#!/bin/bash echo "๐Ÿ”ฅ Burning All Tokens in Wallet" echo "================================" echo "โš ๏ธ This will permanently destroy ALL tokens in your wallet!" echo "๐Ÿ“ Cluster: devnet (safe for testing)" echo "" # Confirm before proceeding read -p "Are you sure you want to burn ALL tokens? (type 'yes' to confirm): " confirm if [ "$confirm" != "yes" ]; then echo "โŒ Aborted - no tokens burned" exit 1 fi echo "๐Ÿ”ฅ Starting token burning process..." echo "" # List of token mints to burn (from spl-token accounts output) TOKENS=( "4auc435LJ9AfprLeMziHTJbP8wQmbSi7o4ZpeXdR66jQ" "5xEQF57sR2L3tJBfdiiqaVtepTMa7nQR9uMybMojEY8n" "8cJ8APx5TwwmpeRk4Zhz1Qbyi1T3HHdHUEw4GUJqxAGN" "AK9fXWyDNWurYjZSDhbqBo6fczqLmCLbCZ3vq9Vftsqb" ) # Set to devnet solana config set --url devnet > /dev/null echo "๐Ÿ’ฐ Current wallet: $(solana address)" echo "๐ŸŒ Cluster: devnet" echo "" # Function to burn tokens for a specific mint burn_token() { local mint=$1 echo "๐Ÿ”ฅ Processing mint: $mint" # Get the token account balance local balance=$(spl-token balance $mint --url devnet 2>/dev/null || echo "0") if [ "$balance" == "0" ] || [ -z "$balance" ]; then echo " โ„น๏ธ No balance or account doesn't exist - skipping" return fi echo " ๐Ÿ’ฐ Current balance: $balance" # Try to burn all tokens echo " ๐Ÿ”ฅ Burning $balance tokens..." local result=$(spl-token burn $mint $balance --url devnet 2>&1) if [ $? -eq 0 ]; then echo " โœ… Successfully burned $balance tokens" # Try to close the token account to reclaim SOL echo " ๐Ÿ—‘๏ธ Attempting to close token account..." spl-token close $mint --url devnet 2>/dev/null if [ $? -eq 0 ]; then echo " โœ… Token account closed and SOL reclaimed" else echo " โš ๏ธ Token account could not be closed (may still have remaining dust)" fi else echo " โŒ Failed to burn tokens: $result" fi echo "" } # Burn tokens for each mint for mint in "${TOKENS[@]}"; do burn_token $mint done echo "๐ŸŽฏ Token burning process complete!" echo "" echo "๐Ÿ“Š Final token account status:" spl-token accounts --url devnet echo "" echo "๐Ÿ’ฐ Final SOL balance:" solana balance --url devnet echo "" echo "โœ… Ready for clean testing!" echo "๐Ÿงช You can now test the PoWH program from a clean state"