This Python script automates the process of sending multiple ERC-20 tokens from multiple sender wallets to a single recipient on the Arbitrum Sepolia testnet.
- Sends all available token balances from each wallet.
- Supports multiple ERC-20 token contracts.
- Handles errors and logs progress clearly in the terminal.
- Uses
.envfor secure configuration.
Make sure you have:
- Python 3.7+
- pip
- ARB Sepolia RPC endpoint (you can get from https://www.infura.io) If you don't have this, steps on how you can do it will be at the bottom of this file.
Then install dependencies:
pip install web3 python-dotenv-
Clone or download this repo to your local machine.
-
Edit the
env.examplefile and rename it to.envin the same directory as the script by putting your RPC endpoint, address and private keys where necessary
⚠️ Never share your.envfile or private keys publicly!!
In the script (index.py), there's a list of token contract addresses:
token_addresses = [
"0xTokenAddress1",
"0xTokenAddress2",
...
]Replace these with the token contracts you want to send.
Once your .env is set up and dependencies are installed, run:
python index.pyThe script will:
- Loop through each sender
- Check all token balances
- Send all available tokens to the recipient
- Log all actions and errors in the terminal
- To change the network, update the
ARBITRUM_SEPOLIA_RPCURL in.env. - To add/remove wallets or tokens, just update the
.envfile and token list. - To adjust gas settings, tweak this section in the script:
"gas": 100000,
"gasPrice": w3.to_wei("0.01", "gwei"),Could not connect to RPC: Check if your RPC URL is valid and working.Error sending token...: Check token contract, gas settings, and private key.Nonce too low: Wait a few seconds or increase the delay between transactions.
- Visit https://www.infura.io
- Signup or login if you have an existing account
- Scroll a little down, if you see -
My First key, click on it. If not, click on generate new API key - By default, all chains are enabled, disable all except
Arbitrum Sepolia. (If you want to use any other chain, simply enable it) - Filter to
Active Endpointsand then copy the URL under Arbitrum Sepolia. This URL is your RPC endpoint.
For Ubuntu/Linux, enter this command;
sudo apt update
sudo apt install python3 python3-pip -yFor MacOS, if you have homebrew installed, enter this command;
brew install pythonFor Windows;
- Go to
https://www.python.org/downloads/ - Download the latest Python version
- Run the installer and make sure to check the box that says
Add Python to PATH - Then click
Install Now
Alternatively, you can get python for your various operating sysytems on https://www.python.org/downloads/
- To check if python is installed
python --versionorpython3 --version - To check pip
pip --versionorpip3 --version
This project is licensed under the MIT License - see the LICENSE file for details.