Update requirements.txt (#1807)

* Update requirements.txt

* use eth-abi

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update python

* Change ci image

* Change requirements

* Remove signature

* Use comma

* Handle pip

* Fix issues

* Reformat setup.py
pull/1812/head
Nikhil Parasaram 1 year ago committed by GitHub
parent a28d600ced
commit d167d20fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .circleci/config.yml
  2. 9
      mythril/analysis/report.py
  3. 4
      mythril/config.ini
  4. 17
      requirements.txt
  5. 10
      setup.py
  6. 21
      tox.ini

@ -5,7 +5,7 @@ defaults:
# used for new integration testing, and it is build on top of the previous # used for new integration testing, and it is build on top of the previous
# `mythril/dev_test_environment:0.0.43`, though a bit newer versions, thus # `mythril/dev_test_environment:0.0.43`, though a bit newer versions, thus
# there is a chance that it breaks some small things. # there is a chance that it breaks some small things.
- image: mythril/mythril-ci - image: norhh/mythril-ci
version: 2 version: 2
jobs: jobs:
@ -37,17 +37,17 @@ jobs:
paths: paths:
- .tox/py* - .tox/py*
- /root/.cache/pip/wheels/ - /root/.cache/pip/wheels/
# TODO: Remove all --break-system-packages here in and mythril-ci image
- run: - run:
name: Black style check name: Black style check
command: | command: |
pip3 install --user black==22.3.0 pip3 install --user black==22.3.0 --break-system-packages
python3 -m black --check /home/mythril/ python3 -m black --check /home/mythril/
- run: - run:
background: true background: true
name: Launch of background geth instance name: Launch of background geth instance
command: geth --syncmode full --http --http.api="db,eth,net,web3,personal" --shh command: geth --syncmode full --http --http.api="db,eth,net,web3,personal"
- run: - run:
name: Unit-testing name: Unit-testing
@ -69,7 +69,7 @@ jobs:
- run: - run:
name: Ensuring that setup script is functional name: Ensuring that setup script is functional
command: python3 setup.py install command: python3 -m build
working_directory: /home/mythril working_directory: /home/mythril
- run: - run:

@ -3,7 +3,12 @@ import logging
import re import re
import json import json
import operator import operator
from eth_abi import decode_abi
try:
from eth_abi import decode
except ImportError:
from eth_abi import decode_abi as decode
from jinja2 import PackageLoader, Environment from jinja2 import PackageLoader, Environment
from typing import Dict, List, Any, Optional from typing import Dict, List, Any, Optional
import hashlib import hashlib
@ -230,7 +235,7 @@ class Issue:
if len(data) % 64 > 0: if len(data) % 64 > 0:
data += "0" * (64 - len(data) % 64) data += "0" * (64 - len(data) % 64)
try: try:
decoded_output = decode_abi(type_info, bytes.fromhex(data)) decoded_output = decode(type_info, bytes.fromhex(data))
return decoded_output return decoded_output
except Exception as e: except Exception as e:
return None return None

@ -0,0 +1,4 @@
[defaults]
dynamic_loading = infura
infura_id =

@ -6,15 +6,13 @@ asn1crypto>=0.22.0
configparser>=3.5.0 configparser>=3.5.0
coverage<7.0,>6.0 coverage<7.0,>6.0
py_ecc<5.0.0,>=1.4.7 py_ecc<5.0.0,>=1.4.7
eth_abi<3.0.0,>=2.0.0b4 eth-abi>=4.0.0
eth-account<0.6.0,>=0.5.6 eth-account>=0.8.0
ethereum-input-decoder>=0.2.2 ethereum-input-decoder>=0.2.2
eth-hash<0.4.0,>=0.3.1 eth-hash<0.4.0,>=0.3.1
eth-keyfile<0.6.0,>=0.5.1 eth-keyfile>=0.6.0
eth-keys<0.4.0,>=0.2.1 eth-rlp>=0.3.0,<0.4.0
eth-rlp<0.3.0,>=0.1.0 eth-utils>=2
eth-typing<3.0.0,>=2.1.0
eth-utils<2
hexbytes<0.3.0 hexbytes<0.3.0
jinja2>=2.9 jinja2>=2.9
MarkupSafe<2.1.0 MarkupSafe<2.1.0
@ -23,7 +21,7 @@ mypy-extensions<1.0.0
numpy numpy
persistent>=4.2.0 persistent>=4.2.0
py-flags py-flags
py-evm==0.5.0a1 py-evm==0.7.0a1
py-solc-x py-solc-x
py-solc py-solc
pytest>=3.6.0 pytest>=3.6.0
@ -31,11 +29,10 @@ pyparsing<3,>=2.0.2
pytest-cov pytest-cov
pytest_mock pytest_mock
requests requests
rlp<3 rlp<4,>=3
semantic_version semantic_version
scikit-learn scikit-learn
transaction>=2.2.1 transaction>=2.2.1
typing-extensions<4,>=3.7.4
z3-solver<4.12.2.0,>=4.8.8.0 z3-solver<4.12.2.0,>=4.8.8.0
matplotlib matplotlib
pre-commit<2.21.0 pre-commit<2.21.0

@ -16,19 +16,13 @@ import os
import io import io
class InstallCommand(_install):
def run(self):
check_call([sys.executable, "-m", "pip", "install", "cython"])
_install.run(self)
# Package meta-data. # Package meta-data.
NAME = "mythril" NAME = "mythril"
DESCRIPTION = "Security analysis tool for Ethereum smart contracts" DESCRIPTION = "Security analysis tool for Ethereum smart contracts"
URL = "https://github.com/ConsenSys/mythril" URL = "https://github.com/ConsenSys/mythril"
AUTHOR = "ConsenSys Dilligence" AUTHOR = "ConsenSys Dilligence"
AUTHOR_MAIL = None AUTHOR_MAIL = None
REQUIRES_PYTHON = ">=3.6.0" REQUIRES_PYTHON = ">=3.7.0"
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
# What packages are required for this module to be executed? # What packages are required for this module to be executed?
@ -135,5 +129,5 @@ setup(
package_data={"mythril.analysis.templates": ["*"], "mythril.support.assets": ["*"]}, package_data={"mythril.analysis.templates": ["*"], "mythril.support.assets": ["*"]},
include_package_data=True, include_package_data=True,
entry_points={"console_scripts": ["myth=mythril.interfaces.cli:main"]}, entry_points={"console_scripts": ["myth=mythril.interfaces.cli:main"]},
cmdclass={"install": InstallCommand, "verify": VerifyVersionCommand}, cmdclass={"verify": VerifyVersionCommand},
) )

@ -1,12 +1,12 @@
[tox] [tox]
envlist = python3.6, python3.9, python3.10 envlist = python3.7, python3.9, python3.10
[testenv] [testenv]
deps = deps =
pytest pytest
pytest-mock pytest-mock
passenv = MYTHRIL_DIR INFURA_ID passenv = MYTHRIL_DIR,INFURA_ID
whitelist_externals = mkdir allowlist_externals = mkdir
commands = commands =
mkdir -p {toxinidir}/tests/testdata/outputs_current/ mkdir -p {toxinidir}/tests/testdata/outputs_current/
mkdir -p {toxinidir}/tests/testdata/outputs_current_laser_result/ mkdir -p {toxinidir}/tests/testdata/outputs_current_laser_result/
@ -15,8 +15,8 @@ commands =
--disable-pytest-warnings \ --disable-pytest-warnings \
{posargs} {posargs}
[testenv:py36] [testenv:py37]
basepython = python3.6 basepython = python3.7
setenv = setenv =
COVERAGE_FILE = .coverage.{envname} COVERAGE_FILE = .coverage.{envname}
deps = deps =
@ -25,8 +25,7 @@ deps =
pytest-mock pytest-mock
pytest-cov pytest-cov
passenv = MYTHRIL_DIR INFURA_ID allowlist_externals = mkdir
whitelist_externals = mkdir
commands = commands =
mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril
mkdir -p {toxinidir}/tests/testdata/outputs_current/ mkdir -p {toxinidir}/tests/testdata/outputs_current/
@ -50,8 +49,8 @@ deps =
pytest-mock pytest-mock
pytest-cov pytest-cov
passenv = MYTHRIL_DIR INFURA_ID passenv = MYTHRIL_DIR,INFURA_ID
whitelist_externals = mkdir allowlist_externals = mkdir
commands = commands =
mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril
mkdir -p {toxinidir}/tests/testdata/outputs_current/ mkdir -p {toxinidir}/tests/testdata/outputs_current/
@ -75,8 +74,8 @@ deps =
pytest-mock pytest-mock
pytest-cov pytest-cov
passenv = MYTHRIL_DIR INFURA_ID passenv = MYTHRIL_DIR,INFURA_ID
whitelist_externals = mkdir allowlist_externals = mkdir
commands = commands =
mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril
mkdir -p {toxinidir}/tests/testdata/outputs_current/ mkdir -p {toxinidir}/tests/testdata/outputs_current/

Loading…
Cancel
Save