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

Internal improvement: Add optimize flag to VyperSettings type in source-fetcher #4735

Merged
merged 2 commits into from
Feb 15, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/source-fetcher/lib/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ const EtherscanFetcher: FetcherConstructor = class EtherscanFetcher
): Types.VyperSettings {
const evmVersion: string =
result.EVMVersion === "Default" ? undefined : result.EVMVersion;
//the optimize flag is not currently supported by etherscan;
//any Vyper contract currently verified on etherscan necessarily has
//optimize flag left unspecified (and therefore effectively true).
//do NOT look at OptimizationUsed for Vyper contracts; it will always
//be "0" even though in fact optimization *was* used. just leave
//the optimize flag unspecified.
if (evmVersion !== undefined) {
return { evmVersion };
} else {
Expand Down
3 changes: 3 additions & 0 deletions packages/source-fetcher/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export interface SolcSettings {

export interface VyperSettings {
evmVersion?: string; //not gonna enumerate these
optimize?: boolean; //warning: the Vyper compiler treats this as true if it's not specified!
//also Etherscan currently doesn't support this flag; any Vyper contract currently
//verified on Etherscan necessarily has this field unspecified (and thus effectively true)
}

export interface SolcSpecializations {
Expand Down