├── .env ├── README.md ├── executor.py ├── executor.sh ├── ext ├── arb.py ├── base.py ├── blast.py └── optimism.py ├── linux.txt ├── lognya.txt ├── main.py ├── main.sh ├── run-executor.bat ├── run-main.bat └── windows.txt /.env: -------------------------------------------------------------------------------- 1 | PRIVATE_KEY=0x00000000000000000000000000000000 2 | BASE_RPC=https://base-sepolia-rpc.publicnode.com 3 | BLAST_RPC=https://sepolia.blast.io 4 | ARB_RPC=https://sepolia-rollup.arbitrum.io/rpc 5 | OP_RPC=https://sepolia.optimism.io -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### WINDOWS/RDP 2 | 3 | 1.) siapkan kopi 1 gelas untuk di minum 4 | 5 | 2.) Edit file .env,lalu isi memakai privatekey kalian (optional ganti rpc) 6 | 7 | 3.) 8 | ``` 9 | pip install -r windows.txt 10 | ``` 11 | 12 | 4.) python main.py untuk run botnya dan tunggu 5 menit 13 | 14 | 5.) 15 | ``` 16 | python executor.py untuk run executor.py 17 | ``` 18 | 19 | 6.) donee 20 | 21 | metode simpelnya untuk windows click aja file run-main,tunggu 5menit lalu click run-executor 22 | 23 | ### LINUX or VPS 24 | 25 | #### Auto Install 26 | ``` 27 | bash <(curl -s https://file.winsnip.xyz/file/uploads/t1rn-bridge-linux) 28 | ``` 29 | - Masukan Private Key Kalian 30 | 31 | #### Check Screen 32 | 33 | ``` 34 | screen -r t1rn 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /executor.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from eth_abi import encode 3 | import os 4 | from dotenv import load_dotenv 5 | 6 | load_dotenv() 7 | blastrpc = os.getenv("BLAST_RPC") 8 | baserpc = os.getenv("BASE_RPC") 9 | arbrpc = os.getenv("ARB_RPC") 10 | oprpc = os.getenv("OP_RPC") 11 | privatekeys = os.getenv("PRIVATE_KEY") 12 | 13 | web3op = Web3(Web3.HTTPProvider(oprpc)) 14 | web3blast = Web3(Web3.HTTPProvider(blastrpc)) 15 | web3_brn = Web3(Web3.HTTPProvider("https://brn.rpc.caldera.xyz/http")) 16 | chainId_brn = web3_brn.eth.chain_id 17 | web3base = Web3(Web3.HTTPProvider(baserpc)) 18 | web3arb = Web3(Web3.HTTPProvider(arbrpc)) 19 | 20 | #connecting web3 21 | if web3blast.is_connected() == True: 22 | print("Web3 Connected BLAST...\n") 23 | else: 24 | print("Error Connecting Please Try Again Exit...") 25 | exit() 26 | 27 | if web3op.is_connected() == True: 28 | print("Web3 Connected OP...\n") 29 | else: 30 | print("Error Connecting Please Try Again Exit...") 31 | exit() 32 | 33 | if web3arb.is_connected() == True: 34 | print("Web3 Connected ARB...\n") 35 | else: 36 | print("Error Connecting Please Try Again Exit...") 37 | exit() 38 | 39 | if web3base.is_connected() == True: 40 | print("Web3 Connected BASE...\n") 41 | else: 42 | print("Error Connecting Please Try Again Exit...") 43 | exit() 44 | #connecting web3 45 | if web3_brn.is_connected() == True: 46 | print("Web3 Connected BRN...\n") 47 | else: 48 | print("Error Connecting Please Try Again Exit...") 49 | exit() 50 | 51 | def ClaimBRN(sender, key, amount, orderid, ordertime, txhash): 52 | try: 53 | gasPrice = web3_brn.eth.gas_price 54 | gasPricePlus = web3_brn.from_wei(gasPrice, 'gwei') 55 | nonce = web3_brn.eth.get_transaction_count(sender) 56 | claimaddr = web3blast.to_checksum_address('0x05C9e2dDfBa9120565c9588fd5d4464B85E77285') #for brn 57 | funcclaim = bytes.fromhex('5765d3c8') 58 | enc_claim = encode(['bytes32', 'address'], [orderid, sender]) 59 | data = web3_brn.to_hex(funcclaim+enc_claim) 60 | 61 | gasAmount = web3_brn.eth.estimate_gas({ 62 | 'chainId': chainId_brn, 63 | 'from': sender, 64 | 'to': claimaddr, 65 | 'value': 0, 66 | 'data': data, 67 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 68 | 'nonce': nonce 69 | }) 70 | 71 | claim_tx = { 72 | 'chainId': chainId_brn, 73 | 'from': sender, 74 | 'to': claimaddr, 75 | 'value': 0, 76 | 'data': data, 77 | 'gas': gasAmount, 78 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 79 | 'nonce': nonce 80 | } 81 | 82 | tx_hash = web3_brn.eth.send_raw_transaction(web3_brn.eth.account.sign_transaction(claim_tx, key).rawTransaction) 83 | print(f'Processing Claim Reward 1 BRN As Executor...') 84 | web3_brn.eth.wait_for_transaction_receipt(tx_hash) 85 | print(f'TX-ID : {str(web3_brn.to_hex(tx_hash))}') 86 | with open("lognya.txt", "r") as file: 87 | lines = file.readlines() 88 | with open("lognya.txt", "w") as file: 89 | found = False 90 | for line in lines: 91 | if line.strip().startswith(txhash): 92 | found = True 93 | else: 94 | file.write(line) 95 | if found: 96 | print("Success Delete Used TXhash and Claim Reward 1 BRN As Executor Success!") 97 | else: 98 | print("Txhash not found") 99 | except Exception as e: 100 | if "BD#16" in str(e): 101 | print('Reward BRN Still Not Ready For Claim!') 102 | elif "BD#15" in str(e): 103 | with open("lognya.txt", "r") as file: 104 | lines = file.readlines() 105 | with open("lognya.txt", "w") as file: 106 | found = False 107 | for line in lines: 108 | if line.strip().startswith(txhash): 109 | found = True 110 | else: 111 | file.write(line) 112 | if found: 113 | print("Reward BRN Already Claimed!, Success Delete Used TXhash") 114 | else: 115 | print("Txhash not found") 116 | else: 117 | print(str(e)) 118 | pass 119 | 120 | def BLAST_BLAST(sender, key, web3, chainid): 121 | with open('lognya.txt', 'r') as file: 122 | local_data = file.read().splitlines() 123 | for txhash in local_data: 124 | try: 125 | txhashdat = txhash.split(":") 126 | if(txhashdat[1] == str(168587773)): 127 | web3 = web3blast 128 | elif(txhashdat[1] == str(84532)): 129 | web3 = web3base 130 | elif(txhashdat[1] == str(421614)): 131 | web3 = web3arb 132 | else: 133 | web3 = web3op 134 | tx = web3.eth.get_transaction(txhashdat[0]) 135 | event = web3.eth.get_transaction_receipt(txhashdat[0]) 136 | amount = tx["value"] 137 | log = event["logs"][0] 138 | topic = log["topics"][1] 139 | data = log["data"] 140 | orderid = topic 141 | getordertime = web3.to_hex(data) 142 | ordertime = int(getordertime[58:], 16) 143 | ClaimBRN(sender, key, amount, orderid, ordertime, txhashdat[0]) 144 | except Exception as e: 145 | print(str(e)) 146 | 147 | while True: 148 | sender = web3blast.eth.account.from_key(privatekeys) 149 | BLAST_BLAST(sender.address, sender.key, web3blast, 168587773) -------------------------------------------------------------------------------- /executor.sh: -------------------------------------------------------------------------------- 1 | python3 executor.py 2 | -------------------------------------------------------------------------------- /ext/arb.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from eth_abi import encode 3 | import os 4 | from dotenv import load_dotenv 5 | import time 6 | import sys 7 | import random 8 | import requests 9 | 10 | load_dotenv() 11 | blastrpc = os.getenv("ARB_RPC") 12 | privatekeys = os.getenv("PRIVATE_KEY") 13 | 14 | web3 = Web3(Web3.HTTPProvider(blastrpc)) 15 | chainId = web3.eth.chain_id 16 | web3_brn = Web3(Web3.HTTPProvider("https://brn.rpc.caldera.xyz/http")) 17 | chainId_brn = web3_brn.eth.chain_id 18 | 19 | #connecting web3 20 | if web3.is_connected() == True: 21 | print("Web3 Connected ARB...\n") 22 | else: 23 | print("Error Connecting Please Try Again Exit...") 24 | exit() 25 | #connecting web3 26 | if web3_brn.is_connected() == True: 27 | print("Web3 Connected BRN...\n") 28 | else: 29 | print("Error Connecting Please Try Again Exit...") 30 | exit() 31 | 32 | def loading_message(message, duration): 33 | sys.stdout.write(message) 34 | sys.stdout.flush() 35 | for _ in range(duration): 36 | sys.stdout.write('.') 37 | sys.stdout.flush() 38 | time.sleep(1) # Adjust speed of the loading effect 39 | sys.stdout.write('\n') 40 | 41 | #log to txt file 42 | def log(txt): 43 | f = open("lognya.txt", "a") 44 | f.write(txt+":"+str(chainId)+'\n') 45 | f.close() 46 | 47 | def Executor(sender, key, amount, amountin, orderid, txhash): 48 | try: 49 | gasPrice = web3.eth.gas_price 50 | nonce = web3.eth.get_transaction_count(sender) 51 | bridgeaddr = web3.to_checksum_address('0x8D86c3573928CE125f9b2df59918c383aa2B514D') #for arb 52 | funcexcutor = bytes.fromhex('01a8f065') 53 | amountzero = 0 54 | bridgedmin = web3.from_wei(amountin, 'ether') 55 | 56 | enc_excutor = encode(['bytes32', 'address', 'uint256', 'uint256'], [orderid, sender, amountin, amountzero]) 57 | data = web3.to_hex(funcexcutor+enc_excutor) 58 | 59 | gasAmount = web3.eth.estimate_gas({ 60 | 'chainId': chainId, 61 | 'from': sender, 62 | 'to': bridgeaddr, 63 | 'value': amountin, 64 | 'data': data, 65 | 'gasPrice': gasPrice, 66 | 'nonce': nonce 67 | }) 68 | 69 | excutor_tx = { 70 | 'chainId': chainId, 71 | 'from': sender, 72 | 'to': bridgeaddr, 73 | 'value': amountin, 74 | 'data': data, 75 | 'gas': gasAmount, 76 | 'gasPrice': gasPrice, 77 | 'nonce': nonce 78 | } 79 | 80 | #sign & send the transaction 81 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(excutor_tx, key).rawTransaction) 82 | #get transaction hash 83 | print(f'Processing Executor Bridge {bridgedmin} From ETH ARB TO ETH ARB') 84 | web3.eth.wait_for_transaction_receipt(tx_hash) 85 | print(f'Executor Bridge {bridgedmin} From ETH ARB TO ETH ARB Success!') 86 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 87 | print(f'') 88 | log(str(txhash)) 89 | except Exception as e: 90 | print(f"Error: {e}") 91 | pass 92 | 93 | def Get_Estimate(sender, key, amount): 94 | url = f"https://pricer.t1rn.io/estimate" 95 | headers = { 96 | "Content-Type": "application/json; charset=utf-8", 97 | "Origin": "https://bridge.t1rn.io", 98 | "Referer": "https://bridge.t1rn.io/", 99 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" 100 | } 101 | 102 | data = { 103 | "fromAsset": "eth", 104 | "toAsset": "eth", 105 | "fromChain": "arbt", 106 | "toChain": "arbt", #arbt (arb) | bssp (base) | blss (blast) | opsp (op) 107 | "amountWei": str(amount), 108 | "executorTipUSD": 0, 109 | "overpayOptionPercentage": 0, 110 | "spreadOptionPercentage": 0 111 | } 112 | 113 | response = requests.post(url, headers=headers, json=data) 114 | result = response.json() 115 | data = result.get('estimatedReceivedAmountWei', {}) 116 | amounthex = data.get('hex') 117 | amountin = int(amounthex, 16) 118 | BLAST_BLAST(sender, key, amount, amountin) 119 | 120 | def BidExecute(sender, key, amount, amountin, orderid, txhash): 121 | try: 122 | gasPrice = web3_brn.eth.gas_price 123 | gasPricePlus = web3_brn.from_wei(gasPrice, 'gwei') 124 | nonce = web3_brn.eth.get_transaction_count(sender) 125 | bidaddr = web3_brn.to_checksum_address('0x05C9e2dDfBa9120565c9588fd5d4464B85E77285') #for brn 126 | funcbid = bytes.fromhex('95627628') 127 | amountzero = 0 128 | bridgedmin = web3_brn.from_wei(amountin, 'ether') 129 | 130 | enc_bid = encode(['bytes32', 'uint256', 'address'], [orderid, amount, sender]) 131 | data = web3_brn.to_hex(funcbid+enc_bid) 132 | 133 | gasAmount = web3_brn.eth.estimate_gas({ 134 | 'chainId': chainId_brn, 135 | 'from': sender, 136 | 'to': bidaddr, 137 | 'value': 0, 138 | 'data': data, 139 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 140 | 'nonce': nonce 141 | }) 142 | 143 | bid_tx = { 144 | 'chainId': chainId_brn, 145 | 'from': sender, 146 | 'to': bidaddr, 147 | 'value': 0, 148 | 'data': data, 149 | 'gas': gasAmount, 150 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 151 | 'nonce': nonce 152 | } 153 | 154 | tx_hash = web3_brn.eth.send_raw_transaction(web3_brn.eth.account.sign_transaction(bid_tx, key).rawTransaction) 155 | print(f'Processing Bid Executor Bridge {bridgedmin} From ETH ARB TO ETH ARB') 156 | web3_brn.eth.wait_for_transaction_receipt(tx_hash) 157 | print(f'Executor Bid Bridge {bridgedmin} From ETH ARB TO ETH ARB Success!') 158 | print(f'TX-ID : {str(web3_brn.to_hex(tx_hash))}') 159 | time.sleep(2) 160 | Executor(sender, key, amount, amountin, orderid, txhash) 161 | except Exception as e: 162 | if "BD#3" in str(e): 163 | loading_message('Please wait',12) 164 | BidExecute(sender, key, amount, amountin, orderid, txhash) 165 | elif "BD#8" in str(e): 166 | loading_message('Please wait',12) 167 | Get_Estimate(sender, key, amount) 168 | elif "nonce" in str(e): 169 | loading_message('Please wait',2) 170 | BidExecute(sender, key, amount, amountin, orderid, txhash) 171 | else: 172 | print(f"Error: {e}") 173 | print('') 174 | time.sleep(2) 175 | time.sleep(2) 176 | pass 177 | 178 | def BLAST_BLAST(sender, key, amount, amountin): 179 | try: 180 | gasPrice = web3.eth.gas_price 181 | nonce = web3.eth.get_transaction_count(sender) 182 | bridgeaddr = web3.to_checksum_address('0x8D86c3573928CE125f9b2df59918c383aa2B514D') #for arb 183 | funcbridge = bytes.fromhex('56591d59') 184 | codebridge = bytes.fromhex('61726274') #arb>arb 185 | amountzero = 0 186 | totalbridge = amount 187 | bridgedmin = web3.from_wei(amountin, 'ether') 188 | 189 | enc_bridge = encode(['bytes4', 'uint256', 'address', 'uint256', 'uint256', 'uint256', 'uint256'], [codebridge, amountzero, sender, amountin, amountzero, amountzero, totalbridge]) 190 | data = web3.to_hex(funcbridge+enc_bridge) 191 | 192 | gasAmount = web3.eth.estimate_gas({ 193 | 'chainId': chainId, 194 | 'from': sender, 195 | 'to': bridgeaddr, 196 | 'value': totalbridge, 197 | 'data': data, 198 | 'gasPrice': gasPrice, 199 | 'nonce': nonce 200 | }) 201 | 202 | bridge_tx = { 203 | 'chainId': chainId, 204 | 'from': sender, 205 | 'to': bridgeaddr, 206 | 'value': totalbridge, 207 | 'data': data, 208 | 'gas': gasAmount, 209 | 'gasPrice': gasPrice, 210 | 'nonce': nonce 211 | } 212 | 213 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(bridge_tx, key).rawTransaction) 214 | print(f'For Wallet Address {sender}') 215 | print(f'Processing Bridge {bridgedmin} ETH ARB TO ETH ARB') 216 | web3.eth.wait_for_transaction_receipt(tx_hash) 217 | print(f'Bridge {bridgedmin} ETH ARB TO ETH ARB Success!') 218 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 219 | event = web3.eth.get_transaction_receipt(web3.to_hex(tx_hash)) 220 | log = event["logs"][1] 221 | topic = log["topics"][1] 222 | orderid = topic 223 | BidExecute(sender, key, amount, amountin, orderid, web3.to_hex(tx_hash)) 224 | except Exception as e: 225 | print(f"Error: {e}") 226 | pass 227 | 228 | amountmin = float(0.01) 229 | amountmax = float(0.0101) 230 | sender = web3.eth.account.from_key(privatekeys) 231 | amountrandom = random.uniform(amountmin, amountmax) 232 | amount = web3.to_wei(amountrandom, 'ether') 233 | calcamountmin = (amountrandom*99.995) / 100 234 | amountin = web3.to_wei(calcamountmin, 'ether') 235 | BLAST_BLAST(sender.address, sender.key, amount, amountin) -------------------------------------------------------------------------------- /ext/base.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from eth_abi import encode 3 | import os 4 | from dotenv import load_dotenv 5 | import time 6 | import sys 7 | import random 8 | import requests 9 | 10 | load_dotenv() 11 | baserpc = os.getenv("BASE_RPC") 12 | privatekeys = os.getenv("PRIVATE_KEY") 13 | 14 | web3 = Web3(Web3.HTTPProvider(baserpc)) 15 | chainId = web3.eth.chain_id 16 | web3_brn = Web3(Web3.HTTPProvider("https://brn.rpc.caldera.xyz/http")) 17 | chainId_brn = web3_brn.eth.chain_id 18 | 19 | #connecting web3 20 | if web3.is_connected() == True: 21 | print("Web3 Connected BASE...\n") 22 | else: 23 | print("Error Connecting Please Try Again Exit...") 24 | exit() 25 | #connecting web3 26 | if web3_brn.is_connected() == True: 27 | print("Web3 Connected BRN...\n") 28 | else: 29 | print("Error Connecting Please Try Again Exit...") 30 | exit() 31 | 32 | def loading_message(message, duration): 33 | sys.stdout.write(message) 34 | sys.stdout.flush() 35 | for _ in range(duration): 36 | sys.stdout.write('.') 37 | sys.stdout.flush() 38 | time.sleep(1) # Adjust speed of the loading effect 39 | sys.stdout.write('\n') 40 | 41 | #log to txt file 42 | def log(txt): 43 | f = open("lognya.txt", "a") 44 | f.write(txt+":"+str(chainId)+'\n') 45 | f.close() 46 | 47 | def Executor(sender, key, amount, amountin, orderid, txhash): 48 | try: 49 | gasPrice = web3.eth.gas_price 50 | nonce = web3.eth.get_transaction_count(sender) 51 | bridgeaddr = web3.to_checksum_address('0x30A0155082629940d4bd9Cd41D6EF90876a0F1b5') #for BASE 52 | funcexcutor = bytes.fromhex('01a8f065') 53 | amountzero = 0 54 | bridgedmin = web3.from_wei(amountin, 'ether') 55 | 56 | enc_excutor = encode(['bytes32', 'address', 'uint256', 'uint256'], [orderid, sender, amountin, amountzero]) 57 | data = web3.to_hex(funcexcutor+enc_excutor) 58 | 59 | gasAmount = web3.eth.estimate_gas({ 60 | 'chainId': chainId, 61 | 'from': sender, 62 | 'to': bridgeaddr, 63 | 'value': amountin, 64 | 'data': data, 65 | 'gasPrice': gasPrice, 66 | 'nonce': nonce 67 | }) 68 | 69 | excutor_tx = { 70 | 'chainId': chainId, 71 | 'from': sender, 72 | 'to': bridgeaddr, 73 | 'value': amountin, 74 | 'data': data, 75 | 'gas': gasAmount, 76 | 'gasPrice': gasPrice, 77 | 'nonce': nonce 78 | } 79 | 80 | #sign & send the transaction 81 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(excutor_tx, key).rawTransaction) 82 | #get transaction hash 83 | print(f'Processing Executor Bridge {bridgedmin} From ETH BASE TO ETH BASE') 84 | web3.eth.wait_for_transaction_receipt(tx_hash) 85 | print(f'Executor Bridge {bridgedmin} From ETH BASE TO ETH BASE Success!') 86 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 87 | print(f'') 88 | log(str(txhash)) 89 | except Exception as e: 90 | print(f"Error: {e}") 91 | pass 92 | 93 | def Get_Estimate(sender, key, amount): 94 | url = f"https://pricer.t1rn.io/estimate" 95 | headers = { 96 | "Content-Type": "application/json; charset=utf-8", 97 | "Origin": "https://bridge.t1rn.io", 98 | "Referer": "https://bridge.t1rn.io/", 99 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" 100 | } 101 | 102 | data = { 103 | "fromAsset": "eth", 104 | "toAsset": "eth", 105 | "fromChain": "bssp", 106 | "toChain": "bssp", #arbt (arb) | bssp (base) | blss (blast) | opsp (op) 107 | "amountWei": str(amount), 108 | "executorTipUSD": 0, 109 | "overpayOptionPercentage": 0, 110 | "spreadOptionPercentage": 0 111 | } 112 | 113 | response = requests.post(url, headers=headers, json=data) 114 | result = response.json() 115 | data = result.get('estimatedReceivedAmountWei', {}) 116 | amounthex = data.get('hex') 117 | amountin = int(amounthex, 16) 118 | BLAST_BLAST(sender, key, amount, amountin) 119 | 120 | def BidExecute(sender, key, amount, amountin, orderid, txhash): 121 | try: 122 | gasPrice = web3_brn.eth.gas_price 123 | gasPricePlus = web3_brn.from_wei(gasPrice, 'gwei') 124 | nonce = web3_brn.eth.get_transaction_count(sender) 125 | bidaddr = web3_brn.to_checksum_address('0x05C9e2dDfBa9120565c9588fd5d4464B85E77285') #for brn 126 | funcbid = bytes.fromhex('95627628') 127 | amountzero = 0 128 | bridgedmin = web3_brn.from_wei(amountin, 'ether') 129 | 130 | enc_bid = encode(['bytes32', 'uint256', 'address'], [orderid, amount, sender]) 131 | data = web3_brn.to_hex(funcbid+enc_bid) 132 | 133 | gasAmount = web3_brn.eth.estimate_gas({ 134 | 'chainId': chainId_brn, 135 | 'from': sender, 136 | 'to': bidaddr, 137 | 'value': 0, 138 | 'data': data, 139 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 140 | 'nonce': nonce 141 | }) 142 | 143 | bid_tx = { 144 | 'chainId': chainId_brn, 145 | 'from': sender, 146 | 'to': bidaddr, 147 | 'value': 0, 148 | 'data': data, 149 | 'gas': gasAmount, 150 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 151 | 'nonce': nonce 152 | } 153 | 154 | tx_hash = web3_brn.eth.send_raw_transaction(web3_brn.eth.account.sign_transaction(bid_tx, key).rawTransaction) 155 | print(f'Processing Bid Executor Bridge {bridgedmin} From ETH BASE TO ETH BASE') 156 | web3_brn.eth.wait_for_transaction_receipt(tx_hash) 157 | print(f'Executor Bid Bridge {bridgedmin} From ETH BASE TO ETH BASE Success!') 158 | print(f'TX-ID : {str(web3_brn.to_hex(tx_hash))}') 159 | time.sleep(2) 160 | Executor(sender, key, amount, amountin, orderid, txhash) 161 | except Exception as e: 162 | if "BD#3" in str(e): 163 | loading_message('Please wait',12) 164 | BidExecute(sender, key, amount, amountin, orderid, txhash) 165 | elif "BD#8" in str(e): 166 | loading_message('Please wait',12) 167 | Get_Estimate(sender, key, amount) 168 | time.sleep(2) 169 | elif "nonce" in str(e): 170 | loading_message('Please wait',2) 171 | BidExecute(sender, key, amount, amountin, orderid, txhash) 172 | else: 173 | print(f"Error: {e}") 174 | print('') 175 | time.sleep(2) 176 | time.sleep(2) 177 | pass 178 | 179 | def BLAST_BLAST(sender, key, amount, amountin): 180 | try: 181 | gasPrice = web3.eth.gas_price 182 | nonce = web3.eth.get_transaction_count(sender) 183 | bridgeaddr = web3.to_checksum_address('0x30A0155082629940d4bd9Cd41D6EF90876a0F1b5') #for base 184 | funcbridge = bytes.fromhex('56591d59') 185 | codebridge = bytes.fromhex('62737370') #base>base 186 | #codebridge = bytes.fromhex('626c7373') #blast>blast 187 | amountzero = 0 188 | totalbridge = amount 189 | bridgedmin = web3.from_wei(amountin, 'ether') 190 | 191 | enc_bridge = encode(['bytes4', 'uint256', 'address', 'uint256', 'uint256', 'uint256', 'uint256'], [codebridge, amountzero, sender, amountin, amountzero, amountzero, totalbridge]) 192 | data = web3.to_hex(funcbridge+enc_bridge) 193 | 194 | gasAmount = web3.eth.estimate_gas({ 195 | 'chainId': chainId, 196 | 'from': sender, 197 | 'to': bridgeaddr, 198 | 'value': totalbridge, 199 | 'data': data, 200 | 'gasPrice': gasPrice, 201 | 'nonce': nonce 202 | }) 203 | 204 | bridge_tx = { 205 | 'chainId': chainId, 206 | 'from': sender, 207 | 'to': bridgeaddr, 208 | 'value': totalbridge, 209 | 'data': data, 210 | 'gas': gasAmount, 211 | 'gasPrice': gasPrice, 212 | 'nonce': nonce 213 | } 214 | 215 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(bridge_tx, key).rawTransaction) 216 | print(f'For Wallet Address {sender}') 217 | print(f'Processing Bridge {bridgedmin} ETH BASE TO ETH BASE') 218 | web3.eth.wait_for_transaction_receipt(tx_hash) 219 | print(f'Bridge {bridgedmin} ETH BASE TO ETH BASE Success!') 220 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 221 | event = web3.eth.get_transaction_receipt(web3.to_hex(tx_hash)) 222 | log = event["logs"][1] 223 | topic = log["topics"][1] 224 | orderid = topic 225 | BidExecute(sender, key, amount, amountin, orderid, web3.to_hex(tx_hash)) 226 | except Exception as e: 227 | print(f"Error: {e}") 228 | pass 229 | 230 | amountmin = float(0.01) 231 | amountmax = float(0.0101) 232 | sender = web3.eth.account.from_key(privatekeys) 233 | amountrandom = random.uniform(amountmin, amountmax) 234 | amount = web3.to_wei(amountrandom, 'ether') 235 | calcamountmin = (amountrandom*99.995) / 100 236 | amountin = web3.to_wei(calcamountmin, 'ether') 237 | BLAST_BLAST(sender.address, sender.key, amount, amountin) -------------------------------------------------------------------------------- /ext/blast.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from eth_abi import encode 3 | import os 4 | from dotenv import load_dotenv 5 | import time 6 | import sys 7 | import random 8 | import requests 9 | 10 | load_dotenv() 11 | blastrpc = os.getenv("BLAST_RPC") 12 | privatekeys = os.getenv("PRIVATE_KEY") 13 | 14 | web3 = Web3(Web3.HTTPProvider(blastrpc)) 15 | chainId = web3.eth.chain_id 16 | web3_brn = Web3(Web3.HTTPProvider("https://brn.rpc.caldera.xyz/http")) 17 | chainId_brn = web3_brn.eth.chain_id 18 | 19 | #connecting web3 20 | if web3.is_connected() == True: 21 | print("Web3 Connected BLAST...\n") 22 | else: 23 | print("Error Connecting Please Try Again Exit...") 24 | exit() 25 | #connecting web3 26 | if web3_brn.is_connected() == True: 27 | print("Web3 Connected BRN...\n") 28 | else: 29 | print("Error Connecting Please Try Again Exit...") 30 | exit() 31 | 32 | def loading_message(message, duration): 33 | sys.stdout.write(message) 34 | sys.stdout.flush() 35 | for _ in range(duration): 36 | sys.stdout.write('.') 37 | sys.stdout.flush() 38 | time.sleep(1) # Adjust speed of the loading effect 39 | sys.stdout.write('\n') 40 | 41 | #log to txt file 42 | def log(txt): 43 | f = open("lognya.txt", "a") 44 | f.write(txt+":"+str(chainId)+'\n') 45 | f.close() 46 | 47 | def Executor(sender, key, amount, amountin, orderid, txhash): 48 | try: 49 | gasPrice = web3.eth.gas_price 50 | nonce = web3.eth.get_transaction_count(sender) 51 | bridgeaddr = web3.to_checksum_address('0x1D5FD4ed9bDdCCF5A74718B556E9d15743cB26A2') #for blast 52 | funcexcutor = bytes.fromhex('01a8f065') 53 | amountzero = 0 54 | bridgedmin = web3.from_wei(amountin, 'ether') 55 | 56 | enc_excutor = encode(['bytes32', 'address', 'uint256', 'uint256'], [orderid, sender, amountin, amountzero]) 57 | data = web3.to_hex(funcexcutor+enc_excutor) 58 | 59 | gasAmount = web3.eth.estimate_gas({ 60 | 'chainId': chainId, 61 | 'from': sender, 62 | 'to': bridgeaddr, 63 | 'value': amountin, 64 | 'data': data, 65 | 'gasPrice': gasPrice, 66 | 'nonce': nonce 67 | }) 68 | 69 | excutor_tx = { 70 | 'chainId': chainId, 71 | 'from': sender, 72 | 'to': bridgeaddr, 73 | 'value': amountin, 74 | 'data': data, 75 | 'gas': gasAmount, 76 | 'gasPrice': gasPrice, 77 | 'nonce': nonce 78 | } 79 | 80 | #sign & send the transaction 81 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(excutor_tx, key).rawTransaction) 82 | #get transaction hash 83 | print(f'Processing Executor Bridge {bridgedmin} From ETH BLAST TO ETH BLAST') 84 | web3.eth.wait_for_transaction_receipt(tx_hash) 85 | print(f'Executor Bridge {bridgedmin} From ETH BLAST TO ETH BLAST Success!') 86 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 87 | print(f'') 88 | log(str(txhash)) 89 | except Exception as e: 90 | print(f"Error: {e}") 91 | pass 92 | 93 | def Get_Estimate(sender, key, amount): 94 | url = f"https://pricer.t1rn.io/estimate" 95 | headers = { 96 | "Content-Type": "application/json; charset=utf-8", 97 | "Origin": "https://bridge.t1rn.io", 98 | "Referer": "https://bridge.t1rn.io/", 99 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" 100 | } 101 | 102 | data = { 103 | "fromAsset": "eth", 104 | "toAsset": "eth", 105 | "fromChain": "blss", 106 | "toChain": "blss", #arbt (arb) | bssp (base) | blss (blast) | opsp (op) 107 | "amountWei": str(amount), 108 | "executorTipUSD": 0, 109 | "overpayOptionPercentage": 0, 110 | "spreadOptionPercentage": 0 111 | } 112 | 113 | response = requests.post(url, headers=headers, json=data) 114 | result = response.json() 115 | data = result.get('estimatedReceivedAmountWei', {}) 116 | amounthex = data.get('hex') 117 | amountin = int(amounthex, 16) 118 | BLAST_BLAST(sender, key, amount, amountin) 119 | 120 | def BidExecute(sender, key, amount, amountin, orderid, txhash): 121 | try: 122 | gasPrice = web3_brn.eth.gas_price 123 | gasPricePlus = web3_brn.from_wei(gasPrice, 'gwei') 124 | nonce = web3_brn.eth.get_transaction_count(sender) 125 | bidaddr = web3_brn.to_checksum_address('0x05C9e2dDfBa9120565c9588fd5d4464B85E77285') #for brn 126 | funcbid = bytes.fromhex('95627628') 127 | amountzero = 0 128 | bridgedmin = web3_brn.from_wei(amountin, 'ether') 129 | 130 | enc_bid = encode(['bytes32', 'uint256', 'address'], [orderid, amount, sender]) 131 | data = web3_brn.to_hex(funcbid+enc_bid) 132 | 133 | gasAmount = web3_brn.eth.estimate_gas({ 134 | 'chainId': chainId_brn, 135 | 'from': sender, 136 | 'to': bidaddr, 137 | 'value': 0, 138 | 'data': data, 139 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 140 | 'nonce': nonce 141 | }) 142 | 143 | bid_tx = { 144 | 'chainId': chainId_brn, 145 | 'from': sender, 146 | 'to': bidaddr, 147 | 'value': 0, 148 | 'data': data, 149 | 'gas': gasAmount, 150 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 151 | 'nonce': nonce 152 | } 153 | 154 | tx_hash = web3_brn.eth.send_raw_transaction(web3_brn.eth.account.sign_transaction(bid_tx, key).rawTransaction) 155 | print(f'Processing Bid Executor Bridge {bridgedmin} From ETH BLAST TO ETH BLAST') 156 | web3_brn.eth.wait_for_transaction_receipt(tx_hash) 157 | print(f'Executor Bid Bridge {bridgedmin} From ETH BLAST TO ETH BLAST Success!') 158 | print(f'TX-ID : {str(web3_brn.to_hex(tx_hash))}') 159 | time.sleep(2) 160 | Executor(sender, key, amount, amountin, orderid, txhash) 161 | except Exception as e: 162 | if "BD#3" in str(e): 163 | loading_message('Please wait',12) 164 | BidExecute(sender, key, amount, amountin, orderid, txhash) 165 | elif "BD#8" in str(e): 166 | loading_message('Please wait',12) 167 | Get_Estimate(sender, key, amount) 168 | elif "nonce" in str(e): 169 | loading_message('Please wait',2) 170 | BidExecute(sender, key, amount, amountin, orderid, txhash) 171 | else: 172 | print(f"Error: {e}") 173 | print('') 174 | time.sleep(2) 175 | time.sleep(2) 176 | pass 177 | 178 | def BLAST_BLAST(sender, key, amount, amountin): 179 | try: 180 | gasPrice = web3.eth.gas_price 181 | nonce = web3.eth.get_transaction_count(sender) 182 | bridgeaddr = web3.to_checksum_address('0x1D5FD4ed9bDdCCF5A74718B556E9d15743cB26A2') #for blast 183 | funcbridge = bytes.fromhex('56591d59') 184 | codebridge = bytes.fromhex('626c7373') #blast>blast 185 | amountzero = 0 186 | totalbridge = amount 187 | bridgedmin = web3.from_wei(amountin, 'ether') 188 | 189 | enc_bridge = encode(['bytes4', 'uint256', 'address', 'uint256', 'uint256', 'uint256', 'uint256'], [codebridge, amountzero, sender, amountin, amountzero, amountzero, totalbridge]) 190 | data = web3.to_hex(funcbridge+enc_bridge) 191 | 192 | gasAmount = web3.eth.estimate_gas({ 193 | 'chainId': chainId, 194 | 'from': sender, 195 | 'to': bridgeaddr, 196 | 'value': totalbridge, 197 | 'data': data, 198 | 'gasPrice': gasPrice, 199 | 'nonce': nonce 200 | }) 201 | 202 | bridge_tx = { 203 | 'chainId': chainId, 204 | 'from': sender, 205 | 'to': bridgeaddr, 206 | 'value': totalbridge, 207 | 'data': data, 208 | 'gas': gasAmount, 209 | 'gasPrice': gasPrice, 210 | 'nonce': nonce 211 | } 212 | 213 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(bridge_tx, key).rawTransaction) 214 | print(f'For Wallet Address {sender}') 215 | print(f'Processing Bridge {bridgedmin} ETH BLAST TO ETH BLAST') 216 | web3.eth.wait_for_transaction_receipt(tx_hash) 217 | print(f'Bridge {bridgedmin} ETH BLAST TO ETH BLAST Success!') 218 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 219 | event = web3.eth.get_transaction_receipt(web3.to_hex(tx_hash)) 220 | log = event["logs"][1] 221 | topic = log["topics"][1] 222 | orderid = topic 223 | BidExecute(sender, key, amount, amountin, orderid, web3.to_hex(tx_hash)) 224 | except Exception as e: 225 | print(f"Error: {e}") 226 | pass 227 | 228 | amountmin = float(0.01) 229 | amountmax = float(0.0101) 230 | sender = web3.eth.account.from_key(privatekeys) 231 | amountrandom = random.uniform(amountmin, amountmax) 232 | amount = web3.to_wei(amountrandom, 'ether') 233 | calcamountmin = (amountrandom*99.995) / 100 234 | amountin = web3.to_wei(calcamountmin, 'ether') 235 | BLAST_BLAST(sender.address, sender.key, amount, amountin) -------------------------------------------------------------------------------- /ext/optimism.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from eth_abi import encode 3 | import os 4 | from dotenv import load_dotenv 5 | import time 6 | import sys 7 | import random 8 | import requests 9 | 10 | load_dotenv() 11 | baserpc = os.getenv("OP_RPC") 12 | privatekeys = os.getenv("PRIVATE_KEY") 13 | 14 | web3 = Web3(Web3.HTTPProvider(baserpc)) 15 | chainId = web3.eth.chain_id 16 | web3_brn = Web3(Web3.HTTPProvider("https://brn.rpc.caldera.xyz/http")) 17 | chainId_brn = web3_brn.eth.chain_id 18 | 19 | #connecting web3 20 | if web3.is_connected() == True: 21 | print("Web3 Connected OP...\n") 22 | else: 23 | print("Error Connecting Please Try Again Exit...") 24 | exit() 25 | #connecting web3 26 | if web3_brn.is_connected() == True: 27 | print("Web3 Connected BRN...\n") 28 | else: 29 | print("Error Connecting Please Try Again Exit...") 30 | exit() 31 | 32 | def loading_message(message, duration): 33 | sys.stdout.write(message) 34 | sys.stdout.flush() 35 | for _ in range(duration): 36 | sys.stdout.write('.') 37 | sys.stdout.flush() 38 | time.sleep(1) # Adjust speed of the loading effect 39 | sys.stdout.write('\n') 40 | 41 | #log to txt file 42 | def log(txt): 43 | f = open("lognya.txt", "a") 44 | f.write(txt+":"+str(chainId)+'\n') 45 | f.close() 46 | 47 | def Executor(sender, key, amount, amountin, orderid, txhash): 48 | try: 49 | gasPrice = web3.eth.gas_price 50 | nonce = web3.eth.get_transaction_count(sender) 51 | bridgeaddr = web3.to_checksum_address('0xF221750e52aA080835d2957F2Eed0d5d7dDD8C38') #for OP 52 | funcexcutor = bytes.fromhex('01a8f065') 53 | amountzero = 0 54 | bridgedmin = web3.from_wei(amountin, 'ether') 55 | 56 | enc_excutor = encode(['bytes32', 'address', 'uint256', 'uint256'], [orderid, sender, amountin, amountzero]) 57 | data = web3.to_hex(funcexcutor+enc_excutor) 58 | 59 | gasAmount = web3.eth.estimate_gas({ 60 | 'chainId': chainId, 61 | 'from': sender, 62 | 'to': bridgeaddr, 63 | 'value': amountin, 64 | 'data': data, 65 | 'gasPrice': gasPrice, 66 | 'nonce': nonce 67 | }) 68 | 69 | excutor_tx = { 70 | 'chainId': chainId, 71 | 'from': sender, 72 | 'to': bridgeaddr, 73 | 'value': amountin, 74 | 'data': data, 75 | 'gas': gasAmount, 76 | 'gasPrice': gasPrice, 77 | 'nonce': nonce 78 | } 79 | 80 | #sign & send the transaction 81 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(excutor_tx, key).rawTransaction) 82 | #get transaction hash 83 | print(f'Processing Executor Bridge {bridgedmin} From ETH OP TO ETH OP') 84 | web3.eth.wait_for_transaction_receipt(tx_hash) 85 | print(f'Executor Bridge {bridgedmin} From ETH OP TO ETH OP Success!') 86 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 87 | print(f'') 88 | log(str(txhash)) 89 | except Exception as e: 90 | print(f"Error: {e}") 91 | pass 92 | 93 | def Get_Estimate(sender, key, amount): 94 | url = f"https://pricer.t1rn.io/estimate" 95 | headers = { 96 | "Content-Type": "application/json; charset=utf-8", 97 | "Origin": "https://bridge.t1rn.io", 98 | "Referer": "https://bridge.t1rn.io/", 99 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" 100 | } 101 | 102 | data = { 103 | "fromAsset": "eth", 104 | "toAsset": "eth", 105 | "fromChain": "opsp", 106 | "toChain": "opsp", #arbt (arb) | bssp (base) | blss (blast) | opsp (op) 107 | "amountWei": str(amount), 108 | "executorTipUSD": 0, 109 | "overpayOptionPercentage": 0, 110 | "spreadOptionPercentage": 0 111 | } 112 | 113 | response = requests.post(url, headers=headers, json=data) 114 | result = response.json() 115 | data = result.get('estimatedReceivedAmountWei', {}) 116 | amounthex = data.get('hex') 117 | amountin = int(amounthex, 16) 118 | BLAST_BLAST(sender, key, amount, amountin) 119 | 120 | def BidExecute(sender, key, amount, amountin, orderid, txhash): 121 | try: 122 | gasPrice = web3_brn.eth.gas_price 123 | gasPricePlus = web3_brn.from_wei(gasPrice, 'gwei') 124 | nonce = web3_brn.eth.get_transaction_count(sender) 125 | bidaddr = web3_brn.to_checksum_address('0x05C9e2dDfBa9120565c9588fd5d4464B85E77285') #for brn 126 | funcbid = bytes.fromhex('95627628') 127 | amountzero = 0 128 | bridgedmin = web3_brn.from_wei(amountin, 'ether') 129 | 130 | enc_bid = encode(['bytes32', 'uint256', 'address'], [orderid, amount, sender]) 131 | data = web3_brn.to_hex(funcbid+enc_bid) 132 | 133 | gasAmount = web3_brn.eth.estimate_gas({ 134 | 'chainId': chainId_brn, 135 | 'from': sender, 136 | 'to': bidaddr, 137 | 'value': 0, 138 | 'data': data, 139 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 140 | 'nonce': nonce 141 | }) 142 | 143 | bid_tx = { 144 | 'chainId': chainId_brn, 145 | 'from': sender, 146 | 'to': bidaddr, 147 | 'value': 0, 148 | 'data': data, 149 | 'gas': gasAmount, 150 | 'gasPrice': web3_brn.to_wei(gasPricePlus*2, 'gwei'), 151 | 'nonce': nonce 152 | } 153 | 154 | tx_hash = web3_brn.eth.send_raw_transaction(web3_brn.eth.account.sign_transaction(bid_tx, key).rawTransaction) 155 | print(f'Processing Bid Executor Bridge {bridgedmin} From ETH OP TO ETH OP') 156 | web3_brn.eth.wait_for_transaction_receipt(tx_hash) 157 | print(f'Executor Bid Bridge {bridgedmin} From ETH OP TO ETH OP Success!') 158 | print(f'TX-ID : {str(web3_brn.to_hex(tx_hash))}') 159 | time.sleep(2) 160 | Executor(sender, key, amount, amountin, orderid, txhash) 161 | except Exception as e: 162 | if "BD#3" in str(e): 163 | loading_message('Please wait',12) 164 | BidExecute(sender, key, amount, amountin, orderid, txhash) 165 | elif "BD#8" in str(e): 166 | loading_message('Please wait',12) 167 | Get_Estimate(sender, key, amount) 168 | time.sleep(2) 169 | elif "nonce" in str(e): 170 | loading_message('Please wait',2) 171 | BidExecute(sender, key, amount, amountin, orderid, txhash) 172 | else: 173 | print(f"Error: {e}") 174 | print('') 175 | time.sleep(2) 176 | time.sleep(2) 177 | pass 178 | 179 | def BLAST_BLAST(sender, key, amount, amountin): 180 | try: 181 | gasPrice = web3.eth.gas_price 182 | nonce = web3.eth.get_transaction_count(sender) 183 | bridgeaddr = web3.to_checksum_address('0xF221750e52aA080835d2957F2Eed0d5d7dDD8C38') #for OP 184 | funcbridge = bytes.fromhex('56591d59') 185 | codebridge = bytes.fromhex('6f707370') #OP>OP 186 | #codebridge = bytes.fromhex('626c7373') #blast>blast 187 | amountzero = 0 188 | totalbridge = amount 189 | bridgedmin = web3.from_wei(amountin, 'ether') 190 | 191 | enc_bridge = encode(['bytes4', 'uint256', 'address', 'uint256', 'uint256', 'uint256', 'uint256'], [codebridge, amountzero, sender, amountin, amountzero, amountzero, totalbridge]) 192 | data = web3.to_hex(funcbridge+enc_bridge) 193 | 194 | gasAmount = web3.eth.estimate_gas({ 195 | 'chainId': chainId, 196 | 'from': sender, 197 | 'to': bridgeaddr, 198 | 'value': totalbridge, 199 | 'data': data, 200 | 'gasPrice': gasPrice, 201 | 'nonce': nonce 202 | }) 203 | 204 | bridge_tx = { 205 | 'chainId': chainId, 206 | 'from': sender, 207 | 'to': bridgeaddr, 208 | 'value': totalbridge, 209 | 'data': data, 210 | 'gas': gasAmount, 211 | 'gasPrice': gasPrice, 212 | 'nonce': nonce 213 | } 214 | 215 | tx_hash = web3.eth.send_raw_transaction(web3.eth.account.sign_transaction(bridge_tx, key).rawTransaction) 216 | print(f'For Wallet Address {sender}') 217 | print(f'Processing Bridge {bridgedmin} ETH OP TO ETH OP') 218 | web3.eth.wait_for_transaction_receipt(tx_hash) 219 | print(f'Bridge {bridgedmin} ETH OP TO ETH OP Success!') 220 | print(f'TX-ID : {str(web3.to_hex(tx_hash))}') 221 | event = web3.eth.get_transaction_receipt(web3.to_hex(tx_hash)) 222 | log = event["logs"][1] 223 | topic = log["topics"][1] 224 | orderid = topic 225 | BidExecute(sender, key, amount, amountin, orderid, web3.to_hex(tx_hash)) 226 | except Exception as e: 227 | print(f"Error: {e}") 228 | pass 229 | 230 | amountmin = float(0.01) 231 | amountmax = float(0.0101) 232 | sender = web3.eth.account.from_key(privatekeys) 233 | amountrandom = random.uniform(amountmin, amountmax) 234 | amount = web3.to_wei(amountrandom, 'ether') 235 | calcamountmin = (amountrandom*99.995) / 100 236 | amountin = web3.to_wei(calcamountmin, 'ether') 237 | BLAST_BLAST(sender.address, sender.key, amount, amountin) -------------------------------------------------------------------------------- /linux.txt: -------------------------------------------------------------------------------- 1 | web3==6.20.1 2 | python-dotenv==1.0.1 -------------------------------------------------------------------------------- /lognya.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winsnip/t3rn/0033dc56bd17e59ecc2f3ec4d1b0bfc6e7318478/lognya.txt -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import curses 2 | from web3 import Web3 3 | import time 4 | import subprocess 5 | import shutil 6 | import os 7 | from dotenv import load_dotenv 8 | load_dotenv() 9 | 10 | privatekeys = os.getenv("PRIVATE_KEY") 11 | 12 | python_executables = ['python', 'python3', 'py'] 13 | 14 | rpc_urls = { 15 | 'sepolia': 'https://ethereum-sepolia-rpc.publicnode.com', 16 | 'arb-sepolia': os.getenv("ARB_RPC"), 17 | 'base-sepolia': os.getenv("BASE_RPC"), 18 | 'opt-sepolia': os.getenv("OP_RPC"), 19 | 'blast-sepolia': os.getenv("BLAST_RPC"), 20 | 'brn': 'https://brn.rpc.caldera.xyz/http' 21 | } 22 | 23 | web3_instances = {name: Web3(Web3.HTTPProvider(url)) for name, url in rpc_urls.items()} 24 | for name, web3 in web3_instances.items(): 25 | if not web3.is_connected(): 26 | print(f"Warning: Cannot connect to the {name} network") 27 | web3_instances[name] = None 28 | 29 | addresses = { 30 | 'MDP': web3.eth.account.from_key(privatekeys).address 31 | } 32 | 33 | def get_balance(web3, address): 34 | if web3 is None: 35 | return 0 36 | balance_wei = web3.eth.get_balance(address) 37 | balance_ether = web3.from_wei(balance_wei, 'ether') 38 | print(f"Debug: Balance for {address}: {balance_ether}") 39 | return balance_ether 40 | 41 | def calculate_change(new_balance, old_balance): 42 | return new_balance - old_balance 43 | 44 | def draw_large_number(stdscr, number, row, col): 45 | large_numbers = { 46 | '0': [" 000 ", "0 0", "0 0", "0 0", " 000 "], 47 | '1': [" 1 ", " 11 ", " 1 ", " 1 ", " 111 "], 48 | '2': [" 222 ", "2 2", " 2 ", " 2 ", " 2222"], 49 | '3': [" 333 ", " 3", " 33 ", " 3", " 333 "], 50 | '4': ["4 4 ", "4 4 ", " 4444", " 4 ", " 4 "], 51 | '5': [" 5555", "5 ", " 555 ", " 5", " 555 "], 52 | '6': [" 666 ", "6 ", " 666 ", "6 6", " 666 "], 53 | '7': [" 7777", " 7", " 7 ", " 7 ", " 7 "], 54 | '8': [" 888 ", "8 8", " 888 ", "8 8", " 888 "], 55 | '9': [" 999 ", "9 9", " 9999", " 9", " 999 "] 56 | } 57 | max_y, max_x = stdscr.getmaxyx() 58 | for i, line in enumerate(large_numbers[number]): 59 | if row + i < max_y and col + len(line) < max_x: 60 | try: 61 | stdscr.addstr(row + i, col, line, curses.color_pair(3)) 62 | except curses.error: 63 | pass 64 | 65 | def main(stdscr): 66 | curses.curs_set(0) 67 | stdscr.nodelay(1) 68 | stdscr.timeout(1000) 69 | 70 | curses.start_color() 71 | curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK) 72 | curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK) 73 | curses.init_pair(3, curses.COLOR_YELLOW, curses.COLOR_BLACK) 74 | curses.init_pair(4, curses.COLOR_GREEN, curses.COLOR_BLACK) 75 | curses.init_pair(5, curses.COLOR_WHITE, curses.COLOR_BLACK) 76 | 77 | chain_names = { 78 | 'sepolia': 'SEPO', 79 | 'arb-sepolia': 'ARB', 80 | 'base-sepolia': 'BASE', 81 | 'opt-sepolia': 'OPT', 82 | 'blast-sepolia': 'BLAST', 83 | 'brn': 'REWARD' 84 | } 85 | 86 | previous_balances = {} 87 | 88 | refresh_interval = 10 89 | while True: 90 | stdscr.clear() 91 | max_y, max_x = stdscr.getmaxyx() 92 | 93 | col_width = max(len(name) for name in addresses.keys()) + 2 94 | col_width = max(col_width, 15) 95 | 96 | stdscr.addstr(0, 0, "+" + "-" * (col_width - 1) + "+") 97 | col = 1 98 | for name in addresses.keys(): 99 | if col * col_width >= max_x: 100 | break 101 | stdscr.addstr(0, col * col_width, "+" + "-" * (col_width - 1) + "+") 102 | stdscr.addstr(1, col * col_width, f"{name}".center(col_width - 1)) 103 | col += 1 104 | stdscr.addstr(1, 0, " " * col_width) 105 | stdscr.addstr(2, 0, "+" + "-" * (col_width - 1) + "+") 106 | for i in range(1, col): 107 | stdscr.addstr(2, i * col_width, "+" + "-" * (col_width - 1) + "+") 108 | 109 | row = 3 110 | for chain_name, web3 in web3_instances.items(): 111 | if web3 is None: 112 | continue 113 | if row >= max_y - 1: 114 | break 115 | stdscr.addstr(row, 0, f"{chain_names[chain_name]}".center(col_width - 1)) 116 | col = 1 117 | for address in addresses.values(): 118 | if col * col_width >= max_x: 119 | break 120 | balance = get_balance(web3, address) 121 | for python_exec in python_executables: 122 | if shutil.which(python_exec) is not None: 123 | try: 124 | if chain_name == 'arb-sepolia' and balance > float(0.02): 125 | subprocess.Popen([python_exec, "ext/arb.py"],stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 126 | elif chain_name == 'opt-sepolia' and balance > float(0.02): 127 | subprocess.Popen([python_exec, "ext/optimism.py"],stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 128 | elif chain_name == 'base-sepolia' and balance > float(0.02): 129 | subprocess.Popen([python_exec, "ext/base.py"],stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 130 | elif chain_name == 'blast-sepolia' and balance > float(0.02): 131 | subprocess.Popen([python_exec, "ext/blast.py"],stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) 132 | except Exception as e: 133 | print(f"Failed to run with {python_exec}: {e}") 134 | if chain_name == 'brn': 135 | balance_str = f"{balance:.5f}".strip() 136 | stdscr.addstr(row, col * col_width, balance_str.center(col_width - 1), curses.color_pair(1)) 137 | elif chain_name == 'arb-sepolia': 138 | balance_str = f"{balance:.5f} ETH".strip() 139 | stdscr.addstr(row, col * col_width, balance_str.center(col_width - 1), curses.color_pair(2)) 140 | else: 141 | balance_str = f"{balance:.5f} ETH".strip() 142 | stdscr.addstr(row, col * col_width, balance_str.center(col_width - 1)) 143 | col += 1 144 | row += 1 145 | stdscr.addstr(row, 0, "+" + "-" * (col_width - 1) + "+") 146 | for i in range(1, col): 147 | stdscr.addstr(row, i * col_width, "+" + "-" * (col_width - 1) + "+") 148 | row += 1 149 | 150 | if not previous_balances: 151 | previous_balances = {address: get_balance(web3_instances['brn'], address) for address in addresses.values()} 152 | 153 | if 'brn' in web3_instances and web3_instances['brn'] is not None: 154 | stdscr.addstr(row, 0, "Change".center(col_width - 1), curses.color_pair(3)) 155 | col = 1 156 | for address in addresses.values(): 157 | if col * col_width >= max_x: 158 | break 159 | new_balance = get_balance(web3_instances['brn'], address) 160 | change = calculate_change(new_balance, previous_balances[address]) 161 | change_str = f"{change:.5f}".strip() 162 | if change > 0: 163 | color = curses.color_pair(4) 164 | elif change == 0: 165 | color = curses.color_pair(5) 166 | else: 167 | color = curses.color_pair(1) 168 | stdscr.addstr(row, col * col_width, change_str.center(col_width - 1), color) 169 | previous_balances[address] = new_balance 170 | col += 1 171 | row += 1 172 | stdscr.addstr(row, 0, "+" + "-" * (col_width - 1) + "+") 173 | for i in range(1, col): 174 | stdscr.addstr(row, i * col_width, "+" + "-" * (col_width - 1) + "+") 175 | row += 1 176 | 177 | max_y, max_x = stdscr.getmaxyx() 178 | for remaining in range(refresh_interval, 0, -1): 179 | if row + 7 < max_y: 180 | try: 181 | stdscr.addstr(row, 0, "Refreshing in".center(max_x)) 182 | draw_large_number(stdscr, str(remaining // 10), row + 1, max_x // 2 - 6) 183 | draw_large_number(stdscr, str(remaining % 10), row + 1, max_x // 2) 184 | stdscr.refresh() 185 | except curses.error: 186 | pass 187 | time.sleep(1) 188 | 189 | stdscr.refresh() 190 | 191 | curses.wrapper(main) 192 | -------------------------------------------------------------------------------- /main.sh: -------------------------------------------------------------------------------- 1 | apt install python3-pip python3 nano -y && pip install -r linux.txt && nano .env && echo "python3 main.py" > main.sh && python3 main.py 2 | -------------------------------------------------------------------------------- /run-executor.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | where python >nul 2>nul 5 | if %errorlevel%==0 ( 6 | echo menjalankan script executor.py 7 | python executor.py 8 | goto end 9 | ) 10 | 11 | where python3 >nul 2>nul 12 | if %errorlevel%==0 ( 13 | echo menjalankan script executor.py 14 | python3 executor.py 15 | goto end 16 | ) -------------------------------------------------------------------------------- /run-main.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | where python >nul 2>nul 5 | if %errorlevel%==0 ( 6 | echo Python sudah terinstall. 7 | notepad "./.env" 8 | python -m pip install -r windows.txt >nul 2>nul 9 | echo menjalankan script main.py 10 | python main.py 11 | goto end 12 | ) 13 | 14 | where python3 >nul 2>nul 15 | if %errorlevel%==0 ( 16 | echo Python sudah terinstall. 17 | notepad "./.env" 18 | python3 -m pip install -r windows.txt >nul 2>nul 19 | echo menjalankan script main.py 20 | python3 main.py 21 | goto end 22 | ) 23 | 24 | echo Python tidak ditemukan. Mengunduh dan menginstal Python... 25 | 26 | curl -o python-installer.exe https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe 27 | 28 | start /wait python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 29 | 30 | del python-installer.exe 31 | 32 | where python >nul 2>nul 33 | if %errorlevel%==0 ( 34 | echo Instalasi Python berhasil. 35 | notepad "./.env" 36 | python -m pip install -r windows.txt >nul 2>nul 37 | echo menjalankan script main.py 38 | python main.py 39 | ) else ( 40 | echo Instalasi Python gagal. 41 | ) 42 | 43 | :end 44 | pause 45 | -------------------------------------------------------------------------------- /windows.txt: -------------------------------------------------------------------------------- 1 | web3==6.20.1 2 | python-dotenv==1.0.1 3 | windows-curses==2.3.3 --------------------------------------------------------------------------------