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: auto add appropriate Solidity version pragma if root file doesn't have #42

Open
yxliang01 opened this issue Aug 27, 2020 · 2 comments

Comments

@yxliang01
Copy link

yxliang01 commented Aug 27, 2020

There might be case that the root file has no pragma for specifying Solidity version while its imports have. It might not make sense to not putting any pragma in this case. What can be done is to use semver library to parse all imports' Solidity requirement, then find the expression that is the minimum among all specifications. i.e. find the intersection between all specifications.

@RyuuGan
Copy link
Owner

RyuuGan commented Sep 17, 2020

Hello @yxliang01,

Sorry for late response. I didn't have internet for a while.

I can see that they might be not resolvable, because some of the libraries can have dependencies with strict pragma version, for example, this 2 pragmas might not be compatible:

pragma solidity >=0.4.0 <0.5.0
pragma solidity ^0.6.0

In that case the issue will still preserve.

Best regards,
Valerii Aligorskii

@yxliang01
Copy link
Author

Under such case, I think it makes sense to throw an error since the merged contract shouldn't be successfully compiled by design.

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

No branches or pull requests

2 participants