-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: automatically handle solc configuration for Etherscan Platform #544
Merged
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0ec001c
Merge pull request #503 from crytic/dev
0xalpharush 35bbe54
prepare 0.3.5 release
0xalpharush a741e4a
Merge pull request #504 from crytic/bump-version
0xalpharush 3a4b0de
Merge pull request #506 from crytic/dev
0xalpharush 62b16c3
Merge pull request #541 from crytic/dev
0xalpharush bf781b1
0.3.6 release
0xalpharush 1b2998e
Merge pull request #542 from crytic/0xalpharush-patch-1
0xalpharush 1e5deb2
feat: PoC of auto-generating solc-remaps file
shortdoom b5f0d62
feat: auto-generate crytic_compile.config.json
shortdoom d47b73a
test: ci_test_etherscan.sh, chore: lint/refactor
shortdoom 6bdc8e3
chore: satisfy super-linter
shortdoom cf981c7
Improve handling of "version" string from Etherscan
ggrieco-tob 1bc8da8
Update etherscan.py
ggrieco-tob ad9bf30
fixed lint
ggrieco-tob c0ad9f5
Merge pull request #545 from crytic/improve-_convert_version
0xalpharush 9c397a7
Merge branch 'crytic:master' into dev-remaps
shortdoom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of Etherscan test #8 introduces a new test case for compiling a specific contract and checking for the existence of
crytic_compile.config.json
before running the compilation process. This is a positive step towards automating the generation ofsolc-remaps
files for projects downloaded from Etherscan. However, there are a few areas that could be improved for clarity, maintainability, and robustness:Use of
$?
for Exit Status: Directly after running a command, the script checks$?
for the exit status. This is a common practice but can lead to errors if additional commands are inadvertently inserted between the command and its status check. Consider capturing the exit status immediately in a variable to avoid such issues.Hardcoded Contract Address: The contract address
0x9AB6b21cDF116f611110b048987E58894786C244
is used twice, suggesting it has a specific significance for this test. It would be beneficial to define this as a variable at the start of the test section for clarity and ease of maintenance.Checking for Configuration File Existence: The script checks for the existence of
crytic_compile.config.json
but does not verify its content or structure. While the presence of the file is a good first step, ensuring it contains the expected configuration (even in a basic form) could prevent future errors.TODO Comment on Globbing: The TODO comment regarding globbing at
crytic_compile.py:720
to run with'.'
suggests an improvement or a fix that is pending. It's important to track these TODOs outside of the codebase, such as in an issue tracker, to ensure they are not forgotten.Directory Navigation: The script navigates into and out of directories using
cd
. While this works, it can be error-prone if the script fails or exits unexpectedly before reaching thecd ../../../
. Consider usingpushd
andpopd
for more robust directory navigation, or running the commands in a subshell to avoid changing the working directory of the script.Error Handling and Messages: The error messages are clear but could include more context to aid in debugging. For example, specifying which part of the test failed or including the contract address in the error message could provide immediate clues without needing to dig through the script.
Improvements in these areas could enhance the script's readability, maintainability, and error resilience.
Committable suggestion