Skip to content
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

fix: Incorrect check of the error object's property #10969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Anon-im
Copy link

@Anon-im Anon-im commented Dec 25, 2024

In this code snippet, there is a check for compilation errors after calling solc.compile. However, the Solidity compiler (solc) returns error objects with a severity field, not type. The severity field can have values "error" or "warning". Therefore, the check should be directed at e.severity instead of e.type.

Due to the incorrect check e.type == "Error", compilation errors may go undetected. This will cause the code to continue executing even in the presence of critical compilation errors, which can lead to unpredictable program behavior, improper deployment of smart contracts, or other serious issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant