diff --git a/.circleci/config.yml b/.circleci/config.yml index 46a67785..42d12a89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,10 +89,10 @@ jobs: working_directory: /home steps: - checkout: - path: /home/mythril-classic + path: /home/mythril - run: - name: Builds `mythril-classic` - command: cd mythril-classic && python3 setup.py install + name: Builds `mythril` + command: cd mythril && python3 setup.py install - run: name: Installs other MythX components command: | diff --git a/docs/source/about.rst b/docs/source/about.rst index edfdc308..169fe4f7 100644 --- a/docs/source/about.rst +++ b/docs/source/about.rst @@ -1,6 +1,6 @@ -What is Mythril Classic? +What is Mythril? ======================== -Mythril Classic is a security analysis tool for Ethereum smart contracts. It was `introduced at HITBSecConf 2018 `_. +Mythril is a security analysis tool for Ethereum smart contracts. It was `introduced at HITBSecConf 2018 `_. -Mythril Classic detects a range of security issues, including integer underflows, owner-overwrite-to-Ether-withdrawal, and others. Note that Mythril is targeted at finding common vulnerabilities, and is not able to discover issues in the business logic of an application. Furthermore, Mythril and symbolic executors are generally unsound, as they are often unable to explore all possible states of a program. +Mythril detects a range of security issues, including integer underflows, owner-overwrite-to-Ether-withdrawal, and others. Note that Mythril is targeted at finding common vulnerabilities, and is not able to discover issues in the business logic of an application. Furthermore, Mythril and symbolic executors are generally unsound, as they are often unable to explore all possible states of a program. diff --git a/docs/source/analysis-modules.rst b/docs/source/analysis-modules.rst index e6e33790..d1751547 100644 --- a/docs/source/analysis-modules.rst +++ b/docs/source/analysis-modules.rst @@ -1,7 +1,7 @@ Analysis Modules ================ -Mythril Classic's detection capabilities are written in modules in the `/analysis/modules `_ directory. +Mythril's detection capabilities are written in modules in the `/analysis/modules `_ directory. .. toctree:: diff --git a/docs/source/conf.py b/docs/source/conf.py index 7169c4fa..1c06fbc4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -108,7 +108,7 @@ html_static_path = ["_static"] # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = "MythrilClassicdoc" +htmlhelp_basename = "Mythrildoc" # -- Options for LaTeX output ------------------------------------------------ @@ -132,13 +132,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ( - master_doc, - "MythrilClassic.tex", - "Mythril Classic Documentation", - "Bernhard Mueller", - "manual", - ) + (master_doc, "Mythril.tex", "Mythril Documentation", "Bernhard Mueller", "manual") ] @@ -146,9 +140,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "mythrilclassic", "Mythril Classic Documentation", [author], 1) -] +man_pages = [(master_doc, "mythril", "Mythril Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------------- @@ -159,10 +151,10 @@ man_pages = [ texinfo_documents = [ ( master_doc, - "MythrilClassic", - "Mythril Classic Documentation", + "Mythril", + "Mythril Documentation", author, - "MythrilClassic", + "Mythril", "One line description of project.", "Miscellaneous", ) diff --git a/docs/source/create-module.rst b/docs/source/create-module.rst index 84aa2cc4..7f6ef505 100644 --- a/docs/source/create-module.rst +++ b/docs/source/create-module.rst @@ -1,4 +1,4 @@ Creating a Module ================= -Create a module in the :code:`analysis/modules` directory, and create an instance of a class that inherits :code:`DetectionModule` named :code:`detector`. Take a look at the `suicide module `_ as an example. +Create a module in the :code:`analysis/modules` directory, and create an instance of a class that inherits :code:`DetectionModule` named :code:`detector`. Take a look at the `suicide module `_ as an example. diff --git a/docs/source/index.rst b/docs/source/index.rst index 9bbabc49..e3f9df42 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,4 +1,4 @@ -Welcome to Mythril Classic's documentation! +Welcome to Mythril's documentation! =========================================== .. toctree:: diff --git a/docs/source/module-list.rst b/docs/source/module-list.rst index 89a5cb05..11c40d02 100644 --- a/docs/source/module-list.rst +++ b/docs/source/module-list.rst @@ -5,65 +5,65 @@ Modules Delegate Call To Untrusted Contract *********************************** -The `delegatecall module `_ detects `SWC-112 (DELEGATECALL to Untrusted Callee) `_. +The `delegatecall module `_ detects `SWC-112 (DELEGATECALL to Untrusted Callee) `_. *********************************** Dependence on Predictable Variables *********************************** -The `predictable variables module `_ detects `SWC-120 (Weak Randomness) `_ and `SWC-116 (Timestamp Dependence) `_. +The `predictable variables module `_ detects `SWC-120 (Weak Randomness) `_ and `SWC-116 (Timestamp Dependence) `_. ****************** Deprecated Opcodes ****************** -The `deprecated opcodes module `_ detects `SWC-111 (Use of Deprecated Functions) `_. +The `deprecated opcodes module `_ detects `SWC-111 (Use of Deprecated Functions) `_. *********** Ether Thief *********** -The `Ether Thief module `_ detects `SWC-105 (Unprotected Ether Withdrawal) `_. +The `Ether Thief module `_ detects `SWC-105 (Unprotected Ether Withdrawal) `_. ********** Exceptions ********** -The `exceptions module `_ detects `SWC-110 (Assert Violation) `_. +The `exceptions module `_ detects `SWC-110 (Assert Violation) `_. ************** External Calls ************** -The `external calls module `_ warns about `SWC-117 (Reentrancy) `_ by detecting calls to external contracts. +The `external calls module `_ warns about `SWC-117 (Reentrancy) `_ by detecting calls to external contracts. ******* Integer ******* -The `integer module `_ detects `SWC-101 (Integer Overflow and Underflow) `_. +The `integer module `_ detects `SWC-101 (Integer Overflow and Underflow) `_. ************** Multiple Sends ************** -The `multiple sends module `_ detects `SWC-113 (Denial of Service with Failed Call) `_ by checking for multiple calls or sends in a single transaction. +The `multiple sends module `_ detects `SWC-113 (Denial of Service with Failed Call) `_ by checking for multiple calls or sends in a single transaction. ******* Suicide ******* -The `suicide module `_ detects `SWC-106 (Unprotected SELFDESTRUCT) `_. +The `suicide module `_ detects `SWC-106 (Unprotected SELFDESTRUCT) `_. **************************** State Change External Calls **************************** -The `state change external calls module `_ detects `SWC-107 (Reentrancy) `_ by detecting state change after calls to an external contract. +The `state change external calls module `_ detects `SWC-107 (Reentrancy) `_ by detecting state change after calls to an external contract. **************** Unchecked Retval **************** -The `unchecked retval module `_ detects `SWC-104 (Unchecked Call Return Value) `_. +The `unchecked retval module `_ detects `SWC-104 (Unchecked Call Return Value) `_. diff --git a/docs/source/security-analysis.rst b/docs/source/security-analysis.rst index afe348a4..4cd1010e 100644 --- a/docs/source/security-analysis.rst +++ b/docs/source/security-analysis.rst @@ -1,7 +1,7 @@ Security Analysis ================= -Run :code:`myth -x` with one of the input options described below will run the analysis modules in the `/analysis/modules `_ directory. +Run :code:`myth -x` with one of the input options described below will run the analysis modules in the `/analysis/modules `_ directory. *********************** Analyzing Solidity Code diff --git a/mythril/analysis/modules/dos.py b/mythril/analysis/modules/dos.py index 7032430d..7c13bb7d 100644 --- a/mythril/analysis/modules/dos.py +++ b/mythril/analysis/modules/dos.py @@ -44,8 +44,8 @@ class DOS(DetectionModule): self._jumpdest_count = {} # type: Dict[object, dict] def _execute(self, state: GlobalState) -> None: - """ + """ :param state: :return: """ diff --git a/mythril/laser/ethereum/strategy/extensions/bounded_loops.py b/mythril/laser/ethereum/strategy/extensions/bounded_loops.py index 10525ffa..48f77383 100644 --- a/mythril/laser/ethereum/strategy/extensions/bounded_loops.py +++ b/mythril/laser/ethereum/strategy/extensions/bounded_loops.py @@ -48,7 +48,7 @@ class BoundedLoopsStrategy(BasicSearchStrategy): :return: """ - while 1: + while True: state = self.super_strategy.get_strategic_global_state() opcode = state.get_current_instruction()["opcode"] @@ -67,7 +67,10 @@ class BoundedLoopsStrategy(BasicSearchStrategy): else: annotation = annotations[0] - target = int(util.get_concrete_int(state.mstate.stack[-1])) + try: + target = util.get_concrete_int(state.mstate.stack[-1]) + except TypeError: + return state try: annotation._jumpdest_count[target] += 1