Skip to content

Commit 0520ad0

Browse files
committed
fix: handle short proxyStorage in getBeaconFromStorageSlot
1 parent a87446a commit 0520ad0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/thirdweb/src/utils/bytecode/resolveImplementation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ async function getBeaconFromStorageSlot(
110110
position:
111111
"0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50",
112112
});
113-
return `0x${proxyStorage.slice(-40)}`;
113+
if (proxyStorage.length >= 40) {
114+
return `0x${proxyStorage.slice(-40)}`;
115+
}
116+
return undefined;
114117
} catch {
115118
return undefined;
116119
}

0 commit comments

Comments
 (0)