Skip to content

Commit fdd89a6

Browse files
author
Nat Chin
authored
Hotfixes 0.8.18 to pull from crytic/solc (#159)
* Real hot fix * updated return link * Linting errors
1 parent 7b493c6 commit fdd89a6

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

solc_select/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@
2020
WINDOWS_AMD64 = "windows-amd64"
2121

2222
EARLIEST_RELEASE = {"macosx-amd64": "0.3.6", "linux-amd64": "0.4.0", "windows-amd64": "0.4.5"}
23+
24+
# URL
25+
CRYTIC_SOLC_ARTIFACTS = "https://raw.githubusercontent.com/crytic/solc/master/linux/amd64/"
26+
CRYTIC_SOLC_JSON = (
27+
"https://raw.githubusercontent.com/crytic/solc/new-list-json/linux/amd64/list.json"
28+
)

solc_select/solc_select.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
EARLIEST_RELEASE,
1818
SOLC_SELECT_DIR,
1919
ARTIFACTS_DIR,
20+
CRYTIC_SOLC_ARTIFACTS,
21+
CRYTIC_SOLC_JSON,
2022
)
2123

2224
Path.mkdir(ARTIFACTS_DIR, parents=True, exist_ok=True)
@@ -78,6 +80,11 @@ def install_artifacts(versions: [str]) -> bool:
7880
continue
7981

8082
(url, _) = get_url(version, artifact)
83+
84+
if is_linux_0818(version):
85+
url = CRYTIC_SOLC_ARTIFACTS + artifact
86+
print(url)
87+
8188
artifact_file_dir = ARTIFACTS_DIR.joinpath(f"solc-{version}")
8289
Path.mkdir(artifact_file_dir, parents=True, exist_ok=True)
8390
print(f"Installing '{version}'...")
@@ -103,6 +110,10 @@ def is_older_linux(version: str) -> bool:
103110
return soliditylang_platform() == LINUX_AMD64 and Version(version) <= Version("0.4.10")
104111

105112

113+
def is_linux_0818(version: str) -> bool:
114+
return soliditylang_platform() == LINUX_AMD64 and Version(version) == Version("0.8.18")
115+
116+
106117
def is_older_windows(version: str) -> bool:
107118
return soliditylang_platform() == WINDOWS_AMD64 and Version(version) <= Version("0.7.1")
108119

@@ -148,8 +159,8 @@ def get_url(version: str = "", artifact: str = "") -> (str, str):
148159
if soliditylang_platform() == LINUX_AMD64:
149160
if version != "" and is_older_linux(version):
150161
return (
151-
f"https://raw.githubusercontent.com/crytic/solc/master/linux/amd64/{artifact}",
152-
"https://raw.githubusercontent.com/crytic/solc/new-list-json/linux/amd64/list.json",
162+
CRYTIC_SOLC_ARTIFACTS + artifact,
163+
CRYTIC_SOLC_JSON,
153164
)
154165
return (
155166
f"https://binaries.soliditylang.org/{soliditylang_platform()}/{artifact}",

0 commit comments

Comments
 (0)