crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
758 stars 103 forks source link

Automatically change solc version depending on pragma #61

Closed 0xicingdeath closed 2 years ago

0xicingdeath commented 3 years ago

When running solc <file> currently, users have to change the solc-select global version, then run the solc file:

solc-select install <version> 
solc-select use <version> 
solc <file to execute> 

Example file:

pragma solidity 0.4.15;
contract Foo {
        function Foo() {
        }
}

When changing the pragma, it requires users to run the solc-select use <version> in their terminal to use the correct solc version. It would speed up testing significantly if the tool had the ability to change the version automatically.

0xicingdeath commented 2 years ago

Closing, as this is something that crytic-compile does.

TalbenXu commented 8 months ago

Hi, @0xicingdeath ,

I am currently try to using slither to detect different version solidity contract in a folder, and everytime I need to use solc-select to choose the right version before running the slither. And how could I use crytic-compile to auto select right solc version based on pragma on contract. It will be extremely helpful to test on batch for me.

Thank you