Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed Jan 10, 2024
1 parent f9b0c56 commit 9be4d30
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ export async function resolveImplementation(
address: string,
provider: providers.Provider,
): Promise<{ address: string; bytecode: string }> {
const fetched = await Promise.all([
const [bytecode, beacon] = await Promise.all([
fetchBytecode(address, provider),
getBeaconFromStorageSlot(address, provider),
]);
const bytecode = fetched[0];

// check minimal proxy first synchronously
const minimalProxyImplementationAddress =
Expand All @@ -56,7 +55,6 @@ export async function resolveImplementation(
}

// check other proxy types
const beacon = fetched[1]; // if the contract is BeaconProxy
if (beacon && beacon !== constants.AddressZero) {
// In case of a BeaconProxy, it is setup as BeaconProxy --> Beacon --> Implementation
// Hence we replace the proxy address with Beacon address, and continue further resolving below
Expand Down

0 comments on commit 9be4d30

Please sign in to comment.