import sys
import json
import requests
from web3 import Web3

# Define your Binance Smart Chain node URL here
BSC_URL = 'https://bsc-dataseed1.binance.org'

# Connect to Binance Smart Chain node
w3 = Web3(Web3.HTTPProvider(BSC_URL))

# Check if connected to Binance Smart Chain node
if not w3.isConnected():
    print("Not connected to the Binance Smart Chain node.")
    sys.exit()


def check_mint_vulnerability(abi):
    for item in abi:
        if item['type'] == 'function' and item['name'] == 'mint':
            if 'internal' not in item['stateMutability']:
                return True
    return False


def check_transfer_fee_vulnerability(abi):
    for item in abi:
        if item['type'] == 'function' and item['name'] == 'transfer':
            for input in item['inputs']:
                if input['name'] == '_fee':
                    fee = int(input['value'])
                    if fee > 10:
                        return True
    return False


def check_ownable_vulnerability(abi):
    for item in abi:
        if item['type'] == 'function' and item['name'] == 'transferOwnership':
            if 'ownable' not in item.get('function_signature', ''):
                return True
    return False


def check_renounce_ownership_vulnerability(abi):
    for item in abi:
        if item['type'] == 'function' and item['name'] == 'transferOwnership':
            if item.get('function_signature', '') == 'renounceOwnership()':
                return True
    return False


def check_unusual_mappings_params(abi):
    unusual_mappings_params = ["lastClaimTimes", "excludedFromDividends", "tokenHoldersMap", "_isExcludedFromMaxWallet", "_isExcludedFromMaxTx",
    "_slipfeDeD", "_mAccount", "_release", "_sellSumETH", "_sellSum", "_buySum", "_marketersAndDevs",
    "balanceOf", "canSale", "_onSaleNum", "_intAddr", "cooldownTimer"]
    for item in abi:
        for unusual in unusual_mappings_params:
            if unusual in item.get("name", ""):
                return True
    return False


def check_suspicious_encodePacked_calls(abi):
    suspicious_calls = ["encodePacked"]
    for item in abi:
        for suspicious in suspicious_calls:
            if suspicious in item.get("function_signature", ""):
                return True
    return False


def check_hidden_address_usage(abi):
    hidden_addresses = ["TrustSwap", "receiveAddress", "deployer", "BSCGas", "Pancakeswap", "HecoGas", "MDEXBSC",
    "EtherGas", "Uniswap", "SnailExclusive", "rewardToken", "VERSOIN", "UniswapV2Router", "_otherAddress",
    "onlyAddress", "deadAddress", "allowedSeller", "dexContract", "pancakeRouterAddress"]
    for item in abi:
        for hidden in hidden_addresses:
            if hidden in item.get("name", ""):
                return True
    return False


def check_onlyOwner_modifier_usage(abi):
    onlyOwner_functions = ["setSwapTokensAtAmount", "setSwapEnabled", "enableTrading", "changeTreasuryWallet", "changeStakingWallet", "changeMarketingWallet",
    "updateFees", "claimStuckTokens", "resetTaxAmount", "updatePoolWallet", "updateCharityWallet", "updateMarketingWallet", "setAutomatedMarketMakerPair",
    "updateSellFees", "updateBuyFees", "updateRescueSwap", "updateSwapEnabled", "airdropToWallets", "enableTrading", "setDeadWallet", "setSwapTokensAtAmount",
    "swapManual", "updateGasForProcessing", "setAutomatedMarketMakerPair", "setMarketingWallet", "setKing", "setAirdropNumbs", "updateUniswapV2Router",
    "processAccount", "setBalance", "updateMinimumTokenBalanceForDividends", "updateClaimWait", "distributeCAKEDividends", "disableSelling", "enableSelling"]

    for item in abi:
        for onlyOwner in onlyOwner_functions:
            if onlyOwner in item.get("name", "") and "onlyOwner" in item.get("modifiers", []):
                return True
    return False

def analyze_contract(0x0d4890ecec59cd55d640d36f7acc6f7f512fdb6e):
try:

    # Get contract ABI from BCSCAN API
    abi_response = requests.get(f'https://api.bscscan.com/api?module=contract&action=getabi&address={0x0d4890ecec59cd55d640d36f7acc6f7f512fdb6e}&apikey=<TRUFFLEHOG_REDACTED_BSCSCAN>')
    abi = json.loads(abi_response.text)['result']
    abi = json.loads(abi)

    # Create contract instance
    contract = w3.eth.contract(address=contract_address, abi=abi)

    # Analyze mint vulnerability
    if check_mint_vulnerability(abi):
        print("Mint function with potential vulnerability found.")
    else:
        print("Mint vulnerability not found.")

    # Analyze transfer fee vulnerability
    if check_transfer_fee_vulnerability(abi):
        print("High transfer fee vulnerability found.")
    else:
        print("High transfer fee vulnerability not found.")

        # Analyze ownable vulnerability
        if check_ownable_vulnerability(abi):
            print("Ownable vulnerability found.")
        else:
            print("Ownable vulnerability not found.")

            # Analyze renounce ownership vulnerability
            if check_renounce_ownership_vulnerability(abi):
                print("Renounce ownership vulnerability found.")
            else:
                print("Renounce ownership vulnerability not found.")

                # Additional vulnerability checks
                if check_unusual_mappings_params(abi):
                    print("Unusual  mappings or params found.")
                else:
                    print("Unusual mappings or params not found.")

                    if check_suspicious_encodePacked_calls(abi):
                        print("Suspicious encodePacked  calls found.")
                    else:
                        print("Suspicious encodePacked calls not found.")

                        if check_hidden_address_usage(abi):
                            print("Hidden address usage found.")
                        else:
                            print("Hidden address usage not found.")

                            if check_onlyOwner_modifier_usage(abi):
                                print("OnlyOwner modifier usage found.")
                            else:
                                print("OnlyOwner modifier usage not found.")

except Exception as e:
    print("Error occurred while analyzing the contract:", e)

    if __name__ == "__main__":
        if len(sys.argv) < 2:
            print("Usage: python rugcheck_bsc.py[contract_address]")
            sys.exit()

            contract_address = sys.argv[1]
            analyze_contract(contract_address)

The code above throws an error.

C:\Users\AshotxXx\PycharmProjects\RugCheck\venv\Scripts\python.exe C:\Users\AshotxXx\PycharmProjects\RugCheck\main.py 
  File "C:\Users\AshotxXx\PycharmProjects\RugCheck\main.py", line 98
    try:
IndentationError: expected an indented block after function definition on line 97

Process finished with exit code 1

Fix it