diff --git a/.github/ISSUE_TEMPLATE/analysis-module.md b/.github/ISSUE_TEMPLATE/analysis-module.md index 81c8b7e2..63f4d240 100644 --- a/.github/ISSUE_TEMPLATE/analysis-module.md +++ b/.github/ISSUE_TEMPLATE/analysis-module.md @@ -4,13 +4,34 @@ about: Create an analysis module feature request --- -# Detection issue: -Name the issue that should be detected using the analysis module +Please remove any of the optional sections if they are not applicable. -## Description: -Provide a detailed description of the vulnerabiltity that should be detected +## Description -## Link -Provide resources that can help with implementing the analysis module +Replace this text with a description of an vulnerability that should be +detected by a Mythril analysis module. -## Implementation details:Initial implementation ideas/instruction +## Tests + +_This section is optional._ + +Replace this text with suggestions on how to test the feature, +if it is not obvious. This might require certain Solidity source, +bytecode, or a Truffle project. You can also provide +links to existing code. + +## Implementation details + +_This section is optional._ + +If you have thoughts about how to implement the analysis, feel free +replace this text with that. + +## Links + +_This section is optional._ + +Replace this text with any links describing the issue or pointing to resources +that can help in implementing the analysis + +Thanks for helping! diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 00000000..aa33c0e9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,68 @@ +--- +name: Bug report +about: Tell us about Mythril bugs to help us improve + +--- + +_Note: did you notice that there is now a template for requesting new features?_ + +Please remove any of the optional sections if they are not applicable. + +## Description + +Replace this text with a clear and concise description of the bug. + +## How to Reproduce + +Please show both the input you gave and the +output you got in describing how to reproduce the bug: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +or give a complete console log with input and output + +```console +$ myth +==== Exception state ==== +Type: ... +Contract: ... +Function name: ... +... +$ +``` + +If there is a Solidity source code, a truffle project, or bytecode +that is involved, please provide that or links to it. + +## Expected behavior + +A clear and concise description of what you expected to happen. + +## Screenshots + +_This section is optional._ + +If applicable, add screenshots to help explain your problem. + +## Environment + +_This section sometimes is optional but helpful to us._ + +Please modify for your setup + +- Mythril version: output from `myth --version` or `pip show mythril` +- Solidity compiler and version: `solc --version` +- Python version: `python -V` +- OS: [e.g. iOS] +- OS Version [e.g. 22] + +## Additional Environment or Context + +_This section is optional._ + +Add any other context about the problem here or special environment setup + +Thanks for helping! diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 0c898ce3..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 00000000..b06ae9a4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,24 @@ +--- +name: Feature Request +about: Tell us about a new feature that would make Mythril better + +--- + +## Description + +Replace this text with a short description of the feature. + +## Background + +Replace this text with any additional background for the +feature, for example: user scenarios, or the value of the feature. + +## Tests +_This section is optional._ + +Replace this text with suggestions on how to test the feature, +if it is not obvious. This might require certain Solidity source, +bytecode, or a Truffle project. You can also provide +links to existing code. + +Thanks for helping! diff --git a/mythril/ether/soliditycontract.py b/mythril/ether/soliditycontract.py index f5825d0e..2fa6c78b 100644 --- a/mythril/ether/soliditycontract.py +++ b/mythril/ether/soliditycontract.py @@ -1,6 +1,6 @@ import mythril.laser.ethereum.util as helper from mythril.ether.ethcontract import ETHContract -from mythril.ether.util import * +from mythril.ether.util import get_solc_json from mythril.exceptions import NoContractFoundError @@ -54,7 +54,7 @@ class SolidityContract(ETHContract): # If a contract name has been specified, find the bytecode of that specific contract if name: - for key, contract in data['contracts'].items(): + for key, contract in sorted(data['contracts'].items()): filename, _name = key.split(":") if filename == input_file and name == _name and len(contract['bin-runtime']): @@ -67,7 +67,7 @@ class SolidityContract(ETHContract): # If no contract name is specified, get the last bytecode entry for the input file else: - for key, contract in data['contracts'].items(): + for key, contract in sorted(data['contracts'].items()): filename, name = key.split(":") if filename == input_file and len(contract['bin-runtime']):