- Clone this:
https://github.com/UnicorNn1/zkSync-Transfer-Bot.git
- Go to the project directory:
cd zk-transfer-bot
- Install the required Node.js dependencies:
npm install
There are two configuration files under the config
folder in the root directory of the project: tokens.json
and wallets.json
. Tokens.json is an already configured file.
This file contains wallet information and addresses to be transferred. For example:
{
"providerUrl": "https://mainnet.era.zksync.io/",
"wallets": [
{
"privateKey": "YOUR_PRIVATE_KEY_1",
"transferToAddress": "ADDRESS_TO_TRANSFER_TO_1"
},
{
"privateKey": "YOUR_PRIVATE_KEY_2",
"transferToAddress": "ADDRESS_TO_TRANSFER_TO_2"
}
]
}
- Start the project:
npm i && npm start
- Create the Docker image:
docker build -t my-node-app .
- Run the Docker container:
docker run my-node-app
This file tracks token transfers and performs transfer operations. The transferTokens
function checks the balance of a wallet and transfers it to a specific address. The monitorWallet
function monitors a specific wallet and listens for transfer events.
The code includes a retry mechanism to retry transactions in case of network failures. This mechanism retries operations up to a certain number of attempts and waits for a certain time for each failed attempt.
This project is licensed under the MIT licence. See the LICENSE file for more information.