Skip to content

Commit 62f2cd9

Browse files
committed
[SDK] Update implementation addr extraction logic (#6093)
TOOL-3258 <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a patch related to EIP-7702 in the `thirdweb` package, specifically enhancing the functionality to extract minimal proxy implementation addresses from bytecode. ### Detailed summary - Added a check for EIP-7702 compliance in the `extractMinimalProxyImplementationAddress.ts` file. - Implemented logic to extract the implementation address from bytecode if it meets the specified conditions (length of 48 and starts with "0xef0100"). > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent f03ded3 commit 62f2cd9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
7702 delegation designator

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,11 @@ export function extractMinimalProxyImplementationAddress(
5454
return `0x${implementationAddress}`;
5555
}
5656

57+
// EIP-7702 - https://eips.ethereum.org/EIPS/eip-7702#abstract
58+
if (bytecode.length === 48 && bytecode.startsWith("0xef0100")) {
59+
const implementationAddress = bytecode.slice(8, 48);
60+
return `0x${implementationAddress}`;
61+
}
62+
5763
return undefined;
5864
}

0 commit comments

Comments
 (0)