You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, solc.install.install_solc_pragma(pragma_string) installs the newest available Solidity version that matches the given pragma. In some situations, it is preferable to use the lowest matching version instead. First, it is natural for programmers to put that solc version into the pragma that they are actually using, prefixing it with a ^. So selecting the lowest version will ensure that an authentic version is selected. There are cases where a later version of solc introduced breaking changes (while still in the same 0.x.* series), by changing a warning to an error. Second, some programmers mistakenly prefix the version by >= instead of ^, such that py-solc-x most certainly will select the wrong version.
Specification
Add a flag favor_earlier_version, default False, to methods like install_solc_pragma and hand it down to routines like get_installable_solc_versions (to sort versions in increasing order) and to _select_pragma_version (to influence the comparison of version and selected. This modification is backwards compatible.
The text was updated successfully, but these errors were encountered:
Overview
Currently,
solc.install.install_solc_pragma(pragma_string)
installs the newest available Solidity version that matches the given pragma. In some situations, it is preferable to use the lowest matching version instead. First, it is natural for programmers to put that solc version into the pragma that they are actually using, prefixing it with a^
. So selecting the lowest version will ensure that an authentic version is selected. There are cases where a later version of solc introduced breaking changes (while still in the same0.x.*
series), by changing a warning to an error. Second, some programmers mistakenly prefix the version by>=
instead of^
, such thatpy-solc-x
most certainly will select the wrong version.Specification
Add a flag
favor_earlier_version
, defaultFalse
, to methods likeinstall_solc_pragma
and hand it down to routines likeget_installable_solc_versions
(to sort versions in increasing order) and to_select_pragma_version
(to influence the comparison ofversion
andselected
. This modification is backwards compatible.The text was updated successfully, but these errors were encountered: