Skip to content

Mythril analyze returning AttributeError #1813

Open
@basedwdev

Description

@basedwdev

Description

mythril.interfaces.cli [ERROR]: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/mythril/interfaces/cli.py", line 966, in parse_args_and_execute
    address = load_code(disassembler, args)
  File "/usr/local/lib/python3.10/site-packages/mythril/interfaces/cli.py", line 717, in load_code
    address, _ = disassembler.load_from_solidity(
  File "/usr/local/lib/python3.10/site-packages/mythril/mythril/mythril_disassembler.py", line 291, in load_from_solidity
    for contract in get_contracts_from_file(
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/soliditycontract.py", line 132, in get_contracts_from_file
    yield SolidityContract(
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/soliditycontract.py", line 197, in __init__
    ).extract_features()
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/features.py", line 28, in extract_features
    ether_vars = self.extract_address_variable(node)
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/features.py", line 224, in extract_address_variable
    transfer_vars.update(self.extract_address_variable(value))
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/features.py", line 228, in extract_address_variable
    transfer_vars.update(self.extract_address_variable(item))
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/features.py", line 228, in extract_address_variable
    transfer_vars.update(self.extract_address_variable(item))
  File "/usr/local/lib/python3.10/site-packages/mythril/solidity/features.py", line 210, in extract_address_variable
    node.get("nodeType", "") == "ExpressionStatement"
AttributeError: 'NoneType' object has no attribute 'get'

How to Reproduce

myth analyze myContract.sol

-> contract code can be found https://bscscan.com/token/0xadb58e26d623acc31870318e419d86fb36c3d9c3#code

using macbook m1 with OS venture 13.4.1

Expected behavior

Should return SWC codes

Screenshots

N/A

Environment

macbook m1 with OS venture 13.4.1

Please modify for your setup

  • Mythril version: output from myth version or pip show mythril

pip3 show mythril
Name: mythril
Version: 0.24.0
Summary: Security analysis tool for Ethereum smart contracts
Home-page: https://github.com/ConsenSys/mythril
Author: ConsenSys Dilligence
Author-email:
License: MIT
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: asn1crypto, blake2b-py, certifi, coincurve, coloredlogs, configparser, coverage, cytoolz, eth-abi, eth-account, eth-hash, eth-keyfile, eth-rlp, eth-utils, ethereum-input-decoder, hexbytes, jinja2, MarkupSafe, matplotlib, mock, mypy-extensions, numpy, persistent, pre-commit, py-ecc, py-evm, py-flags, py-solc, py-solc-x, pyparsing, pytest, pytest-cov, pytest-mock, requests, rlp, scikit-learn, semantic-version, transaction, z3-solver
Required-by:

  • Solidity compiler and version: solc --version

solc --version
solc, the solidity compiler commandline interface
Version: 0.8.21+commit.d9974bed.Darwin.appleclang

  • Python version: python -V

python3 --version
Python 3.11.6

  • OS and Version: [e.g. Mac OS High Sierra]

OS venture 13.4.1

Additional Environment or Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions