Open taiyangc opened 1 year ago
We would need to create a new compilation unit every time a file compiles with a given version. Also, we could consider just parsing the pragma and switching the solc version with solc-select if it's installed. @taiyangc I would think a compilation framework that supports multiple compiler versions such as hardhat or foundry would fit your needs. Is there something about your current use case that prohibits this?
In my use case the contracts being tested against may not come from one single project (it would take significant effort to combine them), hence if detection can be done at pragma level and use solc-select to switch that would be great.
Describe the desired feature
Hello, I am trying to run slither against multiple contracts with different required solc versions, however I am seeing this error:
Note that I have both 0.8.17 and 0.7.6 installed through solc-select:
Based on the docs for
--solc-solcs-select/--solc-solcs-bin
:I would assume this means that I should be able to specify multiple versions or bins of solc, and slither would pick one that works for a particular contract. But this is not the case:
Trying again with bin paths directly:
If I reverse the ordering of 0.8.17 and 0.7.6 on the command line, then the contract with ^0.7.0 succeeds but the ones with ^0.8.0 fail instead. I am confused as to why the doc allows multiple bins, but in reality only the first bin will be used to compile all contracts, instead of being selective.
Assuming this is not a bug (intended to support only one solc version at a time), would it be useful to request (maybe yet another option) to allow exhausting all available solc versions for each individual contract, instead of a blanket compile using just one solc version?