Skip to content

Commit 608890e

Browse files
dguidoclaude
andcommitted
feat: add platform version validation before switching
- Validate version against platform minimum even for installed versions - Prevents using incompatible versions regardless of installation method - Ensures platform boundaries are always enforced - Fixes potential issue where wrong platform versions could be used 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5ff1178 commit 608890e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

solc_select/solc_select.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ def get_url(version: str = "", artifact: str = "") -> (str, str):
217217
def switch_global_version(version: str, always_install: bool, silent: bool = False) -> None:
218218
if version == "latest":
219219
version = get_latest_release()
220+
221+
# Check version against platform minimum even if installed
222+
if version != "latest" and Version(version) < Version(EARLIEST_RELEASE[soliditylang_platform()]):
223+
raise argparse.ArgumentTypeError(
224+
f"Invalid version - only solc versions above '{EARLIEST_RELEASE[soliditylang_platform()]}' are available"
225+
)
226+
220227
if version in installed_versions():
221228
with open(f"{SOLC_SELECT_DIR}/global-version", "w", encoding="utf-8") as f:
222229
f.write(version)

0 commit comments

Comments
 (0)