-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2407 from crytic/dev
sync master<> dev
- Loading branch information
Showing
710 changed files
with
6,076 additions
and
1,218 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Monthly issue metrics | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '3 2 1 * *' | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: read | ||
|
||
jobs: | ||
build: | ||
name: issue metrics | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get dates for last month | ||
shell: bash | ||
run: | | ||
# Calculate the first day of the previous month | ||
first_day=$(date -d "last month" +%Y-%m-01) | ||
# Calculate the last day of the previous month | ||
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) | ||
#Set an environment variable with the date range | ||
echo "$first_day..$last_day" | ||
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" | ||
- name: Run issue-metrics tool | ||
uses: github/issue-metrics@v3 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SEARCH_QUERY: 'repo:crytic/slither is:issue created:${{ env.last_month }} -reason:"not planned" -reason:"duplicate"' | ||
|
||
- name: Create issue | ||
uses: peter-evans/create-issue-from-file@v5 | ||
with: | ||
title: Monthly issue metrics report | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
content-filepath: ./issue_metrics.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ jobs: | |
path: dist/ | ||
|
||
- name: publish | ||
uses: pypa/[email protected].11 | ||
uses: pypa/[email protected].14 | ||
|
||
- name: sign | ||
uses: sigstore/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,15 @@ If you're unsure where to start, we recommend our [`good first issue`](https://g | |
|
||
## Bug reports and feature suggestions | ||
|
||
Bug reports and feature suggestions can be submitted to our issue tracker. For bug reports, attaching the contract that caused the bug will help us in debugging and resolving the issue quickly. If you find a security vulnerability, do not open an issue; email [email protected] instead. | ||
Bug reports and feature suggestions can be submitted to our issue tracker. For bug reports, attaching the contract that caused the bug will help us in debugging and resolving the issue quickly. If you find a security vulnerability, do not open an issue; email <[email protected]> instead. | ||
|
||
## Questions | ||
|
||
Questions can be submitted to the "Discussions" page, and you may also join our [chat room](https://empireslacking.herokuapp.com/) (in the #ethereum channel). | ||
|
||
## Code | ||
|
||
Slither uses the pull request contribution model. Please make an account on Github, fork this repo, and submit code contributions via pull request. For more documentation, look [here](https://guides.github.com/activities/forking/). | ||
Slither uses the pull request contribution model. Please make an account on GitHub, fork this repository, and submit code contributions via pull request. For more documentation, look [here](https://guides.github.com/activities/forking/). | ||
|
||
Some pull request guidelines: | ||
|
||
|
@@ -63,7 +63,7 @@ To automatically reformat the code: | |
|
||
- `make reformat` | ||
|
||
We use pylint `2.13.4`, black `22.3.0`. | ||
We use pylint `3.0.3`, black `22.3.0`. | ||
|
||
### Testing | ||
|
||
|
@@ -82,7 +82,7 @@ For each new detector, at least one regression tests must be present. | |
1. Create a folder in `tests/e2e/detectors/test_data` with the detector's argument name. | ||
2. Create a test contract in `tests/e2e/detectors/test_data/<detector_name>/`. | ||
3. Update `ALL_TESTS` in `tests/e2e/detectors/test_detectors.py`. | ||
4. Run `python tests/e2e/detectors/test_detectors.py --compile` to create a zip file of the compilation artifacts. | ||
4. Run `python tests/e2e/detectors/test_detectors.py --compile` to create a ZIP file of the compilation artifacts. | ||
5. `pytest tests/e2e/detectors/test_detectors.py --insta update-new`. This will generate a snapshot of the detector output in `tests/e2e/detectors/snapshots/`. If updating an existing detector, run `pytest tests/e2e/detectors/test_detectors.py --insta review` and accept or reject the updates. | ||
6. Run `pytest tests/e2e/detectors/test_detectors.py` to ensure everything worked. Then, add and commit the files to git. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import json | ||
from pathlib import Path | ||
import urllib.request | ||
|
||
|
||
def retrieve_json(url): | ||
with urllib.request.urlopen(url) as response: | ||
data = response.read().decode("utf-8") | ||
return json.loads(data) | ||
|
||
|
||
def organize_data(json_data): | ||
version_bugs = {} | ||
for version, info in json_data.items(): | ||
version_bugs[version] = info["bugs"] | ||
return version_bugs | ||
|
||
|
||
if __name__ == "__main__": | ||
bug_list_url = ( | ||
"https://raw.githubusercontent.com/ethereum/solidity/develop/docs/bugs_by_version.json" | ||
) | ||
bug_data = retrieve_json(bug_list_url) | ||
bugs_by_version = organize_data(bug_data) | ||
|
||
with open(Path.cwd() / Path("slither/utils/buggy_versions.py"), "w", encoding="utf-8") as file: | ||
file.write("# pylint: disable=too-many-lines\n") | ||
file.write(f"bugs_by_version = {bugs_by_version}") |
Oops, something went wrong.