Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Reject SolidityAST contracts verified on Etherscan #6082

Merged
merged 1 commit into from Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/source-fetcher/lib/etherscan.ts
Expand Up @@ -255,7 +255,13 @@ const EtherscanFetcher: FetcherConstructor = class EtherscanFetcher
private static processJsonResult(
result: EtherscanResult,
jsonInput: Types.SolcInput
): Types.SourceInfo {
): Types.SourceInfo | null {
if (jsonInput.language === "SolidityAST") {
//I don't know whether this is actually possible on Etherscan,
//but there's no way we can reasonably handle it, so let's
//just be defensive and refuse it
return null;
}
return {
contractName: result.ContractName,
sources: this.processSources(jsonInput.sources),
Expand Down
2 changes: 1 addition & 1 deletion packages/source-fetcher/lib/types.ts
Expand Up @@ -101,7 +101,7 @@ export interface SolcSources {
}

export interface SolcInput {
language: "Solidity";
language: "Solidity" | "Yul" | "SolidityAST";
sources: SolcSources;
settings: SolcSettings;
}
Expand Down