├── private_keys.txt ├── recepients.txt ├── README.md ├── erc20.json └── main.py /private_keys.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /recepients.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sender-coins 2 | 3 | скрипт отправляет монеты в (почти) любой сети. 4 | выводить будет так : 1 кошелек => 1 кошелек. то есть кол-во кошельков должно быть равное. если выводишь с 200 кошельков, то и recepient должно быть 200. если хочешь выводить с (например) 200 кошельков на 1, то в recepient нужно 200 раз прописать адрес одного кошелька. 5 | 6 | --- 7 | 8 | инструкция : 9 | 1. в файл private_keys.txt добавляем приватники кошельков, с которых будем выводить монеты. 10 | 2. в файл recepients.txt добавляем адреса кошельков, на которые будем отправлять монеты. 11 | 3. скачиваем необходимые библиотеки (прописывай в терминал) : 12 | pip install web3, termcolor, json, random, tqdm, decimal, requests, tabulate 13 | 4. в main.py меняем 3 переменные : AMOUNT_TO_TRANSFER, CHAIN и ADDRESS_CONTRACT. 14 | 15 | AMOUNT_TO_TRANSFER = кол-во выводимых токенов. пиши 'all_balance' если хочешь вывести весь баланс. 16 | CHAIN = сеть, в которой будешь выводить. 17 | ADDRESS_CONTRACT = контракт монеты. если выводишь нативную монету сети (eth / bnb / avax), тогда оставляй пустым : ''. 18 | 19 | I'm = админ паблика https://t.me/hodlmodeth, отправитель редких гемов в [ [ chat ] ](http://t.me/chathodlmodeth) и главный, но не самый умный кодер чата [ [ code ] ](https://t.me/code_hodlmodeth). все вопросы по кодингу туда. 20 | -------------------------------------------------------------------------------- /erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "name": "name", 5 | "outputs": [ 6 | { 7 | "internalType": "string", 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "stateMutability": "view", 13 | "type": "function" 14 | }, 15 | { 16 | "inputs": [], 17 | "name": "symbol", 18 | "outputs": [ 19 | { 20 | "internalType": "string", 21 | "name": "", 22 | "type": "string" 23 | } 24 | ], 25 | "stateMutability": "view", 26 | "type": "function" 27 | }, 28 | { 29 | "inputs": [], 30 | "name": "decimals", 31 | "outputs": [ 32 | { 33 | "internalType": "uint8", 34 | "name": "", 35 | "type": "uint8" 36 | } 37 | ], 38 | "stateMutability": "view", 39 | "type": "function" 40 | }, 41 | { 42 | "inputs": [], 43 | "name": "totalSupply", 44 | "outputs": [ 45 | { 46 | "internalType": "uint256", 47 | "name": "", 48 | "type": "uint256" 49 | } 50 | ], 51 | "stateMutability": "view", 52 | "type": "function" 53 | }, 54 | { 55 | "inputs": [ 56 | { 57 | "internalType": "address", 58 | "name": "account", 59 | "type": "address" 60 | } 61 | ], 62 | "name": "balanceOf", 63 | "outputs": [ 64 | { 65 | "internalType": "uint256", 66 | "name": "", 67 | "type": "uint256" 68 | } 69 | ], 70 | "stateMutability": "view", 71 | "type": "function" 72 | }, 73 | { 74 | "inputs": [ 75 | { 76 | "internalType": "address", 77 | "name": "recipient", 78 | "type": "address" 79 | }, 80 | { 81 | "internalType": "uint256", 82 | "name": "amount", 83 | "type": "uint256" 84 | } 85 | ], 86 | "name": "transfer", 87 | "outputs": [ 88 | { 89 | "internalType": "bool", 90 | "name": "", 91 | "type": "bool" 92 | } 93 | ], 94 | "stateMutability": "nonpayable", 95 | "type": "function" 96 | }, 97 | { 98 | "inputs": [ 99 | { 100 | "internalType": "address", 101 | "name": "sender", 102 | "type": "address" 103 | }, 104 | { 105 | "internalType": "address", 106 | "name": "recipient", 107 | "type": "address" 108 | }, 109 | { 110 | "internalType": "uint256", 111 | "name": "amount", 112 | "type": "uint256" 113 | } 114 | ], 115 | "name": "transferFrom", 116 | "outputs": [ 117 | { 118 | "internalType": "bool", 119 | "name": "", 120 | "type": "bool" 121 | } 122 | ], 123 | "stateMutability": "nonpayable", 124 | "type": "function" 125 | }, 126 | { 127 | "inputs": [ 128 | { 129 | "internalType": "address", 130 | "name": "spender", 131 | "type": "address" 132 | }, 133 | { 134 | "internalType": "uint256", 135 | "name": "amount", 136 | "type": "uint256" 137 | } 138 | ], 139 | "name": "approve", 140 | "outputs": [ 141 | { 142 | "internalType": "bool", 143 | "name": "", 144 | "type": "bool" 145 | } 146 | ], 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "inputs": [ 152 | { 153 | "internalType": "address", 154 | "name": "owner", 155 | "type": "address" 156 | }, 157 | { 158 | "internalType": "address", 159 | "name": "spender", 160 | "type": "address" 161 | } 162 | ], 163 | "name": "allowance", 164 | "outputs": [ 165 | { 166 | "internalType": "uint256", 167 | "name": "", 168 | "type": "uint256" 169 | } 170 | ], 171 | "stateMutability": "view", 172 | "type": "function" 173 | }, 174 | { 175 | "anonymous": false, 176 | "inputs": [ 177 | { 178 | "indexed": true, 179 | "internalType": "address", 180 | "name": "from", 181 | "type": "address" 182 | }, 183 | { 184 | "indexed": true, 185 | "internalType": "address", 186 | "name": "to", 187 | "type": "address" 188 | }, 189 | { 190 | "indexed": false, 191 | "internalType": "uint256", 192 | "name": "value", 193 | "type": "uint256" 194 | } 195 | ], 196 | "name": "Transfer", 197 | "type": "event" 198 | }, 199 | { 200 | "anonymous": false, 201 | "inputs": [ 202 | { 203 | "indexed": true, 204 | "internalType": "address", 205 | "name": "owner", 206 | "type": "address" 207 | }, 208 | { 209 | "indexed": true, 210 | "internalType": "address", 211 | "name": "spender", 212 | "type": "address" 213 | }, 214 | { 215 | "indexed": false, 216 | "internalType": "uint256", 217 | "name": "value", 218 | "type": "uint256" 219 | } 220 | ], 221 | "name": "Approval", 222 | "type": "event" 223 | } 224 | ] 225 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from termcolor import cprint 3 | import time 4 | import json 5 | import random 6 | from tqdm import tqdm 7 | import decimal 8 | import requests 9 | from tabulate import tabulate 10 | from decimal import Decimal 11 | 12 | 13 | currency_price = [] 14 | def prices(): 15 | response = requests.get(url=f'https://api.gateio.ws/api/v4/spot/tickers') 16 | currency_price.append(response.json()) 17 | 18 | def intToDecimal(qty, decimal): 19 | return int(qty * int("".join(["1"] + ["0"]*decimal))) 20 | 21 | def decimalToInt(qty, decimal): 22 | return qty / int("".join((["1"]+ ["0"]*decimal))) 23 | 24 | 25 | def check_balance(privatekey, rpc_chain, symbol): 26 | try: 27 | 28 | web3 = Web3(Web3.HTTPProvider(rpc_chain)) 29 | account = web3.eth.account.privateKeyToAccount(privatekey) 30 | balance = web3.eth.get_balance(web3.toChecksumAddress(account.address)) 31 | 32 | humanReadable = web3.fromWei(balance,'ether') 33 | 34 | # check price of token 35 | for currency in currency_price[0]: 36 | if currency['currency_pair'] == f'{symbol}_USDT': 37 | price_ = Decimal(currency['last']) 38 | price = price_ + price_ * Decimal(0.2) 39 | 40 | gas = web3.eth.gas_price 41 | gasPrice = decimalToInt(gas, 18) 42 | 43 | return round(Decimal(humanReadable) - Decimal(Decimal(gasPrice)*Decimal(price)) - Decimal(0.001), 7) 44 | 45 | 46 | except Exception as error: 47 | # cprint(f'error : {error}', 'yellow') 48 | None 49 | 50 | def check_token_balance(privatekey, rpc_chain, address_contract, ERC20_ABI): 51 | try: 52 | 53 | web3 = Web3(Web3.HTTPProvider(rpc_chain)) 54 | account = web3.eth.account.privateKeyToAccount(privatekey) 55 | wallet = account.address 56 | token_contract = web3.eth.contract(address=web3.toChecksumAddress(address_contract), abi=ERC20_ABI) 57 | token_balance = token_contract.functions.balanceOf(web3.toChecksumAddress(wallet)).call() 58 | 59 | symbol = token_contract.functions.symbol().call() 60 | token_decimal = token_contract.functions.decimals().call() 61 | 62 | humanReadable = decimalToInt(token_balance, token_decimal) 63 | 64 | cprint(f'\nbalance : {round(humanReadable, 5)} {symbol}', 'white') 65 | 66 | return humanReadable 67 | 68 | except Exception as error: 69 | # cprint(f'error : {error}', 'yellow') 70 | None 71 | 72 | table = [] 73 | def transfer_token(privatekey, amount_to_transfer, to_address, chain_id, scan, rpc_chain, address_contract, ERC20_ABI): 74 | try: 75 | 76 | web3 = Web3(Web3.HTTPProvider(rpc_chain)) 77 | 78 | token_contract = web3.eth.contract(address=Web3.toChecksumAddress(address_contract), abi=ERC20_ABI) 79 | account = web3.eth.account.privateKeyToAccount(privatekey) 80 | address = account.address 81 | nonce = web3.eth.getTransactionCount(address) 82 | 83 | symbol = token_contract.functions.symbol().call() 84 | token_decimal = token_contract.functions.decimals().call() 85 | 86 | amount = intToDecimal(amount_to_transfer, token_decimal) 87 | gasLimit = web3.eth.estimate_gas({'to': Web3.toChecksumAddress(to_address), 'from': Web3.toChecksumAddress(address),'value': web3.toWei(0.0001, 'ether')}) + random.randint(70000, 200000) 88 | 89 | tx_built = token_contract.functions.transfer( 90 | Web3.toChecksumAddress(to_address), 91 | int(amount) 92 | ).buildTransaction({ 93 | 'chainId': chain_id, 94 | 'gas': gasLimit, 95 | 'gasPrice': web3.eth.gas_price, 96 | 'nonce': nonce, 97 | }) 98 | 99 | tx_signed = web3.eth.account.signTransaction(tx_built, privatekey) 100 | tx_hash = web3.eth.sendRawTransaction(tx_signed.rawTransaction) 101 | 102 | cprint(f'>>> transfer : {decimal.Decimal(str(amount_to_transfer))} {symbol} | {address} => {to_address} | {scan}/{web3.toHex(tx_hash)}', 'green') 103 | table.append([f'{decimal.Decimal(str(amount_to_transfer))} {symbol}', address, to_address, '\u001b[32msend\u001b[0m']) 104 | 105 | except Exception as error: 106 | cprint(f'>>> transfer : {privatekey} | {error}', 'red') 107 | try: 108 | table.append([f'{decimal.Decimal(str(amount_to_transfer))} {symbol}', address, to_address, '\u001b[31merror\u001b[0m']) 109 | except: 110 | table.append([f'{symbol}', address, to_address, '\u001b[31merror\u001b[0m']) 111 | 112 | def transfer_eth(privatekey, amount_to_transfer, to_address, chain_id, scan, rpc_chain, symbol): 113 | try: 114 | 115 | web3 = Web3(Web3.HTTPProvider(rpc_chain)) 116 | 117 | account = web3.eth.account.privateKeyToAccount(privatekey) 118 | address = account.address 119 | nonce = web3.eth.getTransactionCount(address) 120 | 121 | amount = intToDecimal(amount_to_transfer, 18) 122 | gasLimit = web3.eth.estimate_gas({'to': Web3.toChecksumAddress(to_address), 'from': Web3.toChecksumAddress(address),'value': web3.toWei(0.0001, 'ether')}) + random.randint(10000, 30000) 123 | 124 | tx_built = { 125 | 'chainId': chain_id, 126 | 'gas': gasLimit, 127 | 'gasPrice': web3.eth.gas_price, 128 | 'nonce': nonce, 129 | 'to': Web3.toChecksumAddress(to_address), 130 | 'value': int(amount) 131 | } 132 | 133 | tx_signed = web3.eth.account.signTransaction(tx_built, privatekey) 134 | tx_hash = web3.eth.sendRawTransaction(tx_signed.rawTransaction) 135 | 136 | cprint(f'>>> transfer : {decimal.Decimal(str(amount_to_transfer))} {symbol} | {address} => {to_address} | {scan}/{web3.toHex(tx_hash)}', 'green') 137 | table.append([f'{decimal.Decimal(str(amount_to_transfer))} {symbol}', address, to_address, '\u001b[32msend\u001b[0m']) 138 | 139 | except Exception as error: 140 | cprint(f'>>> transfer : {privatekey} | {error}', 'red') 141 | try: 142 | table.append([f'{decimal.Decimal(str(amount_to_transfer))} {symbol}', address, to_address, '\u001b[31merror\u001b[0m']) 143 | except: 144 | table.append([f'{symbol}', address, to_address, '\u001b[31merror\u001b[0m']) 145 | 146 | RPC = [ 147 | {'chain': 'Ethereum', 'chain_id': 1, 'rpc': 'https://rpc.ankr.com/eth', 'scan': 'https://etherscan.io/tx', 'token': 'ETH'}, 148 | 149 | {'chain': 'Optimism', 'chain_id': 10, 'rpc': 'https://rpc.ankr.com/optimism', 'scan': 'https://optimistic.etherscan.io/tx', 'token': 'ETH'}, 150 | 151 | {'chain': 'BSC', 'chain_id': 56, 'rpc': 'https://bsc-dataseed.binance.org', 'scan': 'https://bscscan.com/tx', 'token': 'BNB'}, 152 | 153 | {'chain': 'Polygon', 'chain_id': 137, 'rpc': 'https://polygon-rpc.com', 'scan': 'https://polygonscan.com/tx', 'token': 'MATIC'}, 154 | 155 | {'chain': 'Arbitrum One', 'chain_id': 42161, 'rpc': 'https://arb1.arbitrum.io/rpc', 'scan': 'https://arbiscan.io/tx', 'token': 'ETH'}, 156 | 157 | {'chain': 'AVAX', 'chain_id': 43114, 'rpc': 'https://api.avax.network/ext/bc/C/rpc', 'scan': 'https://snowtrace.io/tx', 'token': 'AVAX'}, 158 | 159 | {'chain': 'Arbitrum Nova', 'chain_id': 42170, 'rpc': 'https://nova.arbitrum.io/rpc', 'scan': 'https://nova-explorer.arbitrum.io/tx', 'token': 'ETH'}, 160 | 161 | {'chain': 'Fantom', 'chain_id': 250, 'rpc': 'https://rpc.ankr.com/fantom', 'scan': 'https://ftmscan.com/tx', 'token': 'FTM'}, 162 | ] 163 | 164 | if __name__ == "__main__": 165 | 166 | cprint(f'\n============================================= hodlmod.eth =============================================', 'cyan') 167 | 168 | cprint(f'\nsubscribe to us : https://t.me/hodlmodeth', 'magenta') 169 | 170 | with open("private_keys.txt", "r") as f: 171 | keys_list = [row.strip() for row in f] 172 | 173 | with open("recepients.txt", "r") as f: 174 | recepients = [row.strip() for row in f] 175 | 176 | with open("erc20.json", "r") as file: 177 | ERC20_ABI = json.load(file) 178 | 179 | prices() 180 | 181 | zero = -1 182 | for privatekey in keys_list: 183 | zero = zero + 1 184 | cprint(f'\n=============== start : {privatekey} ===============', 'white') 185 | 186 | to_address = recepients[zero] 187 | 188 | AMOUNT_TO_TRANSFER = round(random.uniform(1, 3), 5) # от 1 до 3, 5 цифр после точки 189 | # AMOUNT_TO_TRANSFER = 0.1 # фиксированный amount 190 | # AMOUNT_TO_TRANSFER = 'all_balance' # весь баланс 191 | CHAIN = 'Optimism' # Ethereum | Optimism | BSC | Polygon | Fantom | Arbitrum One | Arbitrum Nova | AVAX 192 | ADDRESS_CONTRACT = '0x4200000000000000000000000000000000000042' # пусто если eth 193 | 194 | for x in RPC: 195 | if x['chain'] == CHAIN: 196 | chain_id = x['chain_id'] 197 | scan = x['scan'] 198 | rpc_chain = x['rpc'] 199 | symbol_chain = x['token'] 200 | 201 | if ADDRESS_CONTRACT == '': 202 | 203 | if AMOUNT_TO_TRANSFER == 'all_balance': 204 | AMOUNT_TO_TRANSFER = check_balance(privatekey, rpc_chain, symbol_chain) 205 | 206 | transfer_eth( 207 | privatekey, 208 | AMOUNT_TO_TRANSFER, 209 | to_address, 210 | chain_id, 211 | scan, 212 | rpc_chain, 213 | symbol_chain 214 | ) 215 | 216 | else: 217 | 218 | if AMOUNT_TO_TRANSFER == 'all_balance': 219 | AMOUNT_TO_TRANSFER = check_token_balance(privatekey, rpc_chain, ADDRESS_CONTRACT, ERC20_ABI) 220 | 221 | transfer_token( 222 | privatekey, 223 | AMOUNT_TO_TRANSFER, 224 | to_address, 225 | chain_id, 226 | scan, 227 | rpc_chain, 228 | ADDRESS_CONTRACT, 229 | ERC20_ABI 230 | ) 231 | 232 | 233 | x = random.randint(20, 60) 234 | for i in tqdm(range(x), desc='sleep ', bar_format='{desc}: {n_fmt}/{total_fmt}'): 235 | time.sleep(1) 236 | 237 | headers = ['amount', 'from', 'to', 'result'] 238 | cprint(tabulate(table, headers, tablefmt='double_outline'), 'white') 239 | --------------------------------------------------------------------------------