Script that uses a master wallet with gas and automatically checks balances and funds to an array of wallets and making sure it maintains a defined minimum balance.
- Python 3.x
- web3.py
- eth-account
- python-dotenv
- Clone this repository:
git clone <repository-url>
cd <repository-directory>
- Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install web3 eth-account python-dotenv
- Configure your environment variables in
.envfile:
# API Keys
ALCHEMY_API_KEY=your_alchemy_api_key_here
# Master Wallet (funds distributor)
MASTER_PRIVATE_KEY=your_master_wallet_private_key
# Wallet Private Keys (comma-separated)
WALLET_PRIVATE_KEYS=key1,key2,key3,...
# Configuration
TOKEN_MAX=0.5
CHAIN_ID=7080969
RPC_URL=https://humanity-testnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}
- Make sure your environment variables are set in the
.envfile - Ensure your master wallet has enough funds to distribute
- Run the script:
python airdrop.py
The script will:
- Load your wallet configurations
- Create
accounts.jsonfile if it doesn't exist - Check each wallet's balance
- Send funds from the master wallet to any wallet with a balance below
TOKEN_MAX
π Connected to network: 7080969
π Loaded accounts.json with 20 wallets
πΌ Master wallet: 0xC206074d9153054E88C86197f940F5F1F79E8D11
π° Master balance: 30.004875684100000025 ETH
π Wallet 0 (0x25583917f7Ca519DcF9aF389ae7A97e5cA174a50): 0.5 ETH
π€ Sending 0.1 ETH to 0x53AE1Cd91EFfa8476c2ecc7dfF0A2Bb084613F5B...
β
Transaction successful: 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
TOKEN_MAX: The target ETH balance for each wallet (default: 0.5)CHAIN_ID: The Ethereum network chain ID (7080969 for Humanity Arbitrum Testnet)RPC_URL: The RPC endpoint URL for the Ethereum networkMASTER_PRIVATE_KEY: The private key of the master wallet that will fund other walletsWALLET_PRIVATE_KEYS: Comma-separated list of wallet private keys to manage