The Layer Zero Bridger is a Python script that automates the process of transferring USDC or USDT (stablecoin cryptocurrencies) between different blockchains (Polygon -> Avalanche -> BSC -> Polygon as a default route). It uses a set of pre-configured wallet addresses to perform transfers in both directions and repeat the process a configurable number of times. In addition to this, it is also possible to use script for Bungee Refuel, wallet balance checking, new wallets generation and more.
- Polygon (USDC, USDT)
- Fantom (USDC)
- Avalanche (USDC, USDT)
- BSC (USDT)
- Arbitrum (USDT, USDC)
- Optimism (USDC)
- Base (USDC)
- Python 3.11
- An understanding of blockchain, cryptocurrency, and how to handle wallets and private keys securely.
- Docker (optional)
-
Clone the repository:
git clone https://github.com/tmlnv/layer_zero_bridger.git cd layer_zero_bridger
-
Install the required dependencies:
pip install -r requirements.txt
Or, using Docker:
docker build -t layer_zero_bridger .
-
Configure your wallets and number of cycles:
Specify the wallet keys in the
private_keys.example.env
file and run a command below.
Note: keys should be specified with a name for each key in aKEY=value
way.mv private_keys.example.env private_keys.env
In the
config.py
file, specify the min and max $ amounts for transferring, the number of transfer cycles you want to run and a $ amount for Bungee Refueling.AMOUNT_MIN = 100 # Min amount to bridge AMOUNT_MAX = 150 # Max amount to bridge # If stated amounts exceed wallet balance, the whole available balance would be bridged TIMES = 10 # Number of transfer cycles BUNGEE_AMOUNT = 10 # $ value of native asset to be bridged via Bungee Refuel
Warning: Never disclose your private keys. They are sensitive information.
Execute the main.py
script:
python main.py
Or, using Docker:
docker run -v ./private_keys.env:/app/private_keys.env layer_zero_bridger
To pass CLI arguments, append them after the image name and private_keys.env mounting:
docker run -v ./private_keys.env:/app/private_keys.env layer_zero_bridger --mode balance
The main script performs the following actions for each wallet:
- After a random delay of 1 to 200 seconds, it initiates a USDC transfer from Polygon to Avalanche.
- It waits for a random period between 1200 and 1500 seconds.
- Then, it initiates a USDC transfer from Avalanche to BSC. USDT tokens are received on BSC.
- It waits for a random period between 1200 and 1500 seconds.
- Then, it initiates a USDT transfer from BSC back to Polygon. USDC tokens are received on Polygon.
- It waits for a random period between 100 and 300 seconds.
- These steps are repeated a predefined number of times (
TIMES
inconfig.py
).
The script logs all its actions and reports when each wallet's transfers are done and when all tasks are finished.
To use separate modules, execute the main.py
script using --mode
flag with one of possible options or pass the --mode
flag followed by the specific option to the Docker run command:
Execute only separated one-time bridging runs if you want just to transfer assets. Consider token availability on both departure and destination chains. Execute the main.py
script using --mode one-way
flag with one of possible options:
pf
to bridge from Polygon to Fantompa
to bridge from Polygon to Avalanchepb
to bridge from Polygon to BSCparb
to bridge from Polygon to Arbitrumpo
to bridge from Polygon to Optimismpbase
to bridge from Polygon to Basefp
to bridge from Fantom to Polygonfa
to bridge from Fantom to Avalanchefb
to bridge from Fantom to BSCap
to bridge from Avalanche to Polygonaf
to bridge from Avalanche to Fantomab
to bridge from Avalanche to BSCaarb
to bridge from Avalanche to Arbitrumao
to bridge from Avalanche to Optimismabase
to bridge from Avalanche to Basebp
to bridge from BSC to Polygonbf
to bridge from BSC to Fantomba
to bridge from BSC to Avalanchebarb
to bridge from BSC to Arbitrumbo
to bridge from BSC to Optimismbbase
to bridge from BSC to Basearbp
to bridge from Arbitrum to Polygonarba
to bridge from Arbitrum to Avalanchearbb
to bridge from Arbitrum to BSCarbo
to bridge from Arbitrum to Optimismarbbase
to bridge from Arbitrum to Baseop
to bridge from Optimism to Polygonoa
to bridge from Optimism to Avalancheob
to bridge from Optimism to BSCoarb
to bridge from Optimism to Arbitrumobase
to bridge from Optimism to Basebasep
to bridge from Base to Polygonbasea
to bridge from Base to Avalanchebaseb
to bridge from Base to BSCbasearb
to bridge from Base to Arbitrumbaseo
to bridge from Base to Optimism
Example:
python main.py --mode one-way pf
Generate a new private key and its associated address if you require a fresh wallet. Execute the main.py
script using --mode new-wallet
flag.
Example:
python main.py --mode new-wallet
Check wallet balances. Execute the main.py
script using --mode balance
flag.
Example:
python main.py --mode balance
Get native tokens on the destination chain to pay fees using Bungee Refuel. Execute the main.py
script using --mode refuel
flag with one of possible options:
pa
to refuel from Polygon to Avalanchepb
to refuel from Polygon to BSCparb
to refuel from Polygon to Arbitrumpo
to refuel from Polygon to Optimismpbase
to refuel from Polygon to Baseap
to refuel from Avalanche to Polygonab
to refuel from Avalanche to BSCaarb
to refuel from Avalanche to Arbitrumao
to refuel from Avalanche to Optimismabase
to refuel from Avalanche to Basebp
to refuel from BSC to Polygonba
to refuel from BSC to Avalanchebarb
to refuel from BSC to Arbitrumbo
to refuel from BSC to Optimismbbase
to refuel from BSC to Basearbp
to refuel from Arbitrum to Polygonarba
to refuel from Arbitrum to Avalanchearbb
to refuel from Arbitrum to BSCarbo
to refuel from Arbitrum to Optimismarbbase
to refuel from Arbitrum to Baseop
to refuel from Optimism to Polygonoa
to refuel from Optimism to Avalancheob
to refuel from Optimism to BSCoarb
to refuel from Optimism to Arbitrumobase
to refuel from Optimism to Basebasep
to refuel from Base to Polygonbasea
to refuel from Base to Avalanchebaseb
to refuel from Base to BSCbasearb
to refuel from Base to Arbitrumbaseo
to refuel from Base to Optimism
Example:
python main.py --mode refuel pa
Note: Consider that Bungee Refuel has different limits for different chains.
This script is meant for educational purposes. Always ensure you're keeping your private keys secure.