# Unlock Free BRN Airdrops with T3RN! How to Use Bots for Faster Gains on Testnet!

By [Degen Dojo](https://paragraph.com/@degendojo) · 2024-09-09

airdrop, bot, bridge

---

T3RN is a Polkadot-based blockchain interoperability protocol that facilitates cross-chain transactions, enabling seamless collaboration between blockchains. This project is designed to host smart contracts that are interoperable, secure, and composable, allowing them to execute across multiple chains while being stored in a decentralized repository.

Recently, **T3RN has launched a new incentivized testnet**, offering confirmed rewards for participants who bridge tokens across multiple networks. This guide will show you how to maximize your chances of earning BRN airdrops, including an automated bot setup that will make the process faster and more efficient.

### ![](https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f680.png) What is T3RN?

T3RN aims to build a decentralized ecosystem where developers are rewarded for their contributions to cross-chain interoperability. With smart contracts that can execute on multiple blockchains simultaneously, T3RN simplifies the process of collaborating across chains, offering a trust-free environment. The ultimate goal is to give users the power to deploy smart contracts on various blockchains, seamlessly integrating them into one interoperable network.

### ![](https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f3af.png) How to Participate in the T3RN Incentivized Testnet

Here’s how you can participate and potentially earn BRN airdrops for bridging assets across supported networks:

#### Requirements:

*   **Wallet**: Metamask
    
*   **Supported Networks**: ETH ARB, Base Sepolia, Blast Sepolia, OP Sepolia
    

### ![](https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1fa82.png) Step-by-Step Guide to Register and Earn BRN Airdrops

1.  **Visit** : [T3RN Bridge](https://bridge.t1rn.io/)
    
2.  **Connect New Wallet** or Testnet Wallet through Metamask.
    
3.  **Bridge ETH ARB** to other supported networks.
    
4.  For **every bridge transaction**, you’ll receive **1 BRN Airdrop**.
    
5.  **Repeat this process daily** to increase your airdrops.
    

### 🤖 Automate the Process with a Bot (Boost Your Earnings!)

To make the bridging process more efficient, you can set up a bot on a VPS to handle the transactions automatically. This is particularly useful for pushing more BRN airdrops without manually bridging every day.

#### Setting Up the Bot:

1.  **Install Node.js and npm** on your VPS:
    
        sudo apt-get install nodejs npm -y
        sudo npm install n -g
        sudo n latest
    
2.  **Create a folder for the bot**:
    
        mkdir bot-brn
        cd bot-brn
        npm init
        npm install ethers@5
    
3.  **Create a file called** `index.js` in the folder and paste the bot code (provided below).
    
        const { BigNumber } = require("ethers");
        const { parseEther, formatEther } = require("ethers/lib/utils");
        const ethers = require('ethers')
        
        const sleepTimer = () => {
            return Math.random() * (120000 - 60000) + 60000;
        }
        function generateRandomAmount() {
            return parseFloat(Math.random() * (0.0200 - 0.0100) + 0.0100).toFixed(4);
        }
        function getRandomElement() {
            let chainList = ["2737370","f707370","26c7373","1726274"]
            const randomIndex = Math.floor(Math.random() * chainList.length);
            return chainList[randomIndex];
        }
        function getSourceNetwork() {
            const sourceConfigList = [{
                name: "base-sepolia",
                chainId: "84532",
                address: "0x30A0155082629940d4bd9Cd41D6EF90876a0F1b5",
                provider: "https://base-sepolia.blockpi.network/v1/rpc/public",
                bridgeId: "2737370"
            },{
                name: "blast-sepolia",
                chainId: "168587773",
                address: "0x1D5FD4ed9bDdCCF5A74718B556E9d15743cB26A2",
                provider: "https://blast-sepolia.blockpi.network/v1/rpc/public",
                bridgeId: "26c7373"
            },{
                name: "op-sepolia",
                chainId: "11155420",
                address: "0xF221750e52aA080835d2957F2Eed0d5d7dDD8C38",
                provider: "https://optimism-sepolia.blockpi.network/v1/rpc/public",
                bridgeId: "f707370"
            },{
                name: "arb-sepolia",
                chainId: "421614",
                address: "0x8D86c3573928CE125f9b2df59918c383aa2B514D",
                provider: "https://arbitrum-sepolia.blockpi.network/v1/rpc/public",
                bridgeId: "1726274"
            }]
            
            const randomIndex = Math.floor(Math.random() * sourceConfigList.length);
            return sourceConfigList[randomIndex];
        }
        const bridge = async (privateKey) => {
            console.log("=========================================")
            let config = getSourceNetwork()
        
            let arbProvider = config.provider
            const providerJSON = new ethers.providers.JsonRpcProvider(arbProvider);
            const wallet = new ethers.Wallet(privateKey, providerJSON)
            const balance = await providerJSON.getBalance(wallet.address).catch((e) => 0)
            console.log(`loaded wallet ${config.name}, balance: ${formatEther(balance)} ETH`)
        
            let addrBridge = config.address
            let amountBridge = parseEther(generateRandomAmount())
            console.log(`bridge amount ${formatEther(amountBridge)} ETH`)
            let netAmountBridge = amountBridge - (amountBridge * 0.01)
            console.log(`net amount ${formatEther(netAmountBridge.toString())}`)
            let chainId = getRandomElement()
            console.log(`bridge from ${config.name} to ${chainId}`)
            
            // Translated message
            if (chainId == config.bridgeId) {
                console.log(`[x] Destination Chain Cannot Be the Same as Source Chain, Try Again`)
                return bridge(privateKey)
            }
            
            // Translated message
            if (balance.lt(amountBridge)) {
                console.log(`[x] Insufficient Balance to Bridge, Try Again`)
                return bridge(privateKey)
            }
        
            let dataBridge = `0x56591d596${chainId}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000${wallet.address.slice(2).toLowerCase()}00000000000000000000000000000000000000000000000000${BigNumber.from(netAmountBridge.toString())._hex.slice(2)}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000${BigNumber.from(amountBridge.toString())._hex.slice(2)}`
        
            let txEstimateGas = await wallet.estimateGas({
                to: addrBridge,
                value: amountBridge,
                data: dataBridge
            }).catch((e) => ({status: 500, message: e.reason}))
        
            if (BigNumber.isBigNumber(txEstimateGas)) {
                let txSend = await wallet.sendTransaction({
                    to: addrBridge,
                    value: amountBridge,
                    data: dataBridge
                }).catch((e) => ({status: 500, message: e.reason, hash: null}))
        
                console.log(`√ Tx Bridge: ${txSend.hash}`)
                return setTimeout(() => {
                    bridge(privateKey)
                }, sleepTimer())
            } else {
                console.log(txEstimateGas)
                return setTimeout(() => {
                    bridge(privateKey)
                }, sleepTimer())
            }
        }
        
        bridge("0x00000") // -> CHANGE YOUR PRIVATE KEY
    
4.  **Edit the private key** in the code at `bridge("0x00000")` with your own private key.
    
5.  **Run the bot**:
    
        node index.js
    

This bot will **randomly bridge** small amounts of ETH (between 0.01 - 0.02 ETH) across ARB, BASE, BLAST, and OP networks. The bot runs automatically and randomizes which chains to bridge between, reducing the chance of being flagged as a Sybil or automated activity.

### ![](https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/26a1.png) Tips for Optimizing the Bot

*   **Monitor pending transactions**: If any transactions are pending, manually refund them to avoid being flagged as a bot or Sybil attack.
    
*   **Use new wallets**: If you're unsure about the code or for added security, use a new wallet to run the bot.
    

### ![](https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64/1f3c6.png) Maximize Your Rewards

Using this automated bot, you can increase your chances of earning more BRN airdrops without needing to manually bridge assets every day. Simply set up the bot, fund your wallets, and let the bot handle the rest!

This method can help you efficiently participate in the T3RN incentivized testnet, unlocking the potential to earn free tokens while contributing to the growth of blockchain interoperability.

---

*Originally published on [Degen Dojo](https://paragraph.com/@degendojo/bot-t3rn-bridge-airdrop)*
