Merge branch 'tox'

pull/254/merge
Dr. Sergey Pogodin 7 years ago
commit a62ba2470d
  1. 48
      .circleci/config.yml
  2. 13
      .coveragerc
  3. 177
      .gitignore
  4. 19
      Pipfile
  5. 7
      coverage_report.sh
  6. 16
      mythril/analysis/report.py
  7. 2
      mythril/analysis/templates/report_as_markdown.jinja2
  8. 2
      mythril/analysis/templates/report_as_text.jinja2
  9. 9
      tests/analysis/test_delegatecall.py
  10. 46
      tests/report_test.py
  11. 70
      tests/testdata/outputs_expected/calls.sol.o.markdown
  12. 58
      tests/testdata/outputs_expected/calls.sol.o.text
  13. 18
      tests/testdata/outputs_expected/overflow.sol.o.markdown
  14. 18
      tests/testdata/outputs_expected/overflow.sol.o.text
  15. 18
      tests/testdata/outputs_expected/underflow.sol.o.markdown
  16. 18
      tests/testdata/outputs_expected/underflow.sol.o.text
  17. 39
      tox.ini

@ -1,6 +1,6 @@
defaults: &defaults defaults: &defaults
docker: docker:
- image: birdofpreyru/mythril-integration-tests:0.0.3 - image: birdofpreyru/mythril-integration-tests:0.0.4
version: 2 version: 2
jobs: jobs:
@ -15,13 +15,28 @@ jobs:
# path param in checkout command, and this symlink compenstates for that. # path param in checkout command, and this symlink compenstates for that.
# - run: ln -s /root/project /home/mythril # - run: ln -s /root/project /home/mythril
- restore-cache:
keys:
- tox-env-{{ checksum "/home/mythril/setup.py" }}
- run: - run:
name: Installing mythril tools name: Installing mythril tools
command: cd /home && ./install-mythril-tools.sh laser-ethereum command: ./install-mythril-tools.sh laser-ethereum
working_directory: /home
- run: - run:
name: Install dependencies, in case any are missing in Docker image name: Install tox envs
command: pip3 install -r /home/mythril/requirements.txt command: tox -vv --notest
working_directory: /home/mythril
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
- save_cache:
key: tox-env-{{ checksum "/home/mythril/setup.py" }}
paths:
- .tox/py*
- /root/.cache/pip/wheels/
- run: - run:
background: true background: true
@ -30,21 +45,27 @@ jobs:
- run: - run:
name: Unit-testing name: Unit-testing
command: cd /home/mythril && ./all_tests.sh command: tox
working_directory: /home/mythril
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
- store_test_results: - store_test_results:
path: /tmp/test-reports path: /home/mythril/.tox/output
- store_artifacts: - store_artifacts:
path: /tmp/test-reports path: /home/mythril/.tox/output
- run: - run:
name: Ensuring that setup script is functional name: Ensuring that setup script is functional
command: cd /home/mythril && python3 setup.py install command: python3 setup.py install
working_directory: /home/mythril
- run: - run:
name: Integration tests name: Integration tests
command: if [ -z "$CIRCLE_PR_NUMBER" ]; then cd /home && ./run-integration-tests.sh; fi command: if [ -z "$CIRCLE_PR_NUMBER" ]; then ./run-integration-tests.sh; fi
working_directory: /home
deploy: deploy:
<<: *defaults <<: *defaults
@ -53,13 +74,16 @@ jobs:
path: /home/mythril path: /home/mythril
- run: - run:
name: Verify Git tag vs. version name: Verify Git tag vs. version
command: cd /home/mythril && python3 setup.py verify command: python3 setup.py verify
working_directory: /home/mythril
- run: - run:
name: Build name: Build
command: cd /home/mythril && python3 setup.py sdist command: python3 setup.py sdist
working_directory: /home/mythril
- run: - run:
name: Deploy name: Deploy
command: cd /home/mythril && twine upload dist/* command: twine upload dist/*
working_directory: /home/mythril
workflows: workflows:
version: 2 version: 2

@ -1,13 +0,0 @@
[run]
source =
.
[report]
omit =
*__init__.py
/usr/*
*_test.py
setup.py
[html]
directory = coverage_html_report

177
.gitignore vendored

@ -1,20 +1,179 @@
.DS_Store
# Created by https://www.gitignore.io/api/linux,macos,python,windows
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version .python-version
__pycache__
*.pyc # celery beat schedule file
celerybeat-schedule.*
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/linux,macos,python,windows
*.asm *.asm
mythril.egg-info
build
dist
*.rst *.rst
*.lock *.lock
!Pipfile.lock
*.svg *.svg
laser* laser*
lol* lol*
.idea* .idea*
coverage_html_report/ coverage_html_report/
.coverage
.pytest_cache
tests/testdata/outputs_current/ tests/testdata/outputs_current/
tests/mythril_dir/signatures.json tests/mythril_dir/signatures.json

@ -4,27 +4,16 @@ verify_ssl = true
name = "pypi" name = "pypi"
[packages] [packages]
requests = "*" "e1839a8" = {path = ".", editable = true}
plyvel = "*"
py-solc = "*"
coverage = "*"
BTrees = "*"
ethereum = ">=2.3.0"
zodb = ">=5.3.0"
eth-abi = "*"
"z3-solver" = ">=4.5"
eth-account = "*"
eth-tester = "*"
laser-ethereum = ">=0.5.20"
"jinja2" = "*"
rlp = "<1.0.0"
[dev-packages] [dev-packages]
pylint = "*" pylint = "*"
yapf = "*" yapf = "*"
pytest = "*" pytest = "*"
pytest-mock = "*"
pytest-cov = "*"
[requires] [requires]
python_version = "3.6"
[pipenv] [pipenv]
allow_prereleases = true allow_prereleases = true

@ -7,6 +7,7 @@ rm -rf ./tests/testdata/outputs_current/
mkdir -p ./tests/testdata/outputs_current/ mkdir -p ./tests/testdata/outputs_current/
rm -rf coverage_html_report rm -rf coverage_html_report
coverage run -m unittest discover -p "*_test.py" py.test \
coverage html --cov=mythril \
open coverage_html_report/index.html --cov-config=tox.ini \
--cov-report=html:coverage_html_report \

@ -1,5 +1,6 @@
import hashlib import hashlib
import json import json
import operator
from jinja2 import PackageLoader, Environment from jinja2 import PackageLoader, Environment
class Issue: class Issue:
@ -45,25 +46,28 @@ class Report:
self.verbose = verbose self.verbose = verbose
pass pass
def sorted_issues(self):
issue_list = [issue.as_dict() for key, issue in self.issues.items()]
return sorted(issue_list, key=operator.itemgetter('address', 'title'))
def append_issue(self, issue): def append_issue(self, issue):
m = hashlib.md5() m = hashlib.md5()
m.update((issue.contract + str(issue.address) + issue.title).encode('utf-8')) m.update((issue.contract + str(issue.address) + issue.title).encode('utf-8'))
self.issues[m.digest()] = issue self.issues[m.digest()] = issue
def as_text(self): def as_text(self):
filename = self._file_name() name = self._file_name()
template = Report.environment.get_template('report_as_text.jinja2') template = Report.environment.get_template('report_as_text.jinja2')
return template.render(filename=filename, issues=self.issues, verbose=self.verbose) return template.render(filename=name, issues=self.sorted_issues(), verbose=self.verbose)
def as_json(self): def as_json(self):
issues = [issue.as_dict() for key, issue in self.issues.items()] result = {'success': True, 'error': None, 'issues': self.sorted_issues()}
result = {'success': True, 'error': None, 'issues': issues} return json.dumps(result, sort_keys=True)
return json.dumps(result)
def as_markdown(self): def as_markdown(self):
filename = self._file_name() filename = self._file_name()
template = Report.environment.get_template('report_as_markdown.jinja2') template = Report.environment.get_template('report_as_markdown.jinja2')
return template.render(filename=filename, issues=self.issues, verbose=self.verbose) return template.render(filename=filename, issues=self.sorted_issues(), verbose=self.verbose)
def _file_name(self): def _file_name(self):
if len(self.issues.values()) > 0: if len(self.issues.values()) > 0:

@ -1,6 +1,6 @@
# Analysis results for {{ filename }} # Analysis results for {{ filename }}
{% if issues %} {% if issues %}
{% for key, issue in issues.items() %} {% for issue in issues %}
## {{ issue.title }} ## {{ issue.title }}

@ -1,5 +1,5 @@
{% if issues %} {% if issues %}
{% for key, issue in issues.items() %} {% for issue in issues %}
==== {{ issue.title }} ==== ==== {{ issue.title }} ====
Type: {{ issue.type }} Type: {{ issue.type }}
Contract: {{ issue.contract | default("Unknown") }} Contract: {{ issue.contract | default("Unknown") }}

@ -3,8 +3,7 @@ from mythril.analysis.ops import Call, Variable, VarType
from mythril.analysis.symbolic import SymExecWrapper from mythril.analysis.symbolic import SymExecWrapper
from laser.ethereum.svm import GlobalState, Node, Environment, Account from laser.ethereum.svm import GlobalState, Node, Environment, Account
import pytest import pytest
import mock from unittest.mock import MagicMock, patch
from mock import patch
import pytest_mock import pytest_mock
@ -185,7 +184,7 @@ def test_delegate_call(sym_mock, concrete_mock, curr_instruction):
to = Variable("storage_1", VarType.SYMBOLIC) to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, state, None, "DELEGATECALL", to, None) call = Call(node, state, None, "DELEGATECALL", to, None)
statespace = mock.MagicMock() statespace = MagicMock()
statespace.calls = [call] statespace.calls = [call]
# act # act
@ -211,7 +210,7 @@ def test_delegate_call_not_delegate(sym_mock, concrete_mock):
to = Variable("storage_1", VarType.SYMBOLIC) to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, None, None, "NOT_DELEGATECALL", to, None) call = Call(node, None, None, "NOT_DELEGATECALL", to, None)
statespace = mock.MagicMock() statespace = MagicMock()
statespace.calls = [call] statespace.calls = [call]
# act # act
@ -238,7 +237,7 @@ def test_delegate_call_not_fallback(sym_mock, concrete_mock):
to = Variable("storage_1", VarType.SYMBOLIC) to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, None, None, "DELEGATECALL", to, None) call = Call(node, None, None, "DELEGATECALL", to, None)
statespace = mock.MagicMock() statespace = MagicMock()
statespace.calls = [call] statespace.calls = [call]
# act # act

@ -19,7 +19,7 @@ def _fix_debug_data(json_str):
read_json = json.loads(json_str) read_json = json.loads(json_str)
for issue in read_json["issues"]: for issue in read_json["issues"]:
issue["debug"] = "<DEBUG-DATA>" issue["debug"] = "<DEBUG-DATA>"
return json.dumps(read_json, indent=4) return json.dumps(read_json, sort_keys=True)
def _generate_report(input_file): def _generate_report(input_file):
@ -56,6 +56,29 @@ def _assert_empty(changed_files, postfix):
assert message == "", message assert message == "", message
def _assert_empty_json(changed_files):
""" Asserts there are no changed files and otherwise builds error message"""
postfix = ".json"
expected = []
actual = []
def ordered(obj):
if isinstance(obj, dict):
return sorted((k, ordered(v)) for k, v in obj.items())
elif isinstance(obj, list):
return sorted(ordered(x) for x in obj)
else:
return obj
for input_file in changed_files:
output_expected = json.loads((TESTDATA_OUTPUTS_EXPECTED / (input_file.name + postfix)).read_text())
output_current = json.loads((TESTDATA_OUTPUTS_CURRENT / (input_file.name + postfix)).read_text())
if not ordered(output_expected.items()) == ordered(output_current.items()):
expected.append(output_expected)
actual.append(output_current)
assert expected == actual
def _get_changed_files(postfix, report_builder, reports): def _get_changed_files(postfix, report_builder, reports):
""" """
@ -74,8 +97,27 @@ def _get_changed_files(postfix, report_builder, reports):
yield input_file yield input_file
def _get_changed_files_json(report_builder, reports):
postfix = ".json"
def ordered(obj):
if isinstance(obj, dict):
return sorted((k, ordered(v)) for k, v in obj.items())
elif isinstance(obj, list):
return sorted(ordered(x) for x in obj)
else:
return obj
for report, input_file in reports:
output_expected = TESTDATA_OUTPUTS_EXPECTED / (input_file.name + postfix)
output_current = TESTDATA_OUTPUTS_CURRENT / (input_file.name + postfix)
output_current.write_text(report_builder(report))
if not ordered(json.loads(output_expected.read_text())) == ordered(json.loads(output_current.read_text())):
yield input_file
def test_json_report(reports): def test_json_report(reports):
_assert_empty(_get_changed_files('.json', lambda report: _fix_path(_fix_debug_data(report.as_json())).strip(), reports), '.json') _assert_empty_json(_get_changed_files_json(lambda report: _fix_path(_fix_debug_data(report.as_json())).strip(), reports))
def test_markdown_report(reports): def test_markdown_report(reports):

@ -11,49 +11,27 @@
This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code. This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.
## Message call to external contract ## Unchecked CALL return value
- Type: Warning
- Contract: Unknown
- Function name: `_function_0xd24b08cc`
- PC address: 779
### Description
This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
## Message call to external contract
- Type: Informational - Type: Informational
- Contract: Unknown - Contract: Unknown
- Function name: `_function_0xe11f493e` - Function name: `_function_0x5a6814ec`
- PC address: 858 - PC address: 661
### Description
This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.
## State change after external call
- Type: Warning
- Contract: Unknown
- Function name: `_function_0xe11f493e`
- PC address: 869
### Description ### Description
The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
## Message call to external contract ## Message call to external contract
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `_function_0xe1d10f79` - Function name: `_function_0xd24b08cc`
- PC address: 912 - PC address: 779
### Description ### Description
This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state. This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
## Transaction order dependence ## Transaction order dependence
@ -70,23 +48,23 @@ A possible transaction order independence vulnerability exists in function _func
- Type: Informational - Type: Informational
- Contract: Unknown - Contract: Unknown
- Function name: `_function_0x5a6814ec` - Function name: `_function_0xd24b08cc`
- PC address: 661 - PC address: 779
### Description ### Description
The return value of an external call is not checked. Note that execution continue even if the called contract throws. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
## Unchecked CALL return value ## Message call to external contract
- Type: Informational - Type: Informational
- Contract: Unknown - Contract: Unknown
- Function name: `_function_0xd24b08cc` - Function name: `_function_0xe11f493e`
- PC address: 779 - PC address: 858
### Description ### Description
The return value of an external call is not checked. Note that execution continue even if the called contract throws. This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.
## Unchecked CALL return value ## Unchecked CALL return value
@ -99,6 +77,28 @@ The return value of an external call is not checked. Note that execution continu
The return value of an external call is not checked. Note that execution continue even if the called contract throws. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
## State change after external call
- Type: Warning
- Contract: Unknown
- Function name: `_function_0xe11f493e`
- PC address: 869
### Description
The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.
## Message call to external contract
- Type: Warning
- Contract: Unknown
- Function name: `_function_0xe1d10f79`
- PC address: 912
### Description
This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
## Unchecked CALL return value ## Unchecked CALL return value
- Type: Informational - Type: Informational

@ -6,36 +6,20 @@ PC address: 661
This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code. This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.
-------------------- --------------------
==== Message call to external contract ==== ==== Unchecked CALL return value ====
Type: Warning
Contract: Unknown
Function name: _function_0xd24b08cc
PC address: 779
This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
--------------------
==== Message call to external contract ====
Type: Informational Type: Informational
Contract: Unknown Contract: Unknown
Function name: _function_0xe11f493e Function name: _function_0x5a6814ec
PC address: 858 PC address: 661
This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
--------------------
==== State change after external call ====
Type: Warning
Contract: Unknown
Function name: _function_0xe11f493e
PC address: 869
The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.
-------------------- --------------------
==== Message call to external contract ==== ==== Message call to external contract ====
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: _function_0xe1d10f79 Function name: _function_0xd24b08cc
PC address: 912 PC address: 779
This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state. This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
-------------------- --------------------
==== Transaction order dependence ==== ==== Transaction order dependence ====
@ -49,17 +33,17 @@ A possible transaction order independence vulnerability exists in function _func
==== Unchecked CALL return value ==== ==== Unchecked CALL return value ====
Type: Informational Type: Informational
Contract: Unknown Contract: Unknown
Function name: _function_0x5a6814ec Function name: _function_0xd24b08cc
PC address: 661 PC address: 779
The return value of an external call is not checked. Note that execution continue even if the called contract throws. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
-------------------- --------------------
==== Unchecked CALL return value ==== ==== Message call to external contract ====
Type: Informational Type: Informational
Contract: Unknown Contract: Unknown
Function name: _function_0xd24b08cc Function name: _function_0xe11f493e
PC address: 779 PC address: 858
The return value of an external call is not checked. Note that execution continue even if the called contract throws. This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.
-------------------- --------------------
==== Unchecked CALL return value ==== ==== Unchecked CALL return value ====
@ -70,6 +54,22 @@ PC address: 858
The return value of an external call is not checked. Note that execution continue even if the called contract throws. The return value of an external call is not checked. Note that execution continue even if the called contract throws.
-------------------- --------------------
==== State change after external call ====
Type: Warning
Contract: Unknown
Function name: _function_0xe11f493e
PC address: 869
The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.
--------------------
==== Message call to external contract ====
Type: Warning
Contract: Unknown
Function name: _function_0xe1d10f79
PC address: 912
This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.
--------------------
==== Unchecked CALL return value ==== ==== Unchecked CALL return value ====
Type: Informational Type: Informational
Contract: Unknown Contract: Unknown

@ -5,33 +5,33 @@
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 649 - PC address: 567
### Description ### Description
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The subtraction may result in a value < 0.
## Integer Overflow ## Integer Underflow
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 725 - PC address: 649
### Description ### Description
A possible integer overflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The addition or multiplication may result in a value higher than the maximum representable integer. The subtraction may result in a value < 0.
## Integer Underflow ## Integer Overflow
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 567 - PC address: 725
### Description ### Description
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer overflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The addition or multiplication may result in a value higher than the maximum representable integer.

@ -2,26 +2,26 @@
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 649 PC address: 567
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The subtraction may result in a value < 0.
-------------------- --------------------
==== Integer Overflow ==== ==== Integer Underflow ====
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 725 PC address: 649
A possible integer overflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The addition or multiplication may result in a value higher than the maximum representable integer. The subtraction may result in a value < 0.
-------------------- --------------------
==== Integer Underflow ==== ==== Integer Overflow ====
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 567 PC address: 725
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer overflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The addition or multiplication may result in a value higher than the maximum representable integer.
-------------------- --------------------

@ -5,33 +5,33 @@
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 649 - PC address: 567
### Description ### Description
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The subtraction may result in a value < 0.
## Integer Overflow ## Integer Underflow
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 725 - PC address: 649
### Description ### Description
A possible integer overflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The addition or multiplication may result in a value higher than the maximum representable integer. The subtraction may result in a value < 0.
## Integer Underflow ## Integer Overflow
- Type: Warning - Type: Warning
- Contract: Unknown - Contract: Unknown
- Function name: `sendeth(address,uint256)` - Function name: `sendeth(address,uint256)`
- PC address: 567 - PC address: 725
### Description ### Description
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer overflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The addition or multiplication may result in a value higher than the maximum representable integer.

@ -2,26 +2,26 @@
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 649 PC address: 567
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The subtraction may result in a value < 0.
-------------------- --------------------
==== Integer Overflow ==== ==== Integer Underflow ====
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 725 PC address: 649
A possible integer overflow exists in the function `sendeth(address,uint256)`. A possible integer underflow exists in the function `sendeth(address,uint256)`.
The addition or multiplication may result in a value higher than the maximum representable integer. The subtraction may result in a value < 0.
-------------------- --------------------
==== Integer Underflow ==== ==== Integer Overflow ====
Type: Warning Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 567 PC address: 725
A possible integer underflow exists in the function `sendeth(address,uint256)`. A possible integer overflow exists in the function `sendeth(address,uint256)`.
The subtraction may result in a value < 0. The addition or multiplication may result in a value higher than the maximum representable integer.
-------------------- --------------------

@ -0,0 +1,39 @@
[tox]
envlist = py36
[testenv]
deps =
pytest
pytest-mock
whitelist_externals = mkdir
commands =
mkdir -p {toxinidir}/tests/testdata/outputs_current/
py.test -v \
--junitxml={toxworkdir}/output/{envname}/junit.xml \
{posargs}
[testenv:py36]
basepython = python3.6
setenv =
COVERAGE_FILE = .coverage.{envname}
deps =
pytest
pytest-mock
pytest-cov
whitelist_externals = mkdir
commands =
mkdir -p {toxinidir}/tests/testdata/outputs_current/
py.test -v \
--cov=mythril \
--cov-config=tox.ini \
--cov-report=xml:{toxworkdir}/output/{envname}/coverage.xml \
--cov-report=html:{toxworkdir}/output/{envname}/covhtml \
--junitxml={toxworkdir}/output/{envname}/junit.xml \
{posargs}
[coverage:report]
omit =
*__init__.py
/usr/*
*_test.py
setup.py
Loading…
Cancel
Save