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

feat: add forge mssv command to assist finding the minimum supported solc version for a project #391

Open
mattsse opened this issue Jan 6, 2022 · 3 comments
Labels
C-forge Command: forge D-average Difficulty: average P-low Priority: low T-feature Type: feature

Comments

@mattsse
Copy link
Member

mattsse commented Jan 6, 2022

Add forge mssv command that takes a project and tries to compile it with various solc versions

Ref https://github.com/foresterre/cargo-msrv

@gakonst
Copy link
Member

gakonst commented Jan 6, 2022

Motivation is that we detected a misconfigured pragma here and I had to manually bisect to find which is the min version that works.

@gakonst gakonst added the C-forge Command: forge label Jan 8, 2022
@onbjerg onbjerg added D-average Difficulty: average P-low Priority: low T-feature Type: feature labels Feb 19, 2022
@onbjerg onbjerg added this to Foundry Apr 17, 2022
@onbjerg onbjerg moved this to Todo in Foundry Apr 17, 2022
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@zerosnacks zerosnacks changed the title add a compile mode to assist finding the minimum supported solc version for a project feat: add forge mssv command to assist finding the minimum supported solc version for a project Jul 31, 2024
@zerosnacks zerosnacks removed this from the v1.0.0 milestone Jul 31, 2024
@grandizzy
Copy link
Collaborator

we have now forge compiler resolve which for Uniswap contracts for exmaple would output smth like

Solidity:

0.5.16:
├── src/briefcase/protocols/v2-core/libraries/Math.sol
├── src/briefcase/protocols/v2-core/libraries/SafeMath.sol
└── src/briefcase/protocols/v2-core/libraries/UQ112x112.sol

0.6.6:
├── src/briefcase/protocols/lib-external/solidity-lib/contracts/libraries/Babylonian.sol
├── src/briefcase/protocols/lib-external/solidity-lib/contracts/libraries/FullMath.sol
├── src/briefcase/protocols/v2-core/interfaces/IUniswapV2Factory.sol
...

0.7.6:
├── src/briefcase/protocols/lib-external/base64/base64.sol
├── src/briefcase/protocols/lib-external/oz-v3.4-solc-0.7/contracts/introspection/IERC165.sol
├── src/briefcase/protocols/lib-external/oz-v3.4-solc-0.7/contracts/math/SafeMath.sol
...

0.8.26:
├── lib/forge-std/src/Base.sol
├── lib/forge-std/src/Script.sol

I could be wrong but this should solve the case mentioned in this ticket @mattsse @gakonst wdyt?

@zerosnacks
Copy link
Member

I think this proposed command would iteratively compile and find the lowest target whereas the compiler version list only displays the versions used in the project, it doesn't help the user guide in finding to lowest compatibility version.

Given that the Solidity compiler team recommends using recent versions and projects / auditors prefer strict pinning this is largely relevant for library authors who usually explicitly choose their supported version (e.g. ^0.8.4 w/ Solady).

I would be in favor of closing as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge D-average Difficulty: average P-low Priority: low T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

5 participants