├── 2captcha_key.txt ├── accounts.txt ├── proxy.txt ├── requirements.txt ├── README.md └── bot.py /2captcha_key.txt: -------------------------------------------------------------------------------- 1 | your_2captcha_key -------------------------------------------------------------------------------- /accounts.txt: -------------------------------------------------------------------------------- 1 | your_private_key_1 2 | your_private_key_2 -------------------------------------------------------------------------------- /proxy.txt: -------------------------------------------------------------------------------- 1 | ip:port # Default Protcol HTTP. 2 | protocol://ip:port 3 | protocol://user:pass@ip:port -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | web3==7.11.1 2 | aiohttp==3.11.10 3 | aiohttp-socks==0.9.1 4 | fake-useragent==1.5.1 5 | eth-account==0.13.7 6 | py-solc-x==2.0.4 7 | eth-utils==5.3.0 8 | colorama==0.4.6 9 | pytz==2024.1 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Helios Testnet BOT 2 | Helios Testnet BOT 3 | 4 | - Register Here : [Helios Testnet](https://testnet.helioschain.network/?code=ASTRAL-44773) 5 | - Use Code `ASTRAL-44773` 6 | - Connect Discord Account 7 | - Open Ticket In Helios Discord Server 8 | 9 | ## Features 10 | 11 | - Auto Get Account Information 12 | - Auto Run With Proxy - `Choose 1` 13 | - Auto Run Without Proxy - `Choose 2` 14 | - Auto Rotate Invalid Proxies - `y` or `n` 15 | - Auto Claim HLS Faucet `Need 2Captcha Key` 16 | - Auto Bridge HLS Funds 17 | - Auto Delegate Random Validators 18 | - Auto Claim Delegate Rewards 19 | - Auto Create Governance Proposal 20 | - Auto Vote Governance Proposal 21 | - Auto Deploy Token Contract 22 | - Auto Deploy Smart Contract 23 | - Auto Deploy Chronos Scheduled 24 | - Multi Accounts 25 | 26 | If you need a reliable proxy for multi-wallet automation, airdrop farming, or avoiding geo-restrictions, I recommend **Nstproxy**. 27 | Affordable (from $0.1/GB), global coverage, rotation control, and anti-ban tech. 28 | 29 | 🔗 [Nstproxy.com](https://www.nstproxy.com/?utm_source=vonssy) | [Telegram](https://t.me/nstproxy) | [Discord](https://discord.gg/5jjWCAmvng) | [Github](https://github.com/Nstproxy) 30 | 👉 Use code **VONSSY** to get **10% OFF** 31 | 32 | ## Requiremnets 33 | 34 | - Make sure you have Python3.9 or higher installed and pip. 35 | - 2captcha key (Optional) 36 | 37 | ## Instalation 38 | 39 | 1. **Clone The Repositories:** 40 | ```bash 41 | git clone https://github.com/vonssy/HeliosTestnet-BOT.git 42 | ``` 43 | ```bash 44 | cd HeliosTestnet-BOT 45 | ``` 46 | 47 | 2. **Install Requirements:** 48 | ```bash 49 | pip install -r requirements.txt #or pip3 install -r requirements.txt 50 | ``` 51 | 52 | ### Note: Check your web3, eth-account, and eth-utils library version first. If not same with version in requirements.txt, u must uninstall that library. 53 | - **Check Library Version** 54 | ```bash 55 | pip show libary_name 56 | ``` 57 | - **Uninstall Library** 58 | ```bash 59 | pip uninstall libary_name 60 | ``` 61 | - **Install Library With Version** 62 | ```bash 63 | pip install libary_name==version 64 | ``` 65 | 66 | ## Configuration 67 | 68 | - **accounts.txt:** You will find the file `accounts.txt` inside the project directory. Make sure `accounts.txt` contains data that matches the format expected by the script. Here are examples of file formats: 69 | ```bash 70 | your_private_key_1 71 | your_private_key_2 72 | ``` 73 | 74 | - **2captcha_key.txt:** You will find the file `2captcha_key.txt` inside the project directory. Make sure `2captcha_key.txt` contains data that matches the format expected by the script. Here are examples of file formats: 75 | 76 | ```bash 77 | your_2captcha_key 78 | ``` 79 | 80 | - **proxy.txt:** You will find the file `proxy.txt` inside the project directory. Make sure `proxy.txt` contains data that matches the format expected by the script. Here are examples of file formats: 81 | ```bash 82 | ip:port # Default Protcol HTTP. 83 | protocol://ip:port 84 | protocol://user:pass@ip:port 85 | ``` 86 | 87 | ## Run 88 | 89 | ```bash 90 | python bot.py #or python3 bot.py 91 | ``` 92 | 93 | ## Buy Me a Coffee 94 | 95 | - **EVM:** 0xe3c9ef9a39e9eb0582e5b147026cae524338521a 96 | - **TON:** UQBEFv58DC4FUrGqinBB5PAQS7TzXSm5c1Fn6nkiet8kmehB 97 | - **SOL:** E1xkaJYmAFEj28NPHKhjbf7GcvfdjKdvXju8d8AeSunf 98 | - **SUI:** 0xa03726ecbbe00b31df6a61d7a59d02a7eedc39fe269532ceab97852a04cf3347 99 | 100 | Thank you for visiting this repository, don't forget to contribute in the form of follows and stars. 101 | If you have questions, find an issue, or have suggestions for improvement, feel free to contact me or open an *issue* in this GitHub repository. 102 | 103 | **vonssy** -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | from web3 import Web3 2 | from web3.exceptions import TransactionNotFound 3 | from solcx import compile_source, install_solc, set_solc_version 4 | from eth_utils import to_hex 5 | from eth_account import Account 6 | from eth_account.messages import encode_defunct 7 | from aiohttp import ClientResponseError, ClientSession, ClientTimeout, BasicAuth 8 | from aiohttp_socks import ProxyConnector 9 | from fake_useragent import FakeUserAgent 10 | from datetime import datetime 11 | from colorama import * 12 | import asyncio, random, string, json, re, os, pytz 13 | 14 | wib = pytz.timezone('Asia/Jakarta') 15 | 16 | install_solc('0.8.20') 17 | set_solc_version('0.8.20') 18 | 19 | class Helios: 20 | def __init__(self) -> None: 21 | self.BASE_API = "https://testnet-api.helioschain.network/api" 22 | self.RPC_URL = "https://testnet1.helioschainlabs.org/" 23 | self.HLS_CONTRACT_ADDRESS = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517" 24 | self.WETH_CONTRACT_ADDRESS = "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd" 25 | self.WBNB_CONTRACT_ADDRESS = "0xd567B3d7B8FE3C79a1AD8dA978812cfC4Fa05e75" 26 | self.BRIDGE_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000900" 27 | self.DELEGATE_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000800" 28 | self.REWARDS_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000801" 29 | self.PROPOSAL_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000805" 30 | self.PRECOMPILE_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000806" 31 | self.CHRONOS_ROUTER_ADDRESS = "0x0000000000000000000000000000000000000830" 32 | self.DEST_TOKENS = [ 33 | { "Ticker": "Sepolia", "ChainId": 11155111 }, 34 | { "Ticker": "BSC Testnet", "ChainId": 97 } 35 | ] 36 | self.VALIDATATORS = [ 37 | # {"Moniker": "Helios-Hedge", "Contract Address": "0x007a1123a54cdD9bA35AD2012DB086b9d8350A5f"}, 38 | {"Moniker": "Helios-Peer", "Contract Address": "0x72a9B3509B19D9Dbc2E0Df71c4A6451e8a3DD705"}, 39 | {"Moniker": "Helios-Unity", "Contract Address": "0x7e62c5e7Eba41fC8c25e605749C476C0236e0604"}, 40 | {"Moniker": "Helios-Supra", "Contract Address": "0xa75a393FF3D17eA7D9c9105d5459769EA3EAEf8D"}, 41 | {"Moniker": "Helios-Inter", "Contract Address": "0x882f8A95409C127f0dE7BA83b4Dfa0096C3D8D79"} 42 | ] 43 | self.ERC20_CONTRACT_ABI = json.loads('''[ 44 | {"type":"function","name":"balanceOf","stateMutability":"view","inputs":[{"name":"address","type":"address"}],"outputs":[{"name":"","type":"uint256"}]}, 45 | {"type":"function","name":"decimals","stateMutability":"view","inputs":[],"outputs":[{"name":"","type":"uint8"}]}, 46 | {"type":"function","name":"allowance","stateMutability":"view","inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"outputs":[{"name":"","type":"uint256"}]}, 47 | {"type":"function","name":"approve","stateMutability":"nonpayable","inputs":[{"name":"spender","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]} 48 | ]''') 49 | self.HELIOS_CONTRACT_ABI = [ 50 | { 51 | "name": "sendToChain", 52 | "type": "function", 53 | "stateMutability": "nonpayable", 54 | "inputs": [ 55 | { "name": "chainId", "type": "uint64", "internalType": "uint64" }, 56 | { "name": "destAddress", "type": "string", "internalType": "string" }, 57 | { "name": "contractAddress", "type": "address", "internalType": "address" }, 58 | { "name": "amount", "type": "uint256", "internalType": "uint256" }, 59 | { "name": "bridgeFee", "type": "uint256", "internalType": "uint256" } 60 | ], 61 | "outputs": [ 62 | { "name": "success", "type": "bool", "internalType": "bool" } 63 | ] 64 | }, 65 | { 66 | "name": "delegate", 67 | "type": "function", 68 | "stateMutability": "nonpayable", 69 | "inputs": [ 70 | { "internalType": "address", "name": "delegatorAddress", "type": "address" }, 71 | { "internalType": "address", "name": "validatorAddress", "type": "address" }, 72 | { "internalType": "uint256", "name": "amount", "type": "uint256" }, 73 | { "internalType": "string", "name": "denom", "type": "string" } 74 | ], 75 | "outputs": [ 76 | { "internalType": "bool", "name": "success", "type": "bool" } 77 | ] 78 | }, 79 | { 80 | "name": "claimRewards", 81 | "type": "function", 82 | "stateMutability": "nonpayable", 83 | "inputs": [ 84 | { "internalType": "address", "name": "delegatorAddress", "type": "address" }, 85 | { "internalType": "uint32", "name": "maxRetrieve", "type": "uint32" } 86 | ], 87 | "outputs": [ 88 | { "internalType": "bool", "name": "success", "type": "bool" } 89 | ] 90 | }, 91 | { 92 | "type": "function", 93 | "name": "hyperionProposal", 94 | "stateMutability": "payable", 95 | "inputs": [ 96 | { "internalType": "string", "name": "title", "type": "string" }, 97 | { "internalType": "string", "name": "description", "type": "string" }, 98 | { "internalType": "string", "name": "msg", "type": "string" }, 99 | { "internalType": "uint256", "name": "initialDepositAmount", "type": "uint256" } 100 | ], 101 | "outputs": [ 102 | { "internalType": "uint64", "name": "proposalId", "type": "uint64" } 103 | ] 104 | }, 105 | { 106 | "name": "vote", 107 | "type": "function", 108 | "stateMutability": "nonpayable", 109 | "inputs": [ 110 | { "internalType": "address", "name": "voter", "type": "address" }, 111 | { "internalType": "uint64", "name": "proposalId", "type": "uint64" }, 112 | { "internalType": "enum VoteOption", "name": "option", "type": "uint8" }, 113 | { "internalType": "string", "name": "metadata", "type": "string" } 114 | ], 115 | "outputs": [ 116 | { "internalType": "bool", "name": "success", "type": "bool" } 117 | ] 118 | }, 119 | { 120 | "type": "function", 121 | "name": "createErc20", 122 | "stateMutability": "nonpayable", 123 | "inputs": [ 124 | { "internalType": "string", "name": "name", "type": "string" }, 125 | { "internalType": "string", "name": "symbol", "type": "string" }, 126 | { "internalType": "string", "name": "denom", "type": "string" }, 127 | { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, 128 | { "internalType": "uint8", "name": "decimals", "type": "uint8" }, 129 | { "internalType": "string", "name": "logoBase64", "type": "string" } 130 | ], 131 | "outputs": [ 132 | { "internalType": "address", "name": "tokenAddress", "type": "address" } 133 | ] 134 | }, 135 | { 136 | "type": "function", 137 | "name": "createCron", 138 | "stateMutability": "nonpayable", 139 | "inputs": [ 140 | { "internalType": "address", "name": "contractAddress", "type": "address" }, 141 | { "internalType": "string", "name": "abi", "type": "string" }, 142 | { "internalType": "string", "name": "methodName", "type": "string" }, 143 | { "internalType": "string[]", "name": "params", "type": "string[]" }, 144 | { "internalType": "uint64", "name": "frequency", "type": "uint64" }, 145 | { "internalType": "uint64", "name": "expirationBlock", "type": "uint64" }, 146 | { "internalType": "uint64", "name": "gasLimit", "type": "uint64" }, 147 | { "internalType": "uint256", "name": "maxGasPrice", "type": "uint256" }, 148 | { "internalType": "uint256", "name": "amountToDeposit", "type": "uint256" }, 149 | ], 150 | "outputs": [ 151 | { "internalType": "bool", "name": "success", "type": "bool" }, 152 | ] 153 | } 154 | ] 155 | self.PAGE_URL = "https://testnet.helioschain.network" 156 | self.SITE_KEY = "0x4AAAAAABhz7Yc1no53_eWA" 157 | self.CAPTCHA_KEY = None 158 | self.BASE_HEADERS = {} 159 | self.PORTAL_HEADERS = {} 160 | self.proxies = [] 161 | self.proxy_index = 0 162 | self.account_proxies = {} 163 | self.access_tokens = {} 164 | self.used_nonce = {} 165 | self.bridge_count = 0 166 | self.bridge_amount = 0 167 | self.delegate_count = 0 168 | self.hls_delegate_amount = 0 169 | self.weth_delegate_amount = 0 170 | self.wbnb_delegate_amount = 0 171 | self.create_proposal = False 172 | self.proposal_title = None 173 | self.proposal_description = None 174 | self.proposal_deposit = 0 175 | self.vote_count = 0 176 | self.deploy_token_count = 0 177 | self.deploy_contract_count = 0 178 | self.deploy_chronos_count = 0 179 | self.min_delay = 0 180 | self.max_delay = 0 181 | 182 | def clear_terminal(self): 183 | os.system('cls' if os.name == 'nt' else 'clear') 184 | 185 | def log(self, message): 186 | print( 187 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 188 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}{message}", 189 | flush=True 190 | ) 191 | 192 | def welcome(self): 193 | print( 194 | f""" 195 | {Fore.GREEN + Style.BRIGHT}Helios Testnet{Fore.BLUE + Style.BRIGHT} Auto BOT 196 | """ 197 | f""" 198 | {Fore.GREEN + Style.BRIGHT}Rey? {Fore.YELLOW + Style.BRIGHT} 199 | """ 200 | ) 201 | 202 | def format_seconds(self, seconds): 203 | hours, remainder = divmod(seconds, 3600) 204 | minutes, seconds = divmod(remainder, 60) 205 | return f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}" 206 | 207 | def load_2captcha_key(self): 208 | try: 209 | with open("2captcha_key.txt", 'r') as file: 210 | captcha_key = file.read().strip() 211 | 212 | return captcha_key 213 | except Exception as e: 214 | return None 215 | 216 | async def load_proxies(self): 217 | filename = "proxy.txt" 218 | try: 219 | if not os.path.exists(filename): 220 | self.log(f"{Fore.RED + Style.BRIGHT}File {filename} Not Found.{Style.RESET_ALL}") 221 | return 222 | with open(filename, 'r') as f: 223 | self.proxies = [line.strip() for line in f.read().splitlines() if line.strip()] 224 | 225 | if not self.proxies: 226 | self.log(f"{Fore.RED + Style.BRIGHT}No Proxies Found.{Style.RESET_ALL}") 227 | return 228 | 229 | self.log( 230 | f"{Fore.GREEN + Style.BRIGHT}Proxies Total : {Style.RESET_ALL}" 231 | f"{Fore.WHITE + Style.BRIGHT}{len(self.proxies)}{Style.RESET_ALL}" 232 | ) 233 | 234 | except Exception as e: 235 | self.log(f"{Fore.RED + Style.BRIGHT}Failed To Load Proxies: {e}{Style.RESET_ALL}") 236 | self.proxies = [] 237 | 238 | def check_proxy_schemes(self, proxies): 239 | schemes = ["http://", "https://", "socks4://", "socks5://"] 240 | if any(proxies.startswith(scheme) for scheme in schemes): 241 | return proxies 242 | return f"http://{proxies}" 243 | 244 | def get_next_proxy_for_account(self, token): 245 | if token not in self.account_proxies: 246 | if not self.proxies: 247 | return None 248 | proxy = self.check_proxy_schemes(self.proxies[self.proxy_index]) 249 | self.account_proxies[token] = proxy 250 | self.proxy_index = (self.proxy_index + 1) % len(self.proxies) 251 | return self.account_proxies[token] 252 | 253 | def rotate_proxy_for_account(self, token): 254 | if not self.proxies: 255 | return None 256 | proxy = self.check_proxy_schemes(self.proxies[self.proxy_index]) 257 | self.account_proxies[token] = proxy 258 | self.proxy_index = (self.proxy_index + 1) % len(self.proxies) 259 | return proxy 260 | 261 | def build_proxy_config(self, proxy=None): 262 | if not proxy: 263 | return None, None, None 264 | 265 | if proxy.startswith("socks"): 266 | connector = ProxyConnector.from_url(proxy) 267 | return connector, None, None 268 | 269 | elif proxy.startswith("http"): 270 | match = re.match(r"http://(.*?):(.*?)@(.*)", proxy) 271 | if match: 272 | username, password, host_port = match.groups() 273 | clean_url = f"http://{host_port}" 274 | auth = BasicAuth(username, password) 275 | return None, clean_url, auth 276 | else: 277 | return None, proxy, None 278 | 279 | raise Exception("Unsupported Proxy Type.") 280 | 281 | def generate_address(self, account: str): 282 | try: 283 | account = Account.from_key(account) 284 | address = account.address 285 | 286 | return address 287 | except Exception as e: 288 | self.log( 289 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 290 | f"{Fore.RED+Style.BRIGHT} Generate Address Failed {Style.RESET_ALL}" 291 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 292 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL} " 293 | ) 294 | return None 295 | 296 | def generate_payload(self, account: str, address: str): 297 | try: 298 | message = f"Welcome to Helios! Please sign this message to verify your wallet ownership.\n\nWallet: {address}" 299 | encoded_message = encode_defunct(text=message) 300 | signed_message = Account.sign_message(encoded_message, private_key=account) 301 | signature = to_hex(signed_message.signature) 302 | 303 | payload = { 304 | "wallet": address, 305 | "signature": signature 306 | } 307 | 308 | return payload 309 | except Exception as e: 310 | self.log( 311 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 312 | f"{Fore.RED+Style.BRIGHT} Generate Req Payload Failed {Style.RESET_ALL}" 313 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 314 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL} " 315 | ) 316 | return None 317 | 318 | def mask_account(self, account): 319 | try: 320 | mask_account = account[:6] + '*' * 6 + account[-6:] 321 | return mask_account 322 | except Exception as e: 323 | return None 324 | 325 | def generate_random_asset(self): 326 | asset = random.choice([ 327 | self.HLS_CONTRACT_ADDRESS, 328 | self.WETH_CONTRACT_ADDRESS, 329 | self.WBNB_CONTRACT_ADDRESS 330 | ]) 331 | 332 | if asset == self.HLS_CONTRACT_ADDRESS: 333 | denom = "ahelios" 334 | ticker = "HLS" 335 | amount = self.hls_delegate_amount 336 | elif asset == self.WETH_CONTRACT_ADDRESS: 337 | denom = "hyperion-11155111-0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9" 338 | ticker = "WETH" 339 | amount = self.weth_delegate_amount 340 | else: 341 | denom = "hyperion-97-0xC689BF5a007F44410676109f8aa8E3562da1c9Ba" 342 | ticker = "WBNB" 343 | amount = self.wbnb_delegate_amount 344 | 345 | return asset, ticker, denom, amount 346 | 347 | def generate_raw_token(self): 348 | default_name, default_symbol = random.choice([ 349 | ("Token", "TKN"), ("MyToken", "MTK"), ("NewToken", "NTK"), 350 | ("CryptoCoin", "CRC"), ("SmartToken", "SMT"), ("MetaCoin", "MTC"), 351 | ("ChainToken", "CTK"), ("BlockCoin", "BKC"), ("FutureToken", "FUT"), 352 | ("GalaxyCoin", "GLX"), ("QuantumToken", "QTK"), ("StarCoin", "STR"), 353 | ("HyperToken", "HPT"), ("NovaCoin", "NVC"), ("PulseToken", "PLT"), 354 | ("OrbitCoin", "ORC"), ("UnityToken", "UNT"), ("PrimeCoin", "PMC"), 355 | ("AeroToken", "AET"), ("LunaCoin", "LNC"), 356 | ]) 357 | 358 | numbers = str(random.randint(0, 999999)) 359 | 360 | token_name = default_name + numbers 361 | token_symbol = default_symbol + numbers 362 | 363 | prefix = random.choice(string.ascii_lowercase) 364 | denom = prefix + token_name.lower() 365 | 366 | raw_supply = random.randint(1000, 1_000_000) 367 | total_supply = raw_supply * (10 ** 18) 368 | 369 | return token_name, token_symbol, denom, raw_supply, total_supply 370 | 371 | async def get_web3_with_check(self, address: str, use_proxy: bool, retries=3, timeout=60): 372 | request_kwargs = {"timeout": timeout} 373 | 374 | proxy = self.get_next_proxy_for_account(address) if use_proxy else None 375 | 376 | if use_proxy and proxy: 377 | request_kwargs["proxies"] = {"http": proxy, "https": proxy} 378 | 379 | for attempt in range(retries): 380 | try: 381 | web3 = Web3(Web3.HTTPProvider(self.RPC_URL, request_kwargs=request_kwargs)) 382 | web3.eth.get_block_number() 383 | return web3 384 | except Exception as e: 385 | if attempt < retries - 1: 386 | await asyncio.sleep(3) 387 | continue 388 | raise Exception(f"Failed to Connect to RPC: {str(e)}") 389 | 390 | async def send_raw_transaction_with_retries(self, account, web3, tx, retries=5): 391 | for attempt in range(retries): 392 | try: 393 | signed_tx = web3.eth.account.sign_transaction(tx, account) 394 | raw_tx = web3.eth.send_raw_transaction(signed_tx.raw_transaction) 395 | tx_hash = web3.to_hex(raw_tx) 396 | return tx_hash 397 | except TransactionNotFound: 398 | pass 399 | except Exception as e: 400 | self.log( 401 | f"{Fore.CYAN + Style.BRIGHT} Message :{Style.RESET_ALL}" 402 | f"{Fore.YELLOW + Style.BRIGHT} [Attempt {attempt + 1}] Send TX Error: {str(e)} {Style.RESET_ALL}" 403 | ) 404 | await asyncio.sleep(2 ** attempt) 405 | raise Exception("Transaction Hash Not Found After Maximum Retries") 406 | 407 | async def wait_for_receipt_with_retries(self, web3, tx_hash, retries=5): 408 | for attempt in range(retries): 409 | try: 410 | receipt = await asyncio.to_thread(web3.eth.wait_for_transaction_receipt, tx_hash, timeout=300) 411 | return receipt 412 | except TransactionNotFound: 413 | pass 414 | except Exception as e: 415 | self.log( 416 | f"{Fore.CYAN + Style.BRIGHT} Message :{Style.RESET_ALL}" 417 | f"{Fore.YELLOW + Style.BRIGHT} [Attempt {attempt + 1}] Wait for Receipt Error: {str(e)} {Style.RESET_ALL}" 418 | ) 419 | await asyncio.sleep(2 ** attempt) 420 | raise Exception("Transaction Receipt Not Found After Maximum Retries") 421 | 422 | async def get_token_balance(self, address: str, contract_address: str, use_proxy: bool): 423 | try: 424 | web3 = await self.get_web3_with_check(address, use_proxy) 425 | 426 | token_contract = web3.eth.contract(address=web3.to_checksum_address(contract_address), abi=self.ERC20_CONTRACT_ABI) 427 | balance = token_contract.functions.balanceOf(address).call() 428 | decimals = token_contract.functions.decimals().call() 429 | 430 | token_balance = balance / (10 ** decimals) 431 | 432 | return token_balance 433 | except Exception as e: 434 | self.log( 435 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 436 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 437 | ) 438 | return None 439 | 440 | async def approving_token(self, account: str, address: str, spender_address: str, contract_address: str, required: int, use_proxy: bool): 441 | try: 442 | web3 = await self.get_web3_with_check(address, use_proxy) 443 | 444 | spender = web3.to_checksum_address(spender_address) 445 | token_contract = web3.eth.contract(address=web3.to_checksum_address(contract_address), abi=self.ERC20_CONTRACT_ABI) 446 | 447 | allowance = token_contract.functions.allowance(address, spender).call() 448 | if allowance < required: 449 | approve_data = token_contract.functions.approve(spender, required) 450 | 451 | max_priority_fee = web3.to_wei(2.5, "gwei") 452 | max_fee = web3.to_wei(4.5, "gwei") 453 | 454 | approve_tx = approve_data.build_transaction({ 455 | "from": address, 456 | "gas": 1500000, 457 | "maxFeePerGas": int(max_fee), 458 | "maxPriorityFeePerGas": int(max_priority_fee), 459 | "nonce": self.used_nonce[address], 460 | "chainId": web3.eth.chain_id, 461 | }) 462 | 463 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, approve_tx) 464 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 465 | block_number = receipt.blockNumber 466 | self.used_nonce[address] += 1 467 | 468 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 469 | 470 | self.log( 471 | f"{Fore.CYAN+Style.BRIGHT} Approve :{Style.RESET_ALL}" 472 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL} " 473 | ) 474 | self.log( 475 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 476 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 477 | ) 478 | self.log( 479 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 480 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 481 | ) 482 | self.log( 483 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 484 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 485 | ) 486 | await self.print_timer() 487 | 488 | return True 489 | except Exception as e: 490 | raise Exception(f"Approving Token Contract Failed: {str(e)}") 491 | 492 | async def perform_bridge(self, account: str, address: str, dest_chain_id: int, use_proxy: bool): 493 | try: 494 | web3 = await self.get_web3_with_check(address, use_proxy) 495 | 496 | bridge_amount = web3.to_wei(self.bridge_amount, "ether") 497 | 498 | estimated_fees = int(0.5 * (10 ** 18)) 499 | 500 | required = bridge_amount + estimated_fees 501 | 502 | await self.approving_token(account, address, self.BRIDGE_ROUTER_ADDRESS, self.HLS_CONTRACT_ADDRESS, required, use_proxy) 503 | 504 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.BRIDGE_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 505 | 506 | bridge_data = token_contract.functions.sendToChain( 507 | dest_chain_id, address, self.HLS_CONTRACT_ADDRESS, bridge_amount, estimated_fees 508 | ) 509 | 510 | estimated_gas = bridge_data.estimate_gas({"from": address}) 511 | max_priority_fee = web3.to_wei(2.5, "gwei") 512 | max_fee = web3.to_wei(4.5, "gwei") 513 | 514 | bridge_tx = bridge_data.build_transaction({ 515 | "from": address, 516 | "gas": int(estimated_gas * 1.2), 517 | "maxFeePerGas": int(max_fee), 518 | "maxPriorityFeePerGas": int(max_priority_fee), 519 | "nonce": self.used_nonce[address], 520 | "chainId": web3.eth.chain_id 521 | }) 522 | 523 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, bridge_tx) 524 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 525 | block_number = receipt.blockNumber 526 | self.used_nonce[address] += 1 527 | 528 | return tx_hash, block_number 529 | except Exception as e: 530 | self.log( 531 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 532 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 533 | ) 534 | return None, None 535 | 536 | async def perform_delegate(self, account: str, address: str, contract_address: str, denom: str, delegate_amount: float, use_proxy: bool): 537 | try: 538 | web3 = await self.get_web3_with_check(address, use_proxy) 539 | 540 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.DELEGATE_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 541 | 542 | amount = web3.to_wei(delegate_amount, "ether") 543 | 544 | delegate_data = token_contract.functions.delegate(address, contract_address, amount, denom) 545 | 546 | estimated_gas = delegate_data.estimate_gas({"from": address}) 547 | max_priority_fee = web3.to_wei(2.5, "gwei") 548 | max_fee = web3.to_wei(4.5, "gwei") 549 | 550 | delegate_tx = delegate_data.build_transaction({ 551 | "from": address, 552 | "gas": int(estimated_gas * 1.2), 553 | "maxFeePerGas": int(max_fee), 554 | "maxPriorityFeePerGas": int(max_priority_fee), 555 | "nonce": self.used_nonce[address], 556 | "chainId": web3.eth.chain_id 557 | }) 558 | 559 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, delegate_tx) 560 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 561 | block_number = receipt.blockNumber 562 | self.used_nonce[address] += 1 563 | 564 | return tx_hash, block_number 565 | except Exception as e: 566 | self.log( 567 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 568 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 569 | ) 570 | return None, None 571 | 572 | async def perform_claim_rewards(self, account: str, address: str, use_proxy: bool): 573 | try: 574 | web3 = await self.get_web3_with_check(address, use_proxy) 575 | 576 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.REWARDS_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 577 | 578 | claim_data = token_contract.functions.claimRewards(address, 10) 579 | 580 | estimated_gas = claim_data.estimate_gas({"from": address}) 581 | max_priority_fee = web3.to_wei(2.5, "gwei") 582 | max_fee = web3.to_wei(4.5, "gwei") 583 | 584 | claim_tx = claim_data.build_transaction({ 585 | "from": address, 586 | "gas": int(estimated_gas * 1.2), 587 | "maxFeePerGas": int(max_fee), 588 | "maxPriorityFeePerGas": int(max_priority_fee), 589 | "nonce": self.used_nonce[address], 590 | "chainId": web3.eth.chain_id 591 | }) 592 | 593 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, claim_tx) 594 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 595 | block_number = receipt.blockNumber 596 | self.used_nonce[address] += 1 597 | 598 | return tx_hash, block_number 599 | except Exception as e: 600 | self.log( 601 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 602 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 603 | ) 604 | return None, None 605 | 606 | async def perform_create_proposal(self, account: str, address: str, use_proxy: bool): 607 | try: 608 | web3 = await self.get_web3_with_check(address, use_proxy) 609 | 610 | msg = json.dumps({ 611 | "@type": "/helios.hyperion.v1.MsgUpdateOutTxTimeout", 612 | "signer": address, 613 | "chain_id": random.choice([11155111, 97]), 614 | "target_batch_timeout": 3600000, 615 | "target_outgoing_tx_timeout": 3600000 616 | }) 617 | 618 | amount_to_wei = web3.to_wei(self.proposal_deposit, "ether") 619 | 620 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.PROPOSAL_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 621 | 622 | proposal_data = token_contract.functions.hyperionProposal(self.proposal_title, self.proposal_description, msg, amount_to_wei) 623 | 624 | estimated_gas = proposal_data.estimate_gas({"from": address, "value":amount_to_wei}) 625 | 626 | max_priority_fee = web3.to_wei(2.5, "gwei") 627 | max_fee = web3.to_wei(4.5, "gwei") 628 | 629 | proposal_tx = proposal_data.build_transaction({ 630 | "from": address, 631 | "value": amount_to_wei, 632 | "gas": int(estimated_gas * 1.2), 633 | "maxFeePerGas": int(max_fee), 634 | "maxPriorityFeePerGas": int(max_priority_fee), 635 | "nonce": self.used_nonce[address], 636 | "chainId": web3.eth.chain_id 637 | }) 638 | 639 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, proposal_tx) 640 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 641 | block_number = receipt.blockNumber 642 | self.used_nonce[address] += 1 643 | 644 | return tx_hash, block_number 645 | except Exception as e: 646 | self.log( 647 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 648 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 649 | ) 650 | return None, None 651 | 652 | 653 | async def perform_vote_proposal(self, account: str, address: str, proposal_id: int, use_proxy: bool): 654 | try: 655 | web3 = await self.get_web3_with_check(address, use_proxy) 656 | 657 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.PROPOSAL_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 658 | 659 | metadata = f"Vote on proposal {proposal_id}" 660 | 661 | vote_data = token_contract.functions.vote(address, proposal_id, 1, metadata) 662 | 663 | estimated_gas = vote_data.estimate_gas({"from": address}) 664 | max_priority_fee = web3.to_wei(2.5, "gwei") 665 | max_fee = web3.to_wei(4.5, "gwei") 666 | 667 | vote_tx = vote_data.build_transaction({ 668 | "from": address, 669 | "gas": int(estimated_gas * 1.2), 670 | "maxFeePerGas": int(max_fee), 671 | "maxPriorityFeePerGas": int(max_priority_fee), 672 | "nonce": self.used_nonce[address], 673 | "chainId": web3.eth.chain_id 674 | }) 675 | 676 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, vote_tx) 677 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 678 | block_number = receipt.blockNumber 679 | self.used_nonce[address] += 1 680 | 681 | return tx_hash, block_number 682 | except Exception as e: 683 | self.log( 684 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 685 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 686 | ) 687 | return None, None 688 | 689 | async def perform_deploy_token(self, account: str, address: str, token_name: str, token_symbol: str, denom: str, total_supply: int, use_proxy: bool): 690 | try: 691 | web3 = await self.get_web3_with_check(address, use_proxy) 692 | 693 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.PRECOMPILE_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 694 | 695 | deploy_data = token_contract.functions.createErc20(token_name, token_symbol, denom, total_supply, 18, "") 696 | 697 | estimated_gas = deploy_data.estimate_gas({"from": address}) 698 | max_priority_fee = web3.to_wei(2.5, "gwei") 699 | max_fee = web3.to_wei(4.5, "gwei") 700 | 701 | deploy_tx = deploy_data.build_transaction({ 702 | "from": address, 703 | "gas": int(estimated_gas * 1.2), 704 | "maxFeePerGas": int(max_fee), 705 | "maxPriorityFeePerGas": int(max_priority_fee), 706 | "nonce": self.used_nonce[address], 707 | "chainId": web3.eth.chain_id 708 | }) 709 | 710 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, deploy_tx) 711 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 712 | block_number = receipt.blockNumber 713 | 714 | self.used_nonce[address] += 1 715 | 716 | return tx_hash, block_number 717 | except Exception as e: 718 | self.log( 719 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 720 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 721 | ) 722 | return None, None 723 | 724 | async def perform_deploy_contract(self, account: str, address: str, token_name: str, token_symbol: str, total_supply: int, use_proxy: bool): 725 | try: 726 | web3 = await self.get_web3_with_check(address, use_proxy) 727 | 728 | source_code = f''' 729 | // SPDX-License-Identifier: MIT 730 | pragma solidity ^0.8.20; 731 | 732 | contract MyToken {{ 733 | string public name = "{token_name}"; 734 | string public symbol = "{token_symbol}"; 735 | uint8 public decimals = 18; 736 | uint256 public totalSupply; 737 | 738 | mapping(address => uint256) public balanceOf; 739 | mapping(address => mapping(address => uint256)) public allowance; 740 | 741 | event Transfer(address indexed from, address indexed to, uint256 value); 742 | event Approval(address indexed owner, address indexed spender, uint256 value); 743 | 744 | constructor() {{ 745 | totalSupply = {total_supply}; 746 | balanceOf[msg.sender] = totalSupply; 747 | emit Transfer(address(0), msg.sender, totalSupply); 748 | }} 749 | 750 | function transfer(address to, uint256 value) public returns (bool) {{ 751 | require(balanceOf[msg.sender] >= value, "Insufficient balance"); 752 | balanceOf[msg.sender] -= value; 753 | balanceOf[to] += value; 754 | emit Transfer(msg.sender, to, value); 755 | return true; 756 | }} 757 | 758 | function approve(address spender, uint256 value) public returns (bool) {{ 759 | allowance[msg.sender][spender] = value; 760 | emit Approval(msg.sender, spender, value); 761 | return true; 762 | }} 763 | 764 | function transferFrom(address from, address to, uint256 value) public returns (bool) {{ 765 | require(balanceOf[from] >= value, "Insufficient balance"); 766 | require(allowance[from][msg.sender] >= value, "Allowance exceeded"); 767 | balanceOf[from] -= value; 768 | balanceOf[to] += value; 769 | allowance[from][msg.sender] -= value; 770 | emit Transfer(from, to, value); 771 | return true; 772 | }} 773 | }} 774 | ''' 775 | 776 | compiled_sol = compile_source(source_code, output_values=["abi", "bin"]) 777 | contract_id, contract_interface = compiled_sol.popitem() 778 | abi = contract_interface['abi'] 779 | bytecode = contract_interface['bin'] 780 | TokenContract = web3.eth.contract(abi=abi, bytecode=bytecode) 781 | 782 | max_priority_fee = web3.to_wei(2.5, "gwei") 783 | max_fee = web3.to_wei(4.5, "gwei") 784 | 785 | tx = TokenContract.constructor().build_transaction({ 786 | "from": address, 787 | "gas": 3000000, 788 | "maxFeePerGas": int(max_fee), 789 | "maxPriorityFeePerGas": int(max_priority_fee), 790 | "nonce": self.used_nonce[address], 791 | "chainId": web3.eth.chain_id 792 | }) 793 | 794 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, tx) 795 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 796 | block_number = receipt.blockNumber 797 | contract_address = receipt.contractAddress 798 | self.used_nonce[address] += 1 799 | 800 | return tx_hash, block_number, contract_address 801 | 802 | except Exception as e: 803 | self.log( 804 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 805 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 806 | ) 807 | return None, None, None 808 | 809 | async def perform_create_cron(self, account: str, address: str, use_proxy: bool): 810 | try: 811 | web3 = await self.get_web3_with_check(address, use_proxy) 812 | 813 | token_contract = web3.eth.contract(address=web3.to_checksum_address(self.CHRONOS_ROUTER_ADDRESS), abi=self.HELIOS_CONTRACT_ABI) 814 | 815 | current_block = web3.eth.block_number 816 | 817 | contract_address = web3.to_checksum_address("0xaece8330ae7aeecc6a5e59b9d1ccca02f2dc6c38") 818 | abi = "[{\"inputs\":[],\"name\":\"increment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" 819 | method_name = "increment" 820 | params = [] 821 | frequency = 300 822 | expiration_block = current_block + 10000 823 | gas_limit = 110000 824 | max_gas_price = 5000000000 825 | amount_to_deposit = web3.to_wei(1, "ether") 826 | 827 | cron_data = token_contract.functions.createCron( 828 | contract_address, abi, method_name, params, frequency, expiration_block, gas_limit, max_gas_price, amount_to_deposit 829 | ) 830 | 831 | estimated_gas = cron_data.estimate_gas({"from": address}) 832 | max_priority_fee = web3.to_wei(2.5, "gwei") 833 | max_fee = web3.to_wei(4.5, "gwei") 834 | 835 | cron_tx = cron_data.build_transaction({ 836 | "from": address, 837 | "gas": int(estimated_gas * 1.2), 838 | "maxFeePerGas": int(max_fee), 839 | "maxPriorityFeePerGas": int(max_priority_fee), 840 | "nonce": self.used_nonce[address], 841 | "chainId": web3.eth.chain_id 842 | }) 843 | 844 | tx_hash = await self.send_raw_transaction_with_retries(account, web3, cron_tx) 845 | receipt = await self.wait_for_receipt_with_retries(web3, tx_hash) 846 | block_number = receipt.blockNumber 847 | self.used_nonce[address] += 1 848 | 849 | return tx_hash, block_number 850 | except Exception as e: 851 | self.log( 852 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 853 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 854 | ) 855 | return None, None 856 | 857 | def print_bridge_question(self): 858 | while True: 859 | try: 860 | bridge_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Bridge Count For Each Wallet -> {Style.RESET_ALL}").strip()) 861 | if bridge_count > 0: 862 | self.bridge_count = bridge_count 863 | break 864 | else: 865 | print(f"{Fore.RED + Style.BRIGHT}Bridge Count must be > 0.{Style.RESET_ALL}") 866 | except ValueError: 867 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 868 | 869 | while True: 870 | try: 871 | bridge_amount = float(input(f"{Fore.YELLOW + Style.BRIGHT}Enter Bridge Amount (HLS) -> {Style.RESET_ALL}").strip()) 872 | if bridge_amount > 0: 873 | self.bridge_amount = bridge_amount 874 | break 875 | else: 876 | print(f"{Fore.RED + Style.BRIGHT}Bridge Amount must be > 0.{Style.RESET_ALL}") 877 | except ValueError: 878 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a float or decimal number.{Style.RESET_ALL}") 879 | 880 | def print_delegate_question(self): 881 | while True: 882 | try: 883 | delegate_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Delegate Count For Each Wallet -> {Style.RESET_ALL}").strip()) 884 | if delegate_count > 0: 885 | self.delegate_count = delegate_count 886 | break 887 | else: 888 | print(f"{Fore.RED + Style.BRIGHT}Delegate Count must be > 0.{Style.RESET_ALL}") 889 | except ValueError: 890 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 891 | 892 | while True: 893 | try: 894 | hls_delegate_amount = float(input(f"{Fore.YELLOW + Style.BRIGHT}Enter Delegate Amount (HLS) -> {Style.RESET_ALL}").strip()) 895 | if hls_delegate_amount > 0: 896 | self.hls_delegate_amount = hls_delegate_amount 897 | break 898 | else: 899 | print(f"{Fore.RED + Style.BRIGHT}Delegate Amount must be > 0.{Style.RESET_ALL}") 900 | except ValueError: 901 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a float or decimal number.{Style.RESET_ALL}") 902 | 903 | while True: 904 | try: 905 | weth_delegate_amount = float(input(f"{Fore.YELLOW + Style.BRIGHT}Enter Delegate Amount (WETH) -> {Style.RESET_ALL}").strip()) 906 | if weth_delegate_amount > 0: 907 | self.weth_delegate_amount = weth_delegate_amount 908 | break 909 | else: 910 | print(f"{Fore.RED + Style.BRIGHT}Delegate Amount must be > 0.{Style.RESET_ALL}") 911 | except ValueError: 912 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a float or decimal number.{Style.RESET_ALL}") 913 | 914 | while True: 915 | try: 916 | wbnb_delegate_amount = float(input(f"{Fore.YELLOW + Style.BRIGHT}Enter Delegate Amount (WBNB) -> {Style.RESET_ALL}").strip()) 917 | if wbnb_delegate_amount > 0: 918 | self.wbnb_delegate_amount = wbnb_delegate_amount 919 | break 920 | else: 921 | print(f"{Fore.RED + Style.BRIGHT}Delegate Amount must be > 0.{Style.RESET_ALL}") 922 | except ValueError: 923 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a float or decimal number.{Style.RESET_ALL}") 924 | 925 | def print_create_proposal_question(self): 926 | while True: 927 | proposal_title = str(input(f"{Fore.YELLOW + Style.BRIGHT}Input a Title For Proposal (eg. Vonssy) -> {Style.RESET_ALL}").strip()) 928 | if proposal_title: 929 | self.proposal_title = proposal_title 930 | break 931 | else: 932 | print(f"{Fore.RED + Style.BRIGHT}Proposal Title Cannot be Empty.{Style.RESET_ALL}") 933 | 934 | while True: 935 | proposal_description = str(input(f"{Fore.YELLOW + Style.BRIGHT}Input a Description For Proposal (eg. Long Live's Vonssy!!!) -> {Style.RESET_ALL}").strip()) 936 | if proposal_description: 937 | self.proposal_description = proposal_description 938 | break 939 | else: 940 | print(f"{Fore.RED + Style.BRIGHT}Proposal Description Cannot be Empty.{Style.RESET_ALL}") 941 | 942 | while True: 943 | try: 944 | proposal_deposit = float(input(f"{Fore.YELLOW + Style.BRIGHT}Proposal Initial Deposit Amount [Min. 1 HLS] -> {Style.RESET_ALL}").strip()) 945 | if proposal_deposit >= 1: 946 | self.proposal_deposit = proposal_deposit 947 | break 948 | else: 949 | print(f"{Fore.RED + Style.BRIGHT}Proposal Initial Deposit Amount must be >= 1.{Style.RESET_ALL}") 950 | except ValueError: 951 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 952 | 953 | def print_proposal_question(self): 954 | while True: 955 | try: 956 | create_proposal = str(input(f"{Fore.YELLOW + Style.BRIGHT}Create a Proposal? [y/n] -> {Style.RESET_ALL}").strip()) 957 | if create_proposal in ["y", "n"]: 958 | self.create_proposal = create_proposal == "y" 959 | if self.create_proposal: 960 | self.print_create_proposal_question() 961 | break 962 | else: 963 | print(f"{Fore.RED + Style.BRIGHT}Proposal Initial Deposit Amount must be >= 1.{Style.RESET_ALL}") 964 | except ValueError: 965 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 966 | 967 | def print_vote_proposal_question(self): 968 | while True: 969 | try: 970 | vote_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Vote Proposal Count For Each Wallet -> {Style.RESET_ALL}").strip()) 971 | if vote_count > 0: 972 | self.vote_count = vote_count 973 | break 974 | else: 975 | print(f"{Fore.RED + Style.BRIGHT}Vote Proposal Count must be > 0.{Style.RESET_ALL}") 976 | except ValueError: 977 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 978 | 979 | def print_deploy_token_question(self): 980 | while True: 981 | try: 982 | deploy_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Deploy Token Contract Count For Each Wallet -> {Style.RESET_ALL}").strip()) 983 | if deploy_count > 0: 984 | self.deploy_token_count = deploy_count 985 | break 986 | else: 987 | print(f"{Fore.RED + Style.BRIGHT}Deploy Token Contract Count must be > 0.{Style.RESET_ALL}") 988 | except ValueError: 989 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 990 | 991 | def print_deploy_contract_question(self): 992 | while True: 993 | try: 994 | deploy_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Deploy Smart Contract Count For Each Wallet -> {Style.RESET_ALL}").strip()) 995 | if deploy_count > 0: 996 | self.deploy_contract_count = deploy_count 997 | break 998 | else: 999 | print(f"{Fore.RED + Style.BRIGHT}Deploy Smart Contract Count must be > 0.{Style.RESET_ALL}") 1000 | except ValueError: 1001 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 1002 | 1003 | def print_deploy_chronos_question(self): 1004 | while True: 1005 | try: 1006 | cron_count = int(input(f"{Fore.YELLOW + Style.BRIGHT}Deploy Chronos Count For Each Wallet -> {Style.RESET_ALL}").strip()) 1007 | if cron_count > 0: 1008 | self.deploy_chronos_count = cron_count 1009 | break 1010 | else: 1011 | print(f"{Fore.RED + Style.BRIGHT}Deploy Chronos Count must be > 0.{Style.RESET_ALL}") 1012 | except ValueError: 1013 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 1014 | 1015 | def print_delay_question(self): 1016 | while True: 1017 | try: 1018 | min_delay = int(input(f"{Fore.YELLOW + Style.BRIGHT}Min Delay For Each Tx -> {Style.RESET_ALL}").strip()) 1019 | if min_delay >= 0: 1020 | self.min_delay = min_delay 1021 | break 1022 | else: 1023 | print(f"{Fore.RED + Style.BRIGHT}Min Delay must be >= 0.{Style.RESET_ALL}") 1024 | except ValueError: 1025 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 1026 | 1027 | while True: 1028 | try: 1029 | max_delay = int(input(f"{Fore.YELLOW + Style.BRIGHT}Max Delay For Each Tx -> {Style.RESET_ALL}").strip()) 1030 | if max_delay >= min_delay: 1031 | self.max_delay = max_delay 1032 | break 1033 | else: 1034 | print(f"{Fore.RED + Style.BRIGHT}Max Delay must be >= Min Delay.{Style.RESET_ALL}") 1035 | except ValueError: 1036 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number.{Style.RESET_ALL}") 1037 | 1038 | async def print_timer(self): 1039 | for remaining in range(random.randint(self.min_delay, self.max_delay), 0, -1): 1040 | print( 1041 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 1042 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 1043 | f"{Fore.BLUE + Style.BRIGHT}Wait For{Style.RESET_ALL}" 1044 | f"{Fore.WHITE + Style.BRIGHT} {remaining} {Style.RESET_ALL}" 1045 | f"{Fore.BLUE + Style.BRIGHT}Seconds For Next Tx...{Style.RESET_ALL}", 1046 | end="\r", 1047 | flush=True 1048 | ) 1049 | await asyncio.sleep(1) 1050 | 1051 | def print_question(self): 1052 | while True: 1053 | try: 1054 | print(f"{Fore.GREEN + Style.BRIGHT}Select Option:{Style.RESET_ALL}") 1055 | print(f"{Fore.WHITE + Style.BRIGHT}1. Claim HLS Faucet{Style.RESET_ALL}") 1056 | print(f"{Fore.WHITE + Style.BRIGHT}2. Bridge HLS Funds{Style.RESET_ALL}") 1057 | print(f"{Fore.WHITE + Style.BRIGHT}3. Delegate Random Validators{Style.RESET_ALL}") 1058 | print(f"{Fore.WHITE + Style.BRIGHT}4. Claim Delegate Rewards{Style.RESET_ALL}") 1059 | print(f"{Fore.WHITE + Style.BRIGHT}5. Create Governance Proposal{Style.RESET_ALL}") 1060 | print(f"{Fore.WHITE + Style.BRIGHT}6. Vote Governance Proposal{Style.RESET_ALL}") 1061 | print(f"{Fore.WHITE + Style.BRIGHT}7. Deploy Token Contract{Style.RESET_ALL}") 1062 | print(f"{Fore.WHITE + Style.BRIGHT}8. Deploy Smart Contract{Style.RESET_ALL}") 1063 | print(f"{Fore.WHITE + Style.BRIGHT}9. Deploy Chronos Scheduled{Style.RESET_ALL}") 1064 | print(f"{Fore.WHITE + Style.BRIGHT}10. Run All Features{Style.RESET_ALL}") 1065 | option = int(input(f"{Fore.BLUE + Style.BRIGHT}Choose [1/2/3/4/5/6/7/8/9/10] -> {Style.RESET_ALL}").strip()) 1066 | 1067 | if option in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: 1068 | option_type = ( 1069 | "Claim HLS Faucet" if option == 1 else 1070 | "Bridge HLS Funds" if option == 2 else 1071 | "Delegate Random Validators" if option == 3 else 1072 | "Claim Delegate Rewards" if option == 4 else 1073 | "Create Governance Proposal" if option == 5 else 1074 | "Vote Governance Proposal" if option == 6 else 1075 | "Deploy Token Contract" if option == 7 else 1076 | "Deploy Smart Contract" if option == 8 else 1077 | "Deploy Chronos Scheduled" if option == 9 else 1078 | "Run All Features" 1079 | ) 1080 | print(f"{Fore.GREEN + Style.BRIGHT}{option_type} Selected.{Style.RESET_ALL}") 1081 | break 1082 | else: 1083 | print(f"{Fore.RED + Style.BRIGHT}Please enter either 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10.{Style.RESET_ALL}") 1084 | except ValueError: 1085 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number (1, 2, 3, 4, 5, 6, 7, 8, 9, or 10).{Style.RESET_ALL}") 1086 | 1087 | if option == 2: 1088 | self.print_bridge_question() 1089 | self.print_delay_question() 1090 | 1091 | elif option == 3: 1092 | self.print_delegate_question() 1093 | self.print_delay_question() 1094 | 1095 | elif option == 5: 1096 | self.print_create_proposal_question() 1097 | 1098 | elif option == 6: 1099 | self.print_vote_proposal_question() 1100 | self.print_delay_question() 1101 | 1102 | elif option == 7: 1103 | self.print_deploy_token_question() 1104 | self.print_delay_question() 1105 | 1106 | elif option == 8: 1107 | self.print_deploy_contract_question() 1108 | self.print_delay_question() 1109 | 1110 | elif option == 9: 1111 | self.print_deploy_chronos_question() 1112 | self.print_delay_question() 1113 | 1114 | elif option == 10: 1115 | self.print_bridge_question() 1116 | self.print_delegate_question() 1117 | self.print_proposal_question() 1118 | self.print_vote_proposal_question() 1119 | self.print_deploy_token_question() 1120 | self.print_deploy_contract_question() 1121 | self.print_deploy_chronos_question() 1122 | self.print_delay_question() 1123 | 1124 | while True: 1125 | try: 1126 | print(f"{Fore.WHITE + Style.BRIGHT}1. Run With Proxy{Style.RESET_ALL}") 1127 | print(f"{Fore.WHITE + Style.BRIGHT}2. Run Without Proxy{Style.RESET_ALL}") 1128 | proxy_choice = int(input(f"{Fore.BLUE + Style.BRIGHT}Choose [1/2] -> {Style.RESET_ALL}").strip()) 1129 | 1130 | if proxy_choice in [1, 2]: 1131 | proxy_type = ( 1132 | "With" if proxy_choice == 1 else 1133 | "Without" 1134 | ) 1135 | print(f"{Fore.GREEN + Style.BRIGHT}Run {proxy_type} Proxy Selected.{Style.RESET_ALL}") 1136 | break 1137 | else: 1138 | print(f"{Fore.RED + Style.BRIGHT}Please enter either 1 or 2.{Style.RESET_ALL}") 1139 | except ValueError: 1140 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter a number (1 or 2).{Style.RESET_ALL}") 1141 | 1142 | rotate_proxy = False 1143 | if proxy_choice == 1: 1144 | while True: 1145 | rotate_proxy = input(f"{Fore.BLUE + Style.BRIGHT}Rotate Invalid Proxy? [y/n] -> {Style.RESET_ALL}").strip() 1146 | 1147 | if rotate_proxy in ["y", "n"]: 1148 | rotate_proxy = rotate_proxy == "y" 1149 | break 1150 | else: 1151 | print(f"{Fore.RED + Style.BRIGHT}Invalid input. Enter 'y' or 'n'.{Style.RESET_ALL}") 1152 | 1153 | return option, proxy_choice, rotate_proxy 1154 | 1155 | async def solve_cf_turnstile(self, retries=5): 1156 | for attempt in range(retries): 1157 | try: 1158 | async with ClientSession(timeout=ClientTimeout(total=60)) as session: 1159 | 1160 | if self.CAPTCHA_KEY is None: 1161 | self.log( 1162 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1163 | f"{Fore.BLUE+Style.BRIGHT}Status :{Style.RESET_ALL}" 1164 | f"{Fore.RED+Style.BRIGHT}Turnstile Not Solved{Style.RESET_ALL}" 1165 | f"{Fore.MAGENTA+Style.BRIGHT} - {Style.RESET_ALL}" 1166 | f"{Fore.YELLOW+Style.BRIGHT}2Captcha Key Is None{Style.RESET_ALL}" 1167 | ) 1168 | return None 1169 | 1170 | url = f"http://2captcha.com/in.php?key={self.CAPTCHA_KEY}&method=turnstile&sitekey={self.SITE_KEY}&pageurl={self.PAGE_URL}" 1171 | async with session.get(url=url) as response: 1172 | response.raise_for_status() 1173 | result = await response.text() 1174 | 1175 | if 'OK|' not in result: 1176 | self.log( 1177 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1178 | f"{Fore.BLUE+Style.BRIGHT}Message :{Style.RESET_ALL}" 1179 | f"{Fore.YELLOW + Style.BRIGHT}{result}{Style.RESET_ALL}" 1180 | ) 1181 | await asyncio.sleep(5) 1182 | continue 1183 | 1184 | request_id = result.split('|')[1] 1185 | 1186 | self.log( 1187 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1188 | f"{Fore.BLUE+Style.BRIGHT}Req Id :{Style.RESET_ALL}" 1189 | f"{Fore.WHITE + Style.BRIGHT} {request_id} {Style.RESET_ALL}" 1190 | ) 1191 | 1192 | for _ in range(30): 1193 | res_url = f"http://2captcha.com/res.php?key={self.CAPTCHA_KEY}&action=get&id={request_id}" 1194 | async with session.get(url=res_url) as res_response: 1195 | res_response.raise_for_status() 1196 | res_result = await res_response.text() 1197 | 1198 | if 'OK|' in res_result: 1199 | turnstile_token = res_result.split('|')[1] 1200 | return turnstile_token 1201 | elif res_result == "CAPCHA_NOT_READY": 1202 | self.log( 1203 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1204 | f"{Fore.BLUE+Style.BRIGHT}Message :{Style.RESET_ALL}" 1205 | f"{Fore.YELLOW + Style.BRIGHT} Captcha Not Ready {Style.RESET_ALL}" 1206 | ) 1207 | await asyncio.sleep(5) 1208 | continue 1209 | else: 1210 | break 1211 | 1212 | except Exception as e: 1213 | if attempt < retries - 1: 1214 | await asyncio.sleep(5) 1215 | continue 1216 | self.log( 1217 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1218 | f"{Fore.BLUE+Style.BRIGHT}Status :{Style.RESET_ALL}" 1219 | f"{Fore.RED+Style.BRIGHT}Turnstile Not Solved{Style.RESET_ALL}" 1220 | f"{Fore.MAGENTA+Style.BRIGHT} - {Style.RESET_ALL}" 1221 | f"{Fore.YELLOW+Style.BRIGHT}{str(e)}{Style.RESET_ALL}" 1222 | ) 1223 | return None 1224 | 1225 | async def check_connection(self, proxy_url=None): 1226 | connector, proxy, proxy_auth = self.build_proxy_config(proxy_url) 1227 | try: 1228 | async with ClientSession(connector=connector, timeout=ClientTimeout(total=10)) as session: 1229 | async with session.get(url="https://api.ipify.org?format=json", proxy=proxy, proxy_auth=proxy_auth) as response: 1230 | response.raise_for_status() 1231 | return True 1232 | except (Exception, ClientResponseError) as e: 1233 | self.log( 1234 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 1235 | f"{Fore.RED+Style.BRIGHT} Connection Not 200 OK {Style.RESET_ALL}" 1236 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 1237 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1238 | ) 1239 | return None 1240 | 1241 | async def user_login(self, account: str, address: str, use_proxy: bool, retries=5): 1242 | url = f"{self.BASE_API}/users/login" 1243 | data = json.dumps(self.generate_payload(account, address)) 1244 | headers = { 1245 | **self.BASE_HEADERS[address], 1246 | "Content-Length": str(len(data)), 1247 | "Content-Type": "application/json" 1248 | } 1249 | await asyncio.sleep(3) 1250 | for attempt in range(retries): 1251 | proxy_url = self.get_next_proxy_for_account(address) if use_proxy else None 1252 | connector, proxy, proxy_auth = self.build_proxy_config(proxy_url) 1253 | try: 1254 | async with ClientSession(connector=connector, timeout=ClientTimeout(total=120)) as session: 1255 | async with session.post(url=url, headers=headers, data=data, proxy=proxy, proxy_auth=proxy_auth) as response: 1256 | response.raise_for_status() 1257 | return await response.json() 1258 | except (Exception, ClientResponseError) as e: 1259 | if attempt < retries - 1: 1260 | await asyncio.sleep(5) 1261 | continue 1262 | self.log( 1263 | f"{Fore.CYAN+Style.BRIGHT}Message :{Style.RESET_ALL}" 1264 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1265 | ) 1266 | 1267 | return None 1268 | 1269 | async def check_eligibility(self, address: str, use_proxy: bool, retries=5): 1270 | url = f"{self.BASE_API}/faucet/check-eligibility" 1271 | data = json.dumps({"token":"HLS", "chain":"helios-testnet"}) 1272 | headers = { 1273 | **self.BASE_HEADERS[address], 1274 | "Authorization": f"Bearer {self.access_tokens[address]}", 1275 | "Content-Length": str(len(data)), 1276 | "Content-Type": "application/json" 1277 | } 1278 | await asyncio.sleep(3) 1279 | for attempt in range(retries): 1280 | proxy_url = self.get_next_proxy_for_account(address) if use_proxy else None 1281 | connector, proxy, proxy_auth = self.build_proxy_config(proxy_url) 1282 | try: 1283 | async with ClientSession(connector=connector, timeout=ClientTimeout(total=120)) as session: 1284 | async with session.post(url=url, headers=headers, data=data, proxy=proxy, proxy_auth=proxy_auth) as response: 1285 | response.raise_for_status() 1286 | return await response.json() 1287 | except (Exception, ClientResponseError) as e: 1288 | if attempt < retries - 1: 1289 | await asyncio.sleep(5) 1290 | continue 1291 | self.log( 1292 | f"{Fore.CYAN+Style.BRIGHT}Faucet :{Style.RESET_ALL}" 1293 | f"{Fore.RED+Style.BRIGHT} GET Eligibility Status Failed {Style.RESET_ALL}" 1294 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 1295 | f"{Fore.RED+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1296 | ) 1297 | 1298 | return None 1299 | 1300 | async def request_faucet(self, address: str, turnstile_token: str, use_proxy: bool, retries=5): 1301 | url = f"{self.BASE_API}/faucet/request" 1302 | data = json.dumps({"token":"HLS", "chain":"helios-testnet", "amount":1, "turnstileToken":turnstile_token}) 1303 | headers = { 1304 | **self.BASE_HEADERS[address], 1305 | "Authorization": f"Bearer {self.access_tokens[address]}", 1306 | "Content-Length": str(len(data)), 1307 | "Content-Type": "application/json" 1308 | } 1309 | for attempt in range(retries): 1310 | proxy_url = self.get_next_proxy_for_account(address) if use_proxy else None 1311 | connector, proxy, proxy_auth = self.build_proxy_config(proxy_url) 1312 | try: 1313 | async with ClientSession(connector=connector, timeout=ClientTimeout(total=120)) as session: 1314 | async with session.post(url=url, headers=headers, data=data, proxy=proxy, proxy_auth=proxy_auth) as response: 1315 | response.raise_for_status() 1316 | return await response.json() 1317 | except (Exception, ClientResponseError) as e: 1318 | if attempt < retries - 1: 1319 | await asyncio.sleep(5) 1320 | continue 1321 | self.log( 1322 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1323 | f"{Fore.BLUE+Style.BRIGHT}Status :{Style.RESET_ALL}" 1324 | f"{Fore.RED+Style.BRIGHT} Not Claimed {Style.RESET_ALL}" 1325 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 1326 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1327 | ) 1328 | 1329 | return None 1330 | 1331 | async def proposal_lists(self, address: str, use_proxy: bool, retries=5): 1332 | data = json.dumps({ 1333 | "jsonrpc":"2.0", 1334 | "method":"eth_getProposalsByPageAndSize", 1335 | "params":["0x1","0x14"], 1336 | "id":1 1337 | }) 1338 | for attempt in range(retries): 1339 | proxy_url = self.get_next_proxy_for_account(address) if use_proxy else None 1340 | connector, proxy, proxy_auth = self.build_proxy_config(proxy_url) 1341 | try: 1342 | async with ClientSession(connector=connector, timeout=ClientTimeout(total=120)) as session: 1343 | async with session.post(url=self.RPC_URL, headers=self.PORTAL_HEADERS[address], data=data, proxy=proxy, proxy_auth=proxy_auth) as response: 1344 | response.raise_for_status() 1345 | return await response.json() 1346 | except (Exception, ClientResponseError) as e: 1347 | if attempt < retries - 1: 1348 | await asyncio.sleep(5) 1349 | continue 1350 | self.log( 1351 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 1352 | f"{Fore.RED+Style.BRIGHT} Fetch Proposal Lists Failed {Style.RESET_ALL}" 1353 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 1354 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1355 | ) 1356 | 1357 | return None 1358 | 1359 | async def process_check_connection(self, address: str, use_proxy: bool, rotate_proxy: bool): 1360 | while True: 1361 | proxy = self.get_next_proxy_for_account(address) if use_proxy else None 1362 | self.log( 1363 | f"{Fore.CYAN+Style.BRIGHT}Proxy :{Style.RESET_ALL}" 1364 | f"{Fore.WHITE + Style.BRIGHT} {proxy} {Style.RESET_ALL}" 1365 | ) 1366 | 1367 | is_valid = await self.check_connection(proxy) 1368 | if not is_valid: 1369 | if rotate_proxy: 1370 | proxy = self.rotate_proxy_for_account(address) 1371 | continue 1372 | 1373 | return False 1374 | 1375 | return True 1376 | 1377 | async def process_user_login(self, account: str, address: str, use_proxy: bool, rotate_proxy: bool): 1378 | is_valid = await self.process_check_connection(address, use_proxy, rotate_proxy) 1379 | if is_valid: 1380 | login = await self.user_login(account, address, use_proxy) 1381 | if login and login.get("success", False): 1382 | self.access_tokens[address] = login["token"] 1383 | 1384 | self.log( 1385 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 1386 | f"{Fore.GREEN+Style.BRIGHT} Login Success {Style.RESET_ALL}" 1387 | ) 1388 | return True 1389 | 1390 | self.log( 1391 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 1392 | f"{Fore.RED+Style.BRIGHT} Login Failed {Style.RESET_ALL}" 1393 | ) 1394 | return False 1395 | 1396 | async def process_fetch_proposal(self, address: str, use_proxy: bool): 1397 | propsal_lists = await self.proposal_lists(address, use_proxy) 1398 | if not propsal_lists: return False 1399 | 1400 | proposals = propsal_lists.get("result", []) 1401 | 1402 | live_proposals = [ 1403 | p for p in proposals 1404 | if p.get("status") == "VOTING_PERIOD" 1405 | ] 1406 | 1407 | if not live_proposals: 1408 | self.log( 1409 | f"{Fore.CYAN+Style.BRIGHT} Message :{Style.RESET_ALL}" 1410 | f"{Fore.RED+Style.BRIGHT} No Available Proposals {Style.RESET_ALL}" 1411 | ) 1412 | return False 1413 | 1414 | used_proposals = random.choice(live_proposals) 1415 | 1416 | return used_proposals 1417 | 1418 | async def process_perform_bridge(self, account: str, address: str, dest_chain_id: int, use_proxy: bool): 1419 | tx_hash, block_number = await self.perform_bridge(account, address, dest_chain_id, use_proxy) 1420 | if tx_hash and block_number: 1421 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1422 | self.log( 1423 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1424 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1425 | ) 1426 | self.log( 1427 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1428 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1429 | ) 1430 | self.log( 1431 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1432 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1433 | ) 1434 | self.log( 1435 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1436 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1437 | ) 1438 | else: 1439 | self.log( 1440 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1441 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1442 | ) 1443 | 1444 | async def process_perform_delegate(self, account: str, address: str, contract_address: str, denom: str, amount: float, use_proxy: bool): 1445 | tx_hash, block_number = await self.perform_delegate(account, address, contract_address, denom, amount, use_proxy) 1446 | if tx_hash and block_number: 1447 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1448 | self.log( 1449 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1450 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1451 | ) 1452 | self.log( 1453 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1454 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1455 | ) 1456 | self.log( 1457 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1458 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1459 | ) 1460 | self.log( 1461 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1462 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1463 | ) 1464 | else: 1465 | self.log( 1466 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1467 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1468 | ) 1469 | 1470 | async def process_perform_claim_rewards(self, account: str, address: str, use_proxy: bool): 1471 | tx_hash, block_number = await self.perform_claim_rewards(account, address, use_proxy) 1472 | if tx_hash and block_number: 1473 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1474 | self.log( 1475 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1476 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1477 | ) 1478 | self.log( 1479 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1480 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1481 | ) 1482 | self.log( 1483 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1484 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1485 | ) 1486 | self.log( 1487 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1488 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1489 | ) 1490 | else: 1491 | self.log( 1492 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1493 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1494 | ) 1495 | 1496 | async def process_perform_create_proposal(self, account: str, address: str, use_proxy: bool): 1497 | tx_hash, block_number = await self.perform_create_proposal(account, address, use_proxy) 1498 | if tx_hash and block_number: 1499 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1500 | self.log( 1501 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1502 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1503 | ) 1504 | self.log( 1505 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1506 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1507 | ) 1508 | self.log( 1509 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1510 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1511 | ) 1512 | self.log( 1513 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1514 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1515 | ) 1516 | else: 1517 | self.log( 1518 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1519 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1520 | ) 1521 | 1522 | async def process_perform_vote_proposal(self, account: str, address: str, proposal_id: int, use_proxy: bool): 1523 | tx_hash, block_number = await self.perform_vote_proposal(account, address, proposal_id, use_proxy) 1524 | if tx_hash and block_number: 1525 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1526 | self.log( 1527 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1528 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1529 | ) 1530 | self.log( 1531 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1532 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1533 | ) 1534 | self.log( 1535 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1536 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1537 | ) 1538 | self.log( 1539 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1540 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1541 | ) 1542 | else: 1543 | self.log( 1544 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1545 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1546 | ) 1547 | 1548 | async def process_perform_deploy_token(self, account: str, address: str, token_name: str, token_symbol: str, denom: str, total_supply: int, use_proxy: bool): 1549 | tx_hash, block_number = await self.perform_deploy_token(account, address, token_name, token_symbol, denom, total_supply, use_proxy) 1550 | if tx_hash and block_number: 1551 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1552 | self.log( 1553 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1554 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1555 | ) 1556 | self.log( 1557 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1558 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1559 | ) 1560 | self.log( 1561 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1562 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1563 | ) 1564 | self.log( 1565 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1566 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1567 | ) 1568 | else: 1569 | self.log( 1570 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1571 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1572 | ) 1573 | 1574 | async def process_perform_deploy_contract(self, account: str, address: str, token_name: str, token_symbol: str, total_supply: int, use_proxy: bool): 1575 | tx_hash, block_number, contract_address = await self.perform_deploy_contract(account, address, token_name, token_symbol, total_supply, use_proxy) 1576 | if tx_hash and block_number and contract_address: 1577 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1578 | self.log( 1579 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1580 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1581 | ) 1582 | self.log( 1583 | f"{Fore.CYAN+Style.BRIGHT} Contract :{Style.RESET_ALL}" 1584 | f"{Fore.BLUE+Style.BRIGHT} {contract_address} {Style.RESET_ALL}" 1585 | ) 1586 | self.log( 1587 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1588 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1589 | ) 1590 | self.log( 1591 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1592 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1593 | ) 1594 | self.log( 1595 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1596 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1597 | ) 1598 | else: 1599 | self.log( 1600 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1601 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1602 | ) 1603 | 1604 | async def process_perform_create_cron(self, account: str, address: str, use_proxy: bool): 1605 | tx_hash, block_number = await self.perform_create_cron(account, address, use_proxy) 1606 | if tx_hash and block_number: 1607 | explorer = f"https://explorer.helioschainlabs.org/tx/{tx_hash}" 1608 | self.log( 1609 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1610 | f"{Fore.GREEN+Style.BRIGHT} Success {Style.RESET_ALL}" 1611 | ) 1612 | self.log( 1613 | f"{Fore.CYAN+Style.BRIGHT} Block :{Style.RESET_ALL}" 1614 | f"{Fore.WHITE+Style.BRIGHT} {block_number} {Style.RESET_ALL}" 1615 | ) 1616 | self.log( 1617 | f"{Fore.CYAN+Style.BRIGHT} Tx Hash :{Style.RESET_ALL}" 1618 | f"{Fore.WHITE+Style.BRIGHT} {tx_hash} {Style.RESET_ALL}" 1619 | ) 1620 | self.log( 1621 | f"{Fore.CYAN+Style.BRIGHT} Explorer :{Style.RESET_ALL}" 1622 | f"{Fore.WHITE+Style.BRIGHT} {explorer} {Style.RESET_ALL}" 1623 | ) 1624 | else: 1625 | self.log( 1626 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1627 | f"{Fore.RED+Style.BRIGHT} Perform On-Chain Failed {Style.RESET_ALL}" 1628 | ) 1629 | 1630 | async def process_option_1(self, address: str, use_proxy: bool): 1631 | check = await self.check_eligibility(address, use_proxy) 1632 | if check and check.get("success", False): 1633 | is_eligible = check.get("isEligible", False) 1634 | 1635 | if is_eligible: 1636 | self.log(f"{Fore.CYAN+Style.BRIGHT}Faucet :{Style.RESET_ALL}") 1637 | 1638 | self.log( 1639 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1640 | f"{Fore.YELLOW+Style.BRIGHT}Solving Captcha Turnstile...{Style.RESET_ALL}" 1641 | ) 1642 | 1643 | turnstile_token = await self.solve_cf_turnstile() 1644 | if turnstile_token: 1645 | self.log( 1646 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1647 | f"{Fore.BLUE+Style.BRIGHT}Message :{Style.RESET_ALL}" 1648 | f"{Fore.GREEN + Style.BRIGHT} Capctha Turnstile Solved Successfully{Style.RESET_ALL}" 1649 | ) 1650 | 1651 | request = await self.request_faucet(address, turnstile_token, use_proxy) 1652 | if request and request.get("success", False): 1653 | self.log( 1654 | f"{Fore.MAGENTA+Style.BRIGHT} ● {Style.RESET_ALL}" 1655 | f"{Fore.BLUE+Style.BRIGHT}Status :{Style.RESET_ALL}" 1656 | f"{Fore.GREEN + Style.BRIGHT} 1 HLS Faucet Claimed Successfully {Style.RESET_ALL}" 1657 | ) 1658 | 1659 | else: 1660 | self.log( 1661 | f"{Fore.CYAN+Style.BRIGHT}Faucet :{Style.RESET_ALL}" 1662 | f"{Fore.YELLOW+Style.BRIGHT} Not Eligible to Claim {Style.RESET_ALL}" 1663 | ) 1664 | 1665 | async def process_option_2(self, account: str, address: str, use_proxy: bool): 1666 | self.log(f"{Fore.CYAN+Style.BRIGHT}Bridge :{Style.RESET_ALL}") 1667 | 1668 | for i in range(self.bridge_count): 1669 | self.log( 1670 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1671 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1672 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1673 | f"{Fore.WHITE+Style.BRIGHT}{self.bridge_count}{Style.RESET_ALL} " 1674 | ) 1675 | 1676 | balance = await self.get_token_balance(address, self.HLS_CONTRACT_ADDRESS, use_proxy) 1677 | 1678 | destination = random.choice(self.DEST_TOKENS) 1679 | ticker = destination["Ticker"] 1680 | dest_chain_id = destination["ChainId"] 1681 | estimated_fee = 0.5 1682 | 1683 | self.log( 1684 | f"{Fore.CYAN+Style.BRIGHT} Option :{Style.RESET_ALL}" 1685 | f"{Fore.BLUE+Style.BRIGHT} Helios to {ticker} {Style.RESET_ALL}" 1686 | ) 1687 | self.log( 1688 | f"{Fore.CYAN+Style.BRIGHT} Balance :{Style.RESET_ALL}" 1689 | f"{Fore.WHITE+Style.BRIGHT} {balance} HLS {Style.RESET_ALL}" 1690 | ) 1691 | self.log( 1692 | f"{Fore.CYAN+Style.BRIGHT} Amount :{Style.RESET_ALL}" 1693 | f"{Fore.WHITE+Style.BRIGHT} {self.bridge_amount} HLS {Style.RESET_ALL}" 1694 | ) 1695 | self.log( 1696 | f"{Fore.CYAN+Style.BRIGHT} Est. Fee :{Style.RESET_ALL}" 1697 | f"{Fore.WHITE+Style.BRIGHT} {estimated_fee} HLS {Style.RESET_ALL}" 1698 | ) 1699 | 1700 | required = self.bridge_amount + estimated_fee 1701 | 1702 | if not balance or balance <= required: 1703 | self.log( 1704 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1705 | f"{Fore.YELLOW+Style.BRIGHT} Insufficient HLS Token Balance {Style.RESET_ALL}" 1706 | ) 1707 | return 1708 | 1709 | await self.process_perform_bridge(account, address, dest_chain_id, use_proxy) 1710 | await self.print_timer() 1711 | 1712 | async def process_option_3(self, account: str, address: str, use_proxy: bool): 1713 | self.log(f"{Fore.CYAN+Style.BRIGHT}Delegate :{Style.RESET_ALL} ") 1714 | 1715 | for i in range(self.delegate_count): 1716 | self.log( 1717 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1718 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1719 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1720 | f"{Fore.WHITE+Style.BRIGHT}{self.delegate_count}{Style.RESET_ALL} " 1721 | ) 1722 | 1723 | asset, ticker, denom, amount = self.generate_random_asset() 1724 | 1725 | validators = random.choice(self.VALIDATATORS) 1726 | moniker = validators["Moniker"] 1727 | contract_address = validators["Contract Address"] 1728 | 1729 | balance = await self.get_token_balance(address, asset, use_proxy) 1730 | 1731 | self.log( 1732 | f"{Fore.CYAN+Style.BRIGHT} Asset :{Style.RESET_ALL}" 1733 | f"{Fore.WHITE+Style.BRIGHT} {ticker} {Style.RESET_ALL}" 1734 | ) 1735 | self.log( 1736 | f"{Fore.CYAN+Style.BRIGHT} Balance :{Style.RESET_ALL}" 1737 | f"{Fore.WHITE+Style.BRIGHT} {balance} {ticker} {Style.RESET_ALL}" 1738 | ) 1739 | self.log( 1740 | f"{Fore.CYAN+Style.BRIGHT} Amount :{Style.RESET_ALL}" 1741 | f"{Fore.WHITE+Style.BRIGHT} {amount} {ticker} {Style.RESET_ALL}" 1742 | ) 1743 | self.log( 1744 | f"{Fore.CYAN+Style.BRIGHT} Validator:{Style.RESET_ALL}" 1745 | f"{Fore.WHITE+Style.BRIGHT} {moniker} {Style.RESET_ALL}" 1746 | ) 1747 | 1748 | if not balance or balance <= amount: 1749 | self.log( 1750 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1751 | f"{Fore.YELLOW+Style.BRIGHT} Insufficient {ticker} Token Balance {Style.RESET_ALL}" 1752 | ) 1753 | continue 1754 | 1755 | await self.process_perform_delegate(account, address, contract_address, denom, amount, use_proxy) 1756 | await self.print_timer() 1757 | 1758 | async def process_option_4(self, account: str, address: str, use_proxy: bool): 1759 | self.log(f"{Fore.CYAN+Style.BRIGHT}Rewards :{Style.RESET_ALL} ") 1760 | 1761 | await self.process_perform_claim_rewards(account, address, use_proxy) 1762 | await self.print_timer() 1763 | 1764 | async def process_option_5(self, account: str, address: str, use_proxy: bool): 1765 | self.log(f"{Fore.CYAN+Style.BRIGHT}Create :{Style.RESET_ALL} ") 1766 | 1767 | self.log( 1768 | f"{Fore.CYAN+Style.BRIGHT} Title :{Style.RESET_ALL}" 1769 | f"{Fore.WHITE+Style.BRIGHT} {self.proposal_title} {Style.RESET_ALL}" 1770 | ) 1771 | 1772 | self.log( 1773 | f"{Fore.CYAN+Style.BRIGHT} Desc :{Style.RESET_ALL}" 1774 | f"{Fore.WHITE+Style.BRIGHT} {self.proposal_description} {Style.RESET_ALL}" 1775 | ) 1776 | 1777 | self.log( 1778 | f"{Fore.CYAN+Style.BRIGHT} Deposit :{Style.RESET_ALL}" 1779 | f"{Fore.WHITE+Style.BRIGHT} {self.proposal_deposit} HLS {Style.RESET_ALL}" 1780 | ) 1781 | 1782 | balance = await self.get_token_balance(address, self.HLS_CONTRACT_ADDRESS, use_proxy) 1783 | self.log( 1784 | f"{Fore.CYAN+Style.BRIGHT} Balance :{Style.RESET_ALL}" 1785 | f"{Fore.WHITE+Style.BRIGHT} {balance} HLS {Style.RESET_ALL}" 1786 | ) 1787 | if not balance or balance <= self.proposal_deposit: 1788 | self.log( 1789 | f"{Fore.CYAN+Style.BRIGHT} Status :{Style.RESET_ALL}" 1790 | f"{Fore.YELLOW+Style.BRIGHT} Insufficient HLS Token Balance {Style.RESET_ALL}" 1791 | ) 1792 | return 1793 | 1794 | await self.process_perform_create_proposal(account, address, use_proxy) 1795 | await self.print_timer() 1796 | 1797 | async def process_option_6(self, account: str, address: str, use_proxy: bool): 1798 | self.log(f"{Fore.CYAN+Style.BRIGHT}Vote :{Style.RESET_ALL} ") 1799 | for i in range(self.vote_count): 1800 | self.log( 1801 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1802 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1803 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1804 | f"{Fore.WHITE+Style.BRIGHT}{self.vote_count}{Style.RESET_ALL} " 1805 | ) 1806 | 1807 | proposals = await self.process_fetch_proposal(address, use_proxy) 1808 | if not proposals: continue 1809 | 1810 | proposal_id = proposals["id"] 1811 | title = proposals["title"] 1812 | proposer = proposals["proposer"] 1813 | 1814 | self.log( 1815 | f"{Fore.CYAN+Style.BRIGHT} Prop. Id :{Style.RESET_ALL}" 1816 | f"{Fore.WHITE+Style.BRIGHT} {proposal_id} {Style.RESET_ALL}" 1817 | ) 1818 | self.log( 1819 | f"{Fore.CYAN+Style.BRIGHT} Title :{Style.RESET_ALL}" 1820 | f"{Fore.WHITE+Style.BRIGHT} {title} {Style.RESET_ALL}" 1821 | ) 1822 | self.log( 1823 | f"{Fore.CYAN+Style.BRIGHT} Proposer :{Style.RESET_ALL}" 1824 | f"{Fore.BLUE+Style.BRIGHT} {proposer} {Style.RESET_ALL}" 1825 | ) 1826 | 1827 | await self.process_perform_vote_proposal(account, address, proposal_id, use_proxy) 1828 | await self.print_timer() 1829 | 1830 | async def process_option_7(self, account: str, address: str, use_proxy: bool): 1831 | self.log( 1832 | f"{Fore.CYAN+Style.BRIGHT}Deploy :{Style.RESET_ALL}" 1833 | f"{Fore.BLUE+Style.BRIGHT} Token Contract {Style.RESET_ALL} " 1834 | ) 1835 | 1836 | for i in range(self.deploy_token_count): 1837 | self.log( 1838 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1839 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1840 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1841 | f"{Fore.WHITE+Style.BRIGHT}{self.deploy_token_count}{Style.RESET_ALL} " 1842 | ) 1843 | 1844 | token_name, token_symbol, denom, raw_supply, total_supply = self.generate_raw_token() 1845 | 1846 | self.log( 1847 | f"{Fore.CYAN+Style.BRIGHT} Name :{Style.RESET_ALL}" 1848 | f"{Fore.WHITE+Style.BRIGHT} {token_name} {Style.RESET_ALL}" 1849 | ) 1850 | self.log( 1851 | f"{Fore.CYAN+Style.BRIGHT} Symbol :{Style.RESET_ALL}" 1852 | f"{Fore.WHITE+Style.BRIGHT} {token_symbol} {Style.RESET_ALL}" 1853 | ) 1854 | self.log( 1855 | f"{Fore.CYAN+Style.BRIGHT} Denom :{Style.RESET_ALL}" 1856 | f"{Fore.WHITE+Style.BRIGHT} {denom} {Style.RESET_ALL}" 1857 | ) 1858 | self.log( 1859 | f"{Fore.CYAN+Style.BRIGHT} Decimals :{Style.RESET_ALL}" 1860 | f"{Fore.WHITE+Style.BRIGHT} 18 {Style.RESET_ALL}" 1861 | ) 1862 | self.log( 1863 | f"{Fore.CYAN+Style.BRIGHT} Supply :{Style.RESET_ALL}" 1864 | f"{Fore.WHITE+Style.BRIGHT} {raw_supply} {Style.RESET_ALL}" 1865 | ) 1866 | 1867 | await self.process_perform_deploy_token(account, address, token_name, token_symbol, denom, total_supply, use_proxy) 1868 | await self.print_timer() 1869 | 1870 | async def process_option_8(self, account: str, address: str, use_proxy: bool): 1871 | self.log( 1872 | f"{Fore.CYAN+Style.BRIGHT}Deploy :{Style.RESET_ALL}" 1873 | f"{Fore.BLUE+Style.BRIGHT} Smart Contract {Style.RESET_ALL} " 1874 | ) 1875 | 1876 | for i in range(self.deploy_contract_count): 1877 | self.log( 1878 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1879 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1880 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1881 | f"{Fore.WHITE+Style.BRIGHT}{self.deploy_contract_count}{Style.RESET_ALL} " 1882 | ) 1883 | 1884 | token_name, token_symbol, denom, raw_supply, total_supply = self.generate_raw_token() 1885 | 1886 | self.log( 1887 | f"{Fore.CYAN+Style.BRIGHT} Name :{Style.RESET_ALL}" 1888 | f"{Fore.WHITE+Style.BRIGHT} {token_name} {Style.RESET_ALL}" 1889 | ) 1890 | self.log( 1891 | f"{Fore.CYAN+Style.BRIGHT} Symbol :{Style.RESET_ALL}" 1892 | f"{Fore.WHITE+Style.BRIGHT} {token_symbol} {Style.RESET_ALL}" 1893 | ) 1894 | self.log( 1895 | f"{Fore.CYAN+Style.BRIGHT} Decimals :{Style.RESET_ALL}" 1896 | f"{Fore.WHITE+Style.BRIGHT} 18 {Style.RESET_ALL}" 1897 | ) 1898 | self.log( 1899 | f"{Fore.CYAN+Style.BRIGHT} Supply :{Style.RESET_ALL}" 1900 | f"{Fore.WHITE+Style.BRIGHT} {raw_supply} {Style.RESET_ALL}" 1901 | ) 1902 | 1903 | await self.process_perform_deploy_contract(account, address, token_name, token_symbol, total_supply, use_proxy) 1904 | await self.print_timer() 1905 | 1906 | async def process_option_9(self, account: str, address: str, use_proxy: bool): 1907 | self.log(f"{Fore.CYAN+Style.BRIGHT}Chronos :{Style.RESET_ALL} ") 1908 | 1909 | for i in range(self.deploy_chronos_count): 1910 | self.log( 1911 | f"{Fore.GREEN+Style.BRIGHT} ● {Style.RESET_ALL}" 1912 | f"{Fore.WHITE+Style.BRIGHT}{i+1}{Style.RESET_ALL}" 1913 | f"{Fore.MAGENTA+Style.BRIGHT} Of {Style.RESET_ALL}" 1914 | f"{Fore.WHITE+Style.BRIGHT}{self.deploy_chronos_count}{Style.RESET_ALL} " 1915 | ) 1916 | 1917 | await self.process_perform_create_cron(account, address, use_proxy) 1918 | await self.print_timer() 1919 | 1920 | async def process_accounts(self, account: str, address: str, option: int, use_proxy: bool, rotate_proxy: bool): 1921 | logined = await self.process_user_login(account, address, use_proxy, rotate_proxy) 1922 | if logined: 1923 | try: 1924 | web3 = await self.get_web3_with_check(address, use_proxy) 1925 | except Exception as e: 1926 | self.log( 1927 | f"{Fore.CYAN+Style.BRIGHT}Status :{Style.RESET_ALL}" 1928 | f"{Fore.RED+Style.BRIGHT} Web3 Not Connected {Style.RESET_ALL}" 1929 | f"{Fore.MAGENTA+Style.BRIGHT}-{Style.RESET_ALL}" 1930 | f"{Fore.YELLOW+Style.BRIGHT} {str(e)} {Style.RESET_ALL}" 1931 | ) 1932 | return 1933 | 1934 | self.used_nonce[address] = web3.eth.get_transaction_count(address, "pending") 1935 | 1936 | if option == 1: 1937 | await self.process_option_1(address, use_proxy) 1938 | 1939 | elif option == 2: 1940 | await self.process_option_2(account, address, use_proxy) 1941 | 1942 | elif option == 3: 1943 | await self.process_option_3(account, address, use_proxy) 1944 | 1945 | elif option == 4: 1946 | await self.process_option_4(account, address, use_proxy) 1947 | 1948 | elif option == 5: 1949 | await self.process_option_5(account, address, use_proxy) 1950 | 1951 | elif option == 6: 1952 | await self.process_option_6(account, address, use_proxy) 1953 | 1954 | elif option == 7: 1955 | await self.process_option_7(account, address, use_proxy) 1956 | 1957 | elif option == 8: 1958 | await self.process_option_8(account, address, use_proxy) 1959 | 1960 | elif option == 9: 1961 | await self.process_option_9(account, address, use_proxy) 1962 | 1963 | elif option == 10: 1964 | await self.process_option_1(address, use_proxy) 1965 | 1966 | await self.process_option_2(account, address, use_proxy) 1967 | 1968 | await self.process_option_3(account, address, use_proxy) 1969 | 1970 | await self.process_option_4(account, address, use_proxy) 1971 | 1972 | if self.create_proposal: 1973 | await self.process_option_5(account, address, use_proxy) 1974 | 1975 | await self.process_option_6(account, address, use_proxy) 1976 | 1977 | await self.process_option_7(account, address, use_proxy) 1978 | 1979 | await self.process_option_8(account, address, use_proxy) 1980 | 1981 | await self.process_option_9(account, address, use_proxy) 1982 | 1983 | async def main(self): 1984 | try: 1985 | with open('accounts.txt', 'r') as file: 1986 | accounts = [line.strip() for line in file if line.strip()] 1987 | 1988 | capctha_key = self.load_2captcha_key() 1989 | if capctha_key: 1990 | self.CAPTCHA_KEY = capctha_key 1991 | 1992 | option, proxy_choice, rotate_proxy = self.print_question() 1993 | 1994 | while True: 1995 | use_proxy = True if proxy_choice == 1 else False 1996 | 1997 | self.clear_terminal() 1998 | self.welcome() 1999 | self.log( 2000 | f"{Fore.GREEN + Style.BRIGHT}Account's Total: {Style.RESET_ALL}" 2001 | f"{Fore.WHITE + Style.BRIGHT}{len(accounts)}{Style.RESET_ALL}" 2002 | ) 2003 | 2004 | if use_proxy: 2005 | await self.load_proxies() 2006 | 2007 | separator = "=" * 25 2008 | for account in accounts: 2009 | if account: 2010 | address = self.generate_address(account) 2011 | 2012 | self.log( 2013 | f"{Fore.CYAN + Style.BRIGHT}{separator}[{Style.RESET_ALL}" 2014 | f"{Fore.WHITE + Style.BRIGHT} {self.mask_account(address)} {Style.RESET_ALL}" 2015 | f"{Fore.CYAN + Style.BRIGHT}]{separator}{Style.RESET_ALL}" 2016 | ) 2017 | 2018 | if not address: 2019 | self.log( 2020 | f"{Fore.CYAN + Style.BRIGHT}Status :{Style.RESET_ALL}" 2021 | f"{Fore.RED + Style.BRIGHT} Invalid Private Key or Library Version Not Supported {Style.RESET_ALL}" 2022 | ) 2023 | continue 2024 | 2025 | user_agent = FakeUserAgent().random 2026 | 2027 | self.BASE_HEADERS[address] = { 2028 | "Accept": "application/json, text/plain, */*", 2029 | "Accept-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7", 2030 | "Origin": "https://testnet.helioschain.network", 2031 | "Referer": "https://testnet.helioschain.network/", 2032 | "Sec-Fetch-Dest": "empty", 2033 | "Sec-Fetch-Mode": "cors", 2034 | "Sec-Fetch-Site": "same-site", 2035 | "User-Agent": user_agent 2036 | } 2037 | 2038 | self.PORTAL_HEADERS[address] = { 2039 | "Content-Type": "application/json", 2040 | "Referer": "https://portal.helioschain.network/", 2041 | "User-Agent": user_agent 2042 | } 2043 | 2044 | await self.process_accounts(account, address, option, use_proxy, rotate_proxy) 2045 | await asyncio.sleep(3) 2046 | 2047 | self.log(f"{Fore.CYAN + Style.BRIGHT}={Style.RESET_ALL}"*72) 2048 | seconds = 24 * 60 * 60 2049 | while seconds > 0: 2050 | formatted_time = self.format_seconds(seconds) 2051 | print( 2052 | f"{Fore.CYAN+Style.BRIGHT}[ Wait for{Style.RESET_ALL}" 2053 | f"{Fore.WHITE+Style.BRIGHT} {formatted_time} {Style.RESET_ALL}" 2054 | f"{Fore.CYAN+Style.BRIGHT}... ]{Style.RESET_ALL}" 2055 | f"{Fore.WHITE+Style.BRIGHT} | {Style.RESET_ALL}" 2056 | f"{Fore.BLUE+Style.BRIGHT}All Accounts Have Been Processed.{Style.RESET_ALL}", 2057 | end="\r" 2058 | ) 2059 | await asyncio.sleep(1) 2060 | seconds -= 1 2061 | 2062 | except FileNotFoundError: 2063 | self.log(f"{Fore.RED}File 'accounts.txt' Not Found.{Style.RESET_ALL}") 2064 | return 2065 | except Exception as e: 2066 | self.log(f"{Fore.RED+Style.BRIGHT}Error: {e}{Style.RESET_ALL}") 2067 | raise e 2068 | 2069 | if __name__ == "__main__": 2070 | try: 2071 | bot = Helios() 2072 | asyncio.run(bot.main()) 2073 | except KeyboardInterrupt: 2074 | print( 2075 | f"{Fore.CYAN + Style.BRIGHT}[ {datetime.now().astimezone(wib).strftime('%x %X %Z')} ]{Style.RESET_ALL}" 2076 | f"{Fore.WHITE + Style.BRIGHT} | {Style.RESET_ALL}" 2077 | f"{Fore.RED + Style.BRIGHT}[ EXIT ] Helios - BOT{Style.RESET_ALL} " 2078 | ) --------------------------------------------------------------------------------