Skip to content

Commit

Permalink
Fix flag name
Browse files Browse the repository at this point in the history
  • Loading branch information
yivlad committed Dec 30, 2024
1 parent fc7d0db commit 831f8bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions packages/cli/src/plugins/blockExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ export type BlockExplorerConfig = {
/**
* Whether to try fetching the implementation address of the contract
*/
tryFetchImplementation: true
tryFetchProxyImplementation: true
}
| {
tryFetchImplementation?: false
tryFetchProxyImplementation?: false
}
)

Expand Down Expand Up @@ -148,7 +148,10 @@ export function blockExplorer(config: BlockExplorerConfig) {
const makeUrl = (address: Address) =>
`${baseUrl}?module=contract&action=getabi&address=${address}${apiKey ? `&apikey=${apiKey}` : ''}`

if ('tryFetchImplementation' in config && config.tryFetchImplementation) {
if (
'tryFetchProxyImplementation' in config &&
config.tryFetchProxyImplementation
) {
const implementationAddress = await getImplementationAddress({
address: normalizedAddress,
chainId: config.chainId,
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/plugins/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export type EtherscanConfig<chainId extends number> = {
*/
contracts: Compute<Omit<ContractConfig<ChainId, chainId>, 'abi'>>[]
/**
* Whether to try fetching the implementation address of the contract
* Whether to try fetching proxy implementation address of the contract
*/
tryFetchImplementation?: boolean | undefined
tryFetchProxyImplementation?: boolean | undefined
}

/**
Expand All @@ -95,7 +95,7 @@ export type EtherscanConfig<chainId extends number> = {
export function etherscan<chainId extends ChainId>(
config: EtherscanConfig<chainId>,
) {
const { apiKey, cacheDuration, chainId, tryFetchImplementation } = config
const { apiKey, cacheDuration, chainId, tryFetchProxyImplementation } = config

const contracts = config.contracts.map((x) => ({
...x,
Expand All @@ -120,6 +120,6 @@ export function etherscan<chainId extends ChainId>(
},
name: 'Etherscan',
chainId,
tryFetchImplementation,
tryFetchProxyImplementation,
})
}

0 comments on commit 831f8bb

Please sign in to comment.