├── README.md ├── bot.py ├── private_keys.txt └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # HUMANITY PROTOCOL BOT 2 | 3 | # JOIN HUMANITY : [testnet.humanity.org](testnet.humanity.org/login?ref=shareithub) 4 | 5 | # TUTORIAL VIDEO [HUMANITY BOT TUTORIAL](https://youtu.be/LdLYZ5fNHks) 6 | 7 | # JOIN NOW IN MY CHANNEL : 8 | 9 | [SUBSCRIBE YOUTUBE NOW !](https://www.youtube.com/@SHAREITHUB_COM) 10 | 11 | [SUBSCRIBE TELEGRAM NOW](https://t.me/SHAREITHUB_COM) 12 | 13 | [TELEGRAM GROUP CHAT](https://t.me/DISS_SHAREITHUB) 14 | 15 | Tutorial : 16 | 17 | Create screen : 18 | ``` 19 | screen -S humanity 20 | ``` 21 | 22 | Install python3 : 23 | ``` 24 | sudo apt install python3 -y 25 | ``` 26 | 27 | Install python3-venv : 28 | ``` 29 | sudo apt install python3-venv -y 30 | ``` 31 | 32 | Install python3-pip : 33 | ``` 34 | sudo apt install python3-pip -y 35 | ``` 36 | 37 | Install git : 38 | ``` 39 | sudo apt install git -y 40 | ``` 41 | 42 | Git clone folder BOT HUMANITY : 43 | ``` 44 | git clone https://github.com/shareithub/humanity-protocol.git 45 | ``` 46 | 47 | Go to folder Bot : 48 | ``` 49 | cd humanity-protocol 50 | ``` 51 | 52 | Install & use venv : 53 | ``` 54 | python3 -m venv venv 55 | source venv/bin/activate 56 | ``` 57 | 58 | Install Module in file requirements : 59 | ``` 60 | pip install -r requirements.txt 61 | ``` 62 | 63 | # EDIT FILE private_keys.txt & PASTE YOUR PRIVATE KEYS ( SUPPORT MULTI ACCOUNT ) : 64 | ``` 65 | nano private_keys.txt 66 | ``` 67 | 68 | SAVE FILE U CAN USE : CTRL + X + Y ( ENTER ) 69 | 70 | Running bot : 71 | ``` 72 | python3 bot.py 73 | ``` 74 | 75 | # AFTER DONE , U CAN OUT SCREEN TO RUNNING 24 HOURS. USE ( CTRL + A + D ) 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | import shareithub 2 | import math 3 | import sys 4 | import requests 5 | import time 6 | import threading 7 | from shareithub import shareithub 8 | from web3 import Web3 9 | from colorama import init, Fore 10 | from rich.console import Console 11 | from fake_useragent import UserAgent 12 | 13 | shareithub() 14 | init(autoreset=True) 15 | console = Console() 16 | 17 | RPC_URL = 'https://rpc.testnet.humanity.org' 18 | PRIVATE_KEYS_FILE = 'private_keys.txt' 19 | FAUCET_API_URL = "https://faucet.testnet.humanity.org/api/claim" 20 | CONTRACT_ADDRESS = '0xa18f6FCB2Fd4884436d10610E69DB7BFa1bFe8C7' 21 | 22 | CONTRACT_ABI = [{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"anonymous":False,"inputs":[{"indexed":False,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"internalType":"address","name":"from","type":"address"},{"indexed":True,"internalType":"address","name":"to","type":"address"},{"indexed":False,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":False,"internalType":"bool","name":"bufferSafe","type":"bool"}],"name":"ReferralRewardBuffered","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"internalType":"address","name":"user","type":"address"},{"indexed":True,"internalType":"enum IRewards.RewardType","name":"rewardType","type":"uint8"},{"indexed":False,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":True,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":True,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":True,"internalType":"address","name":"account","type":"address"},{"indexed":True,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":True,"internalType":"address","name":"account","type":"address"},{"indexed":True,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cycleStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vcContract","type":"address"},{"internalType":"address","name":"tkn","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"name":"start","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"epochID","type":"uint256"}],"name":"userClaimStatus","outputs":[{"components":[{"internalType":"uint256","name":"buffer","type":"uint256"},{"internalType":"bool","name":"claimStatus","type":"bool"}],"internalType":"struct IRewards.UserClaim","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userGenesisClaimStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}] 23 | 24 | def setup_blockchain_connection(): 25 | console.print("[bold cyan]🔗 Menghubungkan ke Humanity Protocol...[/bold cyan]") 26 | web3 = Web3(Web3.HTTPProvider(RPC_URL)) 27 | 28 | if web3.is_connected(): 29 | console.print("[bold green]✅ Koneksi berhasil![/bold green]") 30 | else: 31 | console.print(f"{Fore.RED}❌ Gagal terhubung!") 32 | sys.exit(1) 33 | 34 | return web3 35 | 36 | def load_wallets(): 37 | try: 38 | with open(PRIVATE_KEYS_FILE, 'r') as file: 39 | keys = [line.strip() for line in file if line.strip()] 40 | wallets = [{"private_key": key, "address": Web3().eth.account.from_key(key).address} for key in keys] 41 | console.print(f"[bold magenta]🔑 {len(wallets)} Wallet ditemukan![/bold magenta]") 42 | 43 | for w in wallets: 44 | console.print(f"🔹 Wallet Address: {w['address']}") 45 | 46 | return wallets 47 | except FileNotFoundError: 48 | console.print(f"{Fore.RED}🚨 File {PRIVATE_KEYS_FILE} tidak ditemukan!") 49 | sys.exit(1) 50 | 51 | def claim_faucet(wallets): 52 | ua = UserAgent() 53 | 54 | for wallet in wallets: 55 | while True: 56 | headers = { 57 | "authority": "faucet.testnet.humanity.org", 58 | "method": "POST", 59 | "path": "/api/claim", 60 | "scheme": "https", 61 | "accept": "*/*", 62 | "accept-encoding": "gzip, deflate, br, zstd", 63 | "accept-language": "en-US,en;q=0.9,id;q=0.8", 64 | "content-length": "56", 65 | "content-type": "application/json", 66 | "origin": "https://faucet.testnet.humanity.org", 67 | "priority": "u=1, i", 68 | "referer": "https://faucet.testnet.humanity.org/", 69 | "sec-ch-ua": '"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"', 70 | "sec-ch-ua-mobile": "?0", 71 | "sec-ch-ua-platform": '"Windows"', 72 | "sec-fetch-dest": "empty", 73 | "sec-fetch-mode": "cors", 74 | "sec-fetch-site": "same-origin", 75 | "user-agent": ua.random, 76 | } 77 | payload = {"address": wallet["address"]} 78 | 79 | try: 80 | response = requests.post(FAUCET_API_URL, json=payload, headers=headers) 81 | response_json = response.json() if response.status_code == 200 else {} 82 | 83 | if response.status_code == 200: 84 | tx_hash = response_json.get("msg", "TX Hash tidak ditemukan") 85 | console.print(f"💰 [bold green]Faucet berhasil diklaim untuk {wallet['address']}![/bold green] - TX Hash: {tx_hash}") 86 | break 87 | elif response.status_code == 400: 88 | console.print(f"⚠️ [yellow]Faucet gagal untuk {wallet['address']} - Status Code: 400, Mengulang...[/yellow]") 89 | console.print(f"ℹ️ [cyan]Response: {response.text}[/cyan]") 90 | time.sleep(5) 91 | else: 92 | console.print(f"⚠️ [yellow]Faucet gagal untuk {wallet['address']} - Status Code: {response.status_code}[/yellow]") 93 | console.print(f"ℹ️ [cyan]Response: {response.text}[/cyan]") 94 | time.sleep(10) 95 | except Exception as e: 96 | console.print(f"🚨 [red]Error klaim faucet untuk {wallet['address']}: {e}[/red]") 97 | time.sleep(10) 98 | 99 | def claim_reward(wallets, web3, contract): 100 | for wallet in wallets: 101 | try: 102 | account = web3.eth.account.from_key(wallet["private_key"]) 103 | sender_address = account.address 104 | 105 | genesis_claimed = contract.functions.userGenesisClaimStatus(sender_address).call() 106 | current_epoch = contract.functions.currentEpoch().call() 107 | _, claim_status = contract.functions.userClaimStatus(sender_address, current_epoch).call() 108 | 109 | if genesis_claimed and not claim_status: 110 | console.print(f"🟢 [bold green]Claiming reward for {sender_address} (Genesis reward claimed).[/bold green]") 111 | process_claim(sender_address, wallet["private_key"], web3, contract) 112 | elif not genesis_claimed: 113 | console.print(f"🟢 [bold green]Claiming reward for {sender_address} (Genesis reward not claimed).[/bold green]") 114 | process_claim(sender_address, wallet["private_key"], web3, contract) 115 | else: 116 | console.print(f"🟡 [bold yellow]Reward sudah diklaim untuk {sender_address} pada epoch {current_epoch}, skipping.[/bold yellow]") 117 | 118 | except Exception as e: 119 | console.print(f"🚨 [red]Error klaim reward untuk {wallet['address']}: {e}[/red]") 120 | 121 | def process_claim(sender_address, private_key, web3, contract): 122 | try: 123 | max_retries = 15 124 | retry_count = 0 125 | gas_price = web3.eth.gas_price 126 | nonce = web3.eth.get_transaction_count(sender_address, 'pending') 127 | 128 | while retry_count < max_retries: 129 | try: 130 | 131 | gas_amount = contract.functions.claimReward().estimate_gas({ 132 | 'chainId': web3.eth.chain_id, 133 | 'from': sender_address, 134 | 'gasPrice': int(gas_price), 135 | 'nonce': nonce 136 | }) 137 | 138 | transaction = contract.functions.claimReward().build_transaction({ 139 | 'chainId': web3.eth.chain_id, 140 | 'from': sender_address, 141 | 'gas': gas_amount, 142 | 'gasPrice': int(gas_price), 143 | 'nonce': nonce 144 | }) 145 | 146 | signed_txn = web3.eth.account.sign_transaction(transaction, private_key=private_key) 147 | 148 | tx_hash = web3.eth.send_raw_transaction(signed_txn.raw_transaction) 149 | 150 | console.print(f"✅ [bold green]Transaksi sukses untuk {sender_address} | TX Hash: {web3.to_hex(tx_hash)}[/bold green]") 151 | return 152 | 153 | except Exception as e: 154 | error_message = str(e) 155 | 156 | if "ALREADY_EXISTS: already known" in error_message or "replacement transaction underpriced" in error_message: 157 | console.print(f"⚠️ [yellow]Transaksi duplikat terdeteksi. Meningkatkan gas price...[/yellow]") 158 | gas_price = int(math.ceil(gas_price * 3.2)) 159 | nonce += 1 160 | retry_count += 1 161 | time.sleep(5) 162 | else: 163 | console.print(f"🚨 [red]Error proses klaim untuk {sender_address}: {error_message}[/red]") 164 | return 165 | 166 | console.print(f"❌ [bold red]Gagal mengirim transaksi setelah {max_retries} percobaan untuk {sender_address}.[/bold red]") 167 | 168 | except Exception as e: 169 | console.print(f"🚨 [red]Gagal mengeksekusi klaim untuk {sender_address}: {str(e)}[/red]") 170 | def main_loop(): 171 | web3 = setup_blockchain_connection() 172 | contract = web3.eth.contract(address=Web3.to_checksum_address(CONTRACT_ADDRESS), abi=CONTRACT_ABI) 173 | wallets = load_wallets() 174 | 175 | while True: 176 | claim_faucet(wallets) 177 | claim_reward(wallets, web3, contract) 178 | console.print(f"🕒 [cyan]Menunggu 1 menit sebelum proses berikutnya...[/cyan]") 179 | time.sleep(60) 180 | 181 | if __name__ == "__main__": 182 | main_loop() 183 | -------------------------------------------------------------------------------- /private_keys.txt: -------------------------------------------------------------------------------- 1 | PRIVATE_KEY_1 2 | PRIVATE_KEY_2 3 | PRIVATE_KEY_3 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | shareithub 2 | web3 3 | colorama 4 | rich 5 | fake_useragent 6 | requests 7 | --------------------------------------------------------------------------------