-
Notifications
You must be signed in to change notification settings - Fork 39
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
Encountered no pragma
errors
#7
Comments
You executed a different version of SmartBugs that we initially used for that study. SmartBugs v2 tries to determine the version of the required compiler automatically by identifying the pragma in the solidity file. In those cases, no pragma is present in the file, and therefore no compiler could be identified. |
Hi, @tdurieux Thanks for your quick reply. So, if we intend to analyze the dataset using SmartBugs v2 with some tools, is manually adding the compiler version and pragma the sole approach available? Is there any alternative or more efficient method in your opinion? |
You could modify smartbugs to use a default pragma, I expect that the contracts are really old when no pragma is provided. @gsalzer WDYT? |
Yes, they are old. |
@Stamp9 I will look at it in a few days. It should be possible to support solc >= 0.4.0. One might also add a command line switch to supply a default solc version. |
I have also encountered the same problem when running smartbug with smartbugs-wild dataset, may I ask how to solve this? |
This is a version formatting issue in the dataset, which has been resolved by automatically formatting it through a script. |
@MartinY9 Thanks for clarification. Can you elaborate the issue a bit? What exactly did you reformat, to which format? Maybe we should apply the reformatting to the original dataset. |
There are several incorrect formats for writing contract definition versions, such as: "pragma solidity ^ 0.4.18;","pragma solidity 0.4.18;", and "pragma solidity 0.4. 18" and so on. These wrong formats make the program unable to run normally. I wrote a script to address this issue, which was manually checked and proved to be effective. |
Thanks for the analysis. We will fix it for future users. |
Hey,
I was trying to run smartbug with smartbugs-wild dataset but encountered many
no pragma
errors. Given that the paper utilized SmartBugs to analyze the same dataset, I'm wondering why it's not functioning as expected now and how this issue can be resolved. Any information would be appreciated, thanks in advance!The text was updated successfully, but these errors were encountered: